X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fdev-dax.c;h=1d0f66cb1aba7ad57069cd742f93fb3783da567f;hb=25425cb4a5531b1b3f26eba4e49866d944e0f1fb;hp=0660bba563e6a4a522ba5ace408b78ffe4744e3c;hpb=2e4ef4fbd69eb6d4c07f2f362463e3f3df2e808c;p=fio.git diff --git a/engines/dev-dax.c b/engines/dev-dax.c index 0660bba5..1d0f66cb 100644 --- a/engines/dev-dax.c +++ b/engines/dev-dax.c @@ -259,7 +259,7 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f) { char spath[PATH_MAX]; char npath[PATH_MAX]; - char *rpath; + char *rpath, *basename; FILE *sfile; uint64_t size; struct stat st; @@ -289,7 +289,8 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f) } /* check if DAX device */ - if (strcmp("/sys/class/dax", rpath)) { + basename = strrchr(rpath, '/'); + if (!basename || strcmp("dax", basename+1)) { log_err("%s: %s not a DAX device!\n", td->o.name, f->file_name); } @@ -327,7 +328,7 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f) return 0; } -static struct ioengine_ops ioengine = { +FIO_STATIC struct ioengine_ops ioengine = { .name = "dev-dax", .version = FIO_IOOPS_VERSION, .init = fio_devdax_init,