| 71 | } |
| 72 | |
| 73 | static int cls_queue_list_entries(cls_method_context_t hctx, bufferlist *in, bufferlist *out) |
| 74 | { |
| 75 | auto in_iter = in->cbegin(); |
| 76 | cls_queue_list_op op; |
| 77 | try { |
| 78 | decode(op, in_iter); |
| 79 | } catch (ceph::buffer::error& err) { |
| 80 | CLS_LOG(5, "ERROR: cls_queue_list_entries(): failed to decode input data\n"); |
| 81 | return -EINVAL; |
| 82 | } |
| 83 | |
| 84 | cls_queue_head head; |
| 85 | auto ret = queue_read_head(hctx, head); |
| 86 | if (ret < 0) { |
| 87 | return ret; |
| 88 | } |
| 89 | |
| 90 | cls_queue_list_ret op_ret; |
| 91 | ret = queue_list_entries(hctx, op, op_ret, head); |
| 92 | if (ret < 0) { |
| 93 | return ret; |
| 94 | } |
| 95 | |
| 96 | encode(op_ret, *out); |
| 97 | return 0; |
| 98 | } |
| 99 | |
| 100 | static int cls_queue_remove_entries(cls_method_context_t hctx, bufferlist *in, bufferlist *out) |
| 101 | { |