diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-13 19:31:45 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-15 16:27:19 -0400 |
commit | 05408b6f8fea54bf53e68a4ef24291214970f6d0 (patch) | |
tree | 2725db5979ad1f63314967741305ab0301c1f6d3 /libbcachefs/io.c | |
parent | c32bba1325cebd27e4dd3697a4b41ff0df59614f (diff) |
Update bcachefs sources to 4837f82ee1 bcachefs: Use cached iterators for alloc btree
Diffstat (limited to 'libbcachefs/io.c')
-rw-r--r-- | libbcachefs/io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libbcachefs/io.c b/libbcachefs/io.c index 4f39132d..c309080c 100644 --- a/libbcachefs/io.c +++ b/libbcachefs/io.c @@ -500,6 +500,9 @@ static void bch2_write_done(struct closure *cl) bch2_time_stats_update(&c->times[BCH_TIME_data_write], op->start_time); + if (!(op->flags & BCH_WRITE_FROM_INTERNAL)) + up(&c->io_in_flight); + if (op->end_io) { EBUG_ON(cl->parent); closure_debug_destroy(cl); @@ -1258,6 +1261,12 @@ void bch2_write(struct closure *cl) goto err; } + /* + * Can't ratelimit copygc - we'd deadlock: + */ + if (!(op->flags & BCH_WRITE_FROM_INTERNAL)) + down(&c->io_in_flight); + bch2_increment_clock(c, bio_sectors(bio), WRITE); data_len = min_t(u64, bio->bi_iter.bi_size, |