summaryrefslogtreecommitdiff
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-06-15 17:25:38 +0300
committerDavid Sterba <dsterba@suse.com>2016-07-26 14:54:24 +0300
commit14a1e067b45614d6236e3c82b36f62caef44ac62 (patch)
tree2efadf6e036988c7b3f9d3d8e120b76db51b29e8 /fs/btrfs/file-item.c
parent0c83b62e2222a8872f0b65d50540fdfa53b675ff (diff)
downloadlinux-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/file-item.c')
-rw-r--r--fs/btrfs/file-item.c5
1 files changed, 2 insertions, 3 deletions
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))