Commit 96e5b7bb authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

files: Rename file_descs to file_desc_hash

That is what it is -- a hash for file
descriptors based on their ID.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ad41b1e9
......@@ -26,7 +26,7 @@ static struct fdinfo_list_entry *fdinfo_list;
static int nr_fdinfo_list;
#define FDESC_HASH_SIZE 64
static struct list_head file_descs[FDESC_HASH_SIZE];
static struct list_head file_desc_hash[FDESC_HASH_SIZE];
#define FDINFO_POOL_SIZE (4 * 4096)
......@@ -42,7 +42,7 @@ int prepare_shared_fdinfo(void)
}
for (i = 0; i < FDESC_HASH_SIZE; i++)
INIT_LIST_HEAD(&file_descs[i]);
INIT_LIST_HEAD(&file_desc_hash[i]);
return 0;
}
......@@ -54,7 +54,7 @@ void file_desc_add(struct file_desc *d, u32 id,
d->ops = ops;
INIT_LIST_HEAD(&d->fd_info_head);
list_add_tail(&d->hash, &file_descs[id % FDESC_HASH_SIZE]);
list_add_tail(&d->hash, &file_desc_hash[id % FDESC_HASH_SIZE]);
}
struct file_desc *find_file_desc_raw(int type, u32 id)
......@@ -62,7 +62,7 @@ struct file_desc *find_file_desc_raw(int type, u32 id)
struct file_desc *d;
struct list_head *chain;
chain = &file_descs[id % FDESC_HASH_SIZE];
chain = &file_desc_hash[id % FDESC_HASH_SIZE];
list_for_each_entry(d, chain, hash)
if (d->ops->type == type && d->id == id)
return d;
......@@ -96,7 +96,7 @@ void show_saved_files(void)
pr_info("File descs:\n");
for (i = 0; i < FDESC_HASH_SIZE; i++)
list_for_each_entry(fd, &file_descs[i], hash) {
list_for_each_entry(fd, &file_desc_hash[i], hash) {
struct fdinfo_list_entry *le;
pr_info(" `- type %d ID %#x\n", fd->ops->type, fd->id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment