diff options
author | Chris Mason <clm@fb.com> | 2016-08-03 17:05:46 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-08-03 17:08:37 -0400 |
commit | 42049bf60db4c01e0432fc861463dcd3208c0d93 (patch) | |
tree | d0adda9b536d5c9cd12fcbae46c49569e9123f36 /fs/btrfs/file-item.c | |
parent | 023a824f04754a4ed5efc16ee8e41bb932878b0b (diff) |
Btrfs: fix __MAX_CSUM_ITEMS
Jeff Mahoney's cleanup commit (14a1e067b4) wasn't correct for csums on
machines where the pagesize >= metadata blocksize.
This just reverts the relevant hunks to bring the old math back.
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 2fc803da4680..d0d571c47d33 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -27,8 +27,9 @@ | |||
27 | #include "print-tree.h" | 27 | #include "print-tree.h" |
28 | #include "compression.h" | 28 | #include "compression.h" |
29 | 29 | ||
30 | #define __MAX_CSUM_ITEMS(r, size) \ | 30 | #define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \ |
31 | ((unsigned long)(((BTRFS_MAX_ITEM_SIZE(r) * 2) / size) - 1)) | 31 | sizeof(struct btrfs_item) * 2) / \ |
32 | size) - 1)) | ||
32 | 33 | ||
33 | #define MAX_CSUM_ITEMS(r, size) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \ | 34 | #define MAX_CSUM_ITEMS(r, size) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \ |
34 | PAGE_SIZE)) | 35 | PAGE_SIZE)) |