Commit be79373a authored by Jim Harris's avatar Jim Harris
Browse files

fio: set FIO_DISKLESSIO flag for spdk engines



This tells fio to not try to use POSIX calls on
"files" specified for an SPDK engine.

Note that w/o DISKLESSIO option set, fio would
figure out that "*" wasn't a real file.  With this
option set, we now need to explicitly set its
real_file_size to 0 to tell fio to ignore it.

Found by Karol Latecki - he noticed that when
specifying lvols in the form "lvs/lvol" that
fio would create an empty "lvs" directory.  Adding
this flag prevents things like this from happening.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I5d457631b122ba5eb480813ab9d8aa6578f38277
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17937


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 9c274912
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -619,6 +619,10 @@ spdk_fio_setup_oat(void *_ctx)
		struct spdk_bdev *bdev;

		if (strcmp(f->file_name, "*") == 0) {
			/* Explicitly set file size to 0 here to make sure fio doesn't try to
			 * actually send I/O to this "*" file.
			 */
			f->real_file_size = 0;
			continue;
		}

@@ -1436,7 +1440,7 @@ static struct fio_option options[] = {
struct ioengine_ops ioengine = {
	.name			= "spdk_bdev",
	.version		= FIO_IOOPS_VERSION,
	.flags			= FIO_RAWIO | FIO_NOEXTEND | FIO_NODISKUTIL | FIO_MEMALIGN,
	.flags			= FIO_RAWIO | FIO_NOEXTEND | FIO_NODISKUTIL | FIO_MEMALIGN | FIO_DISKLESSIO,
	.setup			= spdk_fio_setup,
	.init			= spdk_fio_init,
	/* .prep		= unused, */
+1 −1
Original line number Diff line number Diff line
@@ -1806,7 +1806,7 @@ struct ioengine_ops ioengine = {
#if FIO_HAS_FDP
	.fdp_fetch_ruhs		= spdk_fio_fdp_fetch_ruhs,
#endif
	.flags			= FIO_RAWIO | FIO_NOEXTEND | FIO_NODISKUTIL | FIO_MEMALIGN,
	.flags			= FIO_RAWIO | FIO_NOEXTEND | FIO_NODISKUTIL | FIO_MEMALIGN | FIO_DISKLESSIO,
	.options		= options,
	.option_struct_size	= sizeof(struct spdk_fio_options),
};