linux-stable/fs/bcachefs
Nathan Chancellor e82f5f40f2 bcachefs: Fix -Wcompare-distinct-pointer-types in bch2_copygc_get_buckets()
When building bcachefs for 32-bit ARM, there is a warning when using
max() to compare an expression involving 'size_t' with an 'unsigned
long' literal:

  fs/bcachefs/movinggc.c:159:21: error: comparison of distinct pointer types ('typeof (16UL) *' (aka 'unsigned long *') and 'typeof (buckets_in_flight->nr / 4) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types]
    159 |         size_t nr_to_get = max(16UL, buckets_in_flight->nr / 4);
        |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/linux/minmax.h:76:19: note: expanded from macro 'max'
     76 | #define max(x, y)       __careful_cmp(x, y, >)
        |                         ^~~~~~~~~~~~~~~~~~~~~~
  include/linux/minmax.h:38:24: note: expanded from macro '__careful_cmp'
     38 |         __builtin_choose_expr(__safe_cmp(x, y), \
        |                               ^~~~~~~~~~~~~~~~
  include/linux/minmax.h:28:4: note: expanded from macro '__safe_cmp'
     28 |                 (__typecheck(x, y) && __no_side_effects(x, y))
        |                  ^~~~~~~~~~~~~~~~~
  include/linux/minmax.h:22:28: note: expanded from macro '__typecheck'
     22 |         (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
        |                    ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
  1 error generated.

On 64-bit architectures, size_t is 'unsigned long', so there is no
warning when comparing these two expressions. Use max_t(size_t, ...) for
this situation, eliminating the warning.

Fixes: dd49018737d4 ("bcachefs: Rhashtable based buckets_in_flight for copygc")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-22 17:10:13 -04:00
..
acl.c bcachefs: bch2_acl_to_text() 2023-10-22 17:10:12 -04:00
acl.h bcachefs: bch2_acl_to_text() 2023-10-22 17:10:12 -04:00
alloc_background.c bcachefs: Fix -Wformat in bch2_bucket_gens_invalid() 2023-10-22 17:10:13 -04:00
alloc_background.h bcachefs: Kill bch2_bucket_gens_read() 2023-10-22 17:10:06 -04:00
alloc_foreground.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
alloc_foreground.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
alloc_types.h bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
backpointers.c bcachefs: Fix a handful of spelling mistakes in various messages 2023-10-22 17:10:13 -04:00
backpointers.h bcachefs: remove duplicate code between backpointer update paths 2023-10-22 17:10:08 -04:00
bbpos.h bcachefs: Run bch2_check_backpointers_to_extents() in multiple passes if necessary 2023-10-22 17:09:51 -04:00
bcachefs.h bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
bcachefs_format.h bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
bcachefs_ioctl.h bcachefs: Convert to __packed and __aligned 2023-10-22 17:09:45 -04:00
bkey.c bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bkey.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bkey_buf.h bcachefs: Move bkey bkey_unpack_key() to bkey.h 2023-10-22 17:09:45 -04:00
bkey_cmp.h bcachefs: bch2_bkey_cmp_packed_inlined() 2023-10-22 17:09:45 -04:00
bkey_methods.c bcachefs: Fix -Wincompatible-function-pointer-types-strict from key_invalid callbacks 2023-10-22 17:10:13 -04:00
bkey_methods.h bcachefs: BCH_COMPAT_bformat_overflow_done no longer required 2023-10-22 17:10:09 -04:00
bkey_sort.c bcachefs: Use memcpy_u64s_small() for copying keys 2023-10-22 17:10:01 -04:00
bkey_sort.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bset.c bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
bset.h bcachefs: bch2_btree_node_to_text() const correctness 2023-10-22 17:09:56 -04:00
btree_cache.c bcachefs: bkey_format helper improvements 2023-10-22 17:10:09 -04:00
btree_cache.h bcachefs: Assorted sparse fixes 2023-10-22 17:10:06 -04:00
btree_gc.c bcachefs: Convert more code to bch_err_msg() 2023-10-22 17:10:12 -04:00
btree_gc.h bcachefs: Split up btree_update_leaf.c 2023-10-22 17:10:10 -04:00
btree_io.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
btree_io.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
btree_iter.c bcachefs: Fix a handful of spelling mistakes in various messages 2023-10-22 17:10:13 -04:00
btree_iter.h bcachefs: Fix bch2_propagate_key_to_snapshot_leaves() 2023-10-22 17:10:12 -04:00
btree_journal_iter.c bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
btree_journal_iter.h bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
btree_key_cache.c bcachefs: Fix -Wformat in bch2_btree_key_cache_to_text() 2023-10-22 17:10:13 -04:00
btree_key_cache.h bcachefs: don't bump key cache journal seq on nojournal commits 2023-10-22 17:09:56 -04:00
btree_locking.c bcachefs: Assorted fixes for clang 2023-10-22 17:10:09 -04:00
btree_locking.h bcachefs: Fix silent enum conversion error 2023-10-22 17:10:12 -04:00
btree_trans_commit.c bcachefs: Put bkey invalid check in commit path in a more useful place 2023-10-22 17:10:11 -04:00
btree_types.h bcachefs: Consolidate btree id properties 2023-10-22 17:10:09 -04:00
btree_update.c bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
btree_update.h bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
btree_update_interior.c bcachefs: remove redundant initialization of pointer d 2023-10-22 17:10:12 -04:00
btree_update_interior.h bcachefs: Move some declarations to the correct header 2023-10-22 17:10:08 -04:00
btree_write_buffer.c bcachefs: Fix btree write buffer with snapshots btrees 2023-10-22 17:10:11 -04:00
btree_write_buffer.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
btree_write_buffer_types.h bcachefs: Btree write buffer 2023-10-22 17:09:50 -04:00
buckets.c bcachefs: remove redundant initialization of pointer d 2023-10-22 17:10:12 -04:00
buckets.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
buckets_types.h bcachefs: Fragmentation LRU 2023-10-22 17:09:53 -04:00
buckets_waiting_for_journal.c bcachefs: Fix -Wformat in bch2_set_bucket_needs_journal_commit() 2023-10-22 17:10:13 -04:00
buckets_waiting_for_journal.h bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
buckets_waiting_for_journal_types.h bcachefs: New data structure for buckets waiting on journal commit 2023-10-22 17:09:22 -04:00
chardev.c bcachefs: Convert -ENOENT to private error codes 2023-10-22 17:10:03 -04:00
chardev.h bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
checksum.c bcachefs: Fix -Wcompare-distinct-pointer-types in do_encrypt() 2023-10-22 17:10:13 -04:00
checksum.h bcachefs: Move bch_sb_field_crypt code to checksum.c 2023-10-22 17:10:10 -04:00
clock.c bcachefs: Private error codes: ENOMEM 2023-10-22 17:09:57 -04:00
clock.h
clock_types.h
compress.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
compress.h bcachefs: Compression levels 2023-10-22 17:10:07 -04:00
counters.c bcachefs: Assorted sparse fixes 2023-10-22 17:10:06 -04:00
counters.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
darray.h bcachefs: Assorted fixes for clang 2023-10-22 17:10:09 -04:00
data_update.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
data_update.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
debug.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
debug.h bcachefs: bch2_btree_node_ondisk_to_text() 2023-10-22 17:09:56 -04:00
dirent.c bcachefs: Lower BCH_NAME_MAX to 512 2023-10-22 17:10:11 -04:00
dirent.h bcachefs: Introduce bch2_dirent_get_name 2023-10-22 17:10:10 -04:00
disk_groups.c bcachefs: remove redundant initialization of pointer dst 2023-10-22 17:10:13 -04:00
disk_groups.h bcachefs: bch_opt_fn 2023-10-22 17:10:07 -04:00
ec.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
ec.h bcachefs: Assorted fixes for clang 2023-10-22 17:10:09 -04:00
ec_types.h bcachefs: Simplify ec stripes heap 2023-10-22 17:09:54 -04:00
errcode.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
errcode.h bcachefs: trace_read_nopromote() 2023-10-22 17:10:12 -04:00
error.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
error.h bcachefs: fix_errors option is now a proper enum 2023-10-22 17:10:07 -04:00
extent_update.c bcachefs: Use for_each_btree_key_upto() more consistently 2023-10-22 17:09:50 -04:00
extent_update.h bcachefs: Reduce iter->trans usage 2023-10-22 17:09:10 -04:00
extents.c bcachefs: Fix 'pointer to invalid device' check 2023-10-22 17:10:11 -04:00
extents.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
extents_types.h
eytzinger.h bcachefs: Make eytzinger size parameter more conventional 2023-10-22 17:09:21 -04:00
fifo.h bcachefs: More style fixes 2023-10-22 17:09:45 -04:00
fs-common.c bcachefs: Convert -ENOENT to private error codes 2023-10-22 17:10:03 -04:00
fs-common.h bcachefs: Add BCH_SUBVOLUME_UNLINKED 2023-10-22 17:09:15 -04:00
fs-io-buffered.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
fs-io-buffered.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io-direct.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
fs-io-direct.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io-pagecache.c bcachefs: fix up wonky error handling in bch2_seek_pagecache_hole() 2023-10-22 17:10:11 -04:00
fs-io-pagecache.h bcachefs: Split up fs-io.[ch] 2023-10-22 17:10:10 -04:00
fs-io.c bcachefs: remove redundant initializations of variables start_offset and end_offset 2023-10-22 17:10:13 -04:00
fs-io.h bcachefs: New io_misc.c helpers 2023-10-22 17:10:12 -04:00
fs-ioctl.c bcachefs: Add btree_trans* to inode_set_fn 2023-10-22 17:10:10 -04:00
fs-ioctl.h
fs.c bcachefs: New io_misc.c helpers 2023-10-22 17:10:12 -04:00
fs.h bcachefs: Add btree_trans* to inode_set_fn 2023-10-22 17:10:10 -04:00
fsck.c bcachefs: __bch2_btree_insert() -> bch2_btree_insert_trans() 2023-10-22 17:10:12 -04:00
fsck.h bcachefs: Enumerate recovery passes 2023-10-22 17:10:06 -04:00
inode.c bcachefs: Kill missing inode warnings in bch2_quota_read() 2023-10-22 17:10:12 -04:00
inode.h bcachefs: Kill missing inode warnings in bch2_quota_read() 2023-10-22 17:10:12 -04:00
io_misc.c bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
io_misc.h bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
io_read.c bcachefs: remove duplicated assignment to variable offset_into_extent 2023-10-22 17:10:13 -04:00
io_read.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
io_write_types.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
journal.c bcachefs: Convert more code to bch_err_msg() 2023-10-22 17:10:12 -04:00
journal.h bcachefs: Kill JOURNAL_WATERMARK 2023-10-22 17:10:05 -04:00
journal_io.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
journal_io.h bcachefs: Convert journal validation to bkey_invalid_flags 2023-10-22 17:10:10 -04:00
journal_reclaim.c bcachefs: Convert more code to bch_err_msg() 2023-10-22 17:10:12 -04:00
journal_reclaim.h
journal_sb.c bcachefs: Assorted sparse fixes 2023-10-22 17:10:06 -04:00
journal_sb.h bcachefs: Journal resize fixes 2023-10-22 17:09:56 -04:00
journal_seq_blacklist.c bcachefs: Private error codes: ENOMEM 2023-10-22 17:09:57 -04:00
journal_seq_blacklist.h Revert "bcachefs: Delete some obsolete journal_seq_blacklist code" 2023-10-22 17:09:21 -04:00
journal_types.h bcachefs: Kill JOURNAL_WATERMARK 2023-10-22 17:10:05 -04:00
Kconfig bcachefs: Compression levels 2023-10-22 17:10:07 -04:00
keylist.c bcachefs: GFP_NOIO -> GFP_NOFS 2023-10-22 17:10:03 -04:00
keylist.h bcachefs: Kill bch2_keylist_add_in_order() 2023-10-22 17:09:54 -04:00
keylist_types.h
logged_ops.c bcachefs: Log truncate operations 2023-10-22 17:10:12 -04:00
logged_ops.h bcachefs: Log finsert/fcollapse operations 2023-10-22 17:10:12 -04:00
lru.c bcachefs: bch2_btree_bit_mod() 2023-10-22 17:10:08 -04:00
lru.h bcachefs: bch2_btree_bit_mod() 2023-10-22 17:10:08 -04:00
Makefile bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
mean_and_variance.c bcachefs: Mean and variance 2023-10-22 17:09:43 -04:00
mean_and_variance.h mean and variance: Add a missing include 2023-10-22 17:10:02 -04:00
mean_and_variance_test.c mean and variance: More tests 2023-10-22 17:10:02 -04:00
migrate.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
migrate.h
move.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
move.h bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
move_types.h bcachefs: Rhashtable based buckets_in_flight for copygc 2023-10-22 17:09:58 -04:00
movinggc.c bcachefs: Fix -Wcompare-distinct-pointer-types in bch2_copygc_get_buckets() 2023-10-22 17:10:13 -04:00
movinggc.h bcachefs: bch2_copygc_wait_to_text() 2023-10-22 17:09:55 -04:00
nocow_locking.c bcachefs: Add an assert to bch2_bucket_nocow_unlock() 2023-10-22 17:09:52 -04:00
nocow_locking.h bcachefs: Improved nocow locking 2023-10-22 17:09:52 -04:00
nocow_locking_types.h bcachefs: Improved nocow locking 2023-10-22 17:09:52 -04:00
opts.c bcachefs: Handle weird opt string from sys_fsconfig() 2023-10-22 17:10:09 -04:00
opts.h bcachefs: Compression levels 2023-10-22 17:10:07 -04:00
printbuf.c bcachefs: Printbuf rework 2023-10-22 17:09:33 -04:00
printbuf.h bcachefs: Improve dev_alloc_debug_to_text() 2023-10-22 17:09:55 -04:00
quota.c bcachefs: remove redundant pointer q 2023-10-22 17:10:13 -04:00
quota.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
quota_types.h
rebalance.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
rebalance.h
rebalance_types.h bcachefs: add progress stats to sysfs 2023-10-22 17:09:10 -04:00
recovery.c bcachefs: Fix a handful of spelling mistakes in various messages 2023-10-22 17:10:13 -04:00
recovery.h bcachefs: btree_journal_iter.c 2023-10-22 17:10:10 -04:00
recovery_types.h bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
reflink.c bcachefs: Break up io.c 2023-10-22 17:10:12 -04:00
reflink.h bcachefs: Change check for invalid key types 2023-10-22 17:10:06 -04:00
replicas.c bcachefs: Convert more code to bch_err_msg() 2023-10-22 17:10:12 -04:00
replicas.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
replicas_types.h bcachefs: Fix bch2_trans_reset_updates() 2023-10-22 17:09:50 -04:00
sb-clean.c bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
sb-clean.h bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
sb-members.c bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
sb-members.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
seqmutex.h bcachefs: seqmutex; fix a lockdep splat 2023-10-22 17:10:04 -04:00
siphash.c bcachefs: Assorted checkpatch fixes 2023-10-22 17:09:44 -04:00
siphash.h
six.c bcachefs: six locks: Guard against wakee exiting in __six_lock_wakeup() 2023-10-22 17:10:10 -04:00
six.h six locks: Split out seq, use atomic_t instead of atomic64_t 2023-10-22 17:10:02 -04:00
snapshot.c bcachefs: Fix a handful of spelling mistakes in various messages 2023-10-22 17:10:13 -04:00
snapshot.h bcachefs: bch2_propagate_key_to_snapshot_leaves() 2023-10-22 17:10:11 -04:00
str_hash.h bcachefs: Convert -ENOENT to private error codes 2023-10-22 17:10:03 -04:00
subvolume.c bcachefs: Fix -Wincompatible-function-pointer-types-strict from key_invalid callbacks 2023-10-22 17:10:13 -04:00
subvolume.h bcachefs: Fix -Wincompatible-function-pointer-types-strict from key_invalid callbacks 2023-10-22 17:10:13 -04:00
subvolume_types.h bcachefs: is_ancestor bitmap 2023-10-22 17:10:07 -04:00
super-io.c bcachefs: Fix a handful of spelling mistakes in various messages 2023-10-22 17:10:13 -04:00
super-io.h bcachefs: sb-clean.c 2023-10-22 17:10:10 -04:00
super.c bcachefs: BTREE_ID_logged_ops 2023-10-22 17:10:12 -04:00
super.h bcachefs: sb-members.c 2023-10-22 17:10:10 -04:00
super_types.h bcachefs: Fix bch_sb_handle type 2023-10-22 17:10:12 -04:00
sysfs.c bcachefs: Improve bch2_moving_ctxt_to_text() 2023-10-22 17:10:11 -04:00
sysfs.h bcachefs: Add persistent counters 2023-10-22 17:09:32 -04:00
tests.c bcachefs: __bch2_btree_insert() -> bch2_btree_insert_trans() 2023-10-22 17:10:12 -04:00
tests.h
trace.c bcachefs: Improve trans_restart_split_race tracepoint 2023-10-22 17:09:58 -04:00
trace.h bcachefs: trace_read_nopromote() 2023-10-22 17:10:12 -04:00
two_state_shared_lock.c bcachefs: Inline bch2_two_state_(trylock|unlock) 2023-10-22 17:09:51 -04:00
two_state_shared_lock.h bcachefs: Inline bch2_two_state_(trylock|unlock) 2023-10-22 17:09:51 -04:00
util.c bcachefs: stack_trace_save_tsk() depends on CONFIG_STACKTRACE 2023-10-22 17:10:11 -04:00
util.h bcachefs: Split out snapshot.c 2023-10-22 17:10:11 -04:00
varint.c bcachefs: Fix assorted checkpatch nits 2023-10-22 17:10:10 -04:00
varint.h
vstructs.h bcachefs: Array bounds fixes 2023-10-22 17:10:12 -04:00
xattr.c bcachefs: bch2_acl_to_text() 2023-10-22 17:10:12 -04:00
xattr.h bcachefs: bch2_xattr_set() now updates ctime 2023-10-22 17:10:06 -04:00