]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: compression fix and cleanup from review
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 6 Jul 2017 15:59:05 +0000 (11:59 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 11 Jul 2017 09:15:17 +0000 (05:15 -0400)
A fix and a cleanup from Adam Kupczyk <akupczyk@redhat.com> review.

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

index 89d53f7dfb92e2eae7a4ae1ed9f5585de232c01d..2e7e9d02f1d49d4342b1e301664cc1149e5d34ca 100644 (file)
@@ -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;
       }
index 9a07d8340bbe1610266f4be2f884b68a987bd0b2..3a1cc00af41599d244d4913b0a326199bacedf72 100644 (file)
@@ -2190,7 +2190,6 @@ public:
   RGWPutObjProcessor* processor;
   RGWPutObjDataProcessor* filter;
   boost::optional<RGWPutObj_Compress> compressor;
-  std::string compression_type = "none";
   CompressorRef plugin;
   buffer::list data;
   uint64_t timer_id;