* Currently the return code and return bufferlist are not wrapped in a * protocol that allows object class vs Lua to be distinguished. For * instance, -EOPNOTSUPP might refer to cls_lua not being found, but would * also be returned when cls_lua is found, but a Lua handler is not found. */
| 20 | * also be returned when cls_lua is found, but a Lua handler is not found. |
| 21 | */ |
| 22 | int exec(IoCtx& ioctx, const string& oid, const string& script, |
| 23 | const string& handler, bufferlist& input, bufferlist& output) |
| 24 | { |
| 25 | cls_lua_eval_op op; |
| 26 | |
| 27 | op.script = script; |
| 28 | op.handler = handler; |
| 29 | op.input = input; |
| 30 | |
| 31 | bufferlist inbl; |
| 32 | encode(op, inbl); |
| 33 | |
| 34 | librados::ObjectWriteOperation wop; |
| 35 | int rval; |
| 36 | wop.exec(method::eval_bufferlist, inbl, &output, &rval); |
| 37 | return ioctx.operate(oid, &wop); |
| 38 | } |
| 39 | } |