From 14a1e067b45614d6236e3c82b36f62caef44ac62 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 15 Jun 2016 10:25:38 -0400 Subject: 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 Signed-off-by: David Sterba --- fs/btrfs/file-item.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fs/btrfs/file-item.c') diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 6b58d0620e2f..cdbbf85a269b 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -27,9 +27,8 @@ #include "print-tree.h" #include "compression.h" -#define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \ - sizeof(struct btrfs_item) * 2) / \ - size) - 1)) +#define __MAX_CSUM_ITEMS(r, size) \ + ((unsigned long)(((BTRFS_MAX_ITEM_SIZE(r) * 2) / size) - 1)) #define MAX_CSUM_ITEMS(r, size) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \ PAGE_SIZE)) -- cgit v1.2.3