]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/buckets.h
Update bcachefs sources to 0010403265 bcachefs: Fix spurious alloc errors on forced...
[bcachefs-tools-debian] / libbcachefs / buckets.h
index 856dc5a8c8a3f19a5f197456c8b1bcf0a9a6b52a..a3873becbb70111b173b6c42e369e2bc5012027f 100644 (file)
@@ -272,11 +272,13 @@ void bch2_trans_fs_usage_apply(struct btree_trans *, struct bch_fs_usage *);
 
 /* disk reservations: */
 
+void __bch2_disk_reservation_put(struct bch_fs *, struct disk_reservation *);
+
 static inline void bch2_disk_reservation_put(struct bch_fs *c,
                                             struct disk_reservation *res)
 {
-       this_cpu_sub(c->usage[0]->online_reserved, res->sectors);
-       res->sectors = 0;
+       if (res->sectors)
+               __bch2_disk_reservation_put(c, res);
 }
 
 #define BCH_DISK_RESERVATION_NOFAIL            (1 << 0)