summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_gpfs.c
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2014-12-10 15:50:14 -0700
committerChristof Schmitt <cs@samba.org>2015-03-02 22:31:08 +0100
commit9948163a64a564de6f423a915dc3dcaae44e3675 (patch)
tree380b28482d57f71eda60e16bbe2ebbb69e8a8a6c /source3/modules/vfs_gpfs.c
parentf9629aee81084d4af39858c83eaf966e72e9e0f0 (diff)
downloadsamba-9948163a64a564de6f423a915dc3dcaae44e3675.tar.gz
samba-9948163a64a564de6f423a915dc3dcaae44e3675.tar.xz
samba-9948163a64a564de6f423a915dc3dcaae44e3675.zip
gpfs: Move set_gpfs_lease to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_gpfs.c')
-rw-r--r--source3/modules/vfs_gpfs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 053b673d71..ab9cfee1f7 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -161,6 +161,26 @@ 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)
+{
+ int gpfs_type = GPFS_LEASE_NONE;
+
+ if (leasetype == F_RDLCK) {
+ gpfs_type = GPFS_LEASE_READ;
+ }
+ if (leasetype == F_WRLCK) {
+ gpfs_type = GPFS_LEASE_WRITE;
+ }
+
+ /* we unconditionally set CAP_LEASE, rather than looking for
+ -1/EACCES as there is a bug in some versions of
+ libgpfs_gpl.so which results in a leaked fd on /dev/ss0
+ each time we try this with the wrong capabilities set
+ */
+ linux_set_lease_capability();
+ return gpfswrap_set_lease(fd, gpfs_type);
+}
+
static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
int leasetype)
{