]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes
authorChristof Schmitt <cs@samba.org>
Tue, 4 Feb 2025 21:05:58 +0000 (14:05 -0700)
committerJule Anger <janger@samba.org>
Thu, 6 Feb 2025 11:24:41 +0000 (11:24 +0000)
The call to the default function for fntimes already calls back into
fset_dos_attributes to set the create time. It is not necessary to
repeat the code in vfs_gpfs_fntimes.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_gpfs.c

index b3c21295c51d5f280f0a221c4a3730cd5987bd13..12d340ede5235f710896fce8a801b66f59d22b74 100644 (file)
@@ -1659,7 +1659,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct *handle,
                struct smb_file_time *ft)
 {
 
-       struct gpfs_winattr attrs;
        int ret;
        struct gpfs_config_data *config;
 
@@ -1673,8 +1672,7 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct *handle,
                return smbd_gpfs_set_times(config, fsp, ft);
        }
 
-       DBG_DEBUG("gpfs_set_times() not available or disabled, "
-                 "use ntimes and winattr\n");
+       DBG_DEBUG("gpfs_set_times() not available or disabled.\n");
 
        ret = SMB_VFS_NEXT_FNTIMES(handle, fsp, ft);
        if (ret == -1) {
@@ -1686,56 +1684,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct *handle,
                return -1;
        }
 
-       if (is_omit_timespec(&ft->create_time)) {
-               DBG_DEBUG("Create Time is NULL\n");
-               return 0;
-       }
-
-       if (!config->winattr) {
-               return 0;
-       }
-
-       attrs.winAttrs = 0;
-       attrs.creationTime.tv_sec = ft->create_time.tv_sec;
-       attrs.creationTime.tv_nsec = ft->create_time.tv_nsec;
-
-       if (!fsp->fsp_flags.is_pathref) {
-               ret = gpfswrap_set_winattrs(fsp_get_io_fd(fsp),
-                                           GPFS_WINATTR_SET_CREATION_TIME,
-                                           &attrs);
-               if (ret == -1 && errno != ENOSYS) {
-                       DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-                       return -1;
-               }
-               return ret;
-       }
-
-       if (fsp->fsp_flags.have_proc_fds) {
-               int fd = fsp_get_pathref_fd(fsp);
-               struct sys_proc_fd_path_buf buf;
-
-               ret = gpfswrap_set_winattrs_path(
-                       sys_proc_fd_path(fd, &buf),
-                       GPFS_WINATTR_SET_CREATION_TIME,
-                       &attrs);
-               if (ret == -1 && errno != ENOSYS) {
-                       DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-                       return -1;
-               }
-               return ret;
-       }
-
-       /*
-        * This is no longer a handle based call.
-        */
-       ret = gpfswrap_set_winattrs_path(fsp->fsp_name->base_name,
-                                        GPFS_WINATTR_SET_CREATION_TIME,
-                                        &attrs);
-       if (ret == -1 && errno != ENOSYS) {
-               DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-               return -1;
-       }
-
        return 0;
 }