char *client_name = NULL;
/*
- * If we specify cluser name, the rados_create2
+ * If we specify cluster name, the rados_create2
* will not assume 'client.'. name is considered
* as a full type.id namestr
*/
goto failed_shutdown;
}
+ if (td->o.odirect) {
+ r = rados_conf_set(rbd->cluster, "rbd_cache", "false");
+ if (r < 0) {
+ log_info("failed to disable RBD in-memory cache\n");
+ }
+ }
+
r = rbd_open(rbd->io_ctx, o->rbd_name, &rbd->image, NULL /*snap */ );
if (r < 0) {
log_err("rbd_open failed.\n");
goto failed_open;
}
+ if (!td->o.odirect) {
+ /*
+ * ensure cache enables writeback/around mode unless explicitly
+ * configured for writethrough mode
+ */
+ r = rbd_flush(rbd->image);
+ if (r < 0) {
+ log_info("rbd: failed to issue initial flush\n");
+ }
+ }
+
if (!_fio_rbd_setup_poll(rbd))
goto failed_poll;
/* taken from "net" engine. Pretend we deal with files,
* even if we do not have any ideas about files.
- * The size of the RBD is set instead of a artificial file.
+ * The size of the RBD is set instead of an artificial file.
*/
if (!td->files_index) {
add_file(td, td->o.filename ? : "rbd", 0, 0);
return 0;
}
-static struct ioengine_ops ioengine = {
+FIO_STATIC struct ioengine_ops ioengine = {
.name = "rbd",
.version = FIO_IOOPS_VERSION,
.setup = fio_rbd_setup,