From: Jeff Layton Date: Mon, 24 Oct 2016 14:02:59 +0000 (-0400) Subject: client: convert ceph_ll_getxattr to take a UserPerm pointer X-Git-Tag: v11.1.0~383^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f5af30b2bda0f8185137e072defb9c326b0397b;p=ceph.git client: convert ceph_ll_getxattr to take a UserPerm pointer Signed-off-by: Jeff Layton --- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index 1401371ce4c2..eb88915dad0e 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1463,13 +1463,12 @@ int ceph_ll_iclose(struct ceph_mount_info *cmount, struct Inode *in, int mode); * @param name name of attribute * @param value pointer to begin buffer * @param size buffer size - * @param uid user ID - * @param gid group ID + * @param perms pointer to UserPerms object * @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); + const char *name, void *value, size_t size, + const UserPerm *perms); 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); diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 5b880aa2ef34..5dca674ff291 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1643,11 +1643,11 @@ extern "C" int ceph_ll_rmdir(class ceph_mount_info *cmount, extern "C" int ceph_ll_getxattr(class ceph_mount_info *cmount, Inode *in, const char *name, void *value, - size_t size, int uid, int gid) + size_t size, const UserPerm *perms) { - UserPerm perms(uid, gid); - return (cmount->get_client()->ll_getxattr(in, name, value, size, perms)); + return (cmount->get_client()->ll_getxattr(in, name, value, size, *perms)); } + 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) diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index e3888819c9a3..810c03060cdf 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -586,7 +586,7 @@ TEST(LibCephFS, Xattrs_ll) { res = ceph_ll_setxattr(cmount, existent_file_handle, valid_name, value, strlen(value), 0, 0, 0); ASSERT_EQ(res, 0); - res = ceph_ll_getxattr(cmount, existent_file_handle, valid_name, value_buf, 256, 0, 0); + res = ceph_ll_getxattr(cmount, existent_file_handle, valid_name, value_buf, 256, perms); ASSERT_EQ(res, (int)strlen(value)); value_buf[res] = '\0';