diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2017-05-18 10:06:40 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-07-03 13:35:10 +0200 |
commit | a124232f5d05446a03f7861451968eafe878c66d (patch) | |
tree | 3877ff5e44c8d89a4ae606bfb1a6e2b03ffab326 /file.c | |
parent | 4925e1bc115dd5ff91235d6d27f7b3bb4d5c12b4 (diff) |
btrfs-progs: Refactor sectorsize users in file.c
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -193,10 +193,10 @@ int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, int len, int read = 0; int ret; - if (!IS_ALIGNED(start, root->sectorsize) || - !IS_ALIGNED(len, root->sectorsize)) { + if (!IS_ALIGNED(start, root->fs_info->sectorsize) || + !IS_ALIGNED(len, root->fs_info->sectorsize)) { warning("@start and @len must be aligned to %u for function %s", - root->sectorsize, __func__); + root->fs_info->sectorsize, __func__); return -EINVAL; } @@ -260,7 +260,7 @@ int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, int len, goto next; read_extent_buffer(leaf, dest, btrfs_file_extent_inline_start(fi), extent_len); - read += round_up(extent_len, root->sectorsize); + read += round_up(extent_len, root->fs_info->sectorsize); break; } @@ -319,7 +319,7 @@ next: ii = btrfs_item_ptr(path.nodes[0], path.slots[0], struct btrfs_inode_item); isize = round_up(btrfs_inode_size(path.nodes[0], ii), - root->sectorsize); + root->fs_info->sectorsize); read = min_t(u64, isize - start, len); } out: |