From d1a0e9b81da07ff7566227eb8a14f88914d01c3d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Jun 2021 14:19:13 -0700 Subject: [PATCH] s3: VFS: streams_xattr: Bring streams_xattr_stat_base() inline into streams_xattr_stat(). That was its only caller. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/modules/vfs_streams_xattr.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index f16cc528a71..880f1eb5e46 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -189,27 +189,6 @@ static bool streams_xattr_recheck(struct stream_io *sio) return true; } -/** - * Helper to stat/lstat the base file of an smb_fname. - */ -static int streams_xattr_stat_base(vfs_handle_struct *handle, - struct smb_filename *smb_fname, - bool follow_links) -{ - char *tmp_stream_name; - int result; - - tmp_stream_name = smb_fname->stream_name; - smb_fname->stream_name = NULL; - if (follow_links) { - result = SMB_VFS_NEXT_STAT(handle, smb_fname); - } else { - result = SMB_VFS_NEXT_LSTAT(handle, smb_fname); - } - smb_fname->stream_name = tmp_stream_name; - return result; -} - static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) { @@ -258,6 +237,7 @@ static int streams_xattr_stat(vfs_handle_struct *handle, NTSTATUS status; int result = -1; char *xattr_name = NULL; + char *tmp_stream_name = NULL; if (!is_named_stream(smb_fname)) { return SMB_VFS_NEXT_STAT(handle, smb_fname); @@ -269,7 +249,12 @@ static int streams_xattr_stat(vfs_handle_struct *handle, * not following links here. */ /* Populate the stat struct with info from the base file. */ - if (streams_xattr_stat_base(handle, smb_fname, true) == -1) { + tmp_stream_name = smb_fname->stream_name; + smb_fname->stream_name = NULL; + result = SMB_VFS_NEXT_STAT(handle, smb_fname); + smb_fname->stream_name = tmp_stream_name; + + if (result == -1) { return -1; }