btrfs: rename btrfs_find_free_objectid to btrfs_get_free_objectid
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>
This commit is contained in:
committed by
David Sterba
parent
453e487386
commit
543068a217
@@ -4778,7 +4778,7 @@ error:
|
|||||||
return ret;
|
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;
|
int ret;
|
||||||
mutex_lock(&root->objectid_mutex);
|
mutex_lock(&root->objectid_mutex);
|
||||||
|
|||||||
@@ -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,
|
int btree_lock_page_hook(struct page *page, void *data,
|
||||||
void (*flush_fn)(void *));
|
void (*flush_fn)(void *));
|
||||||
int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags);
|
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 btrfs_init_root_free_objectid(struct btrfs_root *root);
|
||||||
int __init btrfs_end_io_wq_init(void);
|
int __init btrfs_end_io_wq_init(void);
|
||||||
void __cold btrfs_end_io_wq_exit(void);
|
void __cold btrfs_end_io_wq_exit(void);
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ int create_free_space_inode(struct btrfs_trans_handle *trans,
|
|||||||
int ret;
|
int ret;
|
||||||
u64 ino;
|
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)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|||||||
@@ -6371,7 +6371,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
|
|||||||
if (IS_ERR(trans))
|
if (IS_ERR(trans))
|
||||||
return PTR_ERR(trans);
|
return PTR_ERR(trans);
|
||||||
|
|
||||||
err = btrfs_find_free_objectid(root, &objectid);
|
err = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
@@ -6435,7 +6435,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
|
|||||||
if (IS_ERR(trans))
|
if (IS_ERR(trans))
|
||||||
return PTR_ERR(trans);
|
return PTR_ERR(trans);
|
||||||
|
|
||||||
err = btrfs_find_free_objectid(root, &objectid);
|
err = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
@@ -6579,7 +6579,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|||||||
if (IS_ERR(trans))
|
if (IS_ERR(trans))
|
||||||
return PTR_ERR(trans);
|
return PTR_ERR(trans);
|
||||||
|
|
||||||
err = btrfs_find_free_objectid(root, &objectid);
|
err = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_fail;
|
goto out_fail;
|
||||||
|
|
||||||
@@ -9079,7 +9079,7 @@ static int btrfs_whiteout_for_rename(struct btrfs_trans_handle *trans,
|
|||||||
u64 objectid;
|
u64 objectid;
|
||||||
u64 index;
|
u64 index;
|
||||||
|
|
||||||
ret = btrfs_find_free_objectid(root, &objectid);
|
ret = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -9575,7 +9575,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
|
|||||||
if (IS_ERR(trans))
|
if (IS_ERR(trans))
|
||||||
return PTR_ERR(trans);
|
return PTR_ERR(trans);
|
||||||
|
|
||||||
err = btrfs_find_free_objectid(root, &objectid);
|
err = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
@@ -9909,7 +9909,7 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|||||||
if (IS_ERR(trans))
|
if (IS_ERR(trans))
|
||||||
return PTR_ERR(trans);
|
return PTR_ERR(trans);
|
||||||
|
|
||||||
ret = btrfs_find_free_objectid(root, &objectid);
|
ret = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
@@ -613,7 +613,7 @@ static noinline int create_subvol(struct inode *dir,
|
|||||||
if (!root_item)
|
if (!root_item)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = btrfs_find_free_objectid(fs_info->tree_root, &objectid);
|
ret = btrfs_get_free_objectid(fs_info->tree_root, &objectid);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail_free;
|
goto fail_free;
|
||||||
|
|
||||||
|
|||||||
@@ -3434,7 +3434,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
|
|||||||
return ERR_CAST(trans);
|
return ERR_CAST(trans);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = btrfs_find_free_objectid(root, &objectid);
|
err = btrfs_get_free_objectid(root, &objectid);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
@@ -1526,7 +1526,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
|
|||||||
ASSERT(pending->root_item);
|
ASSERT(pending->root_item);
|
||||||
new_root_item = 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)
|
if (pending->error)
|
||||||
goto no_free_objectid;
|
goto no_free_objectid;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user