]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: do not splice osd_op indata
authorXuehan Xu <xxhdx1985126@gmail.com>
Tue, 29 Dec 2020 04:06:43 +0000 (12:06 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Tue, 29 Dec 2020 04:06:43 +0000 (12:06 +0800)
As each osd_op's indata holds only its own data, there's no need to drop their it.
On the other hand, indata is still needed when osd_op needs to be redone in case of
acting set change.

Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/osd/pg_backend.cc

index 4ba0a403ed1cfb1e17a815f9a426fe9759412830..558fc7dba0b7f2dc049387dcbd03f6a4bd5e705c 100644 (file)
@@ -760,7 +760,6 @@ seastar::future<> PGBackend::setxattr(
     auto bp = osd_op.indata.cbegin();
     bp.copy(osd_op.op.xattr.name_len, name);
     bp.copy(osd_op.op.xattr.value_len, val);
-    osd_op.indata.splice(0, bp.get_off());
   }
   logger().debug("setxattr on obj={} for attr={}", os.oi.soid, name);
 
@@ -780,7 +779,6 @@ PGBackend::get_attr_errorator::future<> PGBackend::getxattr(
     std::string aname;
     bp.copy(osd_op.op.xattr.name_len, aname);
     name = "_" + aname;
-    osd_op.indata.splice(0, bp.get_off());
   }
   logger().debug("getxattr on obj={} for attr={}", os.oi.soid, name);
   return getxattr(os.oi.soid, name).safe_then([&osd_op] (ceph::bufferptr val) {
@@ -841,7 +839,6 @@ PGBackend::rm_xattr_ertr::future<> PGBackend::rm_xattr(
   auto bp = osd_op.indata.cbegin();
   string attr_name{"_"};
   bp.copy(osd_op.op.xattr.name_len, attr_name);
-  osd_op.indata.splice(0, bp.get_off());
   txn.rmattr(coll->get_cid(), ghobject_t{os.oi.soid}, attr_name);
   return rm_xattr_ertr::now();
 }
@@ -917,7 +914,6 @@ PGBackend::omap_get_keys(
     auto p = osd_op.indata.cbegin();
     decode(start_after, p);
     decode(max_return, p);
-    osd_op.indata.splice(0, p.get_off());
   } catch (buffer::error&) {
     throw crimson::osd::invalid_argument{};
   }
@@ -975,7 +971,6 @@ PGBackend::omap_get_vals(
     decode(start_after, p);
     decode(max_return, p);
     decode(filter_prefix, p);
-    osd_op.indata.splice(0, p.get_off());
   } catch (buffer::error&) {
     throw crimson::osd::invalid_argument{};
   }
@@ -1041,7 +1036,6 @@ PGBackend::omap_get_vals_by_keys(
   try {
     auto p = osd_op.indata.cbegin();
     decode(keys_to_get, p);
-    osd_op.indata.splice(0, p.get_off());
   } catch (buffer::error&) {
     throw crimson::osd::invalid_argument();
   }
@@ -1075,7 +1069,6 @@ seastar::future<> PGBackend::omap_set_vals(
   try {
     auto p = osd_op.indata.cbegin();
     decode_str_str_map_to_bl(p, &to_set_bl);
-    osd_op.indata.splice(0, p.get_off());
   } catch (buffer::error&) {
     throw crimson::osd::invalid_argument{};
   }
@@ -1119,7 +1112,6 @@ seastar::future<> PGBackend::omap_remove_range(
     auto p = osd_op.indata.cbegin();
     decode(key_begin, p);
     decode(key_end, p);
-    osd_op.indata.splice(0, p.get_off());
   } catch (buffer::error& e) {
     throw crimson::osd::invalid_argument{};
   }