btrfs: rename btrfs_find_free_objectid to btrfs_get_free_objectid
authorNikolay Borisov <nborisov@suse.com>
Mon, 7 Dec 2020 15:32:33 +0000 (17:32 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:49 +0000 (22:58 +0100)
This better reflects the semantics of the function i.e no search is
performed whatsoever.

Reviewed-by: Josef Bacik <josef@toxicpanda.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/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/relocation.c
fs/btrfs/transaction.c

index 47646a7..98384d3 100644 (file)
@@ -4778,7 +4778,7 @@ error:
        return ret;
 }
 
-int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid)
+int btrfs_get_free_objectid(struct btrfs_root *root, u64 *objectid)
 {
        int ret;
        mutex_lock(&root->objectid_mutex);
index 5e5bc60..9f4a2a1 100644 (file)
@@ -133,7 +133,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
 int btree_lock_page_hook(struct page *page, void *data,
                                void (*flush_fn)(void *));
 int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags);
-int btrfs_find_free_objectid(struct btrfs_root *root, u64 *objectid);
+int btrfs_get_free_objectid(struct btrfs_root *root, u64 *objectid);
 int btrfs_init_root_free_objectid(struct btrfs_root *root);
 int __init btrfs_end_io_wq_init(void);
 void __cold btrfs_end_io_wq_exit(void);
index 71d0d14..fd6ddd6 100644 (file)
@@ -198,7 +198,7 @@ int create_free_space_inode(struct btrfs_trans_handle *trans,
        int ret;
        u64 ino;
 
-       ret = btrfs_find_free_objectid(trans->fs_info->tree_root, &ino);
+       ret = btrfs_get_free_objectid(trans->fs_info->tree_root, &ino);
        if (ret < 0)
                return ret;
 
index a8e0a6b..0fe4df0 100644 (file)
@@ -6371,7 +6371,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       err = btrfs_find_free_objectid(root, &objectid);
+       err = btrfs_get_free_objectid(root, &objectid);
        if (err)
                goto out_unlock;
 
@@ -6435,7 +6435,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       err = btrfs_find_free_objectid(root, &objectid);
+       err = btrfs_get_free_objectid(root, &objectid);
        if (err)
                goto out_unlock;
 
@@ -6579,7 +6579,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       err = btrfs_find_free_objectid(root, &objectid);
+       err = btrfs_get_free_objectid(root, &objectid);
        if (err)
                goto out_fail;
 
@@ -9079,7 +9079,7 @@ static int btrfs_whiteout_for_rename(struct btrfs_trans_handle *trans,
        u64 objectid;
        u64 index;
 
-       ret = btrfs_find_free_objectid(root, &objectid);
+       ret = btrfs_get_free_objectid(root, &objectid);
        if (ret)
                return ret;
 
@@ -9575,7 +9575,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       err = btrfs_find_free_objectid(root, &objectid);
+       err = btrfs_get_free_objectid(root, &objectid);
        if (err)
                goto out_unlock;
 
@@ -9909,7 +9909,7 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       ret = btrfs_find_free_objectid(root, &objectid);
+       ret = btrfs_get_free_objectid(root, &objectid);
        if (ret)
                goto out;
 
index dde49a7..ec83803 100644 (file)
@@ -613,7 +613,7 @@ static noinline int create_subvol(struct inode *dir,
        if (!root_item)
                return -ENOMEM;
 
-       ret = btrfs_find_free_objectid(fs_info->tree_root, &objectid);
+       ret = btrfs_get_free_objectid(fs_info->tree_root, &objectid);
        if (ret)
                goto fail_free;
 
index df63ef6..2698805 100644 (file)
@@ -3434,7 +3434,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
                return ERR_CAST(trans);
        }
 
-       err = btrfs_find_free_objectid(root, &objectid);
+       err = btrfs_get_free_objectid(root, &objectid);
        if (err)
                goto out;
 
index fbf9306..3bcb544 100644 (file)
@@ -1526,7 +1526,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
        ASSERT(pending->root_item);
        new_root_item = pending->root_item;
 
-       pending->error = btrfs_find_free_objectid(tree_root, &objectid);
+       pending->error = btrfs_get_free_objectid(tree_root, &objectid);
        if (pending->error)
                goto no_free_objectid;