gpfs: Move set_gpfs_lease to vfs_gpfs.c
authorChristof Schmitt <cs@samba.org>
Wed, 10 Dec 2014 22:50:14 +0000 (15:50 -0700)
committerChristof Schmitt <cs@samba.org>
Mon, 2 Mar 2015 21:31:08 +0000 (22:31 +0100)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/gpfs.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_gpfs.h

index 585c522f641e9bb7f0060db3e56826dc28165f0f..c5ed93a6b6eb4ae4b9f0ed9b06a4923406f84a9f 100644 (file)
@@ -229,26 +229,6 @@ int gpfswrap_getfilesetid(char *pathname, char *name, int *idp)
        return gpfs_getfilesetid_fn(pathname, name, idp);
 }
 
-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);
-}
-
 int get_gpfs_quota(const char *pathname, int type, int id,
                   struct gpfs_quotaInfo *qi)
 {
index 053b673d71766a847ce66b5137ca4ca649205931..ab9cfee1f72d6451e2935f9d50270221d7808f9e 100644 (file)
@@ -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)
 {
index 61389b9618aa36df8edd3d75948c0f465d642ba4..b3c3e53ff6cffa1ad19a2a507bba176fe0d3e241 100644 (file)
@@ -45,7 +45,6 @@ int gpfswrap_set_times_path(char *pathname, int flags,
 int gpfswrap_quotactl(char *pathname, int cmd, int id, void *bufp);
 int gpfswrap_fcntl(int fd, void *argp);
 int gpfswrap_getfilesetid(char *pathname, char *name, int *idp);
-int set_gpfs_lease(int fd, int leasetype);
 int get_gpfs_quota(const char *pathname, int type, int id,
                   struct gpfs_quotaInfo *qi);
 int get_gpfs_fset_id(const char *pathname, int *fset_id);