mirror of
https://github.com/ceph/ceph
synced 2025-01-31 07:22:56 +00:00
rados: rename rdcall to call
This commit is contained in:
parent
a1b134ad2c
commit
c8b162fb94
@ -220,7 +220,7 @@ enum {
|
||||
CEPH_OSD_OP_DNLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 6,
|
||||
|
||||
/** exec **/
|
||||
CEPH_OSD_OP_RDCALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1,
|
||||
CEPH_OSD_OP_CALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1,
|
||||
CEPH_OSD_OP_WRCALL = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_EXEC | 1,
|
||||
|
||||
/** pg **/
|
||||
@ -300,7 +300,7 @@ static inline const char *ceph_osd_op_name(int op)
|
||||
case CEPH_OSD_OP_UPLOCK: return "uplock";
|
||||
case CEPH_OSD_OP_DNLOCK: return "dnlock";
|
||||
|
||||
case CEPH_OSD_OP_RDCALL: return "rdcall";
|
||||
case CEPH_OSD_OP_CALL: return "call";
|
||||
case CEPH_OSD_OP_WRCALL: return "wrcall";
|
||||
|
||||
case CEPH_OSD_OP_PGLS: return "pgls";
|
||||
|
@ -593,7 +593,7 @@ int RadosClient::exec(PoolCtx& pool, const object_t& oid, const char *cls, const
|
||||
lock.Lock();
|
||||
ceph_object_layout layout = objecter->osdmap->make_object_layout(oid, pool.poolid);
|
||||
ObjectRead rd;
|
||||
rd.rdcall(cls, method, inbl);
|
||||
rd.call(cls, method, inbl);
|
||||
objecter->read(oid, layout, rd, pool.snap_seq, &outbl, 0, onack);
|
||||
lock.Unlock();
|
||||
|
||||
@ -602,7 +602,7 @@ int RadosClient::exec(PoolCtx& pool, const object_t& oid, const char *cls, const
|
||||
cond.Wait(mylock);
|
||||
mylock.Unlock();
|
||||
|
||||
dout(0) << "after rdcall got " << outbl.length() << " bytes" << dendl;
|
||||
dout(0) << "after call got " << outbl.length() << " bytes" << dendl;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ int cls_unregister_method(cls_method_handle_t handle)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cls_rdcall(cls_method_context_t hctx, const char *cls, const char *method,
|
||||
int cls_call(cls_method_context_t hctx, const char *cls, const char *method,
|
||||
char *indata, int datalen,
|
||||
char **outdata, int *outdatalen)
|
||||
{
|
||||
@ -97,7 +97,7 @@ int cls_rdcall(cls_method_context_t hctx, const char *cls, const char *method,
|
||||
OSDOp& op = nops[0];
|
||||
int r;
|
||||
|
||||
op.op.op = CEPH_OSD_OP_RDCALL;
|
||||
op.op.op = CEPH_OSD_OP_CALL;
|
||||
op.op.class_len = strlen(cls);
|
||||
op.op.method_len = strlen(method);
|
||||
op.op.indata_len = datalen;
|
||||
|
@ -36,7 +36,7 @@ extern void cls_free(void *p);
|
||||
|
||||
extern int cls_read(cls_method_context_t hctx, int ofs, int len,
|
||||
char **outdata, int *outdatalen);
|
||||
extern int cls_rdcall(cls_method_context_t hctx, const char *cls, const char *method,
|
||||
extern int cls_call(cls_method_context_t hctx, const char *cls, const char *method,
|
||||
char *indata, int datalen,
|
||||
char **outdata, int *outdatalen);
|
||||
extern int cls_getxattr(cls_method_context_t hctx, const char *name,
|
||||
|
@ -3911,7 +3911,7 @@ void OSD::init_op_flags(MOSDOp *op)
|
||||
|
||||
for (iter = op->ops.begin(); iter != op->ops.end(); ++iter) {
|
||||
switch (iter->op.op) {
|
||||
case CEPH_OSD_OP_RDCALL:
|
||||
case CEPH_OSD_OP_CALL:
|
||||
{
|
||||
bufferlist::iterator bp = iter->data.begin();
|
||||
int is_write, is_read;
|
||||
|
@ -834,7 +834,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
|
||||
bufferlist::iterator bp = osd_op.data.begin();
|
||||
|
||||
switch (op.op) {
|
||||
case CEPH_OSD_OP_RDCALL:
|
||||
case CEPH_OSD_OP_CALL:
|
||||
bp.copy(op.class_len, cname);
|
||||
bp.copy(op.method_len, mname);
|
||||
is_modify = osd->class_handler->get_method_flags(cname, mname) & CLS_METHOD_WR;
|
||||
@ -891,28 +891,27 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
|
||||
}
|
||||
break;
|
||||
|
||||
case CEPH_OSD_OP_RDCALL:
|
||||
case CEPH_OSD_OP_CALL:
|
||||
{
|
||||
bufferlist indata;
|
||||
bp.copy(op.indata_len, indata);
|
||||
//dout(20) << "rdcall param=" << indata.c_str() << dendl;
|
||||
|
||||
ClassHandler::ClassData *cls;
|
||||
ClassVersion version;
|
||||
version.set_arch(get_arch());
|
||||
result = osd->get_class(cname, version, info.pgid, ctx->op, &cls);
|
||||
if (result) {
|
||||
dout(10) << "rdcall class " << cname << " does not exist" << dendl;
|
||||
dout(10) << "call class " << cname << " does not exist" << dendl;
|
||||
if (result == -EAGAIN)
|
||||
return result;
|
||||
} else {
|
||||
bufferlist outdata;
|
||||
ClassHandler::ClassMethod *method = cls->get_method(mname.c_str());
|
||||
if (!method) {
|
||||
dout(10) << "rdcall method " << cname << "." << mname << " does not exist" << dendl;
|
||||
dout(10) << "call method " << cname << "." << mname << " does not exist" << dendl;
|
||||
result = -EINVAL;
|
||||
} else {
|
||||
dout(10) << "rdcall method " << cname << "." << mname << dendl;
|
||||
dout(10) << "call method " << cname << "." << mname << dendl;
|
||||
result = method->exec((cls_method_context_t)&ctx, indata, outdata);
|
||||
op.length = outdata.length();
|
||||
odata.claim_append(outdata);
|
||||
|
@ -97,8 +97,8 @@ struct ObjectRead : public ObjectOperation {
|
||||
add_xattr(CEPH_OSD_OP_GETXATTRS, 0, bl);
|
||||
}
|
||||
|
||||
void rdcall(const char *cname, const char *method, bufferlist &indata) {
|
||||
add_call(CEPH_OSD_OP_RDCALL, cname, method, indata);
|
||||
void call(const char *cname, const char *method, bufferlist &indata) {
|
||||
add_call(CEPH_OSD_OP_CALL, cname, method, indata);
|
||||
}
|
||||
|
||||
void pg_ls(__u64 count, __u64 cookie) {
|
||||
|
@ -33,7 +33,7 @@ int foo_method(cls_method_context_t ctx, char *indata, int datalen,
|
||||
*outdatalen = strlen(*outdata) + 1;
|
||||
cls_log("outdata=%s", *outdata);
|
||||
|
||||
r = cls_rdcall(ctx, "foo", "foo", *outdata, *outdatalen, outdata, outdatalen);
|
||||
r = cls_call(ctx, "foo", "foo", *outdata, *outdatalen, outdata, outdatalen);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user