From b464161d938dbacd03bdea72af67571d35d7c035 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 12 Oct 2016 07:04:42 -0400 Subject: [PATCH] client: convert ceph_setattr callers to ceph_setattrx Signed-off-by: Jeff Layton --- src/java/native/libcephfs_jni.cc | 16 ++++++++-------- src/test/libcephfs/test.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/java/native/libcephfs_jni.cc b/src/java/native/libcephfs_jni.cc index 7a9ffc3f43a..975a092dace 100644 --- a/src/java/native/libcephfs_jni.cc +++ b/src/java/native/libcephfs_jni.cc @@ -1350,7 +1350,7 @@ JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1setattr struct ceph_mount_info *cmount = get_ceph_mount(j_mntp); CephContext *cct = ceph_get_mount_context(cmount); const char *c_path; - struct stat st; + struct ceph_statx stx; int ret, mask = fixup_attr_mask(j_mask); CHECK_ARG_NULL(j_path, "@path is null", -1); @@ -1363,17 +1363,17 @@ JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1setattr return -1; } - memset(&st, 0, sizeof(st)); + memset(&stx, 0, sizeof(stx)); - st.st_mode = env->GetIntField(j_cephstat, cephstat_mode_fid); - st.st_uid = env->GetIntField(j_cephstat, cephstat_uid_fid); - st.st_gid = env->GetIntField(j_cephstat, cephstat_gid_fid); - st.st_mtime = env->GetLongField(j_cephstat, cephstat_m_time_fid); - st.st_atime = env->GetLongField(j_cephstat, cephstat_a_time_fid); + stx.stx_mode = env->GetIntField(j_cephstat, cephstat_mode_fid); + stx.stx_uid = env->GetIntField(j_cephstat, cephstat_uid_fid); + stx.stx_gid = env->GetIntField(j_cephstat, cephstat_gid_fid); + stx.stx_mtime.tv_sec = env->GetLongField(j_cephstat, cephstat_m_time_fid); + stx.stx_atime.tv_sec = env->GetLongField(j_cephstat, cephstat_a_time_fid); ldout(cct, 10) << "jni: setattr: path " << c_path << " mask " << mask << dendl; - ret = ceph_setattr(cmount, c_path, &st, mask); + ret = ceph_setattrx(cmount, c_path, &stx, mask, 0); ldout(cct, 10) << "jni: setattr: exit ret " << ret << dendl; diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index bf91bd7228e..60999b6f40d 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -1148,7 +1148,7 @@ TEST(LibCephFS, UseUnmounted) { EXPECT_EQ(-ENOTCONN, ceph_readlink(cmount, "/path", NULL, 0)); EXPECT_EQ(-ENOTCONN, ceph_symlink(cmount, "/path", "/path")); EXPECT_EQ(-ENOTCONN, ceph_statx(cmount, "/path", &stx, 0, 0)); - EXPECT_EQ(-ENOTCONN, ceph_setattr(cmount, "/path", &st, 0)); + EXPECT_EQ(-ENOTCONN, ceph_setattrx(cmount, "/path", &stx, 0, 0)); EXPECT_EQ(-ENOTCONN, ceph_getxattr(cmount, "/path", "name", NULL, 0)); EXPECT_EQ(-ENOTCONN, ceph_lgetxattr(cmount, "/path", "name", NULL, 0)); EXPECT_EQ(-ENOTCONN, ceph_listxattr(cmount, "/path", NULL, 0));