From 8ae92c10b5d538d387f985e58057aaebf48628d5 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 17 Feb 2016 14:28:54 +0000 Subject: [PATCH] java: add O_DIRECTORY to libcephfs interface Signed-off-by: John Spray --- src/java/java/com/ceph/fs/CephMount.java | 15 ++++++++------- src/java/native/libcephfs_jni.cc | 16 +++++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/java/java/com/ceph/fs/CephMount.java b/src/java/java/com/ceph/fs/CephMount.java index a2867958710cc..d1267142c3ecf 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 050acc3f8a0a3..d0cb7ee063d59 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 -- 2.39.5