]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: convert ceph_ll_getxattr to take a UserPerm pointer
authorJeff Layton <jlayton@redhat.com>
Mon, 24 Oct 2016 14:02:59 +0000 (10:02 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 25 Oct 2016 17:06:28 +0000 (13:06 -0400)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/include/cephfs/libcephfs.h
src/libcephfs.cc
src/test/libcephfs/test.cc

index 1401371ce4c2d855f667681adb27d7528eca960a..eb88915dad0e8e9ab4d28a4007617b735009d962 100644 (file)
@@ -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);
index 5b880aa2ef34e3222499c8d113c80fbf84d1eeae..5dca674ff291f94001847454652c055203b90b9f 100644 (file)
@@ -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)
index e3888819c9a3d25cd89b06d4c64a46f717cfcc8d..810c03060cdf939d538da9075e8cc8eed04432b6 100644 (file)
@@ -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';