From: Christof Schmitt Date: Thu, 16 Jan 2020 19:18:46 +0000 (-0700) Subject: vfs_gpfs: Cleanup lease mapping function X-Git-Tag: ldb-2.1.1~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fed2c3edc5285d712e5c060a8fc0f05fc19ae6bb;p=thirdparty%2Fsamba.git vfs_gpfs: Cleanup lease mapping function Shorten the function a bit by directly returning the mapped value. Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index f41e5d41f48..3967a7c723a 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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,