Home | History | Annotate | Download | only in engines

Lines Matching refs:rbd

2  * rbd engine
8 #include <rbd/librbd.h>
38 .lname = "rbd engine rbdname",
40 .help = "RBD name for RBD engine",
47 .lname = "rbd engine pool",
49 .help = "Name of the pool hosting the RBD for the RBD engine",
56 .lname = "rbd engine clientname",
58 .help = "Name of the ceph client to access the RBD for the RBD engine",
81 struct rbd_data *rbd;
86 rbd = calloc(1, sizeof(struct rbd_data));
87 if (!rbd)
90 rbd->aio_events = calloc(td->o.iodepth, sizeof(struct io_u *));
91 if (!rbd->aio_events)
94 rbd->sort_events = calloc(td->o.iodepth, sizeof(struct io_u *));
95 if (!rbd->sort_events)
98 *rbd_data_ptr = rbd;
102 if (rbd)
103 free(rbd);
110 struct rbd_data *rbd = td->io_ops->data;
114 r = rados_create(&rbd->cluster, o->client_name);
120 r = rados_conf_read_file(rbd->cluster, NULL);
126 r = rados_connect(rbd->cluster);
132 r = rados_ioctx_create(rbd->cluster, o->pool_name, &rbd->io_ctx);
138 r = rbd_open(rbd->io_ctx, o->rbd_name, &rbd->image, NULL /*snap */ );
146 rados_ioctx_destroy(rbd->io_ctx);
147 rbd->io_ctx = NULL;
149 rados_shutdown(rbd->cluster);
150 rbd->cluster = NULL;
155 static void _fio_rbd_disconnect(struct rbd_data *rbd)
157 if (!rbd)
161 if (rbd->image) {
162 rbd_close(rbd->image);
163 rbd->image = NULL;
166 if (rbd->io_ctx) {
167 rados_ioctx_destroy(rbd->io_ctx);
168 rbd->io_ctx = NULL;
171 if (rbd->cluster) {
172 rados_shutdown(rbd->cluster);
173 rbd->cluster = NULL;
200 struct rbd_data *rbd = td->io_ops->data;
202 return rbd->aio_events[event];
205 static inline int fri_check_complete(struct rbd_data *rbd, struct io_u *io_u,
212 rbd->aio_events[*events] = io_u;
256 struct rbd_data *rbd = td->io_ops->data;
268 if (fri_check_complete(rbd, io_u, events))
271 rbd->sort_events[sidx++] = io_u;
283 qsort(rbd->sort_events, sidx, sizeof(struct io_u *), rbd_io_u_cmp);
286 io_u = rbd->sort_events[i];
288 if (fri_check_complete(rbd, io_u, events)) {
302 if (fri_check_complete(rbd, io_u, events))
335 struct rbd_data *rbd = td->io_ops->data;
352 r = rbd_aio_write(rbd->image, io_u->offset, io_u->xfer_buflen,
360 r = rbd_aio_read(rbd->image, io_u->offset, io_u->xfer_buflen,
368 r = rbd_aio_discard(rbd->image, io_u->offset,
375 r = rbd_aio_flush(rbd->image, fri->completion);
413 struct rbd_data *rbd = td->io_ops->data;
415 if (rbd) {
416 _fio_rbd_disconnect(rbd);
417 free(rbd->aio_events);
418 free(rbd->sort_events);
419 free(rbd);
427 struct rbd_data *rbd = NULL;
433 log_info("rbd engine: RBD version: %d.%d.%d\n", major, minor, extra);
436 r = _fio_setup_rbd_data(td, &rbd);
441 td->io_ops->data = rbd;
460 r = rbd_stat(rbd->image, &info, sizeof(info));
465 dprint(FD_IO, "rbd-engine: image size: %lu\n", info.size);
469 * The size of the RBD is set instead of a artificial file.
472 add_file(td, td->o.filename ? : "rbd", 0, 0);
480 * the size of the RBD.
482 _fio_rbd_disconnect(rbd);
486 _fio_rbd_disconnect(rbd);
500 struct rbd_data *rbd = td->io_ops->data;
502 return rbd_invalidate_cache(rbd->image);
529 .name = "rbd",