#include "vfs_gpfs.h"
static bool gpfs_getrealfilename;
-static bool gpfs_winattr;
static bool gpfs_do_ftruncate;
static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
int get_gpfs_winattrs(char *pathname,struct gpfs_winattr *attrs)
{
- if ((!gpfs_winattr) || (gpfs_get_winattrs_path_fn == NULL)) {
+ if (gpfs_get_winattrs_path_fn == NULL) {
errno = ENOSYS;
return -1;
}
int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs)
{
- if ((!gpfs_winattr) || (gpfs_get_winattrs_fn == NULL)) {
+ if (gpfs_get_winattrs_fn == NULL) {
errno = ENOSYS;
return -1;
}
int set_gpfs_winattrs(char *pathname,int flags,struct gpfs_winattr *attrs)
{
- if ((!gpfs_winattr) || (gpfs_set_winattrs_path_fn == NULL)) {
+ if (gpfs_set_winattrs_path_fn == NULL) {
errno = ENOSYS;
return -1;
}
gpfs_getrealfilename = lp_parm_bool(-1, "gpfs", "getrealfilename",
True);
- gpfs_winattr = lp_parm_bool(-1, "gpfs", "winattr", False);
gpfs_do_ftruncate = lp_parm_bool(-1, "gpfs", "ftruncate", True);
return;
bool leases;
bool hsm;
bool syncio;
+ bool winattr;
};
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));
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));
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);
{
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) {
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;
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);
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){
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);
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)) {
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);