int sys_creat(const char *path, mode_t mode);
int sys_open(const char *path, int oflag, mode_t mode);
FILE *sys_fopen(const char *path, const char *type);
-void kernel_flock(int fd, uint32 share_mode);
+void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
SMB_STRUCT_DIR *sys_opendir(const char *name);
SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
struct smb_file_time *ft);
int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset);
bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
- int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode);
+ int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp,
+ uint32 share_mode, uint32_t access_mask);
int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype);
bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
struct files_struct *fsp, int op, SMB_OFF_T offset,
SMB_OFF_T count, int type);
int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, uint32 share_mode);
+ struct files_struct *fsp, uint32 share_mode,
+ uint32_t access_mask);
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,
#define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
-#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode) \
- smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode))
-#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode) \
- smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode))
+#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode, access_mask) \
+ smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode), (access_mask))
+#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_LINUX_SETLEASE(fsp, leasetype) \
smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
A flock() wrapper that will perform the kernel flock.
********************************************************************/
-void kernel_flock(int fd, uint32 share_mode)
+void kernel_flock(int fd, uint32 share_mode, uint32 access_mask)
{
#if HAVE_KERNEL_SHARE_MODES
int kernel_mode = 0;
note that GPFS supports it as well - jmcd */
if (fsp->fh->fd != -1) {
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
if(ret_flock == -1 ){
TALLOC_FREE(lck);
}
static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
- uint32 share_mode)
+ uint32 share_mode, uint32 access_mask)
{
START_PROFILE(syscall_kernel_flock);
- kernel_flock(fsp->fh->fd, share_mode);
+ kernel_flock(fsp->fh->fd, share_mode, access_mask);
END_PROFILE(syscall_kernel_flock);
return 0;
}
static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
struct files_struct *fsp,
- uint32 share_mode)
+ uint32 share_mode, uint32 access_mask)
{
int result;
- result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
+ result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
fsp_str_do_log(fsp));
#include "vfs_gpfs.h"
static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
- uint32 share_mode)
+ uint32 share_mode, uint32 access_mask)
{
START_PROFILE(syscall_kernel_flock);
- kernel_flock(fsp->fh->fd, share_mode);
+ kernel_flock(fsp->fh->fd, share_mode, access_mask);
- if (!set_gpfs_sharemode(fsp, fsp->access_mask, fsp->share_access)) {
+ if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
return -1;
note that GPFS supports it as well - jmcd */
if (fsp->fh->fd != -1) {
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
+ ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
if(ret_flock == -1 ){
TALLOC_FREE(lck);
}
int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, uint32 share_mode)
+ struct files_struct *fsp, uint32 share_mode,
+ uint32_t access_mask)
{
VFS_FIND(kernel_flock);
- return handle->fns->kernel_flock(handle, fsp, share_mode);
+ return handle->fns->kernel_flock(handle, fsp, share_mode,
+ access_mask);
}
int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,