From 8b335baef22768deb7140e45f32f37ea51a1faf4 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 4 Nov 2018 22:09:51 -0500 Subject: bcachefs: Assorted fixes for running on very small devices It's now possible to create and use a filesystem on a 512k device with 4k buckets (though at that size we still waste almost half to internal reserves) Signed-off-by: Kent Overstreet --- fs/bcachefs/alloc_background.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/bcachefs/alloc_background.h') diff --git a/fs/bcachefs/alloc_background.h b/fs/bcachefs/alloc_background.h index 245e037fbaea..33224070e827 100644 --- a/fs/bcachefs/alloc_background.h +++ b/fs/bcachefs/alloc_background.h @@ -6,7 +6,7 @@ #include "alloc_types.h" #include "debug.h" -#define ALLOC_SCAN_BATCH(ca) ((ca)->mi.nbuckets >> 9) +#define ALLOC_SCAN_BATCH(ca) max_t(size_t, 1, (ca)->mi.nbuckets >> 9) const char *bch2_alloc_invalid(const struct bch_fs *, struct bkey_s_c); int bch2_alloc_to_text(struct bch_fs *, char *, size_t, struct bkey_s_c); -- cgit v1.2.3