[CRIU] [PATCH 1/4] files: Rename file_descs to file_desc_hash

Cyrill Gorcunov gorcunov at openvz.org
Sat Jun 9 04:17:00 EDT 2012


That is what it is -- a hash for file
descriptors based on their ID.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 files.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/files.c b/files.c
index dd68edf..86ebde7 100644
--- a/files.c
+++ b/files.c
@@ -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);
-- 
1.7.7.6



More information about the CRIU mailing list