Remove redundant parameter fd from SMB_VFS_KERNEL_FLOCK().
authorMichael Adam <obnox@samba.org>
Mon, 7 Jan 2008 16:14:20 +0000 (17:14 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 7 Jan 2008 16:14:20 +0000 (17:14 +0100)
Michael

source/include/vfs.h
source/include/vfs_macros.h
source/modules/vfs_default.c
source/modules/vfs_full_audit.c
source/modules/vfs_gpfs.c
source/smbd/open.c

index 9cf49bf7214904843a94ac781a4d0b22b85bdd76..3ca602cc09e060117da7225b0501bc88a7c3cd87 100644 (file)
@@ -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);
index 4566bb9b1d12dde7bc3ae9a2d7a8162754ffb8ee..b1f094f815483f95e96252a564b438fe6446ffe3 100644 (file)
@@ -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)))
 #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)))
 #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)))
index 0076f8d1b4acd8e077a7e9249bda5163d38f4cec..96161ad273733ce68a0e8f6a4c8acb13e9877f4b 100644 (file)
@@ -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;
 }
index 13f442485f0c1c59218093690dd64a636d13a147..cc14597d977ba06686473d0650b8360f74286267 100644 (file)
@@ -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);
index 832dcbfcad9e372071d2bdea67cd5b8a0d609fc8..1dd2c5967ebf8ac16e798a2f8bb1a4ffc2d5f065 100644 (file)
@@ -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);
index cc62e020da22c000996247dde46dc009368a743c..b618092a321174eb7aeee34660e25e9cf1f08a10 100644 (file)
@@ -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);