Skip to content

Commit 3be4d8e

Browse files
adam900710kdave
authored andcommitted
btrfs: block-group: rename write_one_cache_group()
The name of this function contains the word "cache", which is left from the times where btrfs_block_group was called btrfs_block_group_cache. Now this "cache" doesn't match anything, and we have better namings for functions like read/insert/remove_block_group_item(). Rename it to update_block_group_item(). Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 97f4728 commit 3be4d8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/btrfs/block-group.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,13 +2349,13 @@ void btrfs_dec_block_group_ro(struct btrfs_block_group *cache)
23492349
spin_unlock(&sinfo->lock);
23502350
}
23512351

2352-
static int write_one_cache_group(struct btrfs_trans_handle *trans,
2353-
struct btrfs_path *path,
2354-
struct btrfs_block_group *cache)
2352+
static int update_block_group_item(struct btrfs_trans_handle *trans,
2353+
struct btrfs_path *path,
2354+
struct btrfs_block_group *cache)
23552355
{
23562356
struct btrfs_fs_info *fs_info = trans->fs_info;
23572357
int ret;
2358-
struct btrfs_root *extent_root = fs_info->extent_root;
2358+
struct btrfs_root *root = fs_info->extent_root;
23592359
unsigned long bi;
23602360
struct extent_buffer *leaf;
23612361
struct btrfs_block_group_item bgi;
@@ -2365,7 +2365,7 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
23652365
key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
23662366
key.offset = cache->length;
23672367

2368-
ret = btrfs_search_slot(trans, extent_root, &key, path, 0, 1);
2368+
ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
23692369
if (ret) {
23702370
if (ret > 0)
23712371
ret = -ENOENT;
@@ -2677,7 +2677,7 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans)
26772677
}
26782678
}
26792679
if (!ret) {
2680-
ret = write_one_cache_group(trans, path, cache);
2680+
ret = update_block_group_item(trans, path, cache);
26812681
/*
26822682
* Our block group might still be attached to the list
26832683
* of new block groups in the transaction handle of some
@@ -2826,7 +2826,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
28262826
}
28272827
}
28282828
if (!ret) {
2829-
ret = write_one_cache_group(trans, path, cache);
2829+
ret = update_block_group_item(trans, path, cache);
28302830
/*
28312831
* One of the free space endio workers might have
28322832
* created a new block group while updating a free space
@@ -2843,7 +2843,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
28432843
if (ret == -ENOENT) {
28442844
wait_event(cur_trans->writer_wait,
28452845
atomic_read(&cur_trans->num_writers) == 1);
2846-
ret = write_one_cache_group(trans, path, cache);
2846+
ret = update_block_group_item(trans, path, cache);
28472847
}
28482848
if (ret)
28492849
btrfs_abort_transaction(trans, ret);

0 commit comments

Comments
 (0)