/* Version 40 - Add SMB_VFS_GET_DOS_ATTRIBUTES_SEND/RECV */
/* Bump to version 41, Samba 4.11 will ship with that */
/* Version 41 - Remove SMB_VFS_BRL_CANCEL_WINDOWS */
-
-#define SMB_VFS_INTERFACE_VERSION 41
+/* Version 41 - Remove unused st_ex_mask from struct stat_ex */
+/* Version 41 - convert struct stat_ex.st_ex_calculated_birthtime to flags */
+/* Version 41 - add st_ex_itime to struct stat_ex */
+/* Version 41 - add st_ex_file_id to struct stat_ex */
+/* Version 41 - add SMB_VFS_FS_FILE_ID */
+/* Version 41 - Remove "blocking_lock" parameter from
+ SMB_VFS_BRL_LOCK_WINDOWS */
+/* Version 41 - Remove "msg_ctx" parameter from SMB_VFS_BRL_UNLOCK_WINDOWS */
+/* Bump to version 42, Samba 4.12 will ship with that */
+/* Version 42 - Remove share_access member from struct files_struct */
+/* Version 42 - Make "lease" a const* in create_file_fn */
+/* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */
+
+#define SMB_VFS_INTERFACE_VERSION 42
/*
All intercepted VFS operations must be declared as static functions inside module source
struct write_cache *wcp;
struct timeval open_time;
uint32_t access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */
- uint32_t share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
-
bool kernel_share_modes_taken;
bool update_write_time_triggered;
struct files_struct *base_fsp; /* placeholder for delete on close */
+ /*
+ * Cache of share_mode_data->flags
+ */
+ int share_mode_flags_seqnum;
+ uint8_t share_mode_flags;
+
/*
* Read-only cached brlock record, thrown away when the
* brlock.tdb seqnum changes. This avoids fetching data from
enum timestamp_set_resolution ts_res;
char *connectpath;
char *origpath;
- struct smb_filename *cwd_fname; /* Working directory. */
+ struct files_struct *cwd_fsp; /* Working directory. */
bool tcon_done;
struct vfs_handle_struct *vfs_handles; /* for the new plugins */
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- struct smb2_lease *lease,
+ const struct smb2_lease *lease,
uint64_t allocation_size,
uint32_t private_flags,
struct security_descriptor *sd,
off_t (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, int whence);
ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, off_t offset, size_t count);
ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t count);
- int (*rename_fn)(struct vfs_handle_struct *handle,
+ int (*renameat_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *srcdir_fsp,
const struct smb_filename *smb_fname_src,
+ struct files_struct *dstdir_fsp,
const struct smb_filename *smb_fname_dst);
struct tevent_req *(*fsync_send_fn)(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
unsigned int flags);
struct file_id (*file_id_create_fn)(struct vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
+ uint64_t (*fs_file_id_fn)(struct vfs_handle_struct *handle,
+ const SMB_STRUCT_STAT *sbuf);
struct tevent_req *(*offload_read_send_fn)(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct vfs_handle_struct *handle,
NTSTATUS (*brl_lock_windows_fn)(struct vfs_handle_struct *handle,
struct byte_range_lock *br_lck,
- struct lock_struct *plock,
- bool blocking_lock);
+ struct lock_struct *plock);
bool (*brl_unlock_windows_fn)(struct vfs_handle_struct *handle,
- struct messaging_context *msg_ctx,
struct byte_range_lock *br_lck,
const struct lock_struct *plock);
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- struct smb2_lease *lease,
+ const struct smb2_lease *lease,
uint64_t allocation_size,
uint32_t private_flags,
struct security_descriptor *sd,
ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd,
files_struct *tofsp, off_t offset,
size_t count);
-int smb_vfs_call_rename(struct vfs_handle_struct *handle,
+int smb_vfs_call_renameat(struct vfs_handle_struct *handle,
+ struct files_struct *srcfsp,
const struct smb_filename *smb_fname_src,
+ struct files_struct *dstfsp,
const struct smb_filename *smb_fname_dst);
struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle,
unsigned int flags);
struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
+uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle,
+ const SMB_STRUCT_STAT *sbuf);
NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const struct smb_filename *smb_fname,
const struct smb_filename *smb_fname);
NTSTATUS smb_vfs_call_brl_lock_windows(struct vfs_handle_struct *handle,
struct byte_range_lock *br_lck,
- struct lock_struct *plock,
- bool blocking_lock);
+ struct lock_struct *plock);
bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
- struct messaging_context *msg_ctx,
struct byte_range_lock *br_lck,
const struct lock_struct *plock);
bool smb_vfs_call_strict_lock_check(struct vfs_handle_struct *handle,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- struct smb2_lease *lease,
+ const struct smb2_lease *lease,
uint64_t allocation_size,
uint32_t private_flags,
struct security_descriptor *sd,
off_t offset, size_t n);
ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
files_struct *tofsp, off_t offset, size_t n);
-int vfs_not_implemented_rename(vfs_handle_struct *handle,
+int vfs_not_implemented_renameat(vfs_handle_struct *handle,
+ files_struct *srcfsp,
const struct smb_filename *smb_fname_src,
+ files_struct *dstfsp,
const struct smb_filename *smb_fname_dst);
struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
uint flags);
struct file_id vfs_not_implemented_file_id_create(vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
+uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct *handle,
+ const SMB_STRUCT_STAT *sbuf);
struct tevent_req *vfs_not_implemented_offload_read_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
const struct smb_filename *smb_fname);
NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
struct byte_range_lock *br_lck,
- struct lock_struct *plock,
- bool blocking_lock);
+ struct lock_struct *plock);
bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
- struct messaging_context *msg_ctx,
struct byte_range_lock *br_lck,
const struct lock_struct *plock);
bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct *handle,