Centralize the pattern
if (fsp->base_fsp != NULL) {
fsp = fsp->base_fsp;
}
with a descriptive name.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(backported from commit
ac58b0b942cd73210100ee346816a0cf23900716)
[slow@samba.org: only backport the function, skip all updated callers]
{
return (fsp->base_fsp != NULL);
}
+
+struct files_struct *metadata_fsp(struct files_struct *fsp)
+{
+ if (fsp_is_alternate_stream(fsp)) {
+ return fsp->base_fsp;
+ }
+ return fsp;
+}
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);
+struct files_struct *metadata_fsp(struct files_struct *fsp);
NTSTATUS create_internal_fsp(connection_struct *conn,
const struct smb_filename *smb_fname,