summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-11-03 11:23:37 +0800
committerDavid Sterba <dsterba@suse.com>2015-11-03 13:16:02 +0100
commita40b0ff048385bde41935c4353154cdfc234ee64 (patch)
treed39cc2cbd8858021fb0cfb39b678c80e9ab625c5 /utils.c
parent518fdbabd715600c698a78687aaebe7e957ca5e8 (diff)
downloadbtrfs-progs-a40b0ff048385bde41935c4353154cdfc234ee64.tar.gz
btrfs-progs: Rename variables in btrfs_add_to_fsid
There are two total_bytes in btrfs_add_to_fsid(), local variable of total_bytes means fs_total_bytes, and device->total_bytes means device's total_bytes. And device's total_bytes in argument is named block_count in current code. This patch rename: total_bytes -> fs_total_bytes block_count -> device_total_bytes To make code more readable. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils.c b/utils.c
index cd11091..93338be 100644
--- a/utils.c
+++ b/utils.c
@@ -724,7 +724,7 @@ static int zero_dev_clamped(int fd, off_t start, ssize_t len, u64 dev_size)
int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int fd, char *path,
- u64 block_count, u32 io_width, u32 io_align,
+ u64 device_total_bytes, u32 io_width, u32 io_align,
u32 sectorsize)
{
struct btrfs_super_block *disk_super;
@@ -732,7 +732,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
struct btrfs_device *device;
struct btrfs_dev_item *dev_item;
char *buf = NULL;
- u64 total_bytes;
+ u64 fs_total_bytes;
u64 num_devs;
int ret;
@@ -755,7 +755,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
device->sector_size = sectorsize;
device->fd = fd;
device->writeable = 1;
- device->total_bytes = block_count;
+ device->total_bytes = device_total_bytes;
device->bytes_used = 0;
device->total_ios = 0;
device->dev_root = root->fs_info->dev_root;
@@ -767,8 +767,8 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
ret = btrfs_add_device(trans, root, device);
BUG_ON(ret);
- total_bytes = btrfs_super_total_bytes(super) + block_count;
- btrfs_set_super_total_bytes(super, total_bytes);
+ fs_total_bytes = btrfs_super_total_bytes(super) + device_total_bytes;
+ btrfs_set_super_total_bytes(super, fs_total_bytes);
num_devs = btrfs_super_num_devices(super) + 1;
btrfs_set_super_num_devices(super, num_devs);