From: Christof Schmitt Date: Mon, 19 Aug 2019 22:35:18 +0000 (-0700) Subject: gpfswrap: Add wrappers for gpfs_fstat_x and gpfs_stat_x X-Git-Tag: ldb-2.1.0~674 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=586ffd5b6010b833b4d5b743f69b1629c36b6e7d;p=thirdparty%2Fsamba.git gpfswrap: Add wrappers for gpfs_fstat_x and gpfs_stat_x Signed-off-by: Christof Schmitt Reviewed-by: Volker Lendecke --- diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c index 32be942bc7c..7bc2ec06c15 100644 --- a/lib/util/gpfswrap.c +++ b/lib/util/gpfswrap.c @@ -44,6 +44,10 @@ static int (*gpfs_init_trace_fn)(void); static int (*gpfs_query_trace_fn)(void); static void (*gpfs_add_trace_fn)(int level, const char *msg); static void (*gpfs_fini_trace_fn)(void); +static int (*gpfs_fstat_x_fn)(int fd, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len); +static int (*gpfs_stat_x_fn)(const char *pathname, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len); int gpfswrap_init(void) { @@ -76,6 +80,8 @@ int gpfswrap_init(void) gpfs_query_trace_fn = dlsym(l, "gpfs_query_trace"); gpfs_add_trace_fn = dlsym(l, "gpfs_add_trace"); gpfs_fini_trace_fn = dlsym(l, "gpfs_fini_trace"); + gpfs_fstat_x_fn = dlsym(l, "gpfs_fstat_x"); + gpfs_stat_x_fn = dlsym(l, "gpfs_stat_x"); return 0; } @@ -259,3 +265,25 @@ void gpfswrap_fini_trace(void) gpfs_fini_trace_fn(); } + +int gpfswrap_fstat_x(int fd, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len) +{ + if (gpfs_fstat_x_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_fstat_x_fn(fd, litemask, iattr, len); +} + +int gpfswrap_stat_x(const char *pathname, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len) +{ + if (gpfs_stat_x_fn == NULL) { + errno = ENOSYS; + return -1; + } + + return gpfs_stat_x_fn(pathname, litemask, iattr, len); +} diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h index 40202104064..3141360a584 100644 --- a/lib/util/gpfswrap.h +++ b/lib/util/gpfswrap.h @@ -47,5 +47,9 @@ int gpfswrap_init_trace(void); int gpfswrap_query_trace(void); void gpfswrap_add_trace(int level, const char *msg); void gpfswrap_fini_trace(void); +int gpfswrap_fstat_x(int fd, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len); +int gpfswrap_stat_x(const char *pathname, unsigned int *litemask, + struct gpfs_iattr64 *iattr, size_t len); #endif