diff options
author | Andrey Kuznetsov <Andrey_Kuznetsov@epam.com> | 2013-07-10 14:28:40 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-04 17:53:30 -0700 |
commit | 38a31eaec3e6ddfc7aebce36a4bd346d50085fe6 (patch) | |
tree | f6f1f3874a697732b14475855f1f92451f7aa5d4 | |
parent | 9e68497ec7f4e51f8b1f6df011a56d5a2236f217 (diff) | |
download | ceph-38a31eaec3e6ddfc7aebce36a4bd346d50085fe6.tar.gz |
libcephfs: add ceph_ll_listxattr
Signed-off-by: Andrey Kuznetsov <Andrey_Kuznetsov@epam.com>
-rw-r--r-- | src/include/cephfs/libcephfs.h | 14 | ||||
-rw-r--r-- | src/libcephfs.cc | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index 4ba63069064..c45c19d8c96 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1245,12 +1245,26 @@ int64_t ceph_ll_writev(struct ceph_mount_info *cmount, struct Fh *fh, const struct iovec *iov, int iovcnt, int64_t off); int ceph_ll_close(struct ceph_mount_info *cmount, struct Fh* filehandle); int ceph_ll_iclose(struct ceph_mount_info *cmount, struct Inode *in, int mode); +/** + * Get xattr value by xattr name. + * + * @param cmount the ceph mount handle to use. + * @param in file handle + * @param name name of attribute + * @param value pointer to begin buffer + * @param size buffer size + * @param uid user ID + * @param gid group ID + * @returns size of returned buffer. Negative number in error case + */ int ceph_ll_getxattr(struct ceph_mount_info *cmount, struct Inode *in, const char *name, void *value, size_t size, int uid, int gid); int ceph_ll_setxattr(struct ceph_mount_info *cmount, struct Inode *in, const char *name, const void *value, size_t size, int flags, int uid, int gid); +int ceph_ll_listxattr(struct ceph_mount_info *cmount, struct Inode *in, + char *list, size_t buf_size, size_t *list_size, int uid, int gid); int ceph_ll_removexattr(struct ceph_mount_info *cmount, struct Inode *in, const char *name, int uid, int gid); int ceph_ll_create(struct ceph_mount_info *cmount, struct Inode *parent, diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 885ee02a288..97a51aec3c6 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1403,6 +1403,17 @@ extern "C" int ceph_ll_getxattr(class ceph_mount_info *cmount, { return (cmount->get_client()->ll_getxattr(in, name, value, size, uid, gid)); } +extern "C" int ceph_ll_listxattr(struct ceph_mount_info *cmount, + Inode *in, char *list, + size_t buf_size, size_t *list_size, int uid, int gid) +{ + int res = cmount->get_client()->ll_listxattr(in, list, buf_size, uid, gid); + if (res >= 0) { + *list_size = (size_t)res; + return 0; + } + return res; +} extern "C" int ceph_ll_setxattr(class ceph_mount_info *cmount, Inode *in, const char *name, |