summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r--fs/bcachefs/buckets.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h
index ff61a0054eaa..0fc101b9aaf1 100644
--- a/fs/bcachefs/buckets.h
+++ b/fs/bcachefs/buckets.h
@@ -255,6 +255,7 @@ int __bch2_disk_reservation_add(struct bch_fs *,
static inline int bch2_disk_reservation_add(struct bch_fs *c, struct disk_reservation *res,
u64 sectors, int flags)
{
+#ifdef __KERNEL__
u64 old, new;
do {
@@ -268,6 +269,9 @@ static inline int bch2_disk_reservation_add(struct bch_fs *c, struct disk_reserv
this_cpu_add(*c->online_reserved, sectors);
res->sectors += sectors;
return 0;
+#else
+ return __bch2_disk_reservation_add(c, res, sectors, flags);
+#endif
}
static inline struct disk_reservation