From 0b246afa62b0cf5b09d078121f543135f28492ad Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 22 Jun 2016 18:54:23 -0400 Subject: btrfs: root->fs_info cleanup, add fs_info convenience variables In routines where someptr->fs_info is referenced multiple times, we introduce a convenience variable. This makes the code considerably more readable. Signed-off-by: Jeff Mahoney Signed-off-by: David Sterba --- fs/btrfs/dir-item.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/btrfs/dir-item.c') diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index 79233ab69ae5..128f8ab20d41 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c @@ -451,12 +451,12 @@ int verify_dir_item(struct btrfs_root *root, struct extent_buffer *leaf, struct btrfs_dir_item *dir_item) { + struct btrfs_fs_info *fs_info = root->fs_info; u16 namelen = BTRFS_NAME_LEN; u8 type = btrfs_dir_type(leaf, dir_item); if (type >= BTRFS_FT_MAX) { - btrfs_crit(root->fs_info, "invalid dir item type: %d", - (int)type); + btrfs_crit(fs_info, "invalid dir item type: %d", (int)type); return 1; } @@ -464,16 +464,16 @@ int verify_dir_item(struct btrfs_root *root, namelen = XATTR_NAME_MAX; if (btrfs_dir_name_len(leaf, dir_item) > namelen) { - btrfs_crit(root->fs_info, "invalid dir item name len: %u", + btrfs_crit(fs_info, "invalid dir item name len: %u", (unsigned)btrfs_dir_data_len(leaf, dir_item)); return 1; } /* BTRFS_MAX_XATTR_SIZE is the same for all dir items */ if ((btrfs_dir_data_len(leaf, dir_item) + - btrfs_dir_name_len(leaf, dir_item)) > BTRFS_MAX_XATTR_SIZE(root->fs_info)) { - btrfs_crit(root->fs_info, - "invalid dir item name + data len: %u + %u", + btrfs_dir_name_len(leaf, dir_item)) > + BTRFS_MAX_XATTR_SIZE(fs_info)) { + btrfs_crit(fs_info, "invalid dir item name + data len: %u + %u", (unsigned)btrfs_dir_name_len(leaf, dir_item), (unsigned)btrfs_dir_data_len(leaf, dir_item)); return 1; -- cgit v1.2.3