* libhdfs engine
*
* this engine helps perform read/write operations on hdfs cluster using
- * libhdfs. hdfs doesnot support modification of data once file is created.
+ * libhdfs. hdfs does not support modification of data once file is created.
*
* so to mimic that create many files of small size (e.g 256k), and this
* engine select a file based on the offset generated by fio.
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct hdfsio_options, directory),
.def = "/",
- .help = "The HDFS directory where fio will create chuncks",
+ .help = "The HDFS directory where fio will create chunks",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_HDFS,
},
.type = FIO_OPT_INT,
.off1 = offsetof(struct hdfsio_options, chunck_size),
.def = "1048576",
- .help = "Size of individual chunck",
+ .help = "Size of individual chunk",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_HDFS,
},
return 0;
}
-static enum fio_q_status
-fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_hdfsio_queue(struct thread_data *td,
+ struct io_u *io_u)
{
struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
if( (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_WRITE) &&
hdfsTell(hd->fs, hd->fp) != offset && hdfsSeek(hd->fs, hd->fp, offset) != 0 ) {
- log_err("hdfs: seek failed: %s, are you doing random write smaller than chunck size ?\n", strerror(errno));
+ log_err("hdfs: seek failed: %s, are you doing random write smaller than chunk size ?\n", strerror(errno));
io_u->error = errno;
return FIO_Q_COMPLETED;
};
return 0;
}
-static int fio_hdfsio_init(struct thread_data *td)
+static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
{
struct hdfsio_options *options = td->eo;
struct hdfsio_data *hd = td->io_ops_data;
}
f->real_file_size = file_size;
}
- /* If the size doesn't divide nicely with the chunck size,
+ /* If the size doesn't divide nicely with the chunk size,
* make the last files bigger.
- * Used only if filesize was not explicitely given
+ * Used only if filesize was not explicitly given
*/
if (!td->o.file_size_low && total_file_size < td->o.size) {
f->real_file_size += (td->o.size - total_file_size);
return 0;
}
-static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
+static int fio_hdfsio_init(struct thread_data *td)
{
struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
}
hd->fs = hdfsBuilderConnect(bld);
- /* hdfsSetWorkingDirectory succeed on non existend directory */
+ /* hdfsSetWorkingDirectory succeed on non-existent directory */
if (hdfsExists(hd->fs, options->directory) < 0 || hdfsSetWorkingDirectory(hd->fs, options->directory) < 0) {
failure = errno;
log_err("hdfs: invalid working directory %s: %s\n", options->directory, strerror(errno));
}
}
-static struct ioengine_ops ioengine_hdfs = {
+FIO_STATIC struct ioengine_ops ioengine = {
.name = "libhdfs",
.version = FIO_IOOPS_VERSION,
.flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_NODISKUTIL,
static void fio_init fio_hdfsio_register(void)
{
- register_ioengine(&ioengine_hdfs);
+ register_ioengine(&ioengine);
}
static void fio_exit fio_hdfsio_unregister(void)
{
- unregister_ioengine(&ioengine_hdfs);
+ unregister_ioengine(&ioengine);
}