]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: add dirfsp to struct files_struct
authorRalph Boehme <slow@samba.org>
Fri, 15 May 2020 14:18:13 +0000 (16:18 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 21 May 2020 05:23:30 +0000 (05:23 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/vfs.h

index 4780d87c3c2226b1d8b4db228e8e460fedc49edc..caec8e8088e3616b9139792ff38589a70cb210d7 100644 (file)
  *              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. */