1

bcachefs: Fix a few warnings on 32 bit

These showed up when building for mips.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-04-09 20:29:26 -04:00 committed by Kent Overstreet
parent aae29082c6
commit 502f973dba
5 changed files with 7 additions and 8 deletions

View File

@ -851,10 +851,9 @@ struct bch_dirent {
#define DT_SUBVOL 16
#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) - \
offsetof(struct bch_dirent, d_name))
offsetof(struct bch_dirent, d_name)))
/* Xattrs */

View File

@ -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)
{
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_dirty:\t%zu\n", atomic_long_read(&c->nr_dirty));
pr_buf(out, "nr_keys:\t%lu\n", atomic_long_read(&c->nr_keys));
pr_buf(out, "nr_dirty:\t%lu\n", atomic_long_read(&c->nr_dirty));
}
void bch2_btree_key_cache_exit(void)

View File

@ -108,7 +108,7 @@ int bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
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);
return -EINVAL;
}

View File

@ -987,7 +987,7 @@ static void bch2_journal_read_device(struct closure *cl)
for (i = 0; i < r->nr_ptrs; i++) {
if (r->ptrs[i].dev == ca->dev_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);
ja->sectors_free = min(ja->sectors_free,

View File

@ -198,7 +198,7 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id,
if (keys->nr == keys->size) {
struct journal_keys new_keys = {
.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,
};