diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-15 17:25:38 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 14:54:24 +0300 |
commit | 14a1e067b45614d6236e3c82b36f62caef44ac62 (patch) | |
tree | 2efadf6e036988c7b3f9d3d8e120b76db51b29e8 /fs/btrfs/ctree.h | |
parent | 0c83b62e2222a8872f0b65d50540fdfa53b675ff (diff) | |
download | linux-14a1e067b45614d6236e3c82b36f62caef44ac62.tar.xz |
btrfs: introduce BTRFS_MAX_ITEM_SIZE
We use BTRFS_LEAF_DATA_SIZE - sizeof(struct btrfs_item) in
several places. This introduces a BTRFS_MAX_ITEM_SIZE macro to do the
same.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 950e4ee6b66e..1d46ceec1fc0 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -150,13 +150,13 @@ struct btrfs_header { sizeof(struct btrfs_key_ptr)) #define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header)) #define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->nodesize)) +#define BTRFS_MAX_ITEM_SIZE(r) \ + (BTRFS_LEAF_DATA_SIZE(r) - sizeof(struct btrfs_item)) #define BTRFS_FILE_EXTENT_INLINE_DATA_START \ (offsetof(struct btrfs_file_extent_item, disk_bytenr)) -#define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ - sizeof(struct btrfs_item) - \ +#define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_MAX_ITEM_SIZE(r) - \ BTRFS_FILE_EXTENT_INLINE_DATA_START) -#define BTRFS_MAX_XATTR_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ - sizeof(struct btrfs_item) -\ +#define BTRFS_MAX_XATTR_SIZE(r) (BTRFS_MAX_ITEM_SIZE(r) - \ sizeof(struct btrfs_dir_item)) |