summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-05 05:55:35 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:11 +0300
commitb092dadd55fb242a480f81c421303a9e53302156 (patch)
tree8cef50ce499ac371476302a29d1976056efe560e /fs/bcachefs/alloc_foreground.h
parent72644db153e6d3fc146d2c805dcba5b5d676cd99 (diff)
downloadlinux-b092dadd55fb242a480f81c421303a9e53302156.tar.xz
bcachefs: Scale down number of writepoints when low on space
this means we don't have to reserve space for them when calculating filesystem capacity Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.h')
-rw-r--r--fs/bcachefs/alloc_foreground.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/bcachefs/alloc_foreground.h b/fs/bcachefs/alloc_foreground.h
index 636fe686dc48..6672101cbe26 100644
--- a/fs/bcachefs/alloc_foreground.h
+++ b/fs/bcachefs/alloc_foreground.h
@@ -91,15 +91,6 @@ void bch2_alloc_sectors_done(struct bch_fs *, struct write_point *);
void bch2_writepoint_stop(struct bch_fs *, struct bch_dev *,
struct write_point *);
-static inline struct hlist_head *writepoint_hash(struct bch_fs *c,
- unsigned long write_point)
-{
- unsigned hash =
- hash_long(write_point, ilog2(ARRAY_SIZE(c->write_points_hash)));
-
- return &c->write_points_hash[hash];
-}
-
static inline struct write_point_specifier writepoint_hashed(unsigned long v)
{
return (struct write_point_specifier) { .v = v | 1 };
@@ -117,4 +108,6 @@ static inline void writepoint_init(struct write_point *wp,
wp->type = type;
}
+void bch2_fs_allocator_foreground_init(struct bch_fs *);
+
#endif /* _BCACHEFS_ALLOC_FOREGROUND_H */