| 98 | } |
| 99 | |
| 100 | static int cls_queue_remove_entries(cls_method_context_t hctx, bufferlist *in, bufferlist *out) |
| 101 | { |
| 102 | auto in_iter = in->cbegin(); |
| 103 | cls_queue_remove_op op; |
| 104 | try { |
| 105 | decode(op, in_iter); |
| 106 | } catch (ceph::buffer::error& err) { |
| 107 | CLS_LOG(5, "ERROR: cls_queue_remove_entries: failed to decode input data\n"); |
| 108 | return -EINVAL; |
| 109 | } |
| 110 | |
| 111 | cls_queue_head head; |
| 112 | auto ret = queue_read_head(hctx, head); |
| 113 | if (ret < 0) { |
| 114 | return ret; |
| 115 | } |
| 116 | ret = queue_remove_entries(hctx, op, head); |
| 117 | if (ret < 0) { |
| 118 | return ret; |
| 119 | } |
| 120 | return queue_write_head(hctx, head); |
| 121 | } |
| 122 | |
| 123 | CLS_INIT(queue) |
| 124 | { |