client: convert ceph_setattr callers to ceph_setattrx

Signed-off-by: Jeff Layton <jlayton@redhat.com>
This commit is contained in:
Jeff Layton 2016-10-12 07:04:42 -04:00
parent 09adfcaf54
commit b464161d93
2 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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));