]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Introduce fsp_is_alternate_stream()
authorVolker Lendecke <vl@samba.org>
Fri, 11 Feb 2022 08:37:35 +0000 (09:37 +0100)
committerJule Anger <janger@samba.org>
Tue, 6 Sep 2022 06:32:13 +0000 (06:32 +0000)
To me this is more descriptive than "fsp->base_fsp != NULL". If this
turns out to be a performance problem, I would go and make this a
static inline in smbd/proto.h.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(backported from commit 21b380ca133417df096e2b262a5da41faff186ea)
[slow@samba.org: only backport the function, skip all changed callers]

source3/smbd/files.c
source3/smbd/proto.h

index 3f90c2e247ed16fb1ebaf2f08945099c881cf8ae..2930ceb18f6e76903c08d9725ee1445aacd016cf 100644 (file)
@@ -1487,3 +1487,8 @@ void fsp_set_base_fsp(struct files_struct *fsp, struct files_struct *base_fsp)
                fsp->base_fsp->stream_fsp = fsp;
        }
 }
+
+bool fsp_is_alternate_stream(const struct files_struct *fsp)
+{
+       return (fsp->base_fsp != NULL);
+}
index d937d3d9615affc168eaf9199325febae7dea955..9539a3c2d4cd5dadcf8c748d5ddcb37edc38b2f7 100644 (file)
@@ -438,6 +438,7 @@ NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
                           const struct smb_filename *smb_fname_in);
 size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen);
 void fsp_set_base_fsp(struct files_struct *fsp, struct files_struct *base_fsp);
+bool fsp_is_alternate_stream(const struct files_struct *fsp);
 
 NTSTATUS create_internal_fsp(connection_struct *conn,
                             const struct smb_filename *smb_fname,