diff options
author | Anoop C S <anoopcs@redhat.com> | 2019-09-27 11:19:37 +0530 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-10-08 08:38:32 +0000 |
commit | 5084a69de14f24e9d804998580eefcba773fdd5a (patch) | |
tree | b916c4c98de899dbf47e16c87c46e780ea558e5d /source3/include | |
parent | c9d302f20b066267a8fd2d7ce4dc171161c9c40c (diff) | |
download | samba-5084a69de14f24e9d804998580eefcba773fdd5a.tar.gz |
s3: VFS: Add SMB_VFS_FCNTL
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/include/smbprofile.h | 1 | ||||
-rw-r--r-- | source3/include/vfs.h | 7 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 |
4 files changed, 14 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 91a7c00fef2..c98f7cfa351 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -219,6 +219,7 @@ ssize_t sys_send(int s, const void *msg, size_t len, int flags); ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); int sys_fcntl_ptr(int fd, int cmd, void *arg); int sys_fcntl_long(int fd, int cmd, long arg); +int sys_fcntl_int(int fd, int cmd, int arg); void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts); void update_stat_ex_itime(struct stat_ex *dst, struct timespec itime); void update_stat_ex_create_time(struct stat_ex *dst, struct timespec create_time); diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index cc54dea2710..ea2a29a0758 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -80,6 +80,7 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_fallocate) \ SMBPROFILE_STATS_BASIC(syscall_fcntl_lock) \ SMBPROFILE_STATS_BASIC(syscall_kernel_flock) \ + SMBPROFILE_STATS_BASIC(syscall_fcntl) \ SMBPROFILE_STATS_BASIC(syscall_linux_setlease) \ SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \ SMBPROFILE_STATS_BASIC(syscall_readlinkat) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 6ba653f56c7..326687f5ee1 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -282,6 +282,7 @@ /* Version 42 - Move change_to_user_by_fsp() -> change_to_user_and_service_by_fsp() */ /* Version 42 - Move [un]become_user*() -> [un]become_user_without_service*() */ /* Version 42 - Move SMB_VFS_UNLINK -> SMB_VFS_UNLINKAT. */ +/* Version 42 - Add SMB_VFS_FCNTL */ #define SMB_VFS_INTERFACE_VERSION 42 @@ -810,6 +811,8 @@ struct vfs_fn_pointers { bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, off_t offset, off_t count, int type); int (*kernel_flock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32_t share_mode, uint32_t access_mask); + int (*fcntl_fn)(struct vfs_handle_struct *handle, + struct files_struct *fsp, int cmd, va_list cmd_arg); int (*linux_setlease_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid); int (*symlinkat_fn)(struct vfs_handle_struct *handle, @@ -1345,6 +1348,8 @@ bool smb_vfs_call_lock(struct vfs_handle_struct *handle, int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32_t share_mode, uint32_t access_mask); +int smb_vfs_call_fcntl(struct vfs_handle_struct *handle, + struct files_struct *fsp, int cmd, ...); int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); bool smb_vfs_call_getlock(struct vfs_handle_struct *handle, @@ -1780,6 +1785,8 @@ bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int int vfs_not_implemented_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32_t share_mode, uint32_t access_mask); +int vfs_not_implemented_fcntl(struct vfs_handle_struct *handle, + struct files_struct *fsp, int cmd, va_list cmd_arg); int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 2979769e7d5..2dd59711e19 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -286,6 +286,11 @@ #define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask) \ smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode), (access_mask)) +#define SMB_VFS_FCNTL(fsp, cmd, ...) \ + smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__)) +#define SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, ...) \ + smb_vfs_call_fcntl((handle)->next, (fsp), (cmd), (__VA_ARGS__)) + #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \ smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype)) #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype) \ |