From a967e401983806f977c6aa0dac262fbebd37af7e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 17 Sep 2019 22:22:02 +0800 Subject: [PATCH] crimson/osd/OpsExecuter: s/do_osd_op/execute_osd_op/ will add execute_pg_op() for performing pg specific ops, which do not need the object state. Signed-off-by: Kefu Chai --- src/crimson/osd/objclass.cc | 34 ++++++++++++++++----------------- src/crimson/osd/ops_executer.cc | 2 +- src/crimson/osd/ops_executer.h | 2 +- src/crimson/osd/pg.cc | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/crimson/osd/objclass.cc b/src/crimson/osd/objclass.cc index f191013a46a..e95c3896737 100644 --- a/src/crimson/osd/objclass.cc +++ b/src/crimson/osd/objclass.cc @@ -70,7 +70,7 @@ int cls_cxx_create(cls_method_context_t hctx, const bool exclusive) OSDOp op{CEPH_OSD_OP_CREATE}; op.op.flags = (exclusive ? CEPH_OSD_OP_FLAG_EXCL : 0); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -83,7 +83,7 @@ int cls_cxx_remove(cls_method_context_t hctx) // we're blocking here which presumes execution in Seastar's thread. try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -96,7 +96,7 @@ int cls_cxx_stat(cls_method_context_t hctx, uint64_t *size, time_t *mtime) // we're blocking here which presumes execution in Seastar's thread. try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); } catch (ceph::osd::error& e) { return -e.code().value(); } @@ -137,7 +137,7 @@ int cls_cxx_read2(cls_method_context_t hctx, op.op.extent.length = len; op.op.flags = op_flags; try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); } catch (ceph::osd::error& e) { return -e.code().value(); } @@ -157,7 +157,7 @@ int cls_cxx_write2(cls_method_context_t hctx, op.op.flags = op_flags; op.indata = *inbl; try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -171,7 +171,7 @@ int cls_cxx_write_full(cls_method_context_t hctx, bufferlist * const inbl) op.op.extent.length = inbl->length(); op.indata = *inbl; try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -188,7 +188,7 @@ int cls_cxx_replace(cls_method_context_t hctx, top.op.extent.offset = 0; top.op.extent.length = 0; try { - reinterpret_cast(hctx)->do_osd_op(top).get(); + reinterpret_cast(hctx)->execute_osd_op(top).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -202,7 +202,7 @@ int cls_cxx_replace(cls_method_context_t hctx, wop.indata = *inbl; try { - reinterpret_cast(hctx)->do_osd_op(wop).get(); + reinterpret_cast(hctx)->execute_osd_op(wop).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -216,7 +216,7 @@ int cls_cxx_truncate(cls_method_context_t hctx, int ofs) op.op.extent.offset = ofs; op.op.extent.length = 0; try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -231,7 +231,7 @@ int cls_cxx_getxattr(cls_method_context_t hctx, op.op.xattr.name_len = strlen(name); op.indata.append(name, op.op.xattr.name_len); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); outbl->claim(op.outdata); return outbl->length(); } catch (ceph::osd::error& e) { @@ -255,7 +255,7 @@ int cls_cxx_setxattr(cls_method_context_t hctx, op.indata.append(name, op.op.xattr.name_len); op.indata.append(*inbl); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -267,7 +267,7 @@ int cls_cxx_snap_revert(cls_method_context_t hctx, snapid_t snapid) OSDOp op{op = CEPH_OSD_OP_ROLLBACK}; op.op.snap.snapid = snapid; try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -291,7 +291,7 @@ int cls_cxx_map_get_keys(cls_method_context_t hctx, encode(start_obj, op.indata); encode(max_to_get, op.indata); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); } catch (ceph::osd::error& e) { return -e.code().value(); } @@ -317,7 +317,7 @@ int cls_cxx_map_get_vals(cls_method_context_t hctx, encode(max_to_get, op.indata); encode(filter_prefix, op.indata); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); } catch (ceph::osd::error& e) { return -e.code().value(); } @@ -346,7 +346,7 @@ int cls_cxx_map_get_val(cls_method_context_t hctx, encode(k, op.indata); } try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); } catch (ceph::osd::error& e) { return -e.code().value(); } @@ -377,7 +377,7 @@ int cls_cxx_map_set_val(cls_method_context_t hctx, } try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); @@ -391,7 +391,7 @@ int cls_cxx_map_set_vals(cls_method_context_t hctx, encode(*map, op.indata); try { - reinterpret_cast(hctx)->do_osd_op(op).get(); + reinterpret_cast(hctx)->execute_osd_op(op).get(); return 0; } catch (ceph::osd::error& e) { return -e.code().value(); diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index 105f4fbcd6a..cd455cdd9d2 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -341,7 +341,7 @@ static seastar::future<> do_pgnls_filtered( } seastar::future<> -OpsExecuter::do_osd_op(OSDOp& osd_op) +OpsExecuter::execute_osd_op(OSDOp& osd_op) { // TODO: dispatch via call table? // TODO: we might want to find a way to unify both input and output diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index 295cefebc9c..fbd376a738f 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -104,7 +104,7 @@ public: msg(std::move(msg)) { } - seastar::future<> do_osd_op(class OSDOp& osd_op); + seastar::future<> execute_osd_op(class OSDOp& osd_op); template seastar::future<> submit_changes(Func&& f) &&; diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 245a81cb217..33ffb32a0ba 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -362,7 +362,7 @@ seastar::future> PG::do_osd_ops(Ref m) [this, m] (auto& ox) { return seastar::do_for_each(m->ops, [this, &ox](OSDOp& osd_op) { logger().debug("will be handling op {}", ceph_osd_op_name(osd_op.op.op)); - return ox.do_osd_op(osd_op); + return ox.execute_osd_op(osd_op); }).then([this, m, &ox] { logger().debug("all operations have been executed successfully"); return std::move(ox).submit_changes([this, m] (auto&& txn, auto&& os) { -- 2.39.5