Commit 42257569 authored by David Sterba's avatar David Sterba

btrfs: rename __btrfs_add_inode_defrag() and drop double underscores

The function does not follow the pattern where the underscores would be
justified, so rename it.

Also update the misleading comment, the passed item is not freed, that's
what the caller does.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6d2f07e1
...@@ -61,15 +61,13 @@ static int compare_inode_defrag(const struct inode_defrag *defrag1, ...@@ -61,15 +61,13 @@ static int compare_inode_defrag(const struct inode_defrag *defrag1,
} }
/* /*
* Pop a record for an inode into the defrag tree. The lock must be held * Insert a record for an inode into the defrag tree. The lock must be held
* already. * already.
* *
* If you're inserting a record for an older transid than an existing record, * If you're inserting a record for an older transid than an existing record,
* the transid already in the tree is lowered. * the transid already in the tree is lowered.
*
* If an existing record is found the defrag item you pass in is freed.
*/ */
static int __btrfs_add_inode_defrag(struct btrfs_inode *inode, static int btrfs_insert_inode_defrag(struct btrfs_inode *inode,
struct inode_defrag *defrag) struct inode_defrag *defrag)
{ {
struct btrfs_fs_info *fs_info = inode->root->fs_info; struct btrfs_fs_info *fs_info = inode->root->fs_info;
...@@ -157,7 +155,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, ...@@ -157,7 +155,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans,
* and then re-read this inode, this new inode doesn't have * and then re-read this inode, this new inode doesn't have
* IN_DEFRAG flag. At the case, we may find the existed defrag. * IN_DEFRAG flag. At the case, we may find the existed defrag.
*/ */
ret = __btrfs_add_inode_defrag(inode, defrag); ret = btrfs_insert_inode_defrag(inode, defrag);
if (ret) if (ret)
kmem_cache_free(btrfs_inode_defrag_cachep, defrag); kmem_cache_free(btrfs_inode_defrag_cachep, defrag);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment