diff mbox series

btrfs: make btrfs_bin_search a macro

Message ID 520705d35cbfb6c21d1e89481f8a4d0343daa138.1676986303.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs: make btrfs_bin_search a macro | expand

Commit Message

Anand Jain Feb. 21, 2023, 2:59 p.m. UTC
btrfs_bin_search() is an inline function that wraps
btrfs_generic_bin_search() and sets the second argument to 0.

The inline compiler directive is not always guaranteed to work,
unless the __always_inline directive is used.

Further, this function is small and can be a #define macro as well.
Make btrfs_bin_search() a macro.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/ctree.h | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 97897107fab5..e86bb94558bc 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -515,15 +515,9 @@  int btrfs_generic_bin_search(struct extent_buffer *eb, int first_slot,
  * Simple binary search on an extent buffer. Works for both leaves and nodes, and
  * always searches over the whole range of keys (slot 0 to slot 'nritems - 1').
  */
-static inline int btrfs_bin_search(struct extent_buffer *eb,
-				   const struct btrfs_key *key,
-				   int *slot)
-{
-	return btrfs_generic_bin_search(eb, 0, key, slot);
-}
+#define btrfs_bin_search(eb, key, slot) \
+		btrfs_generic_bin_search(eb, 0, key, slot);
 
-int btrfs_bin_search(struct extent_buffer *eb, const struct btrfs_key *key,
-		     int *slot);
 int __pure btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
 int btrfs_previous_item(struct btrfs_root *root,
 			struct btrfs_path *path, u64 min_objectid,