Commit 42049bf6 authored by Chris Mason's avatar Chris Mason

Btrfs: fix __MAX_CSUM_ITEMS

Jeff Mahoney's cleanup commit (14a1e067) 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: default avatarChris Mason <clm@fb.com>
parent 023a824f
......@@ -27,8 +27,9 @@
#include "print-tree.h"
#include "compression.h"
#define __MAX_CSUM_ITEMS(r, size) \
((unsigned long)(((BTRFS_MAX_ITEM_SIZE(r) * 2) / size) - 1))
#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) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \
PAGE_SIZE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment