]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix/update rgw_create flag arguments
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Aug 2016 20:52:51 +0000 (16:52 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Oct 2016 18:24:25 +0000 (14:24 -0400)
Allow passing POSIX open flags as well as api call flags.  Needed
for NFS3 support.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 2d0ea2b4649e76cbbb87f44c57754d7ea9c46dce)

src/include/rados/rgw_file.h
src/rgw/rgw_file.cc
src/test/librgw_file_nfsns.cc

index d3dba290c524ff5c579e11033d447b6b726c7df4..5fac51acba16b5c99ff920deca0bc67230401d82 100644 (file)
@@ -143,8 +143,9 @@ int rgw_statfs(struct rgw_fs *rgw_fs,
 #define RGW_CREATE_FLAG_NONE     0x0000
 
 int rgw_create(struct rgw_fs *rgw_fs, struct rgw_file_handle *parent_fh,
-             const char *name, struct stat *st, uint32_t mask,
-             struct rgw_file_handle **fh, uint32_t flags);
+              const char *name, struct stat *st, uint32_t mask,
+              struct rgw_file_handle **fh, uint32_t posix_flags,
+              uint32_t flags);
 
 /*
   create a new directory
index 2925e43dcc12b2c6dd63ee1dcf4124c7d7826fca..8491b7701323595e8fa619c7dc520d8326d1efa7 100644 (file)
@@ -1114,10 +1114,10 @@ int rgw_statfs(struct rgw_fs *rgw_fs,
 /*
   generic create -- create an empty regular file
 */
-int rgw_create(struct rgw_fs *rgw_fs,
-             struct rgw_file_handle *parent_fh,
-             const char *name, struct stat *st, uint32_t mask,
-             struct rgw_file_handle **fh, uint32_t flags)
+int rgw_create(struct rgw_fs *rgw_fs, struct rgw_file_handle *parent_fh,
+              const char *name, struct stat *st, uint32_t mask,
+              struct rgw_file_handle **fh, uint32_t posix_flags,
+              uint32_t flags)
 {
   using std::get;
 
index 6fee01d9d6448137259c71fe273a61dde2295a37..ebac187ae993686cf4d5ca2ed9a6cfc7a22ec03c 100644 (file)
@@ -498,7 +498,7 @@ TEST(LibRGW, RGW_CREATE_DIRS1) {
                          RGW_LOOKUP_FLAG_NONE);
        if (! sf.fh) {
          rc = rgw_create(fs, sf.parent_fh, sf.name.c_str(), &st, create_mask,
-                         &sf.fh, RGW_CREATE_FLAG_NONE);
+                         &sf.fh, 0 /* posix flags */, RGW_CREATE_FLAG_NONE);
          ASSERT_EQ(rc, 0);
        }
        sf.sync();
@@ -545,7 +545,7 @@ TEST(LibRGW, RGW_SETUP_RENAME1) {
                          RGW_LOOKUP_FLAG_NONE);
        if (! rf.fh) {
          rc = rgw_create(fs, rf.parent_fh, rf.name.c_str(), &st, create_mask,
-                         &rf.fh, RGW_CREATE_FLAG_NONE);
+                         &rf.fh, 0 /* posix flags */, RGW_CREATE_FLAG_NONE);
          ASSERT_EQ(rc, 0);
        }
        rf.sync();