Commit 502f973d authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a few warnings on 32 bit

These showed up when building for mips.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent aae29082
...@@ -851,10 +851,9 @@ struct bch_dirent { ...@@ -851,10 +851,9 @@ struct bch_dirent {
#define DT_SUBVOL 16 #define DT_SUBVOL 16
#define BCH_DT_MAX 17 #define BCH_DT_MAX 17
#define BCH_NAME_MAX (U8_MAX * sizeof(u64) - \ #define BCH_NAME_MAX ((unsigned) (U8_MAX * sizeof(u64) - \
sizeof(struct bkey) - \ sizeof(struct bkey) - \
offsetof(struct bch_dirent, d_name)) offsetof(struct bch_dirent, d_name)))
/* Xattrs */ /* Xattrs */
......
...@@ -742,8 +742,8 @@ int bch2_fs_btree_key_cache_init(struct btree_key_cache *bc) ...@@ -742,8 +742,8 @@ int bch2_fs_btree_key_cache_init(struct btree_key_cache *bc)
void bch2_btree_key_cache_to_text(struct printbuf *out, struct btree_key_cache *c) void bch2_btree_key_cache_to_text(struct printbuf *out, struct btree_key_cache *c)
{ {
pr_buf(out, "nr_freed:\t%zu\n", c->nr_freed); pr_buf(out, "nr_freed:\t%zu\n", c->nr_freed);
pr_buf(out, "nr_keys:\t%zu\n", atomic_long_read(&c->nr_keys)); pr_buf(out, "nr_keys:\t%lu\n", atomic_long_read(&c->nr_keys));
pr_buf(out, "nr_dirty:\t%zu\n", atomic_long_read(&c->nr_dirty)); pr_buf(out, "nr_dirty:\t%lu\n", atomic_long_read(&c->nr_dirty));
} }
void bch2_btree_key_cache_exit(void) void bch2_btree_key_cache_exit(void)
......
...@@ -108,7 +108,7 @@ int bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k, ...@@ -108,7 +108,7 @@ int bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k,
} }
if (len > BCH_NAME_MAX) { if (len > BCH_NAME_MAX) {
pr_buf(err, "dirent name too big (%u > %lu)", pr_buf(err, "dirent name too big (%u > %u)",
len, BCH_NAME_MAX); len, BCH_NAME_MAX);
return -EINVAL; return -EINVAL;
} }
......
...@@ -987,7 +987,7 @@ static void bch2_journal_read_device(struct closure *cl) ...@@ -987,7 +987,7 @@ static void bch2_journal_read_device(struct closure *cl)
for (i = 0; i < r->nr_ptrs; i++) { for (i = 0; i < r->nr_ptrs; i++) {
if (r->ptrs[i].dev == ca->dev_idx && if (r->ptrs[i].dev == ca->dev_idx &&
sector_to_bucket(ca, r->ptrs[i].sector) == ja->buckets[ja->cur_idx]) { sector_to_bucket(ca, r->ptrs[i].sector) == ja->buckets[ja->cur_idx]) {
unsigned wrote = (r->ptrs[i].sector % ca->mi.bucket_size) + unsigned wrote = bucket_remainder(ca, r->ptrs[i].sector) +
vstruct_sectors(&r->j, c->block_bits); vstruct_sectors(&r->j, c->block_bits);
ja->sectors_free = min(ja->sectors_free, ja->sectors_free = min(ja->sectors_free,
......
...@@ -198,7 +198,7 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id, ...@@ -198,7 +198,7 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id,
if (keys->nr == keys->size) { if (keys->nr == keys->size) {
struct journal_keys new_keys = { struct journal_keys new_keys = {
.nr = keys->nr, .nr = keys->nr,
.size = max(keys->size, 8UL) * 2, .size = max_t(size_t, keys->size, 8) * 2,
.journal_seq_base = keys->journal_seq_base, .journal_seq_base = keys->journal_seq_base,
}; };
......
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