]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_gpfs: Cleanup lease mapping function
authorChristof Schmitt <cs@samba.org>
Thu, 16 Jan 2020 19:18:46 +0000 (12:18 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 21 Jan 2020 22:08:41 +0000 (22:08 +0000)
Shorten the function a bit by directly returning the mapped value.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c

index f41e5d41f48ae905aa03496c5544fc4f2e649238..3967a7c723af383be386fc001e3a7312d71dc9d4 100644 (file)
@@ -221,16 +221,15 @@ static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp)
 
 static int lease_type_to_gpfs(int leasetype)
 {
-       int gpfs_type = GPFS_LEASE_NONE;
-
        if (leasetype == F_RDLCK) {
-               gpfs_type = GPFS_LEASE_READ;
+               return GPFS_LEASE_READ;
        }
+
        if (leasetype == F_WRLCK) {
-               gpfs_type = GPFS_LEASE_WRITE;
+               return GPFS_LEASE_WRITE;
        }
 
-       return gpfs_type;
+       return GPFS_LEASE_NONE;
 }
 
 static int vfs_gpfs_setlease(vfs_handle_struct *handle,