]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: use pre-defined calls to replace raw flag operation 15107/head
authorGui Hecheng <guihecheng@cmss.chinamobile.com>
Tue, 16 May 2017 01:43:08 +0000 (09:43 +0800)
committerGui Hecheng <guihecheng@cmss.chinamobile.com>
Fri, 19 May 2017 01:17:51 +0000 (09:17 +0800)
Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
src/rgw/rgw_file.h

index 433356344e271dcaf842e7f3460219c52c7ba912..1666160d1a5c209c3b589843055afaab7e2a1b12 100644 (file)
@@ -282,7 +282,7 @@ namespace rgw {
        variant_type = directory();
        flags |= FLAG_BUCKET;
       } else {
-       bucket = (parent->flags & FLAG_BUCKET) ? parent
+       bucket = parent->is_bucket() ? parent
          : parent->bucket;
        if (flags & FLAG_DIRECTORY) {
          fh.fh_type = RGW_FS_TYPE_DIRECTORY;
@@ -410,7 +410,7 @@ namespace rgw {
     const std::string& bucket_name() const {
       if (is_root())
        return root_name;
-      if (flags & FLAG_BUCKET)
+      if (is_bucket())
        return name;
       return bucket->object_name();
     }
@@ -506,7 +506,7 @@ namespace rgw {
 
     int open(uint32_t gsh_flags) {
       lock_guard guard(mtx);
-      if (! (flags & FLAG_OPEN)) {
+      if (! is_open()) {
        if (gsh_flags & RGW_OPEN_FLAG_V3) {
          flags |= FLAG_STATELESS_OPEN;
        }