mirror of
https://github.com/ceph/ceph
synced 2024-12-16 08:26:25 +00:00
java: add support for get_stripe_unit_granularity
Signed-off-by: Joe Buck <jbbuck@gmail.com> Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
abcda95b75
commit
6954bf3392
@ -664,4 +664,15 @@ public class CephMount {
|
||||
}
|
||||
|
||||
private static synchronized native int native_ceph_localize_reads(long mountp, boolean on);
|
||||
|
||||
/**
|
||||
* Pull the stripe unit granularity from the underlying ceph installation.
|
||||
*
|
||||
* @return all block sizes must be a (non-zero) multiple of this value.
|
||||
*/
|
||||
public int get_stripe_unit_granularity() {
|
||||
return native_ceph_get_stripe_unit_granularity(instance_ptr);
|
||||
}
|
||||
|
||||
private static synchronized native int native_ceph_get_stripe_unit_granularity(long mountp);
|
||||
}
|
||||
|
@ -2408,3 +2408,31 @@ JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1localize_1reads
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: com_ceph_fs_CephMount
|
||||
* Method: native_ceph_get_stripe_unit_granularity
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1get_1stripe_1unit_1granularity
|
||||
(JNIEnv *env, jclass clz, jlong j_mntp)
|
||||
{
|
||||
struct ceph_mount_info *cmount = get_ceph_mount(j_mntp);
|
||||
CephContext *cct = ceph_get_mount_context(cmount);
|
||||
int ret;
|
||||
|
||||
CHECK_MOUNTED(cmount, -1);
|
||||
|
||||
ldout(cct, 10) << "jni: get_stripe_unit_granularity" << dendl;
|
||||
|
||||
ret = ceph_get_stripe_unit_granularity(cmount);
|
||||
|
||||
ldout(cct, 10) << "jni: get_stripe_unit_granularity: exit ret " << ret << dendl;
|
||||
|
||||
if (ret < 0)
|
||||
handle_error(env, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user