gpfs: Move smbd_gpfs_set_times_path to vfs_gpfs.c
authorChristof Schmitt <cs@samba.org>
Wed, 10 Dec 2014 22:56:30 +0000 (15:56 -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 4b9b7757f3de49ca7b601391e0d121ee7aa94904..d05fe50ce68c51035e41af53f0cc504d6f55f460 100644 (file)
@@ -228,41 +228,3 @@ int gpfswrap_getfilesetid(char *pathname, char *name, int *idp)
 
        return gpfs_getfilesetid_fn(pathname, name, idp);
 }
-
-static void timespec_to_gpfs_time(struct timespec ts, gpfs_timestruc_t *gt,
-                                 int idx, int *flags)
-{
-       if (!null_timespec(ts)) {
-               *flags |= 1 << idx;
-               gt[idx].tv_sec = ts.tv_sec;
-               gt[idx].tv_nsec = ts.tv_nsec;
-               DEBUG(10, ("Setting GPFS time %d, flags 0x%x\n", idx, *flags));
-       }
-}
-
-int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft)
-{
-       gpfs_timestruc_t gpfs_times[4];
-       int flags = 0;
-       int rc;
-
-       ZERO_ARRAY(gpfs_times);
-       timespec_to_gpfs_time(ft->atime, gpfs_times, 0, &flags);
-       timespec_to_gpfs_time(ft->mtime, gpfs_times, 1, &flags);
-       /* No good mapping from LastChangeTime to ctime, not storing */
-       timespec_to_gpfs_time(ft->create_time, gpfs_times, 3, &flags);
-
-       if (!flags) {
-               DEBUG(10, ("nothing to do, return to avoid EINVAL\n"));
-               return 0;
-       }
-
-       rc = gpfswrap_set_times_path(path, flags, gpfs_times);
-
-       if (rc != 0 && errno != ENOSYS) {
-               DEBUG(1,("gpfs_set_times() returned with error %s\n",
-                       strerror(errno)));
-       }
-
-       return rc;
-}
index d796170136925191f2fafa7246170ae1355fa34e..b91e377e94a445f0162182025854b1c16cf8c3de 100644 (file)
@@ -1736,6 +1736,44 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
        return 0;
 }
 
+static void timespec_to_gpfs_time(struct timespec ts, gpfs_timestruc_t *gt,
+                                 int idx, int *flags)
+{
+       if (!null_timespec(ts)) {
+               *flags |= 1 << idx;
+               gt[idx].tv_sec = ts.tv_sec;
+               gt[idx].tv_nsec = ts.tv_nsec;
+               DEBUG(10, ("Setting GPFS time %d, flags 0x%x\n", idx, *flags));
+       }
+}
+
+static int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft)
+{
+       gpfs_timestruc_t gpfs_times[4];
+       int flags = 0;
+       int rc;
+
+       ZERO_ARRAY(gpfs_times);
+       timespec_to_gpfs_time(ft->atime, gpfs_times, 0, &flags);
+       timespec_to_gpfs_time(ft->mtime, gpfs_times, 1, &flags);
+       /* No good mapping from LastChangeTime to ctime, not storing */
+       timespec_to_gpfs_time(ft->create_time, gpfs_times, 3, &flags);
+
+       if (!flags) {
+               DEBUG(10, ("nothing to do, return to avoid EINVAL\n"));
+               return 0;
+       }
+
+       rc = gpfswrap_set_times_path(path, flags, gpfs_times);
+
+       if (rc != 0 && errno != ENOSYS) {
+               DEBUG(1,("gpfs_set_times() returned with error %s\n",
+                       strerror(errno)));
+       }
+
+       return rc;
+}
+
 static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
                         const struct smb_filename *smb_fname,
                        struct smb_file_time *ft)
index 8c8ab74a5b255c3975dbbb05ec4d307517d9ba9a..4399c9bb046d01ce13fe0010c292a36a4b71ff24 100644 (file)
@@ -45,4 +45,3 @@ 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 smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft);