From 6a2d97b361ac2e8c31ee643f0e82a86cffcd67bc Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Tue, 22 Mar 2016 22:38:11 -0700 Subject: [PATCH] gpfswrap: Add wrapper for gpfs_set_winattrs Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- lib/util/gpfswrap.c | 13 +++++++++++++ lib/util/gpfswrap.h | 1 + 2 files changed, 14 insertions(+) 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); -- 2.47.3