btrfs: rename struct btrfs_fs_devices::list
authorAnand Jain <anand.jain@oracle.com>
Thu, 12 Apr 2018 02:29:25 +0000 (10:29 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:21 +0000 (18:07 +0200)
btrfs_fs_devices::list is the list of BTRFS fsid in the kernel, a generic
name 'list' makes it's search very difficult, rename it to fs_list.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index 4848a4318fb5429ada1e83114c48e99822f121df..fa6c8c88b2503ddf2fcf2c3d1b8d5e9d5af1040b 100644 (file)
@@ -589,7 +589,7 @@ void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
                return;
        }
 
                return;
        }
 
-       list_for_each_entry(fs_devs, fs_uuids, list) {
+       list_for_each_entry(fs_devs, fs_uuids, fs_list) {
                __btrfs_sysfs_remove_fsid(fs_devs);
        }
 }
                __btrfs_sysfs_remove_fsid(fs_devs);
        }
 }
index a25d5bf4462f500b1a39669e2a5340b06e3e4d03..e1394bbcc54081980d3b05ca77f11a133c296c94 100644 (file)
@@ -262,7 +262,7 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid)
        INIT_LIST_HEAD(&fs_devs->devices);
        INIT_LIST_HEAD(&fs_devs->resized_devices);
        INIT_LIST_HEAD(&fs_devs->alloc_list);
        INIT_LIST_HEAD(&fs_devs->devices);
        INIT_LIST_HEAD(&fs_devs->resized_devices);
        INIT_LIST_HEAD(&fs_devs->alloc_list);
-       INIT_LIST_HEAD(&fs_devs->list);
+       INIT_LIST_HEAD(&fs_devs->fs_list);
        if (fsid)
                memcpy(fs_devs->fsid, fsid, BTRFS_FSID_SIZE);
 
        if (fsid)
                memcpy(fs_devs->fsid, fsid, BTRFS_FSID_SIZE);
 
@@ -308,8 +308,8 @@ void __exit btrfs_cleanup_fs_uuids(void)
 
        while (!list_empty(&fs_uuids)) {
                fs_devices = list_entry(fs_uuids.next,
 
        while (!list_empty(&fs_uuids)) {
                fs_devices = list_entry(fs_uuids.next,
-                                       struct btrfs_fs_devices, list);
-               list_del(&fs_devices->list);
+                                       struct btrfs_fs_devices, fs_list);
+               list_del(&fs_devices->fs_list);
                free_fs_devices(fs_devices);
        }
 }
                free_fs_devices(fs_devices);
        }
 }
@@ -378,7 +378,7 @@ static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid)
 {
        struct btrfs_fs_devices *fs_devices;
 
 {
        struct btrfs_fs_devices *fs_devices;
 
-       list_for_each_entry(fs_devices, &fs_uuids, list) {
+       list_for_each_entry(fs_devices, &fs_uuids, fs_list) {
                if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0)
                        return fs_devices;
        }
                if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0)
                        return fs_devices;
        }
@@ -642,7 +642,7 @@ static void btrfs_free_stale_devices(const char *path,
        struct btrfs_fs_devices *fs_devs, *tmp_fs_devs;
        struct btrfs_device *dev, *tmp_dev;
 
        struct btrfs_fs_devices *fs_devs, *tmp_fs_devs;
        struct btrfs_device *dev, *tmp_dev;
 
-       list_for_each_entry_safe(fs_devs, tmp_fs_devs, &fs_uuids, list) {
+       list_for_each_entry_safe(fs_devs, tmp_fs_devs, &fs_uuids, fs_list) {
 
                if (fs_devs->opened)
                        continue;
 
                if (fs_devs->opened)
                        continue;
@@ -667,7 +667,7 @@ static void btrfs_free_stale_devices(const char *path,
                        /* delete the stale device */
                        if (fs_devs->num_devices == 1) {
                                btrfs_sysfs_remove_fsid(fs_devs);
                        /* delete the stale device */
                        if (fs_devs->num_devices == 1) {
                                btrfs_sysfs_remove_fsid(fs_devs);
-                               list_del(&fs_devs->list);
+                               list_del(&fs_devs->fs_list);
                                free_fs_devices(fs_devs);
                                break;
                        } else {
                                free_fs_devices(fs_devs);
                                break;
                        } else {
@@ -767,7 +767,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
                if (IS_ERR(fs_devices))
                        return ERR_CAST(fs_devices);
 
                if (IS_ERR(fs_devices))
                        return ERR_CAST(fs_devices);
 
-               list_add(&fs_devices->list, &fs_uuids);
+               list_add(&fs_devices->fs_list, &fs_uuids);
 
                device = NULL;
        } else {
 
                device = NULL;
        } else {
@@ -2294,7 +2294,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
                return PTR_ERR(old_devices);
        }
 
                return PTR_ERR(old_devices);
        }
 
-       list_add(&old_devices->list, &fs_uuids);
+       list_add(&old_devices->fs_list, &fs_uuids);
 
        memcpy(seed_devices, fs_devices, sizeof(*seed_devices));
        seed_devices->opened = 1;
 
        memcpy(seed_devices, fs_devices, sizeof(*seed_devices));
        seed_devices->opened = 1;
index 79096884654fa99171d2509def8143abefaacca4..62a92e472f65337ef409a2f990b76e0d3a0c70a5 100644 (file)
@@ -208,6 +208,7 @@ BTRFS_DEVICE_GETSET_FUNCS(bytes_used);
 
 struct btrfs_fs_devices {
        u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
 
 struct btrfs_fs_devices {
        u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+       struct list_head fs_list;
 
        u64 num_devices;
        u64 open_devices;
 
        u64 num_devices;
        u64 open_devices;
@@ -229,7 +230,6 @@ struct btrfs_fs_devices {
        struct list_head resized_devices;
        /* devices not currently being allocated */
        struct list_head alloc_list;
        struct list_head resized_devices;
        /* devices not currently being allocated */
        struct list_head alloc_list;
-       struct list_head list;
 
        struct btrfs_fs_devices *seed;
        int seeding;
 
        struct btrfs_fs_devices *seed;
        int seeding;