From: Pritha Srivastava Date: Mon, 20 Mar 2017 06:11:48 +0000 (+0530) Subject: rgw: Added code to correctly account for bytes sent/ received during a 'PUT' operation. X-Git-Tag: v12.0.2~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85735c972f5db1a110f55e01a4f6249202152553;p=ceph.git rgw: Added code to correctly account for bytes sent/ received during a 'PUT' operation. 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 --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index c3c44fa4d04b..3a997a369098 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -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) {