Commit de0dc456 authored by David Sterba's avatar David Sterba

btrfs: rename block_group_item on-stack accessors to follow naming

All accessors defined by BTRFS_SETGET_STACK_FUNCS contain _stack_ in the
name, the block group ones were not following that scheme, so let's
switch them.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3d976388
...@@ -1474,7 +1474,7 @@ static int find_first_block_group(struct btrfs_fs_info *fs_info, ...@@ -1474,7 +1474,7 @@ static int find_first_block_group(struct btrfs_fs_info *fs_info,
read_extent_buffer(leaf, &bg, read_extent_buffer(leaf, &bg,
btrfs_item_ptr_offset(leaf, slot), btrfs_item_ptr_offset(leaf, slot),
sizeof(bg)); sizeof(bg));
flags = btrfs_block_group_flags(&bg) & flags = btrfs_stack_block_group_flags(&bg) &
BTRFS_BLOCK_GROUP_TYPE_MASK; BTRFS_BLOCK_GROUP_TYPE_MASK;
if (flags != (em->map_lookup->type & if (flags != (em->map_lookup->type &
...@@ -1753,8 +1753,8 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info) ...@@ -1753,8 +1753,8 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
btrfs_item_ptr_offset(leaf, path->slots[0]), btrfs_item_ptr_offset(leaf, path->slots[0]),
sizeof(bgi)); sizeof(bgi));
/* cache::chunk_objectid is unused */ /* cache::chunk_objectid is unused */
cache->used = btrfs_block_group_used(&bgi); cache->used = btrfs_stack_block_group_used(&bgi);
cache->flags = btrfs_block_group_flags(&bgi); cache->flags = btrfs_stack_block_group_flags(&bgi);
if (!mixed && if (!mixed &&
((cache->flags & BTRFS_BLOCK_GROUP_METADATA) && ((cache->flags & BTRFS_BLOCK_GROUP_METADATA) &&
(cache->flags & BTRFS_BLOCK_GROUP_DATA))) { (cache->flags & BTRFS_BLOCK_GROUP_DATA))) {
...@@ -1878,10 +1878,10 @@ void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans) ...@@ -1878,10 +1878,10 @@ void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans)
goto next; goto next;
spin_lock(&block_group->lock); spin_lock(&block_group->lock);
btrfs_set_block_group_used(&item, block_group->used); btrfs_set_stack_block_group_used(&item, block_group->used);
btrfs_set_block_group_chunk_objectid(&item, btrfs_set_stack_block_group_chunk_objectid(&item,
BTRFS_FIRST_CHUNK_TREE_OBJECTID); BTRFS_FIRST_CHUNK_TREE_OBJECTID);
btrfs_set_block_group_flags(&item, block_group->flags); btrfs_set_stack_block_group_flags(&item, block_group->flags);
memcpy(&key, &block_group->key, sizeof(key)); memcpy(&key, &block_group->key, sizeof(key));
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
...@@ -2130,10 +2130,10 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans, ...@@ -2130,10 +2130,10 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
leaf = path->nodes[0]; leaf = path->nodes[0];
bi = btrfs_item_ptr_offset(leaf, path->slots[0]); bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
btrfs_set_block_group_used(&bgi, cache->used); btrfs_set_stack_block_group_used(&bgi, cache->used);
btrfs_set_block_group_chunk_objectid(&bgi, btrfs_set_stack_block_group_chunk_objectid(&bgi,
BTRFS_FIRST_CHUNK_TREE_OBJECTID); BTRFS_FIRST_CHUNK_TREE_OBJECTID);
btrfs_set_block_group_flags(&bgi, cache->flags); btrfs_set_stack_block_group_flags(&bgi, cache->flags);
write_extent_buffer(leaf, &bgi, bi, sizeof(bgi)); write_extent_buffer(leaf, &bgi, bi, sizeof(bgi));
btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf);
fail: fail:
......
...@@ -1519,18 +1519,18 @@ static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb, ...@@ -1519,18 +1519,18 @@ static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb,
} }
/* struct btrfs_block_group_item */ /* struct btrfs_block_group_item */
BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item, BTRFS_SETGET_STACK_FUNCS(stack_block_group_used, struct btrfs_block_group_item,
used, 64); used, 64);
BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item, BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item,
used, 64); used, 64);
BTRFS_SETGET_STACK_FUNCS(block_group_chunk_objectid, BTRFS_SETGET_STACK_FUNCS(stack_block_group_chunk_objectid,
struct btrfs_block_group_item, chunk_objectid, 64); struct btrfs_block_group_item, chunk_objectid, 64);
BTRFS_SETGET_FUNCS(disk_block_group_chunk_objectid, BTRFS_SETGET_FUNCS(disk_block_group_chunk_objectid,
struct btrfs_block_group_item, chunk_objectid, 64); struct btrfs_block_group_item, chunk_objectid, 64);
BTRFS_SETGET_FUNCS(disk_block_group_flags, BTRFS_SETGET_FUNCS(disk_block_group_flags,
struct btrfs_block_group_item, flags, 64); struct btrfs_block_group_item, flags, 64);
BTRFS_SETGET_STACK_FUNCS(block_group_flags, BTRFS_SETGET_STACK_FUNCS(stack_block_group_flags,
struct btrfs_block_group_item, flags, 64); struct btrfs_block_group_item, flags, 64);
/* struct btrfs_free_space_info */ /* struct btrfs_free_space_info */
......
...@@ -512,23 +512,23 @@ static int check_block_group_item(struct extent_buffer *leaf, ...@@ -512,23 +512,23 @@ static int check_block_group_item(struct extent_buffer *leaf,
read_extent_buffer(leaf, &bgi, btrfs_item_ptr_offset(leaf, slot), read_extent_buffer(leaf, &bgi, btrfs_item_ptr_offset(leaf, slot),
sizeof(bgi)); sizeof(bgi));
if (btrfs_block_group_chunk_objectid(&bgi) != if (btrfs_stack_block_group_chunk_objectid(&bgi) !=
BTRFS_FIRST_CHUNK_TREE_OBJECTID) { BTRFS_FIRST_CHUNK_TREE_OBJECTID) {
block_group_err(leaf, slot, block_group_err(leaf, slot,
"invalid block group chunk objectid, have %llu expect %llu", "invalid block group chunk objectid, have %llu expect %llu",
btrfs_block_group_chunk_objectid(&bgi), btrfs_stack_block_group_chunk_objectid(&bgi),
BTRFS_FIRST_CHUNK_TREE_OBJECTID); BTRFS_FIRST_CHUNK_TREE_OBJECTID);
return -EUCLEAN; return -EUCLEAN;
} }
if (btrfs_block_group_used(&bgi) > key->offset) { if (btrfs_stack_block_group_used(&bgi) > key->offset) {
block_group_err(leaf, slot, block_group_err(leaf, slot,
"invalid block group used, have %llu expect [0, %llu)", "invalid block group used, have %llu expect [0, %llu)",
btrfs_block_group_used(&bgi), key->offset); btrfs_stack_block_group_used(&bgi), key->offset);
return -EUCLEAN; return -EUCLEAN;
} }
flags = btrfs_block_group_flags(&bgi); flags = btrfs_stack_block_group_flags(&bgi);
if (hweight64(flags & BTRFS_BLOCK_GROUP_PROFILE_MASK) > 1) { if (hweight64(flags & BTRFS_BLOCK_GROUP_PROFILE_MASK) > 1) {
block_group_err(leaf, slot, block_group_err(leaf, slot,
"invalid profile flags, have 0x%llx (%lu bits set) expect no more than 1 bit set", "invalid profile flags, have 0x%llx (%lu bits set) expect no more than 1 bit set",
......
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