aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-11-21 09:32:57 -0800
committerBrian Behlendorf <[email protected]>2019-11-21 09:32:57 -0800
commitda92d5cbb38cea3a860b8a6bb8ee21f9129e7d7c (patch)
treecc2d84b481a30b43d4097603e79a55a1975b0b64 /cmd/ztest
parent67a6c3bc9ff401fa04bc41354c5172b51aaed1c9 (diff)
Add zfs_file_* interface, remove vnodes
Provide a common zfs_file_* interface which can be implemented on all platforms to perform normal file access from either the kernel module or the libzpool library. This allows all non-portable vnode_t usage in the common code to be replaced by the new portable zfs_file_t. The associated vnode and kobj compatibility functions, types, and macros have been removed from the SPL. Moving forward, vnodes should only be used in platform specific code when provided by the native operating system. Reviewed-by: Sean Eric Fagan <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9556
Diffstat (limited to 'cmd/ztest')
-rw-r--r--cmd/ztest/ztest.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index b886f1e99..dbc5084d0 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -5826,8 +5826,8 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
(long long)vd0->vdev_id, (int)maxfaults);
if (vf != NULL && ztest_random(3) == 0) {
- (void) close(vf->vf_vnode->v_fd);
- vf->vf_vnode->v_fd = -1;
+ (void) close(vf->vf_file->f_fd);
+ vf->vf_file->f_fd = -1;
} else if (ztest_random(2) == 0) {
vd0->vdev_cant_read = B_TRUE;
} else {
@@ -6933,7 +6933,7 @@ ztest_run(ztest_shared_t *zs)
/*
* Open our pool.
*/
- kernel_init(FREAD | FWRITE);
+ kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
metaslab_preload_limit = ztest_random(20) + 1;
ztest_spa = spa;
@@ -7122,7 +7122,7 @@ ztest_freeze(void)
if (ztest_opts.zo_verbose >= 3)
(void) printf("testing spa_freeze()...\n");
- kernel_init(FREAD | FWRITE);
+ kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
VERIFY3U(0, ==, ztest_dataset_open(0));
ztest_spa = spa;
@@ -7189,7 +7189,7 @@ ztest_freeze(void)
/*
* Open and close the pool and dataset to induce log replay.
*/
- kernel_init(FREAD | FWRITE);
+ kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
ASSERT(spa_freeze_txg(spa) == UINT64_MAX);
VERIFY3U(0, ==, ztest_dataset_open(0));
@@ -7262,7 +7262,7 @@ ztest_import(ztest_shared_t *zs)
mutex_init(&ztest_checkpoint_lock, NULL, MUTEX_DEFAULT, NULL);
VERIFY0(pthread_rwlock_init(&ztest_name_lock, NULL));
- kernel_init(FREAD | FWRITE);
+ kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
searchdirs[0] = ztest_opts.zo_dir;
args.paths = nsearch;
@@ -7308,7 +7308,7 @@ ztest_init(ztest_shared_t *zs)
mutex_init(&ztest_checkpoint_lock, NULL, MUTEX_DEFAULT, NULL);
VERIFY0(pthread_rwlock_init(&ztest_name_lock, NULL));
- kernel_init(FREAD | FWRITE);
+ kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
/*
* Create the storage pool.