summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-13 20:01:42 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:46 -0400
commitb2d1d56b1d34bcfb6da77eb74a2fbcdea92514f9 (patch)
tree01c678f5b0e103d80567273497fd3429ae265dbb /fs/bcachefs/buckets.h
parenta7ecd30c8300624448c4e66cd7a7e7209b96ea61 (diff)
bcachefs: Fixes for building in userspace
- Marking a non-static function as inline doesn't actually work and is now causing problems - drop that - Introduce BCACHEFS_LOG_PREFIX for when we want to prefix log messages with bcachefs (filesystem name) - Userspace doesn't have real percpu variables (maybe we can get this fixed someday), put an #ifdef around bch2_disk_reservation_add() fastpath Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
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