s3:vfs_gpfs: correct use of profiling macros
authorChristian Ambach <ambi@samba.org>
Thu, 22 Mar 2012 17:00:17 +0000 (18:00 +0100)
committerChristian Ambach <ambi@samba.org>
Thu, 22 Mar 2012 17:41:22 +0000 (18:41 +0100)
under certain conditions START_PROFILE could have been called, but no END_PROFILE

source3/modules/vfs_gpfs.c

index 65cd33a394ebbee3438bb6ae9f4aaab7180bf4b1..6d66b291870be974693d1113f956f9da53d85656 100644 (file)
@@ -53,6 +53,7 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
 {
 
        struct gpfs_config_data *config;
+       int ret = 0;
 
        SMB_VFS_HANDLE_GET_DATA(handle, config,
                                struct gpfs_config_data,
@@ -64,12 +65,12 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
 
        if (config->sharemodes
                && !set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
-               return -1;
+               ret = -1;
        }
 
        END_PROFILE(syscall_kernel_flock);
 
-       return 0;
+       return ret;
 }
 
 static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp)
@@ -98,11 +99,11 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
                                struct gpfs_config_data,
                                return -1);
 
-       START_PROFILE(syscall_linux_setlease);
-
        if (linux_set_lease_sighandler(fsp->fh->fd) == -1)
                return -1;
 
+       START_PROFILE(syscall_linux_setlease);
+
        if (config->leases) {
                ret = set_gpfs_lease(fsp->fh->fd,leasetype);
        }