btrfs: send: implement fs_path_add_path() using fs_path_add()

The helper fs_path_add_path() is basically a copy of fs_path_add() and it
can be made a wrapper around fs_path_add(). So do that and also make it
inline and constify its second argument.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana 2025-02-05 12:23:11 +00:00 committed by David Sterba
parent c727371879
commit a3d37502e7

View File

@ -566,19 +566,9 @@ static int fs_path_add(struct fs_path *p, const char *name, int name_len)
return 0;
}
static int fs_path_add_path(struct fs_path *p, struct fs_path *p2)
static inline int fs_path_add_path(struct fs_path *p, const struct fs_path *p2)
{
int ret;
const int p2_len = fs_path_len(p2);
char *prepared;
ret = fs_path_prepare_for_add(p, p2_len, &prepared);
if (ret < 0)
goto out;
memcpy(prepared, p2->start, p2_len);
out:
return ret;
return fs_path_add(p, p2->start, fs_path_len(p2));
}
static int fs_path_add_from_extent_buffer(struct fs_path *p,