gpfs: Move get_gpfs_fset_id to vfs_gpfs.c
authorChristof Schmitt <cs@samba.org>
Wed, 10 Dec 2014 22:55:19 +0000 (15:55 -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 9654bd73f71f95ffbcb0df9f49e4c6acfab127d2..4b9b7757f3de49ca7b601391e0d121ee7aa94904 100644 (file)
@@ -229,50 +229,6 @@ int gpfswrap_getfilesetid(char *pathname, char *name, int *idp)
        return gpfs_getfilesetid_fn(pathname, name, idp);
 }
 
-int get_gpfs_fset_id(const char *pathname, int *fset_id)
-{
-       int err, fd, errno_fcntl;
-
-       struct {
-               gpfsFcntlHeader_t hdr;
-               gpfsGetFilesetName_t fsn;
-       } arg;
-
-       arg.hdr.totalLength = sizeof(arg);
-       arg.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
-       arg.hdr.fcntlReserved = 0;
-       arg.fsn.structLen = sizeof(arg.fsn);
-       arg.fsn.structType = GPFS_FCNTL_GET_FILESETNAME;
-
-       fd = open(pathname, O_RDONLY);
-       if (fd == -1) {
-               DEBUG(1, ("Could not open %s: %s\n",
-                         pathname, strerror(errno)));
-               return fd;
-       }
-
-       err = gpfswrap_fcntl(fd, &arg);
-       errno_fcntl = errno;
-       close(fd);
-
-       if (err) {
-               errno = errno_fcntl;
-               if (errno != ENOSYS) {
-                       DEBUG(1, ("GPFS_FCNTL_GET_FILESETNAME for %s failed: "
-                                 "%s\n", pathname, strerror(errno)));
-               }
-               return err;
-       }
-
-       err = gpfswrap_getfilesetid(discard_const_p(char, pathname),
-                                   arg.fsn.buffer, fset_id);
-       if (err && errno != ENOSYS) {
-               DEBUG(1, ("gpfs_getfilesetid for %s failed: %s\n",
-                         pathname, strerror(errno)));
-       }
-       return err;
-}
-
 static void timespec_to_gpfs_time(struct timespec ts, gpfs_timestruc_t *gt,
                                  int idx, int *flags)
 {
index fe506cfd2d337a2cf0a7fdcf465dfe39fcac0d28..d796170136925191f2fafa7246170ae1355fa34e 100644 (file)
@@ -2005,6 +2005,50 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
        return 0;
 }
 
+static int get_gpfs_fset_id(const char *pathname, int *fset_id)
+{
+       int err, fd, errno_fcntl;
+
+       struct {
+               gpfsFcntlHeader_t hdr;
+               gpfsGetFilesetName_t fsn;
+       } arg;
+
+       arg.hdr.totalLength = sizeof(arg);
+       arg.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
+       arg.hdr.fcntlReserved = 0;
+       arg.fsn.structLen = sizeof(arg.fsn);
+       arg.fsn.structType = GPFS_FCNTL_GET_FILESETNAME;
+
+       fd = open(pathname, O_RDONLY);
+       if (fd == -1) {
+               DEBUG(1, ("Could not open %s: %s\n",
+                         pathname, strerror(errno)));
+               return fd;
+       }
+
+       err = gpfswrap_fcntl(fd, &arg);
+       errno_fcntl = errno;
+       close(fd);
+
+       if (err) {
+               errno = errno_fcntl;
+               if (errno != ENOSYS) {
+                       DEBUG(1, ("GPFS_FCNTL_GET_FILESETNAME for %s failed: "
+                                 "%s\n", pathname, strerror(errno)));
+               }
+               return err;
+       }
+
+       err = gpfswrap_getfilesetid(discard_const_p(char, pathname),
+                                   arg.fsn.buffer, fset_id);
+       if (err && errno != ENOSYS) {
+               DEBUG(1, ("gpfs_getfilesetid for %s failed: %s\n",
+                         pathname, strerror(errno)));
+       }
+       return err;
+}
+
 static int get_gpfs_quota(const char *pathname, int type, int id,
                          struct gpfs_quotaInfo *qi)
 {
index b61a0ddbae3aa1a8b3bf18cdb7042933aea9e8f2..8c8ab74a5b255c3975dbbb05ec4d307517d9ba9a 100644 (file)
@@ -45,5 +45,4 @@ 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 get_gpfs_fset_id(const char *pathname, int *fset_id);
 int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft);