summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index e3df8c00b1a..ba468382077 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -15,6 +15,9 @@
#include "glfs.h"
#include "glfs-handles.h"
+int
+glfs_listxattr_process (void *value, size_t size, dict_t *xattr);
+
static void
glfs_iatt_from_stat (struct stat *stat, int valid, struct iatt *iatt,
int *glvalid)
@@ -259,7 +262,11 @@ glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object, const char *name,
if (ret)
goto out;
- ret = glfs_getxattr_process (value, size, xattr, name);
+ /* If @name is NULL, means get all the xattrs (i.e listxattr). */
+ if (name)
+ ret = glfs_getxattr_process (value, size, xattr, name);
+ else
+ ret = glfs_listxattr_process (value, size, xattr);
out:
loc_wipe (&loc);