diff options
Diffstat (limited to 'source3/modules/vfs_gpfs.c')
-rw-r--r-- | source3/modules/vfs_gpfs.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 3dec6abfb2..0f084f8578 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -39,6 +39,7 @@ struct gpfs_config_data { bool leases; bool hsm; bool syncio; + bool winattr; }; @@ -946,6 +947,16 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle, const char *path, unsigned int dosmode=0; struct gpfs_winattr attrs; int ret = 0; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->winattr) { + DEBUG(10, ("gpfs_set_xattr:name is %s -> next\n",name)); + return SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags); + } DEBUG(10, ("gpfs_set_xattr: %s \n",path)); @@ -1022,6 +1033,16 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat unsigned int dosmode = 0; struct gpfs_winattr attrs; int ret = 0; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->winattr) { + DEBUG(10, ("gpfs_get_xattr:name is %s -> next\n",name)); + return SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size); + } DEBUG(10, ("gpfs_get_xattr: %s \n",path)); @@ -1075,11 +1096,21 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle, char *fname = NULL; NTSTATUS status; int ret; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); ret = SMB_VFS_NEXT_STAT(handle, smb_fname); if (ret == -1) { return -1; } + + if (!config->winattr) { + return 0; + } + status = get_full_smb_filename(talloc_tos(), smb_fname, &fname); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); @@ -1100,6 +1131,11 @@ static int vfs_gpfs_fstat(struct vfs_handle_struct *handle, { struct gpfs_winattr attrs; int ret; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf); if (ret == -1) { @@ -1108,6 +1144,10 @@ static int vfs_gpfs_fstat(struct vfs_handle_struct *handle, if ((fsp->fh == NULL) || (fsp->fh->fd == -1)) { return 0; } + if (!config->winattr) { + return 0; + } + ret = smbd_fget_gpfs_winattrs(fsp->fh->fd, &attrs); if (ret == 0) { sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec; @@ -1123,11 +1163,20 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle, char *path = NULL; NTSTATUS status; int ret; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname); if (ret == -1) { return -1; } + if (!config->winattr) { + return 0; + } + status = get_full_smb_filename(talloc_tos(), smb_fname, &path); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); @@ -1152,6 +1201,11 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle, int ret; char *path = NULL; NTSTATUS status; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); ret = SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft); if(ret == -1){ @@ -1164,6 +1218,10 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle, return 0; } + if (!config->winattr) { + return 0; + } + status = get_full_smb_filename(talloc_tos(), smb_fname, &path); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); @@ -1203,6 +1261,15 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle, struct gpfs_winattr attrs; char *path = NULL; NTSTATUS status; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->winattr) { + return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf); + } status = get_full_smb_filename(talloc_tos(), fname, &path); if (!NT_STATUS_IS_OK(status)) { @@ -1280,6 +1347,9 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service, config->syncio = lp_parm_bool(SNUM(handle->conn), "gpfs", "syncio", false); + config->winattr = lp_parm_bool(SNUM(handle->conn), "gpfs", + "winattr", false); + SMB_VFS_HANDLE_SET_DATA(handle, config, NULL, struct gpfs_config_data, return -1); |