From: Christof Schmitt Date: Thu, 16 Jan 2020 19:17:46 +0000 (-0700) Subject: vfs_gpfs: Change lease helper function to only provide mapping X-Git-Tag: ldb-2.1.1~258 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49584782789f345a38f5efa577439c934bc4b7a6;p=thirdparty%2Fsamba.git vfs_gpfs: Change lease helper function to only provide mapping The set_gpfs_lease function first maps the lease argument to the GPFS version and then issues the API call. Change this to only do the mapping in the helper function. Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 240b6839d0b..f41e5d41f48 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -219,7 +219,7 @@ static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp) return SMB_VFS_NEXT_CLOSE(handle, fsp); } -static int set_gpfs_lease(int fd, int leasetype) +static int lease_type_to_gpfs(int leasetype) { int gpfs_type = GPFS_LEASE_NONE; @@ -230,7 +230,7 @@ static int set_gpfs_lease(int fd, int leasetype) gpfs_type = GPFS_LEASE_WRITE; } - return gpfswrap_set_lease(fd, gpfs_type); + return gpfs_type; } static int vfs_gpfs_setlease(vfs_handle_struct *handle, @@ -252,12 +252,14 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, } if (config->leases) { + int gpfs_lease_type = lease_type_to_gpfs(leasetype); + /* * Ensure the lease owner is root to allow * correct delivery of lease-break signals. */ become_root(); - ret = set_gpfs_lease(fsp->fh->fd,leasetype); + ret = gpfswrap_set_lease(fsp->fh->fd, gpfs_lease_type); unbecome_root(); }