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:
Joe Buck 2013-01-04 17:33:26 -08:00 committed by Noah Watkins
parent abcda95b75
commit 6954bf3392
2 changed files with 39 additions and 0 deletions

View File

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

View File

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