From 075368d89a3fcb1fed2c68d569e190137bdce552 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 26 Jun 2017 15:47:38 -0400 Subject: [PATCH 1/2] rgw/rgw_op: fix indentation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home/sage/src/ceph2/src/rgw/rgw_op.cc: In member function ‘virtual void RGWDeleteObjTags::execute()’: /home/sage/src/ceph2/src/rgw/rgw_op.cc:777:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (s->object.empty()) ^~ /home/sage/src/ceph2/src/rgw/rgw_op.cc:780:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ rgw_obj obj; ^~~~~~~ Signed-off-by: Sage Weil --- src/rgw/rgw_op.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 80ef87e76c9..8138b6284e7 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -773,18 +773,19 @@ int RGWDeleteObjTags::verify_permission(){ return 0; } -void RGWDeleteObjTags::execute() { +void RGWDeleteObjTags::execute() +{ if (s->object.empty()) return; - rgw_obj obj; - obj = rgw_obj(s->bucket, s->object); - store->set_atomic(s->obj_ctx, obj); - map attrs; - map rmattr; - bufferlist bl; - rmattr[RGW_ATTR_TAGS] = bl; - op_ret = store->set_attrs(s->obj_ctx, s->bucket_info, obj, attrs, &rmattr); + rgw_obj obj; + obj = rgw_obj(s->bucket, s->object); + store->set_atomic(s->obj_ctx, obj); + map attrs; + map rmattr; + bufferlist bl; + rmattr[RGW_ATTR_TAGS] = bl; + op_ret = store->set_attrs(s->obj_ctx, s->bucket_info, obj, attrs, &rmattr); } int RGWOp::do_aws4_auth_completion() From cb57eccb41516164d0222751b83e8a03ad662a04 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 26 Jun 2017 15:48:16 -0400 Subject: [PATCH 2/2] rgw/rgw_op: fix some more whitespace Signed-off-by: Sage Weil --- src/rgw/rgw_op.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 8138b6284e7..1b216daf4fa 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -702,7 +702,8 @@ int RGWGetObjTags::verify_permission() return 0; } -void RGWGetObjTags::pre_exec(){ +void RGWGetObjTags::pre_exec() +{ rgw_bucket_object_pre_exec(s); } @@ -736,12 +737,10 @@ int RGWPutObjTags::verify_permission() void RGWPutObjTags::execute() { - op_ret = get_params(); if (op_ret < 0) return; - if (s->object.empty()){ op_ret= -EINVAL; // we only support tagging on existing objects return; @@ -756,14 +755,15 @@ void RGWPutObjTags::execute() } } -void RGWDeleteObjTags::pre_exec(){ +void RGWDeleteObjTags::pre_exec() +{ rgw_bucket_object_pre_exec(s); } -int RGWDeleteObjTags::verify_permission(){ - - if (!s->object.empty()){ +int RGWDeleteObjTags::verify_permission() +{ + if (!s->object.empty()) { if (!verify_object_permission(s, s->object.instance.empty() ? rgw::IAM::s3DeleteObjectTagging: