From: Christof Schmitt Date: Mon, 19 Aug 2019 23:06:57 +0000 (-0700) Subject: vfs_gpfs: Use gpfs_fstat_x in vfs_gpfs_fget_dos_attributes X-Git-Tag: ldb-2.1.0~672 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba5d4803bab3f8fd980a5776f375b4e57b82cc85;p=thirdparty%2Fsamba.git vfs_gpfs: Use gpfs_fstat_x in vfs_gpfs_fget_dos_attributes This is no functional change, but allows to use additional metadata later on. Signed-off-by: Christof Schmitt Reviewed-by: Volker Lendecke --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 7c0cd0d2290..cb0db12daab 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1665,7 +1665,8 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle, uint32_t *dosmode) { struct gpfs_config_data *config; - struct gpfs_winattr attrs = { }; + struct gpfs_iattr64 iattr = { }; + unsigned int litemask; int ret; SMB_VFS_HANDLE_GET_DATA(handle, config, @@ -1676,7 +1677,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle, return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode); } - ret = gpfswrap_get_winattrs(fsp->fh->fd, &attrs); + ret = gpfswrap_fstat_x(fsp->fh->fd, &litemask, &iattr, sizeof(iattr)); if (ret == -1 && errno == ENOSYS) { return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode); } @@ -1693,7 +1694,8 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle, set_effective_capability(DAC_OVERRIDE_CAPABILITY); - ret = gpfswrap_get_winattrs(fsp->fh->fd, &attrs); + ret = gpfswrap_fstat_x(fsp->fh->fd, &litemask, + &iattr, sizeof(iattr)); if (ret == -1) { saved_errno = errno; } @@ -1711,10 +1713,10 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle, return map_nt_error_from_unix(errno); } - *dosmode |= vfs_gpfs_winattrs_to_dosmode(attrs.winAttrs); + *dosmode |= vfs_gpfs_winattrs_to_dosmode(iattr.ia_winflags); fsp->fsp_name->st.st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_BTIME; - fsp->fsp_name->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec; - fsp->fsp_name->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec; + fsp->fsp_name->st.st_ex_btime.tv_sec = iattr.ia_createtime.tv_sec; + fsp->fsp_name->st.st_ex_btime.tv_nsec = iattr.ia_createtime.tv_nsec; return NT_STATUS_OK; }