summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-07-12 01:52:14 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:43 +0300
commit8f3b41ab4f39f87712ed57e0443642d7bcabd1ff (patch)
treec41656a9bd017e19d57bf58643cd86dc94e1300d /fs/bcachefs/alloc_foreground.h
parent63b214e75b1c941d3fc81da5b7fc4aa997e40873 (diff)
downloadlinux-8f3b41ab4f39f87712ed57e0443642d7bcabd1ff.tar.xz
bcachefs: Don't restrict copygc writes to the same device
This no longer makes any sense, since copygc is now one thread per filesystem, not per device, with a single write point. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.h')
-rw-r--r--fs/bcachefs/alloc_foreground.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/bcachefs/alloc_foreground.h b/fs/bcachefs/alloc_foreground.h
index 17a6869bb8cd..e8357ec0b333 100644
--- a/fs/bcachefs/alloc_foreground.h
+++ b/fs/bcachefs/alloc_foreground.h
@@ -12,6 +12,13 @@ struct bch_dev;
struct bch_fs;
struct bch_devs_List;
+enum bucket_alloc_ret {
+ ALLOC_SUCCESS,
+ OPEN_BUCKETS_EMPTY,
+ FREELIST_EMPTY, /* Allocator thread not keeping up */
+ INSUFFICIENT_DEVICES,
+};
+
struct dev_alloc_list {
unsigned nr;
u8 devs[BCH_SB_MEMBERS_MAX];
@@ -92,10 +99,11 @@ static inline void bch2_open_bucket_get(struct bch_fs *c,
}
}
-int bch2_bucket_alloc_set(struct bch_fs *, struct open_buckets *,
- struct dev_stripe_state *, struct bch_devs_mask *,
- unsigned, unsigned *, bool *, enum alloc_reserve,
- unsigned, struct closure *);
+enum bucket_alloc_ret
+bch2_bucket_alloc_set(struct bch_fs *, struct open_buckets *,
+ struct dev_stripe_state *, struct bch_devs_mask *,
+ unsigned, unsigned *, bool *, enum alloc_reserve,
+ unsigned, struct closure *);
struct write_point *bch2_alloc_sectors_start(struct bch_fs *,
unsigned, unsigned,