From: Matt Benjamin Date: Thu, 6 Jul 2017 15:59:05 +0000 (-0400) Subject: rgw_file: compression fix and cleanup from review X-Git-Tag: v12.1.1~83^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d064915aa56aaa945b69af55877c7ac4f01d93a5;p=ceph.git rgw_file: compression fix and cleanup from review A fix and a cleanup from Adam Kupczyk review. Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 89d53f7dfb92..2e7e9d02f1d4 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -1258,6 +1258,10 @@ namespace rgw { int RGWWriteRequest::exec_start() { struct req_state* s = get_state(); + auto compression_type = + get_store()->get_zone_params().get_compression_type( + s->bucket_info.placement_rule); + /* not obviously supportable */ assert(! dlo_manifest); assert(! slo_info); @@ -1293,10 +1297,6 @@ namespace rgw { } filter = processor; - - if (compression_type == "none") - compression_type = get_store()->get_zone_params().get_compression_type( - s->bucket_info.placement_rule); if (compression_type != "none") { plugin = Compressor::create(s->cct, compression_type); if (! plugin) { @@ -1371,7 +1371,7 @@ namespace rgw { filter = &*compressor; } - op_ret = put_data_and_throttle(processor, data, ofs, false); + op_ret = put_data_and_throttle(filter, data, ofs, false); if (op_ret < 0) { goto done; } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 9a07d8340bbe..3a1cc00af415 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -2190,7 +2190,6 @@ public: RGWPutObjProcessor* processor; RGWPutObjDataProcessor* filter; boost::optional compressor; - std::string compression_type = "none"; CompressorRef plugin; buffer::list data; uint64_t timer_id;