]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fixes following rebase
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 2 Feb 2018 00:18:38 +0000 (16:18 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 12 Apr 2018 22:38:39 +0000 (15:38 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 63438c0b87fe285a00d9a66358873f2780bb1a02..851a97f8a283b99694766540ba95a3aa61ce04b4 100644 (file)
@@ -7362,6 +7362,7 @@ class RGWRadosPutObj : public RGWHTTPStreamRWRequest::ReceiveCB
   uint64_t data_len;
   map<string, bufferlist> src_attrs;
   off_t ofs{0};
+  off_t lofs{0}; /* logical ofs */
 public:
   RGWRadosPutObj(CephContext* cct,
                  CompressorRef& plugin,
@@ -7405,7 +7406,7 @@ public:
 
   int handle_data(bufferlist& bl, bool *pause) override {
     if (progress_cb) {
-      progress_cb(ofs, progress_data);
+      progress_cb(lofs, progress_data);
     }
     if (extra_data_left) {
       size_t extra_len = bl.length();
@@ -7422,15 +7423,15 @@ public:
         if (res < 0)
           return res;
       }
+      ofs += extra_len;
       if (bl.length() == 0) {
         return 0;
       }
-      ofs += extra_len;
     }
-    // adjust ofs based on extra_data_len, so the result is a logical offset
-    // into the object data
+
     assert(uint64_t(ofs) >= extra_data_len);
-    ofs -= extra_data_len;
+
+    lofs = ofs - extra_data_len;
 
     data_len += bl.length();
     bool again = false;
@@ -7441,7 +7442,7 @@ public:
       void *handle = NULL;
       rgw_raw_obj obj;
       uint64_t size = bl.length();
-      int ret = filter->handle_data(bl, ofs, &handle, &obj, &again);
+      int ret = filter->handle_data(bl, lofs, &handle, &obj, &again);
       if (ret < 0)
         return ret;