]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: inline bch2_ob_ptr()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 4 May 2025 20:24:43 +0000 (16:24 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:14:46 +0000 (20:14 -0400)
This was an oversight, we want bch2_alloc_sectors_append_ptrs_inlined()
fully inlined.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_foreground.h

index 2d7f32f9499e7721eceaca694b374ad918a3a8a3..b50846da7ae40988e5f29e5ab10fc27d627d6b44 100644 (file)
@@ -1388,20 +1388,6 @@ err:
        return ret;
 }
 
-struct bch_extent_ptr bch2_ob_ptr(struct bch_fs *c, struct open_bucket *ob)
-{
-       struct bch_dev *ca = ob_dev(c, ob);
-
-       return (struct bch_extent_ptr) {
-               .type   = 1 << BCH_EXTENT_ENTRY_ptr,
-               .gen    = ob->gen,
-               .dev    = ob->dev,
-               .offset = bucket_to_sector(ca, ob->bucket) +
-                       ca->mi.bucket_size -
-                       ob->sectors_free,
-       };
-}
-
 void bch2_alloc_sectors_append_ptrs(struct bch_fs *c, struct write_point *wp,
                                    struct bkey_i *k, unsigned sectors,
                                    bool cached)
index 192203410d4ec3ae7936479a25ec628164e6ca77..2e01c7b61ed1109e64653c6aa6c93f2e44508b4d 100644 (file)
@@ -3,6 +3,7 @@
 #define _BCACHEFS_ALLOC_FOREGROUND_H
 
 #include "bcachefs.h"
+#include "buckets.h"
 #include "alloc_types.h"
 #include "extents.h"
 #include "io_write_types.h"
@@ -233,7 +234,19 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *,
                                   struct closure *,
                                   struct write_point **);
 
-struct bch_extent_ptr bch2_ob_ptr(struct bch_fs *, struct open_bucket *);
+static inline struct bch_extent_ptr bch2_ob_ptr(struct bch_fs *c, struct open_bucket *ob)
+{
+       struct bch_dev *ca = ob_dev(c, ob);
+
+       return (struct bch_extent_ptr) {
+               .type   = 1 << BCH_EXTENT_ENTRY_ptr,
+               .gen    = ob->gen,
+               .dev    = ob->dev,
+               .offset = bucket_to_sector(ca, ob->bucket) +
+                       ca->mi.bucket_size -
+                       ob->sectors_free,
+       };
+}
 
 /*
  * Append pointers to the space we just allocated to @k, and mark @sectors space