summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2014-12-10 15:47:46 -0700
committerChristof Schmitt <cs@samba.org>2015-03-02 22:31:08 +0100
commit26991065f24e5beedfe4d60b98d5c24127be6ec5 (patch)
treed69ad2db3628e5fb450287f1d0f8398ba83439ef /source3
parente30d5012170cd99cbd71ffac4392e7e799e43a9c (diff)
downloadsamba-26991065f24e5beedfe4d60b98d5c24127be6ec5.tar.gz
samba-26991065f24e5beedfe4d60b98d5c24127be6ec5.tar.xz
samba-26991065f24e5beedfe4d60b98d5c24127be6ec5.zip
gpfs: Introduce wrapper for gpfs_getfilesetid
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/gpfs.c23
-rw-r--r--source3/modules/vfs_gpfs.h1
2 files changed, 15 insertions, 9 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index 4959e1d2ec..44bf6b35e2 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -44,7 +44,7 @@ static int (*gpfs_set_times_path_fn)(char *pathname, int flags,
gpfs_timestruc_t times[4]);
static int (*gpfs_quotactl_fn)(char *pathname, int cmd, int id, void *bufp);
static int (*gpfs_fcntl_fn)(int fd, void *argp);
-static int (*gpfs_getfilesetid_fn)(char *pathname, char *name, int *idP);
+static int (*gpfs_getfilesetid_fn)(char *pathname, char *name, int *idp);
int gpfswrap_init(void)
{
@@ -220,6 +220,16 @@ int gpfswrap_fcntl(int fd, void *argp)
return gpfs_fcntl_fn(fd, argp);
}
+int gpfswrap_getfilesetid(char *pathname, char *name, int *idp)
+{
+ if (gpfs_getfilesetid_fn == NULL) {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ return gpfs_getfilesetid_fn(pathname, name, idp);
+}
+
bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
uint32 share_access)
{
@@ -321,11 +331,6 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id)
gpfsGetFilesetName_t fsn;
} arg;
- if (!gpfs_getfilesetid_fn) {
- errno = ENOSYS;
- return -1;
- }
-
arg.hdr.totalLength = sizeof(arg);
arg.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
arg.hdr.fcntlReserved = 0;
@@ -352,9 +357,9 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id)
return err;
}
- err = gpfs_getfilesetid_fn(discard_const_p(char, pathname),
- arg.fsn.buffer, fset_id);
- if (err) {
+ err = gpfswrap_getfilesetid(discard_const_p(char, pathname),
+ arg.fsn.buffer, fset_id);
+ if (err && errno != ENOSYS) {
DEBUG(1, ("gpfs_getfilesetid for %s failed: %s\n",
pathname, strerror(errno)));
}
diff --git a/source3/modules/vfs_gpfs.h b/source3/modules/vfs_gpfs.h
index 9f83b97d3b..5c7dc1b4dd 100644
--- a/source3/modules/vfs_gpfs.h
+++ b/source3/modules/vfs_gpfs.h
@@ -44,6 +44,7 @@ int gpfswrap_set_times_path(char *pathname, int flags,
gpfs_timestruc_t times[4]);
int gpfswrap_quotactl(char *pathname, int cmd, int id, void *bufp);
int gpfswrap_fcntl(int fd, void *argp);
+int gpfswrap_getfilesetid(char *pathname, char *name, int *idp);
bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
uint32 share_access);
int set_gpfs_lease(int fd, int leasetype);