diff options
author | Michael Adam <obnox@samba.org> | 2008-01-07 17:14:20 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-01-07 17:14:20 +0100 |
commit | 195c519377c2fdc655e25760b52bc0694b8dda81 (patch) | |
tree | 395db980543330c9aeec4d4af8091555a1124828 | |
parent | 5c01309a2b078f08c4f0caf802d81c9b3d53382f (diff) | |
download | samba-195c519377c2fdc655e25760b52bc0694b8dda81.tar.gz samba-195c519377c2fdc655e25760b52bc0694b8dda81.tar.xz samba-195c519377c2fdc655e25760b52bc0694b8dda81.zip |
Remove redundant parameter fd from SMB_VFS_KERNEL_FLOCK().
Michael
-rw-r--r-- | source/include/vfs.h | 3 | ||||
-rw-r--r-- | source/include/vfs_macros.h | 6 | ||||
-rw-r--r-- | source/modules/vfs_default.c | 4 | ||||
-rw-r--r-- | source/modules/vfs_full_audit.c | 6 | ||||
-rw-r--r-- | source/modules/vfs_gpfs.c | 2 | ||||
-rw-r--r-- | source/smbd/open.c | 2 |
6 files changed, 12 insertions, 11 deletions
diff --git a/source/include/vfs.h b/source/include/vfs.h index 9cf49bf7214..3ca602cc09e 100644 --- a/source/include/vfs.h +++ b/source/include/vfs.h @@ -88,6 +88,7 @@ /* Leave at 22 - not yet released. Remove parameter fd from fchown. - obnox */ /* Leave at 22 - not yet released. Remove parameter fd from ftruncate. - obnox */ /* Leave at 22 - not yet released. Remove parameter fd from lock. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from kernel_flock. - obnox */ #define SMB_VFS_INTERFACE_VERSION 22 @@ -301,7 +302,7 @@ struct vfs_ops { int (*ntimes)(struct vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); 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, int fd, uint32 share_mode); + int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode); int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int leasetype); bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, 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); diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h index 4566bb9b1d1..b1f094f8154 100644 --- a/source/include/vfs_macros.h +++ b/source/include/vfs_macros.h @@ -71,7 +71,7 @@ #define SMB_VFS_NTIMES(conn, path, ts) ((conn)->vfs.ops.ntimes((conn)->vfs.handles.ntimes, (path), (ts))) #define SMB_VFS_FTRUNCATE(fsp, offset) ((fsp)->conn->vfs.ops.ftruncate((fsp)->conn->vfs.handles.ftruncate, (fsp), (offset))) #define SMB_VFS_LOCK(fsp, op, offset, count, type) ((fsp)->conn->vfs.ops.lock((fsp)->conn->vfs.handles.lock, (fsp), (op), (offset), (count), (type))) -#define SMB_VFS_KERNEL_FLOCK(fsp, fd, share_mode) ((fsp)->conn->vfs.ops.kernel_flock((fsp)->conn->vfs.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode) ((fsp)->conn->vfs.ops.kernel_flock((fsp)->conn->vfs.handles.kernel_flock, (fsp), (share_mode))) #define SMB_VFS_LINUX_SETLEASE(fsp, fd, leasetype) ((fsp)->conn->vfs.ops.linux_setlease((fsp)->conn->vfs.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_GETLOCK(fsp, fd, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs.ops.getlock((fsp)->conn->vfs.handles.getlock, (fsp), (fd) ,(poffset), (pcount), (ptype), (ppid))) #define SMB_VFS_SYMLINK(conn, oldpath, newpath) ((conn)->vfs.ops.symlink((conn)->vfs.handles.symlink, (oldpath), (newpath))) @@ -190,7 +190,7 @@ #define SMB_VFS_OPAQUE_NTIMES(conn, path, ts) ((conn)->vfs_opaque.ops.ntimes((conn)->vfs_opaque.handles.ntimes, (path), (ts))) #define SMB_VFS_OPAQUE_FTRUNCATE(fsp, offset) ((fsp)->conn->vfs_opaque.ops.ftruncate((fsp)->conn->vfs_opaque.handles.ftruncate, (fsp), (offset))) #define SMB_VFS_OPAQUE_LOCK(fsp, op, offset, count, type) ((fsp)->conn->vfs_opaque.ops.lock((fsp)->conn->vfs_opaque.handles.lock, (fsp), (op), (offset), (count), (type))) -#define SMB_VFS_OPAQUE_KERNEL_FLOCK(fsp, fd, share_mode) ((fsp)->conn->vfs_opaque.ops.kernel_flock((fsp)->conn->vfs_opaque.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_OPAQUE_KERNEL_FLOCK(fsp, share_mode) ((fsp)->conn->vfs_opaque.ops.kernel_flock((fsp)->conn->vfs_opaque.handles.kernel_flock, (fsp), (share_mode))) #define SMB_VFS_OPAQUE_LINUX_SETLEASE(fsp, fd, leasetype) ((fsp)->conn->vfs_opaque.ops.linux_setlease((fsp)->conn->vfs_opaque.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_OPAQUE_GETLOCK(fsp, fd, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs_opaque.ops.getlock((fsp)->conn->vfs_opaque.handles.getlock, (fsp), (fd), (poffset), (pcount), (ptype), (ppid))) #define SMB_VFS_OPAQUE_SYMLINK(conn, oldpath, newpath) ((conn)->vfs_opaque.ops.symlink((conn)->vfs_opaque.handles.symlink, (oldpath), (newpath))) @@ -310,7 +310,7 @@ #define SMB_VFS_NEXT_NTIMES(handle, path, ts) ((handle)->vfs_next.ops.ntimes((handle)->vfs_next.handles.ntimes, (path), (ts))) #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) ((handle)->vfs_next.ops.ftruncate((handle)->vfs_next.handles.ftruncate, (fsp), (offset))) #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) ((handle)->vfs_next.ops.lock((handle)->vfs_next.handles.lock, (fsp), (op), (offset), (count), (type))) -#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode)((handle)->vfs_next.ops.kernel_flock((handle)->vfs_next.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode)((handle)->vfs_next.ops.kernel_flock((handle)->vfs_next.handles.kernel_flock, (fsp), (share_mode))) #define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype)((handle)->vfs_next.ops.linux_setlease((handle)->vfs_next.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid) ((handle)->vfs_next.ops.getlock((handle)->vfs_next.handles.getlock, (fsp), (fd), (poffset), (pcount), (ptype), (ppid))) #define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) ((handle)->vfs_next.ops.symlink((handle)->vfs_next.handles.symlink, (oldpath), (newpath))) diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c index 0076f8d1b4a..96161ad2737 100644 --- a/source/modules/vfs_default.c +++ b/source/modules/vfs_default.c @@ -811,11 +811,11 @@ static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, S return result; } -static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, uint32 share_mode) { START_PROFILE(syscall_kernel_flock); - kernel_flock(fd, share_mode); + kernel_flock(fsp->fh->fd, share_mode); END_PROFILE(syscall_kernel_flock); return 0; } diff --git a/source/modules/vfs_full_audit.c b/source/modules/vfs_full_audit.c index 13f442485f0..cc14597d977 100644 --- a/source/modules/vfs_full_audit.c +++ b/source/modules/vfs_full_audit.c @@ -163,7 +163,7 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, uint32 share_mode); static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int fd, int leasetype); @@ -1378,12 +1378,12 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, } static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, uint32 share_mode) { int result; - result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode); + result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode); do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s", fsp->fsp_name); diff --git a/source/modules/vfs_gpfs.c b/source/modules/vfs_gpfs.c index 832dcbfcad9..1dd2c5967eb 100644 --- a/source/modules/vfs_gpfs.c +++ b/source/modules/vfs_gpfs.c @@ -33,7 +33,7 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 share_mode) + uint32 share_mode) { START_PROFILE(syscall_kernel_flock); diff --git a/source/smbd/open.c b/source/smbd/open.c index cc62e020da2..b618092a321 100644 --- a/source/smbd/open.c +++ b/source/smbd/open.c @@ -1764,7 +1764,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, the kernel refuses the operations then the kernel is wrong. note that GPFS supports it as well - jmcd */ - ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, fsp->fh->fd, share_access); + ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access); if(ret_flock == -1 ){ TALLOC_FREE(lck); |