From: John Spray Date: Wed, 17 Feb 2016 14:28:54 +0000 (+0000) Subject: java: add O_DIRECTORY to libcephfs interface X-Git-Tag: v10.1.0~144^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ae92c10b5d538d387f985e58057aaebf48628d5;p=ceph.git java: add O_DIRECTORY to libcephfs interface Signed-off-by: John Spray --- diff --git a/src/java/java/com/ceph/fs/CephMount.java b/src/java/java/com/ceph/fs/CephMount.java index a2867958710c..d1267142c3ec 100644 --- a/src/java/java/com/ceph/fs/CephMount.java +++ b/src/java/java/com/ceph/fs/CephMount.java @@ -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(). diff --git a/src/java/native/libcephfs_jni.cc b/src/java/native/libcephfs_jni.cc index 050acc3f8a0a..d0cb7ee063d5 100644 --- a/src/java/native/libcephfs_jni.cc +++ b/src/java/native/libcephfs_jni.cc @@ -54,13 +54,14 @@ * 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