Skip to content

Commit

Permalink
osd: pass in data to do_command
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
Sage Weil authored and liewegas committed Feb 24, 2012
1 parent c9416e6 commit 0361a3c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
r = -ENOENT;
} else {
cmd.erase(cmd.begin(), cmd.begin() + 2);
r = pg->do_command(cmd, ss, odata);
r = pg->do_command(cmd, ss, data, odata);
}
pg->unlock();
}
Expand Down
3 changes: 2 additions & 1 deletion src/osd/PG.h
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,8 @@ class PG {
virtual void do_backfill(OpRequest *op) = 0;
virtual bool snap_trimmer() = 0;

virtual int do_command(vector<string>& cmd, ostream& ss, bufferlist& data) = 0;
virtual int do_command(vector<string>& cmd, ostream& ss,
bufferlist& idata, bufferlist& odata) = 0;

virtual bool same_for_read_since(epoch_t e) = 0;
virtual bool same_for_modify_since(epoch_t e) = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ int ReplicatedPG::get_pgls_filter(bufferlist::iterator& iter, PGLSFilter **pfilt

// ==========================================================

int ReplicatedPG::do_command(vector<string>& cmd, ostream& ss, bufferlist& data)
int ReplicatedPG::do_command(vector<string>& cmd, ostream& ss,
bufferlist& idata, bufferlist& odata)
{
if (cmd.size() && cmd[0] == "query") {
JSONFormatter jsf(true);
Expand All @@ -271,7 +272,7 @@ int ReplicatedPG::do_command(vector<string>& cmd, ostream& ss, bufferlist& data)
jsf.close_section();
stringstream dss;
jsf.flush(dss);
data.append(dss);
odata.append(dss);
return 0;
}
else if (cmd.size() > 1 &&
Expand Down
2 changes: 1 addition & 1 deletion src/osd/ReplicatedPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ class ReplicatedPG : public PG {
ReplicatedPG(OSD *o, PGPool *_pool, pg_t p, const hobject_t& oid, const hobject_t& ioid);
~ReplicatedPG() {}

int do_command(vector<string>& cmd, ostream& ss, bufferlist& data);
int do_command(vector<string>& cmd, ostream& ss, bufferlist& idata, bufferlist& odata);

void do_op(OpRequest *op);
bool pg_op_must_wait(MOSDOp *op);
Expand Down

0 comments on commit 0361a3c

Please sign in to comment.