Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 221b8318 authored by Zach Brown's avatar Zach Brown Committed by Chris Mason
Browse files

btrfs: fix min csum item size warnings in 32bit



commit 7ca4be45 limited csum items to
PAGE_CACHE_SIZE.  It used min() with incompatible types in 32bit which
generates warnings:

fs/btrfs/file-item.c: In function ‘btrfs_csum_file_blocks’:
fs/btrfs/file-item.c:717: warning: comparison of distinct pointer types lacks a cast

This uses min_t(u32,) to fix the warnings.  u32 seemed reasonable
because btrfs_root->leafsize is u32 and PAGE_CACHE_SIZE is unsigned
long.

Signed-off-by: default avatarZach Brown <zab@zabbo.net>
parent 67b0fd63
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,8 @@
				   sizeof(struct btrfs_item) * 2) / \
				   sizeof(struct btrfs_item) * 2) / \
				  size) - 1))
				  size) - 1))


#define MAX_CSUM_ITEMS(r, size) (min(__MAX_CSUM_ITEMS(r, size), PAGE_CACHE_SIZE))
#define MAX_CSUM_ITEMS(r, size) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \
				       PAGE_CACHE_SIZE))


#define MAX_ORDERED_SUM_BYTES(r) ((PAGE_SIZE - \
#define MAX_ORDERED_SUM_BYTES(r) ((PAGE_SIZE - \
				   sizeof(struct btrfs_ordered_sum)) / \
				   sizeof(struct btrfs_ordered_sum)) / \