gpfs: Introduce wrapper for gpfs_set_times_path
authorChristof Schmitt <cs@samba.org>
Wed, 10 Dec 2014 22:40:16 +0000 (15:40 -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.h

index b90d42292ed78145704758a13933d4e740606b23..1659f5b32fb55fc89216eb4ae84610aea5859baf 100644 (file)
@@ -189,6 +189,17 @@ int gpfswrap_lib_init(int flags)
        return gpfs_lib_init_fn(flags);
 }
 
+int gpfswrap_set_times_path(char *pathname, int flags,
+                           gpfs_timestruc_t times[4])
+{
+       if (gpfs_set_times_path_fn == NULL) {
+               errno = ENOSYS;
+               return -1;
+       }
+
+       return gpfs_set_times_path_fn(pathname, flags, times);
+}
+
 bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
                        uint32 share_access)
 {
@@ -350,11 +361,6 @@ int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft)
        int flags = 0;
        int rc;
 
-       if (!gpfs_set_times_path_fn) {
-               errno = ENOSYS;
-               return -1;
-       }
-
        ZERO_ARRAY(gpfs_times);
        timespec_to_gpfs_time(ft->atime, gpfs_times, 0, &flags);
        timespec_to_gpfs_time(ft->mtime, gpfs_times, 1, &flags);
@@ -366,9 +372,9 @@ int smbd_gpfs_set_times_path(char *path, struct smb_file_time *ft)
                return 0;
        }
 
-       rc = gpfs_set_times_path_fn(path, flags, gpfs_times);
+       rc = gpfswrap_set_times_path(path, flags, gpfs_times);
 
-       if (rc != 0) {
+       if (rc != 0 && errno != ENOSYS) {
                DEBUG(1,("gpfs_set_times() returned with error %s\n",
                        strerror(errno)));
        }
index 9d7ed542f3e24a28a96db84a6745ef11a2c81503..d56b80867b70493ee6d5f6eff1feee5056557aa4 100644 (file)
@@ -40,6 +40,8 @@ int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs);
 int gpfswrap_prealloc(int fd, gpfs_off64_t start, gpfs_off64_t bytes);
 int gpfswrap_ftruncate(int fd, gpfs_off64_t length);
 int gpfswrap_lib_init(int flags);
+int gpfswrap_set_times_path(char *pathname, int flags,
+                           gpfs_timestruc_t times[4]);
 bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
                        uint32 share_access);
 int set_gpfs_lease(int fd, int leasetype);