From f38d7f20a865b1ff5f7b039dd284d91b2ba7ec26 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Mon, 20 Oct 2008 17:43:45 -0700 Subject: s3: Add SMB_VFS_CREATE_FILE to the vfs layer Modify all callers of create_file to go through SMB_VFS_CREATE_FILE --- source3/include/vfs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/include/vfs.h') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 4cedb4a9c6..03b4b8e706 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -110,6 +110,7 @@ open handle. JRA. */ /* Changed to version 24 - make security descriptor const in fset_nt_acl. JRA. */ /* Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t. */ +/* Leave at 25 - not yet released. Add create_file call. -- tprouty. */ #define SMB_VFS_INTERFACE_VERSION 25 @@ -134,6 +135,8 @@ struct connection_struct; struct files_struct; struct security_descriptor; struct vfs_statvfs_struct; +struct smb_request; +struct ea_list; /* Available VFS operations. These values must be in sync with vfs_ops struct @@ -170,6 +173,7 @@ typedef enum _vfs_op_type { /* File operations */ SMB_VFS_OP_OPEN, + SMB_VFS_OP_CREATE_FILE, SMB_VFS_OP_CLOSE, SMB_VFS_OP_READ, SMB_VFS_OP_PREAD, @@ -305,6 +309,22 @@ struct vfs_ops { /* File operations */ int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode); + NTSTATUS (*create_file)(struct vfs_handle_struct *handle, + struct smb_request *req, + uint16_t root_dir_fid, + const char *fname, + uint32_t access_mask, + uint32_t share_access, + uint32_t create_disposition, + uint32_t create_options, + uint32_t file_attributes, + uint32_t oplock_request, + uint64_t allocation_size, + struct security_descriptor *sd, + struct ea_list *ea_list, + files_struct **result, + int *pinfo, + SMB_STRUCT_STAT *psbuf); int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); @@ -452,6 +472,7 @@ struct vfs_ops { /* File operations */ struct vfs_handle_struct *open; + struct vfs_handle_struct *create_file; struct vfs_handle_struct *close_hnd; struct vfs_handle_struct *vfs_read; struct vfs_handle_struct *pread; -- cgit From f995a7af2a06ccff29f23f1b099e0a84bc948f6e Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Wed, 19 Nov 2008 17:55:28 -0800 Subject: s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILE Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly. --- source3/include/vfs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/vfs.h') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 03b4b8e706..5f6851a7bc 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -313,6 +313,7 @@ struct vfs_ops { struct smb_request *req, uint16_t root_dir_fid, const char *fname, + bool is_dos_path, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, -- cgit From 58440122853b65048793efd90ee45916e25c08c1 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Mon, 1 Dec 2008 12:47:31 -0800 Subject: s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argument This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request. --- source3/include/vfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/vfs.h') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 5f6851a7bc..383cd327ae 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -313,7 +313,7 @@ struct vfs_ops { struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, -- cgit From 21b9dec990b08a104600bf8e408e64e805a02835 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 10 Dec 2008 03:17:19 +0100 Subject: Pass the get_real_filename operation through the VFS This is done to help file systems that can tell us about the real upper/lower case combination given a case-insensitive file name. The sample I will soon push is the gpfs module (recent gpfs has a get_real_filename function), others might have a similar function to help alleviate the 1million files in a single directory problem. Jeremy, please comment! Thanks, Volker --- source3/include/vfs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/include/vfs.h') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 383cd327ae..d02d14b854 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -210,6 +210,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, SMB_VFS_OP_STREAMINFO, + SMB_VFS_OP_GET_REAL_FILENAME, /* NT ACL operations. */ @@ -375,6 +376,12 @@ struct vfs_ops { unsigned int *num_streams, struct stream_struct **streams); + int (*get_real_filename)(struct vfs_handle_struct *handle, + const char *path, + const char *name, + TALLOC_CTX *mem_ctx, + char **found_name); + /* NT ACL operations. */ NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle, @@ -510,6 +517,7 @@ struct vfs_ops { struct vfs_handle_struct *chflags; struct vfs_handle_struct *file_id_create; struct vfs_handle_struct *streaminfo; + struct vfs_handle_struct *get_real_filename; /* NT ACL operations. */ -- cgit