]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
java: enable ceph_release
authorNoah Watkins <noahwatkins@gmail.com>
Thu, 25 Oct 2012 21:23:18 +0000 (14:23 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Fri, 26 Oct 2012 20:58:20 +0000 (13:58 -0700)
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/java/java/com/ceph/fs/CephMount.java
src/java/native/libcephfs_jni.cc

index 79760e2f5a6140a9b6a7262980d51e2d078801cd..8dea7f6872c3ad364d0868d19dce5b37025786bf 100644 (file)
@@ -130,6 +130,11 @@ public class CephMount {
 
   private static synchronized native int native_ceph_unmount(long mountp);
 
+  /*
+   * Private access to low-level ceph_release.
+   */
+  private static synchronized native int native_ceph_release(long mountp);
+
   /**
    * Shutdown the mount.
    */
index a42cc712f95856acec8f74dc3802669d494060eb..a06ec73671028fda02707648c780f24c8279a79f 100644 (file)
@@ -424,6 +424,28 @@ JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1unmount
   return ret;
 }
 
+/*
+ * Class:     com_ceph_fs_CephMount
+ * Method:    native_ceph_release
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_com_ceph_fs_CephMount_native_1ceph_1release
+  (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;
+
+  ldout(cct, 10) << "jni: ceph_release called" << dendl;
+
+  ret = ceph_release(cmount);
+
+  if (ret)
+    handle_error(env, ret);
+
+  return ret;
+}
+
 /*
  * Class:     com_ceph_fs_CephMount
  * Method:    native_ceph_shutdown