diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-15 09:22:56 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 16:06:58 +0100 |
commit | da17066c40472c2d6a1aab7bb0090c3d285531c9 (patch) | |
tree | f51910799ffea3bfe5af34d009a2967b9e99e6ad /fs/btrfs/tree-log.c | |
parent | f15376df0dc2b632eb689793a73d4adba8404987 (diff) | |
download | talos-obmc-linux-da17066c40472c2d6a1aab7bb0090c3d285531c9.tar.gz talos-obmc-linux-da17066c40472c2d6a1aab7bb0090c3d285531c9.zip |
btrfs: pull node/sector/stripe sizes out of root and into fs_info
We track the node sizes per-root, but they never vary from the values
in the superblock. This patch messes with the 80-column style a bit,
but subsequent patches to factor out root->fs_info into a convenience
variable fix it up again.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 72bd398f6c66..ad3ae2ef0cd4 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -608,7 +608,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { size = btrfs_file_extent_inline_len(eb, slot, item); nbytes = btrfs_file_extent_ram_bytes(eb, item); - extent_end = ALIGN(start + size, root->sectorsize); + extent_end = ALIGN(start + size, + root->fs_info->sectorsize); } else { ret = 0; goto out; @@ -2432,7 +2433,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, bytenr = btrfs_node_blockptr(cur, path->slots[*level]); ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); - blocksize = root->nodesize; + blocksize = root->fs_info->nodesize; parent = path->nodes[*level]; root_owner = btrfs_header_owner(parent); @@ -3789,7 +3790,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, src_path->slots[0], extent); *last_extent = ALIGN(key.offset + len, - log->sectorsize); + log->fs_info->sectorsize); } else { len = btrfs_file_extent_num_bytes(src, extent); *last_extent = key.offset + len; @@ -3852,7 +3853,8 @@ fill_holes: if (btrfs_file_extent_type(src, extent) == BTRFS_FILE_EXTENT_INLINE) { len = btrfs_file_extent_inline_len(src, i, extent); - extent_end = ALIGN(key.offset + len, log->sectorsize); + extent_end = ALIGN(key.offset + len, + log->fs_info->sectorsize); } else { len = btrfs_file_extent_num_bytes(src, extent); extent_end = key.offset + len; @@ -4427,7 +4429,7 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans, if (hole_size == 0) return 0; - hole_size = ALIGN(hole_size, root->sectorsize); + hole_size = ALIGN(hole_size, root->fs_info->sectorsize); ret = btrfs_insert_file_extent(trans, log, ino, hole_start, 0, 0, hole_size, 0, hole_size, 0, 0, 0); return ret; |