summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-05 03:11:00 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:56 -0400
commit0b943b973c67c2780cb991c3011ad3279f670fa4 (patch)
tree4241a45baceacf8a7777a473b047401c0eae7141
parent5be6a274ff7a7cd9640555db63d60127c6434e1a (diff)
downloadlwn-0b943b973c67c2780cb991c3011ad3279f670fa4.tar.gz
lwn-0b943b973c67c2780cb991c3011ad3279f670fa4.zip
bcachefs: Free move buffers as early as possible
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index a7e09772895e..393629e52d03 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -834,6 +834,10 @@ static void bch2_write_index(struct closure *cl)
struct write_point *wp = op->wp;
struct workqueue_struct *wq = index_update_wq(op);
+ if ((op->flags & BCH_WRITE_DONE) &&
+ (op->flags & BCH_WRITE_MOVE))
+ bch2_bio_free_pages_pool(op->c, &op->wbio.bio);
+
barrier();
/*