]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Added code to correctly account for bytes sent/ received during a 'PUT' operation. 14042/head
authorPritha Srivastava <prsrivas@redhat.com>
Mon, 20 Mar 2017 06:11:48 +0000 (11:41 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 20 Mar 2017 06:11:48 +0000 (11:41 +0530)
Currently, the bytes sent/ received are both set to zero after
an object is uploaded to a bucket. Added code to correct the logic.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_rest.cc

index c3c44fa4d04bf854238c9b43174b319067541c16..3a997a369098a521c44b35d8ac7a3087a64545d1 100644 (file)
@@ -1192,6 +1192,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
 
   int len = 0;
   if (cl) {
+    ACCOUNTING_IO(s)->set_account(true);
     bufferptr bp(cl);
 
     const auto read_len  = recv_body(s, bp.c_str(), cl);
@@ -1222,7 +1223,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
         bl.rebuild();
       }
     }
-
+    ACCOUNTING_IO(s)->set_account(false);
   }
 
   if ((uint64_t)ofs + len > s->cct->_conf->rgw_max_put_size) {