From: Gui Hecheng Date: Tue, 16 May 2017 01:43:08 +0000 (+0800) Subject: rgw_file: use pre-defined calls to replace raw flag operation X-Git-Tag: v12.1.0~10^2~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf08d0060656fec48d16c4d8d4959e053e0ea3f1;p=ceph.git rgw_file: use pre-defined calls to replace raw flag operation Signed-off-by: Gui Hecheng --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 433356344e27..1666160d1a5c 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -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; }