With the removal of the call to flock LOCK_MAND, the only remaining use
of this VFS path is to register sharemodes with specific file systems.
Rename the VFS call to reflect that this is no longer related to flock.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
16 files changed:
.ftruncate_fn = skel_ftruncate,
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
.ftruncate_fn = skel_ftruncate,
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
- .kernel_flock_fn = skel_kernel_flock,
+ .filesystem_sharemode_fn = skel_kernel_flock,
.fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
struct files_struct *fsp, uint32_t share_mode,
uint32_t access_mask)
{
struct files_struct *fsp, uint32_t share_mode,
uint32_t access_mask)
{
- return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
+ return SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle,
+ fsp,
+ share_mode,
+ access_mask);
}
static int skel_fcntl(struct vfs_handle_struct *handle,
}
static int skel_fcntl(struct vfs_handle_struct *handle,
.ftruncate_fn = skel_ftruncate,
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
.ftruncate_fn = skel_ftruncate,
.fallocate_fn = skel_fallocate,
.lock_fn = skel_lock,
- .kernel_flock_fn = skel_kernel_flock,
+ .filesystem_sharemode_fn = skel_kernel_flock,
.fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.fcntl_fn = skel_fcntl,
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
off_t offset,
off_t len);
bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, off_t offset, off_t count, int type);
off_t offset,
off_t len);
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_access, uint32_t access_mask);
+ int (*filesystem_sharemode_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t share_access, 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);
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 smb_vfs_call_lock(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op, off_t offset,
off_t count, int type);
bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op, off_t offset,
off_t count, int type);
-int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, uint32_t share_access,
- uint32_t access_mask);
+int smb_vfs_call_filesystem_sharemode(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t share_access,
+ 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,
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,
uint32_t mode, off_t offset, off_t len);
bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
off_t offset, off_t count, int type);
uint32_t mode, off_t offset, off_t len);
bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
off_t offset, off_t count, int type);
-int vfs_not_implemented_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- uint32_t share_access, uint32_t access_mask);
+int vfs_not_implemented_filesystem_sharemode(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t share_access,
+ 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,
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,
#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_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_access, access_mask) \
- smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_access), (access_mask))
-#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_access, access_mask) \
- smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_access), (access_mask))
+#define SMB_VFS_FILESYSTEM_SHAREMODE(fsp, share_access, access_mask) \
+ smb_vfs_call_filesystem_sharemode((fsp)->conn->vfs_handles, \
+ (fsp), \
+ (share_access), \
+ (access_mask))
+#define SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle, fsp, share_access, \
+ access_mask) \
+ smb_vfs_call_filesystem_sharemode((handle)->next, \
+ (fsp), \
+ (share_access), \
+ (access_mask))
#define SMB_VFS_FCNTL(fsp, cmd, ...) \
smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
#define SMB_VFS_FCNTL(fsp, cmd, ...) \
smb_vfs_call_fcntl((fsp)->conn->vfs_handles, (fsp), (cmd), (__VA_ARGS__))
- ret = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_access, access_mask);
+ ret = SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle,
+ fsp,
+ share_access,
+ access_mask);
CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
.ftruncate_fn = catia_ftruncate,
.fallocate_fn = catia_fallocate,
.lock_fn = catia_lock,
.ftruncate_fn = catia_ftruncate,
.fallocate_fn = catia_fallocate,
.lock_fn = catia_lock,
- .kernel_flock_fn = catia_kernel_flock,
+ .filesystem_sharemode_fn = catia_kernel_flock,
.linux_setlease_fn = catia_linux_setlease,
.getlock_fn = catia_getlock,
.realpath_fn = catia_realpath,
.linux_setlease_fn = catia_linux_setlease,
.getlock_fn = catia_getlock,
.realpath_fn = catia_realpath,
.ftruncate_fn = cephwrap_ftruncate,
.fallocate_fn = cephwrap_fallocate,
.lock_fn = cephwrap_lock,
.ftruncate_fn = cephwrap_ftruncate,
.fallocate_fn = cephwrap_fallocate,
.lock_fn = cephwrap_lock,
- .kernel_flock_fn = cephwrap_kernel_flock,
+ .filesystem_sharemode_fn = cephwrap_kernel_flock,
.fcntl_fn = cephwrap_fcntl,
.linux_setlease_fn = cephwrap_linux_setlease,
.getlock_fn = cephwrap_getlock,
.fcntl_fn = cephwrap_fcntl,
.linux_setlease_fn = cephwrap_linux_setlease,
.getlock_fn = cephwrap_getlock,
.ftruncate_fn = vfswrap_ftruncate,
.fallocate_fn = vfswrap_fallocate,
.lock_fn = vfswrap_lock,
.ftruncate_fn = vfswrap_ftruncate,
.fallocate_fn = vfswrap_fallocate,
.lock_fn = vfswrap_lock,
- .kernel_flock_fn = vfswrap_kernel_flock,
+ .filesystem_sharemode_fn = vfswrap_kernel_flock,
.fcntl_fn = vfswrap_fcntl,
.linux_setlease_fn = vfswrap_linux_setlease,
.getlock_fn = vfswrap_getlock,
.fcntl_fn = vfswrap_fcntl,
.linux_setlease_fn = vfswrap_linux_setlease,
.getlock_fn = vfswrap_getlock,
- result = SMB_VFS_NEXT_KERNEL_FLOCK(handle,
- fsp,
- share_access,
- access_mask);
+ result = SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle,
+ fsp,
+ share_access,
+ access_mask);
do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
fsp_str_do_log(fsp));
do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
fsp_str_do_log(fsp));
.ftruncate_fn = smb_full_audit_ftruncate,
.fallocate_fn = smb_full_audit_fallocate,
.lock_fn = smb_full_audit_lock,
.ftruncate_fn = smb_full_audit_ftruncate,
.fallocate_fn = smb_full_audit_fallocate,
.lock_fn = smb_full_audit_lock,
- .kernel_flock_fn = smb_full_audit_kernel_flock,
+ .filesystem_sharemode_fn = smb_full_audit_kernel_flock,
.fcntl_fn = smb_full_audit_fcntl,
.linux_setlease_fn = smb_full_audit_linux_setlease,
.getlock_fn = smb_full_audit_getlock,
.fcntl_fn = smb_full_audit_fcntl,
.linux_setlease_fn = smb_full_audit_linux_setlease,
.getlock_fn = smb_full_audit_getlock,
.ftruncate_fn = vfs_gluster_ftruncate,
.fallocate_fn = vfs_gluster_fallocate,
.lock_fn = vfs_gluster_lock,
.ftruncate_fn = vfs_gluster_ftruncate,
.fallocate_fn = vfs_gluster_fallocate,
.lock_fn = vfs_gluster_lock,
- .kernel_flock_fn = vfs_gluster_kernel_flock,
+ .filesystem_sharemode_fn = vfs_gluster_kernel_flock,
.fcntl_fn = vfs_gluster_fcntl,
.linux_setlease_fn = vfs_gluster_linux_setlease,
.getlock_fn = vfs_gluster_getlock,
.fcntl_fn = vfs_gluster_fcntl,
.linux_setlease_fn = vfs_gluster_linux_setlease,
.getlock_fn = vfs_gluster_getlock,
.disk_free_fn = vfs_gpfs_disk_free,
.get_quota_fn = vfs_gpfs_get_quota,
.fs_capabilities_fn = vfs_gpfs_capabilities,
.disk_free_fn = vfs_gpfs_disk_free,
.get_quota_fn = vfs_gpfs_get_quota,
.fs_capabilities_fn = vfs_gpfs_capabilities,
- .kernel_flock_fn = vfs_gpfs_kernel_flock,
+ .filesystem_sharemode_fn = vfs_gpfs_kernel_flock,
.linux_setlease_fn = vfs_gpfs_setlease,
.get_real_filename_fn = vfs_gpfs_get_real_filename,
.get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
.linux_setlease_fn = vfs_gpfs_setlease,
.get_real_filename_fn = vfs_gpfs_get_real_filename,
.get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
-int vfs_not_implemented_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- uint32_t share_access, uint32_t access_mask)
+int vfs_not_implemented_filesystem_sharemode(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t share_access,
+ uint32_t access_mask)
{
errno = ENOSYS;
return -1;
{
errno = ENOSYS;
return -1;
.ftruncate_fn = vfs_not_implemented_ftruncate,
.fallocate_fn = vfs_not_implemented_fallocate,
.lock_fn = vfs_not_implemented_lock,
.ftruncate_fn = vfs_not_implemented_ftruncate,
.fallocate_fn = vfs_not_implemented_fallocate,
.lock_fn = vfs_not_implemented_lock,
- .kernel_flock_fn = vfs_not_implemented_kernel_flock,
+ .filesystem_sharemode_fn = vfs_not_implemented_filesystem_sharemode,
.fcntl_fn = vfs_not_implemented_fcntl,
.linux_setlease_fn = vfs_not_implemented_linux_setlease,
.getlock_fn = vfs_not_implemented_getlock,
.fcntl_fn = vfs_not_implemented_fcntl,
.linux_setlease_fn = vfs_not_implemented_linux_setlease,
.getlock_fn = vfs_not_implemented_getlock,
(struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
if (sio == NULL) {
(struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
if (sio == NULL) {
- return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp,
- share_access, access_mask);
+ return SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle,
+ fsp,
+ share_access,
+ access_mask);
.lock_fn = streams_xattr_lock,
.getlock_fn = streams_xattr_getlock,
.lock_fn = streams_xattr_lock,
.getlock_fn = streams_xattr_getlock,
- .kernel_flock_fn = streams_xattr_kernel_flock,
+ .filesystem_sharemode_fn = streams_xattr_kernel_flock,
.linux_setlease_fn = streams_xattr_linux_setlease,
.strict_lock_check_fn = streams_xattr_strict_lock_check,
.linux_setlease_fn = streams_xattr_linux_setlease,
.strict_lock_check_fn = streams_xattr_strict_lock_check,
double timediff;
clock_gettime_mono(&ts1);
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_access,
- access_mask);
+ result = SMB_VFS_NEXT_FILESYSTEM_SHAREMODE(handle,
+ fsp,
+ share_access,
+ access_mask);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
.ftruncate_fn = smb_time_audit_ftruncate,
.fallocate_fn = smb_time_audit_fallocate,
.lock_fn = smb_time_audit_lock,
.ftruncate_fn = smb_time_audit_ftruncate,
.fallocate_fn = smb_time_audit_fallocate,
.lock_fn = smb_time_audit_lock,
- .kernel_flock_fn = smb_time_audit_kernel_flock,
+ .filesystem_sharemode_fn = smb_time_audit_kernel_flock,
.fcntl_fn = smb_time_audit_fcntl,
.linux_setlease_fn = smb_time_audit_linux_setlease,
.getlock_fn = smb_time_audit_getlock,
.fcntl_fn = smb_time_audit_fcntl,
.linux_setlease_fn = smb_time_audit_linux_setlease,
.getlock_fn = smb_time_audit_getlock,
* A file system sharemode could block the unlink;
* remove filesystem sharemodes first.
*/
* A file system sharemode could block the unlink;
* remove filesystem sharemodes first.
*/
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
+ ret_flock = SMB_VFS_FILESYSTEM_SHAREMODE(fsp, 0, 0);
if (ret_flock == -1) {
DBG_INFO("removing kernel flock for %s failed: %s\n",
fsp_str_dbg(fsp), strerror(errno));
if (ret_flock == -1) {
DBG_INFO("removing kernel flock for %s failed: %s\n",
fsp_str_dbg(fsp), strerror(errno));
int ret_flock;
/* remove filesystem sharemodes */
int ret_flock;
/* remove filesystem sharemodes */
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
+ ret_flock = SMB_VFS_FILESYSTEM_SHAREMODE(fsp, 0, 0);
if (ret_flock == -1) {
DEBUG(2, ("close_remove_share_mode: removing kernel "
"flock for %s failed: %s\n",
if (ret_flock == -1) {
DEBUG(2, ("close_remove_share_mode: removing kernel "
"flock for %s failed: %s\n",
* check is deferred to the VFS module implementing
* the file-system sharemode call.
*/
* check is deferred to the VFS module implementing
* the file-system sharemode call.
*/
- ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
+ ret_flock = SMB_VFS_FILESYSTEM_SHAREMODE(fsp,
+ share_access,
+ access_mask);
if(ret_flock == -1 ){
del_share_mode(lck, fsp);
if(ret_flock == -1 ){
del_share_mode(lck, fsp);
return handle->fns->fallocate_fn(handle, fsp, mode, offset, len);
}
return handle->fns->fallocate_fn(handle, fsp, mode, offset, len);
}
-int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
- struct files_struct *fsp, uint32_t share_mode,
- uint32_t access_mask)
-{
- VFS_FIND(kernel_flock);
- return handle->fns->kernel_flock_fn(handle, fsp, share_mode,
- access_mask);
+int smb_vfs_call_filesystem_sharemode(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t share_mode,
+ uint32_t access_mask)
+{
+ VFS_FIND(filesystem_sharemode);
+ return handle->fns->filesystem_sharemode_fn(handle,
+ fsp,
+ share_mode,
+ access_mask);
}
int smb_vfs_call_fcntl(struct vfs_handle_struct *handle,
}
int smb_vfs_call_fcntl(struct vfs_handle_struct *handle,