]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
java: add O_DIRECTORY to libcephfs interface
authorJohn Spray <john.spray@redhat.com>
Wed, 17 Feb 2016 14:28:54 +0000 (14:28 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 10 Mar 2016 11:18:28 +0000 (11:18 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
src/java/java/com/ceph/fs/CephMount.java
src/java/native/libcephfs_jni.cc

index a2867958710cccd48d5e74b1d16587298f98edc1..d1267142c3ecfea8bf76738c80617752e428e248 100644 (file)
@@ -42,13 +42,14 @@ public class CephMount {
    *
    * Must be synchronized with JNI if changed.
    */
-  public static final int O_RDONLY = 1;
-  public static final int O_RDWR   = 2;
-  public static final int O_APPEND = 4;
-  public static final int O_CREAT  = 8;
-  public static final int O_TRUNC  = 16;
-  public static final int O_EXCL   = 32;
-  public static final int O_WRONLY = 64;
+  public static final int O_RDONLY    = 1;
+  public static final int O_RDWR      = 2;
+  public static final int O_APPEND    = 4;
+  public static final int O_CREAT     = 8;
+  public static final int O_TRUNC     = 16;
+  public static final int O_EXCL      = 32;
+  public static final int O_WRONLY    = 64;
+  public static final int O_DIRECTORY = 128;
 
   /*
    * Whence flags for seek().
index 050acc3f8a0a3c34c09ea5d1d61b0485068e1469..d0cb7ee063d593e5fa278d70740743021845ae0e 100644 (file)
  * keeping the values in Java and making a cross-JNI up-call to retrieve them,
  * and makes it easy to keep any platform specific value changes in this file.
  */
-#define JAVA_O_RDONLY 1
-#define JAVA_O_RDWR   2
-#define JAVA_O_APPEND 4
-#define JAVA_O_CREAT  8
-#define JAVA_O_TRUNC  16
-#define JAVA_O_EXCL   32
-#define JAVA_O_WRONLY 64
+#define JAVA_O_RDONLY    1
+#define JAVA_O_RDWR      2
+#define JAVA_O_APPEND    4
+#define JAVA_O_CREAT     8
+#define JAVA_O_TRUNC     16
+#define JAVA_O_EXCL      32
+#define JAVA_O_WRONLY    64
+#define JAVA_O_DIRECTORY 128
 
 /*
  * Whence flags for seek(). sync with CephMount.java if changed.
@@ -111,6 +112,7 @@ static inline int fixup_open_flags(jint jflags)
        FIXUP_OPEN_FLAG(O_TRUNC)
        FIXUP_OPEN_FLAG(O_EXCL)
        FIXUP_OPEN_FLAG(O_WRONLY)
+       FIXUP_OPEN_FLAG(O_DIRECTORY)
 
 #undef FIXUP_OPEN_FLAG