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>
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,