diff mbox series

[02/26] btrfs: send: make fs_path_len() inline and constify its argument

Message ID 8f82f33481d50f8381a6c29ae0966982d3a7bc1d.1739965104.git.fdmanana@suse.com (mailing list archive)
State New
Headers show
Series btrfs: avoid repeated path computations and allocations for send | expand

Commit Message

Filipe Manana Feb. 19, 2025, 11:43 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

The helper function fs_path_len() is trivial and doesn't need to change
its path argument, so make it inline and constify the argument.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 8de561fb1390..4e998bf8d379 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -468,7 +468,7 @@  static void fs_path_free(struct fs_path *p)
 	kfree(p);
 }
 
-static int fs_path_len(struct fs_path *p)
+static inline int fs_path_len(const struct fs_path *p)
 {
 	return p->end - p->start;
 }