Skip to content

Commit

Permalink
osd/PrimaryLogPG: add custom operation version do_proxy_(write|read)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgy217 committed Jan 17, 2024
1 parent 05c5764 commit f960216
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/osd/PrimaryLogPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,11 @@ void PrimaryLogPG::do_proxy_read(OpRequestRef op, ObjectContextRef obc, bool sel
// NOTE: non-const here because the ProxyReadOp needs mutable refs to
// stash the result in the request's OSDOp vector
MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
do_proxy_read(m, op, obc, self);
}

void PrimaryLogPG::do_proxy_read(MOSDOp *m, OpRequestRef op, ObjectContextRef obc, bool self)
{
object_locator_t oloc;
hobject_t soid;
/* extensible tier */
Expand Down Expand Up @@ -3276,6 +3281,11 @@ void PrimaryLogPG::do_proxy_write(OpRequestRef op, ObjectContextRef obc, bool se
{
// NOTE: non-const because ProxyWriteOp takes a mutable ref
MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
do_proxy_write(m, op, obc, self, false);
}

void PrimaryLogPG::do_proxy_write(MOSDOp *m, OpRequestRef op, ObjectContextRef obc, bool self, bool is_custom_op)
{
object_locator_t oloc;
SnapContext snapc(m->get_snap_seq(), m->get_snaps());
hobject_t soid;
Expand Down Expand Up @@ -3325,6 +3335,7 @@ void PrimaryLogPG::do_proxy_write(OpRequestRef op, ObjectContextRef obc, bool se
ProxyWriteOpRef pwop(std::make_shared<ProxyWriteOp>(op, soid, m->ops, m->get_reqid()));
pwop->ctx = new OpContext(op, m->get_reqid(), &pwop->ops, this);
pwop->mtime = m->get_mtime();
pwop->sent_reply = is_custom_op;

ObjectOperation obj_op;
obj_op.dup(pwop->ops);
Expand Down
2 changes: 2 additions & 0 deletions src/osd/PrimaryLogPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,7 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
map<ceph_tid_t, ProxyReadOpRef> proxyread_ops;

void do_proxy_read(OpRequestRef op, ObjectContextRef obc = NULL, bool self = false);
void do_proxy_read(MOSDOp *m, OpRequestRef op, ObjectContextRef obc = NULL, bool self = false);
void finish_proxy_read(hobject_t oid, ceph_tid_t tid, int r);
void cancel_proxy_read(ProxyReadOpRef prdop, vector<ceph_tid_t> *tids);

Expand All @@ -1475,6 +1476,7 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
map<ceph_tid_t, ProxyWriteOpRef> proxywrite_ops;

void do_proxy_write(OpRequestRef op, ObjectContextRef obc = NULL, bool self = false);
void do_proxy_write(MOSDOp *m, OpRequestRef op, ObjectContextRef obc = NULL, bool self = false, bool is_custom_op = true);
void finish_proxy_write(hobject_t oid, ceph_tid_t tid, int r);
void cancel_proxy_write(ProxyWriteOpRef pwop, vector<ceph_tid_t> *tids);

Expand Down

0 comments on commit f960216

Please sign in to comment.