From e9e87d456aeb9acd36d352378b615769444809d3 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Wed, 10 Dec 2014 15:22:27 -0700 Subject: [PATCH] gpfs: Rename wrapper for gpfs_set_winattrs_path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christof Schmitt Reviewed-by: Ralph Böhme --- source3/modules/gpfs.c | 25 +++++++++++++------------ source3/modules/vfs_gpfs.c | 9 +++++---- source3/modules/vfs_gpfs.h | 3 ++- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c index 2b12bbe969d..dbcfa323203 100644 --- a/source3/modules/gpfs.c +++ b/source3/modules/gpfs.c @@ -32,7 +32,8 @@ static int (*gpfs_getacl_fn)(char *pathname, int flags, void *acl); static int (*gpfs_putacl_fn)(char *pathname, int flags, void *acl); static int (*gpfs_get_realfilename_path_fn)(char *pathname, char *filenamep, int *len); -static int (*gpfs_set_winattrs_path_fn)(char *pathname, int flags, struct gpfs_winattr *attrs); +static int (*gpfs_set_winattrs_path_fn)(char *pathname, int flags, + struct gpfs_winattr *attrs); static int (*gpfs_get_winattrs_path_fn)(char *pathname, struct gpfs_winattr *attrs); static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs); static int (*gpfs_prealloc_fn)(int fd, gpfs_off64_t startOffset, gpfs_off64_t bytesToPrealloc); @@ -126,6 +127,17 @@ int gpfswrap_get_realfilename_path(char *pathname, char *filenamep, int *len) return gpfs_get_realfilename_path_fn(pathname, filenamep, len); } +int gpfswrap_set_winattrs_path(char *pathname, int flags, + struct gpfs_winattr *attrs) +{ + if (gpfs_set_winattrs_path_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_set_winattrs_path_fn(pathname, flags, attrs); +} + bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask, uint32 share_access) { @@ -231,17 +243,6 @@ int smbd_gpfs_prealloc(int fd, gpfs_off64_t start, gpfs_off64_t bytes) return gpfs_prealloc_fn(fd, start, bytes); } -int set_gpfs_winattrs(char *pathname,int flags,struct gpfs_winattr *attrs) -{ - if (gpfs_set_winattrs_path_fn == NULL) { - errno = ENOSYS; - return -1; - } - - DEBUG(10, ("gpfs_set_winattrs_path:open call %s\n",pathname)); - return gpfs_set_winattrs_path_fn(pathname,flags, attrs); -} - int get_gpfs_quota(const char *pathname, int type, int id, struct gpfs_quotaInfo *qi) { diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 52b2857fd5c..c2a3e14d44d 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1425,8 +1425,8 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle, const char *path, } - ret = set_gpfs_winattrs(discard_const_p(char, path), - GPFS_WINATTR_SET_ATTRS, &attrs); + ret = gpfswrap_set_winattrs_path(discard_const_p(char, path), + GPFS_WINATTR_SET_ATTRS, &attrs); if ( ret == -1){ if (errno == ENOSYS) { return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, @@ -1726,8 +1726,9 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle, attrs.creationTime.tv_sec = ft->create_time.tv_sec; attrs.creationTime.tv_nsec = ft->create_time.tv_nsec; - ret = set_gpfs_winattrs(discard_const_p(char, path), - GPFS_WINATTR_SET_CREATION_TIME, &attrs); + ret = gpfswrap_set_winattrs_path(discard_const_p(char, path), + GPFS_WINATTR_SET_CREATION_TIME, + &attrs); if(ret == -1 && errno != ENOSYS){ DEBUG(1,("vfs_gpfs_ntimes: set GPFS ntimes failed %d\n",ret)); return -1; diff --git a/source3/modules/vfs_gpfs.h b/source3/modules/vfs_gpfs.h index 3b4037c722e..56374216c6e 100644 --- a/source3/modules/vfs_gpfs.h +++ b/source3/modules/vfs_gpfs.h @@ -33,12 +33,13 @@ int gpfswrap_set_lease(int fd, unsigned int type); int gpfswrap_getacl(char *pathname, int flags, void *acl); int gpfswrap_putacl(char *pathname, int flags, void *acl); int gpfswrap_get_realfilename_path(char *pathname, char *filenamep, int *len); +int gpfswrap_set_winattrs_path(char *pathname, int flags, + struct gpfs_winattr *attrs); bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask, uint32 share_access); int set_gpfs_lease(int fd, int leasetype); int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs); int get_gpfs_winattrs(char * pathname,struct gpfs_winattr *attrs); -int set_gpfs_winattrs(char * pathname,int flags,struct gpfs_winattr *attrs); int smbd_gpfs_prealloc(int fd, gpfs_off64_t start, gpfs_off64_t bytes); int smbd_gpfs_ftruncate(int fd, gpfs_off64_t length); int get_gpfs_quota(const char *pathname, int type, int id,