From: Christof Schmitt Date: Wed, 23 Mar 2016 05:38:11 +0000 (-0700) Subject: gpfswrap: Add wrapper for gpfs_set_winattrs X-Git-Tag: tdb-1.3.9~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a2d97b361ac2e8c31ee643f0e82a86cffcd67bc;p=thirdparty%2Fsamba.git gpfswrap: Add wrapper for gpfs_set_winattrs Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c index 4c7410552be..0632ee20757 100644 --- a/lib/util/gpfswrap.c +++ b/lib/util/gpfswrap.c @@ -29,6 +29,8 @@ 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_fn)(int fd, 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); @@ -63,6 +65,7 @@ int gpfswrap_init(void) gpfs_putacl_fn = dlsym(l, "gpfs_putacl"); gpfs_get_realfilename_path_fn = dlsym(l, "gpfs_get_realfilename_path"); gpfs_set_winattrs_path_fn = dlsym(l, "gpfs_set_winattrs_path"); + gpfs_set_winattrs_fn = dlsym(l, "gpfs_set_winattrs"); gpfs_get_winattrs_path_fn = dlsym(l, "gpfs_get_winattrs_path"); gpfs_get_winattrs_fn = dlsym(l, "gpfs_get_winattrs"); gpfs_prealloc_fn = dlsym(l, "gpfs_prealloc"); @@ -140,6 +143,16 @@ int gpfswrap_set_winattrs_path(char *pathname, int flags, return gpfs_set_winattrs_path_fn(pathname, flags, attrs); } +int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs) +{ + if (gpfs_set_winattrs_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_set_winattrs_fn(fd, flags, attrs); +} + int gpfswrap_get_winattrs_path(char *pathname, struct gpfs_winattr *attrs) { if (gpfs_get_winattrs_path_fn == NULL) { diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h index 25b1ba8046d..1c9c64f7e8c 100644 --- a/lib/util/gpfswrap.h +++ b/lib/util/gpfswrap.h @@ -34,6 +34,7 @@ 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); +int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs); int gpfswrap_get_winattrs_path(char *pathname, struct gpfs_winattr *attrs); int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs); int gpfswrap_prealloc(int fd, gpfs_off64_t start, gpfs_off64_t bytes);