dout(10) << "CephFSInterface: In setcwd" << dendl;
const char* c_path = env->GetStringUTFChars(j_path, 0);
- return (0 <= ceph_chdir(c_path)) ? JNI_TRUE : JNI_FALSE;
+ jboolean success = (0 <= ceph_chdir(c_path)) ? JNI_TRUE : JNI_FALSE;
env->ReleaseStringUTFChars(j_path, c_path);
+ return success;
}
/*
dout(10) << "CephFSInterface: In rmdir" << dendl;
const char* c_path = env->GetStringUTFChars(j_path, 0);
- return (0 == ceph_rmdir(c_path)) ? JNI_TRUE : JNI_FALSE;
+ jboolean success = (0 == ceph_rmdir(c_path)) ? JNI_TRUE : JNI_FALSE;
env->ReleaseStringUTFChars(j_path, c_path);
+ return success;
}
dout(10) << "CephFSInterface: In mkdir" << dendl;
const char* c_path = env->GetStringUTFChars(j_path, 0);
- return (0 == ceph_mkdir(c_path, 0xFF)) ? JNI_TRUE : JNI_FALSE;
+ jboolean success = (0 == ceph_mkdir(c_path, 0xFF)) ? JNI_TRUE : JNI_FALSE;
env->ReleaseStringUTFChars(j_path, c_path);
+ return success;
}
/*
int stat_result = ceph_lstat(c_path, &stbuf);
if (stat_result < 0) {// then the path doesn't even exist
dout(0) << "ceph_unlink: path " << c_path << " does not exist" << dendl;
+ env->ReleaseStringUTFChars(j_path, c_path);
return false;
- }
+ }
int result;
if (0 != S_ISDIR(stbuf.st_mode)) { // it's a directory
dout(10) << "ceph_unlink: path " << c_path << " is a directory. Calling client->rmdir()" << dendl;
const char* c_from = env->GetStringUTFChars(j_from, 0);
const char* c_to = env->GetStringUTFChars(j_to, 0);
- return (0 <= ceph_rename(c_from, c_to)) ? JNI_TRUE : JNI_FALSE;
+ jboolean success = (0 <= ceph_rename(c_from, c_to)) ? JNI_TRUE : JNI_FALSE;
env->ReleaseStringUTFChars(j_from, c_from);
env->ReleaseStringUTFChars(j_to, c_to);
+ return success;
}
/*
// we need to open the file to retrieve the stripe size
dout(10) << "CephFSInterface: getblocksize: opening file" << dendl;
int fh = ceph_open(c_path, O_RDONLY);
- if (fh < 0)
+ if (fh < 0) {
+ env->ReleaseStringUTFChars(j_path, c_path);
return -1;
+ }
result = ceph_get_stripe_unit(fh);