From: Matt Benjamin Date: Sun, 17 Jan 2016 21:46:05 +0000 (-0500) Subject: librgw: cleanup rgw_write X-Git-Tag: v10.1.0~382^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8aa4378106a3c7e22c89223b29479ca20dbebc62;p=ceph.git librgw: cleanup rgw_write Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index a4060a7f9209..f168faac28e5 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -405,9 +405,6 @@ namespace rgw { lock_guard guard(mtx); int rc = 0; - buffer::list bl; - bl.push_back( - buffer::create_static(len, static_cast(buffer))); file* f = get(&variant_type); if (! f) @@ -422,6 +419,10 @@ namespace rgw { rc = rgwlib.get_fe()->start_req(f->write_req); } + buffer::list bl; + bl.push_back( + buffer::create_static(len, static_cast(buffer))); + f->write_req->put_data(off, bl); rc = f->write_req->exec_continue(); @@ -1142,6 +1143,8 @@ int rgw_write(struct rgw_fs *rgw_fs, RGWFileHandle* rgw_fh = get_rgwfh(fh); int rc; + *bytes_written = 0; + if (! rgw_fh->is_file()) return -EISDIR; @@ -1160,11 +1163,6 @@ int rgw_write(struct rgw_fs *rgw_fs, << " rc " << rc << std::endl; - std::string str; - str.reserve(length+1); - str.assign(static_cast(buffer), uint32_t(length)); - str += '\0'; - return rc; }