From: Jeff Layton Date: Mon, 24 Oct 2016 14:02:59 +0000 (-0400) Subject: client: rename ceph_ll_getattrx to ceph_ll_getattr, and drop the original X-Git-Tag: v11.1.0~383^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7e2d03e9c5959b5319e8c46ba4dfb88796fc8f8b;p=ceph.git client: rename ceph_ll_getattrx to ceph_ll_getattr, and drop the original Signed-off-by: Jeff Layton --- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index f1974bfcf790..14d400337ece 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1435,10 +1435,8 @@ int ceph_ll_walk(struct ceph_mount_info *cmount, const char *name, struct Inode **i, struct stat *attr); int ceph_ll_getattr(struct ceph_mount_info *cmount, struct Inode *in, - struct stat *attr, int uid, int gid); -int ceph_ll_getattrx(struct ceph_mount_info *cmount, struct Inode *in, struct ceph_statx *stx, unsigned int want, unsigned int flags, - int uid, int gid); + const UserPerm *perms); int ceph_ll_setattr(struct ceph_mount_info *cmount, struct Inode *in, struct stat *st, int mask, int uid, int gid); int ceph_ll_setattrx(struct ceph_mount_info *cmount, struct Inode *in, diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 6b3dca649c07..1f9c92030bbd 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1430,20 +1430,11 @@ extern "C" int ceph_ll_walk(class ceph_mount_info *cmount, const char *name, } extern "C" int ceph_ll_getattr(class ceph_mount_info *cmount, - Inode *in, struct stat *attr, - int uid, int gid) -{ - UserPerm perms(uid, gid); - return (cmount->get_client()->ll_getattr(in, attr, perms)); -} - -extern "C" int ceph_ll_getattrx(class ceph_mount_info *cmount, - Inode *in, struct ceph_statx *stx, - unsigned int want, unsigned int flags, - int uid, int gid) + Inode *in, struct ceph_statx *stx, + unsigned int want, unsigned int flags, + const UserPerm *perms) { - UserPerm perms(uid, gid); - return (cmount->get_client()->ll_getattrx(in, stx, want, flags, perms)); + return (cmount->get_client()->ll_getattrx(in, stx, want, flags, *perms)); } extern "C" int ceph_ll_setattr(class ceph_mount_info *cmount, diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index 2f36b40b174e..96a5607977ff 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -1581,7 +1581,7 @@ TEST(LibCephFS, LazyStatx) { ASSERT_EQ(ceph_ll_setattr(cmount1, file1, &st, CEPH_SETATTR_MODE, getuid(), getgid()), 0); struct ceph_statx stx; - ASSERT_EQ(ceph_ll_getattrx(cmount2, file2, &stx, CEPH_STATX_CTIME, AT_NO_ATTR_SYNC, getuid(), getgid()), 0); + ASSERT_EQ(ceph_ll_getattr(cmount2, file2, &stx, CEPH_STATX_CTIME, AT_NO_ATTR_SYNC, ceph_mount_perms(cmount2)), 0); ASSERT_TRUE(stx.stx_mask & CEPH_STATX_CTIME); ASSERT_TRUE(stx.stx_ctime.tv_sec == old_ctime.tv_sec && stx.stx_ctime.tv_nsec == old_ctime.tv_nsec);