diff options
author | Christof Schmitt <cs@samba.org> | 2014-12-10 15:46:07 -0700 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2015-03-02 22:31:08 +0100 |
commit | e30d5012170cd99cbd71ffac4392e7e799e43a9c (patch) | |
tree | 05b77fcc1eb31273379776879538690dfdcd7233 /source3/modules/gpfs.c | |
parent | c4f1f3b2534c3a99202772e5dad783e0c52fbd08 (diff) | |
download | samba-e30d5012170cd99cbd71ffac4392e7e799e43a9c.tar.gz samba-e30d5012170cd99cbd71ffac4392e7e799e43a9c.tar.xz samba-e30d5012170cd99cbd71ffac4392e7e799e43a9c.zip |
gpfs: Introduce wrapper for gpfs_fcntl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/modules/gpfs.c')
-rw-r--r-- | source3/modules/gpfs.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c index 101b6ff6da..4959e1d2ec 100644 --- a/source3/modules/gpfs.c +++ b/source3/modules/gpfs.c @@ -43,7 +43,7 @@ static int (*gpfs_lib_init_fn)(int flags); 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)(gpfs_file_t fileDesc, void *fcntlArgP); +static int (*gpfs_fcntl_fn)(int fd, void *argp); static int (*gpfs_getfilesetid_fn)(char *pathname, char *name, int *idP); int gpfswrap_init(void) @@ -210,6 +210,16 @@ int gpfswrap_quotactl(char *pathname, int cmd, int id, void *bufp) return gpfs_quotactl_fn(pathname, cmd, id, bufp); } +int gpfswrap_fcntl(int fd, void *argp) +{ + if (gpfs_fcntl_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_fcntl_fn(fd, argp); +} + bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask, uint32 share_access) { @@ -311,7 +321,7 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id) gpfsGetFilesetName_t fsn; } arg; - if (!gpfs_fcntl_fn || !gpfs_getfilesetid_fn) { + if (!gpfs_getfilesetid_fn) { errno = ENOSYS; return -1; } @@ -329,14 +339,16 @@ int get_gpfs_fset_id(const char *pathname, int *fset_id) return fd; } - err = gpfs_fcntl_fn(fd, &arg); + err = gpfswrap_fcntl(fd, &arg); errno_fcntl = errno; close(fd); if (err) { errno = errno_fcntl; - DEBUG(1, ("GPFS_FCNTL_GET_FILESETNAME for %s failed: %s\n", - pathname, strerror(errno))); + if (errno != ENOSYS) { + DEBUG(1, ("GPFS_FCNTL_GET_FILESETNAME for %s failed: " + "%s\n", pathname, strerror(errno))); + } return err; } |