diff options
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index d0a288dddb45..78b4c93a7170 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -657,7 +657,7 @@ static int bch2_mark_alloc(struct bch_fs *c, struct bkey_s_c k, g = __bucket(ca, k.k->p.offset, gc); u = bch2_alloc_unpack(k); - old = bucket_data_cmpxchg(c, ca, fs_usage, g, m, ({ + old = bucket_cmpxchg(g, m, ({ m.gen = u.gen; m.data_type = u.data_type; m.dirty_sectors = u.dirty_sectors; @@ -669,6 +669,9 @@ static int bch2_mark_alloc(struct bch_fs *c, struct bkey_s_c k, } })); + if (!(flags & BCH_BUCKET_MARK_ALLOC_READ)) + bch2_dev_usage_update(c, ca, fs_usage, old, m, gc); + g->io_time[READ] = u.read_time; g->io_time[WRITE] = u.write_time; g->oldest_gen = u.oldest_gen; |