summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-05 06:09:51 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:11 +0300
commit8b335baef22768deb7140e45f32f37ea51a1faf4 (patch)
tree47e503994a655cbef184189b655c1d77576e5478 /fs/bcachefs/alloc_background.h
parentb092dadd55fb242a480f81c421303a9e53302156 (diff)
downloadlinux-8b335baef22768deb7140e45f32f37ea51a1faf4.tar.xz
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.h')
-rw-r--r--fs/bcachefs/alloc_background.h2
1 files changed, 1 insertions, 1 deletions
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);