summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-08-12 16:46:54 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:10 -0400
commit73ded163e5ec47d229683b32c501e548b745d032 (patch)
tree9d1664109933fc4bc37828dfecd7b5f0ada05eb8 /fs/bcachefs/alloc_foreground.c
parentc294ea50da4b1a0ee84253f46391aa87a6efe91c (diff)
downloadlinux-73ded163e5ec47d229683b32c501e548b745d032.tar.gz
linux-73ded163e5ec47d229683b32c501e548b745d032.tar.bz2
linux-73ded163e5ec47d229683b32c501e548b745d032.zip
bcachefs: Add a comment for should_drop_open_bucket()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 089185a661ee..e02749ddc362 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -989,7 +989,6 @@ retry_blocking:
cl = _cl;
goto retry_blocking;
}
-
}
return ret;
@@ -1031,6 +1030,16 @@ static int open_bucket_add_buckets(struct btree_trans *trans,
return ret < 0 ? ret : 0;
}
+/**
+ * should_drop_bucket - check if this is open_bucket should go away
+ * @ca: if set, we're killing buckets for a particular device
+ * @ec: if true, we're shutting down erasure coding and killing all ec
+ * open_buckets
+ * otherwise, return true
+ *
+ * We're killing open_buckets because we're shutting down a device, erasure
+ * coding, or the entire filesystem - check if this open_bucket matches:
+ */
static bool should_drop_bucket(struct open_bucket *ob, struct bch_fs *c,
struct bch_dev *ca, bool ec)
{