aboutsummaryrefslogtreecommitdiffstats
path: root/volumes.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-11-30 16:07:35 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-04 11:28:24 +0100
commit22d9c7091b3855663571cf445141ba2b24522bd0 (patch)
treee403d28ad83f601b33aeb886f17c79ec0578417b /volumes.c
parent9c655bfc1cc73fcacb5d555855ff0199d314eb84 (diff)
downloadbtrfs-progs-22d9c7091b3855663571cf445141ba2b24522bd0.tar.gz
btrfs-progs-22d9c7091b3855663571cf445141ba2b24522bd0.tar.xz
btrfs-progs-22d9c7091b3855663571cf445141ba2b24522bd0.zip
btrfs-progs: cleanup, rename a few variables in btrfs_read_sys_array
Port of kernel commit 1ffb22cf8c322bbfea6b35fe23d025841b49fede There's a pointer to buffer, integer offset and offset passed as pointer, try to find matching names for them. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/volumes.c b/volumes.c
index 01cfafe..939ff7b 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1795,13 +1795,13 @@ int btrfs_read_sys_array(struct btrfs_root *root)
struct extent_buffer *sb;
struct btrfs_disk_key *disk_key;
struct btrfs_chunk *chunk;
- u8 *ptr;
- unsigned long sb_ptr;
+ u8 *array_ptr;
+ unsigned long sb_array_offset;
int ret = 0;
u32 num_stripes;
u32 array_size;
u32 len = 0;
- u32 cur;
+ u32 cur_offset;
struct btrfs_key key;
sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET,
@@ -1812,20 +1812,21 @@ int btrfs_read_sys_array(struct btrfs_root *root)
write_extent_buffer(sb, super_copy, 0, sizeof(*super_copy));
array_size = btrfs_super_sys_array_size(super_copy);
- ptr = super_copy->sys_chunk_array;
- sb_ptr = offsetof(struct btrfs_super_block, sys_chunk_array);
- cur = 0;
+ array_ptr = super_copy->sys_chunk_array;
+ sb_array_offset = offsetof(struct btrfs_super_block, sys_chunk_array);
+ cur_offset = 0;
- while (cur < array_size) {
- disk_key = (struct btrfs_disk_key *)ptr;
+ while (cur_offset < array_size) {
+ disk_key = (struct btrfs_disk_key *)array_ptr;
btrfs_disk_key_to_cpu(&key, disk_key);
- len = sizeof(*disk_key); ptr += len;
- sb_ptr += len;
- cur += len;
+ len = sizeof(*disk_key);
+ array_ptr += len;
+ sb_array_offset += len;
+ cur_offset += len;
if (key.type == BTRFS_CHUNK_ITEM_KEY) {
- chunk = (struct btrfs_chunk *)sb_ptr;
+ chunk = (struct btrfs_chunk *)sb_array_offset;
ret = read_one_chunk(root, &key, sb, chunk, -1);
if (ret)
break;
@@ -1834,9 +1835,9 @@ int btrfs_read_sys_array(struct btrfs_root *root)
} else {
BUG();
}
- ptr += len;
- sb_ptr += len;
- cur += len;
+ array_ptr += len;
+ sb_array_offset += len;
+ cur_offset += len;
}
free_extent_buffer(sb);
return ret;