bcachefs: Fix compiler warnings
authorBrett Holman <bholman.devel@gmail.com>
Sun, 17 Oct 2021 01:13:53 +0000 (19:13 -0600)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:14 +0000 (17:09 -0400)
Type size_t is architecture-specific. Fix warnings for some non-amd64
arches.

Signed-off-by: Brett Holman <bholman.devel@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_reclaim.c
fs/bcachefs/subvolume.h

index 54d8e2f32a37ea8eab2586516cef28230cdad065..0bc4681ccc24a31377457f5b79b4549eb256be58 100644 (file)
@@ -653,7 +653,7 @@ static int __bch2_journal_reclaim(struct journal *j, bool direct)
                                atomic_long_read(&c->btree_key_cache.nr_dirty),
                                atomic_long_read(&c->btree_key_cache.nr_keys));
 
-               min_key_cache = min(bch2_nr_btree_keys_need_flush(c), 128UL);
+               min_key_cache = min(bch2_nr_btree_keys_need_flush(c), (size_t) 128);
 
                nr_flushed = journal_flush_pins(j, seq_to_flush,
                                                min_nr, min_key_cache);
index ed02b982ff96f6f0eec46ff217e5ef1f3bbc369e..f98c8c0dbea20d952b17ed51a9c86a810ce6a42c 100644 (file)
@@ -75,7 +75,7 @@ static inline void snapshots_seen_init(struct snapshots_seen *s)
 static inline int snapshots_seen_add(struct bch_fs *c, struct snapshots_seen *s, u32 id)
 {
        if (s->nr == s->size) {
-               size_t new_size = max(s->size, 128UL) * 2;
+               size_t new_size = max(s->size, (size_t) 128) * 2;
                u32 *d = krealloc(s->d, new_size * sizeof(s->d[0]), GFP_KERNEL);
 
                if (!d) {