]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
btrfs: make close_fs_devices return void
authorNikolay Borisov <nborisov@suse.com>
Wed, 15 Jul 2020 10:48:48 +0000 (13:48 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:57 +0000 (12:06 +0200)
The return value of this function conveys absolutely no information.
All callers already check the state of fs_devices->opened to decide how
to proceed. So convert the function to returning void. While at it make
btrfs_close_devices also return void.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index 309b575613fe0797dba14dd373d85d4b9a96c30a..e94a0eeeeb52cce697022658570977a3ce85bfe8 100644 (file)
@@ -1156,12 +1156,12 @@ static void btrfs_close_one_device(struct btrfs_device *device)
        ASSERT(atomic_read(&device->reada_in_flight) == 0);
 }
 
-static int close_fs_devices(struct btrfs_fs_devices *fs_devices)
+static void close_fs_devices(struct btrfs_fs_devices *fs_devices)
 {
        struct btrfs_device *device, *tmp;
 
        if (--fs_devices->opened > 0)
-               return 0;
+               return;
 
        mutex_lock(&fs_devices->device_list_mutex);
        list_for_each_entry_safe(device, tmp, &fs_devices->devices, dev_list) {
@@ -1173,17 +1173,14 @@ static int close_fs_devices(struct btrfs_fs_devices *fs_devices)
        WARN_ON(fs_devices->rw_devices);
        fs_devices->opened = 0;
        fs_devices->seeding = false;
-
-       return 0;
 }
 
-int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
+void btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
 {
        struct btrfs_fs_devices *seed_devices = NULL;
-       int ret;
 
        mutex_lock(&uuid_mutex);
-       ret = close_fs_devices(fs_devices);
+       close_fs_devices(fs_devices);
        if (!fs_devices->opened) {
                seed_devices = fs_devices->seed;
                fs_devices->seed = NULL;
@@ -1196,7 +1193,6 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
                close_fs_devices(fs_devices);
                free_fs_devices(fs_devices);
        }
-       return ret;
 }
 
 static int open_fs_devices(struct btrfs_fs_devices *fs_devices,
index 302c9234f7d08177cb149141b9e10a640154469d..d0e93e01d60ba8686774d62f00e04f2a04ed3386 100644 (file)
@@ -435,7 +435,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
 struct btrfs_device *btrfs_scan_one_device(const char *path,
                                           fmode_t flags, void *holder);
 int btrfs_forget_devices(const char *path);
-int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
+void btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
 void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step);
 void btrfs_assign_next_active_device(struct btrfs_device *device,
                                     struct btrfs_device *this_dev);