bcachefs: Add a comment for should_drop_open_bucket()
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 12 Aug 2023 20:46:54 +0000 (16:46 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:10 +0000 (17:10 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_foreground.c

index 089185a661ee2a18869172ba51a764bc9437bea8..e02749ddc362ce106d99e5aa3466ea4c2e407d65 100644 (file)
@@ -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)
 {