diff options
author | Christof Schmitt <cs@samba.org> | 2014-12-10 15:06:02 -0700 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2015-03-02 22:31:07 +0100 |
commit | 193b5dd143da3a1c4e22aa115935b437500c952c (patch) | |
tree | 5a811a5628439047379a0f5ecc9ccf913670a063 /source3/modules/gpfs.c | |
parent | 5fb2568d5b723fcd77861f14d4ba7de1978876a9 (diff) | |
download | samba-193b5dd143da3a1c4e22aa115935b437500c952c.tar.gz samba-193b5dd143da3a1c4e22aa115935b437500c952c.tar.xz samba-193b5dd143da3a1c4e22aa115935b437500c952c.zip |
gpfs: Introduce wrapper for gpfs_set_lease
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 | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c index e2628a56d1..e2a07661c9 100644 --- a/source3/modules/gpfs.c +++ b/source3/modules/gpfs.c @@ -27,7 +27,7 @@ #include "vfs_gpfs.h" static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny); -static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType); +static int (*gpfs_set_lease_fn)(int fd, unsigned int type); 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, @@ -86,6 +86,16 @@ int gpfswrap_set_share(int fd, unsigned int allow, unsigned int deny) return gpfs_set_share_fn(fd, allow, deny); } +int gpfswrap_set_lease(int fd, unsigned int type) +{ + if (gpfs_set_lease_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_set_lease_fn(fd, type); +} + bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask, uint32 share_access) { @@ -135,11 +145,6 @@ int set_gpfs_lease(int fd, int leasetype) { int gpfs_type = GPFS_LEASE_NONE; - if (gpfs_set_lease_fn == NULL) { - errno = EINVAL; - return -1; - } - if (leasetype == F_RDLCK) { gpfs_type = GPFS_LEASE_READ; } @@ -153,7 +158,7 @@ int set_gpfs_lease(int fd, int leasetype) each time we try this with the wrong capabilities set */ linux_set_lease_capability(); - return gpfs_set_lease_fn(fd, gpfs_type); + return gpfswrap_set_lease(fd, gpfs_type); } int smbd_gpfs_getacl(char *pathname, int flags, void *acl) |