From: Ralph Boehme Date: Fri, 15 May 2020 14:18:13 +0000 (+0200) Subject: vfs: add dirfsp to struct files_struct X-Git-Tag: ldb-2.2.0~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=373d02da7560ef6bbe54c9ed4eedcefbf34f3963;p=thirdparty%2Fsamba.git vfs: add dirfsp to struct files_struct As fsp->fsp_name will be a AT-name in the future, we need something to retrieve the full path for an fsp from for stuff like fsp_str_dbg(). As there are functions like vfs_stat_fsp() that have internal fallbacks to path-based VFS functions if fsp->fh->fh == -1, having the original dirfsp as part of the fsp helps in converting the internal VFS functions to AT versions. In the future when all such internal fallbacks are eliminated we can remove fsp->dirfsp to avoid the additional fd per fsp and use a fsp->path or similar. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 4780d87c3c2..caec8e8088e 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -320,6 +320,7 @@ * to struct smb_filename * Version 43 - Move SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT(). * Version 43 - Remove root_dir_fid from SMB_VFS_CREATE_FILE(). + * Version 43 - Add dirfsp to struct files_struct */ #define SMB_VFS_INTERFACE_VERSION 43 @@ -377,6 +378,7 @@ typedef struct files_struct { struct smbXsrv_open *op; struct connection_struct *conn; struct fd_handle *fh; + struct files_struct *dirfsp; unsigned int num_smb_operations; struct file_id file_id; uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */