]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: FLAG_CREATE cleanup
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 9 Jan 2016 22:02:07 +0000 (17:02 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:07:41 +0000 (12:07 -0500)
Split the transiently-creating concept (CREATING) from the request
to create objects used in lookup_fh.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.h

index 4d189a401476767f6b6c72248f483ba45e1b3ef9..84556f705417280e18a0fb33e4e0abff025ec6cf 100644 (file)
@@ -201,7 +201,7 @@ namespace rgw {
     static constexpr uint32_t FLAG_OPEN =    0x0001;
     static constexpr uint32_t FLAG_ROOT =    0x0002;
     static constexpr uint32_t FLAG_CREATE =  0x0004;
-    static constexpr uint32_t FLAG_PSEUDO =  0x0008;
+    static constexpr uint32_t FLAG_CREATING =  0x0008;
     static constexpr uint32_t FLAG_DIRECTORY = 0x0010;
     static constexpr uint32_t FLAG_BUCKET = 0x0020;
     static constexpr uint32_t FLAG_LOCK =   0x0040;
@@ -405,8 +405,7 @@ namespace rgw {
     bool is_object() const { return !is_bucket(); }
     bool is_file() const { return (fh.fh_type == RGW_FS_TYPE_FILE); }
     bool is_dir() const { return (fh.fh_type == RGW_FS_TYPE_DIRECTORY); }
-    bool creating() const { return flags & FLAG_CREATE; }
-    bool pseudo() const { return flags & FLAG_PSEUDO; }
+    bool creating() const { return flags & FLAG_CREATING; }
 
     uint32_t open(uint32_t gsh_flags) {
       lock_guard guard(mtx);
@@ -425,11 +424,12 @@ namespace rgw {
 
     void open_for_create() {
       lock_guard guard(mtx);
-      flags |= FLAG_CREATE;
+      flags |= FLAG_CREATING;
     }
 
-    void set_pseudo() {
-      flags |= FLAG_PSEUDO;
+    void clear_creating() {
+      lock_guard guard(mtx);
+      flags &= ~FLAG_CREATING;
     }
 
     void set_nlink(const uint64_t n) {