diff options
author | Allan Jude <[email protected]> | 2020-06-05 20:17:02 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-05 17:17:02 -0700 |
commit | 4547fc4e071ceb1818b3a46c3035b923e06e5390 (patch) | |
tree | d5754d84d30f9a1eb63d963e00158a2bdb8a6dbd /module/os/linux | |
parent | 99b281f1ae3833826b4e3cee4126a4ea5e6de987 (diff) |
Connect dataset_kstats for FreeBSD
Expand the FreeBSD spl for kstats to support all current types
Move the dataset_kstats_t back to zvol_state_t from zfs_state_os_t
now that it is common once again
```
kstat.zfs/mypool.dataset.objset-0x10b.nunlinked: 0
kstat.zfs/mypool.dataset.objset-0x10b.nunlinks: 0
kstat.zfs/mypool.dataset.objset-0x10b.nread: 150528
kstat.zfs/mypool.dataset.objset-0x10b.reads: 48
kstat.zfs/mypool.dataset.objset-0x10b.nwritten: 134217728
kstat.zfs/mypool.dataset.objset-0x10b.writes: 1024
kstat.zfs/mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname
```
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed by: Sean Eric Fagan <[email protected]>
Reviewed-by: Serapheim Dimitropoulos <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Allan Jude <[email protected]>
Closes #10386
Diffstat (limited to 'module/os/linux')
-rw-r--r-- | module/os/linux/zfs/zvol_os.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c index 286c39d5c..3d820ce56 100644 --- a/module/os/linux/zfs/zvol_os.c +++ b/module/os/linux/zfs/zvol_os.c @@ -50,7 +50,6 @@ unsigned int zvol_threads = 32; struct zvol_state_os { struct gendisk *zvo_disk; /* generic disk */ struct request_queue *zvo_queue; /* request queue */ - dataset_kstats_t zvo_kstat; /* zvol kstats */ dev_t zvo_dev; /* device id */ }; @@ -163,7 +162,7 @@ zvol_write(void *arg) zfs_rangelock_exit(lr); int64_t nwritten = start_resid - uio.uio_resid; - dataset_kstats_update_write_kstats(&zv->zv_zso->zvo_kstat, nwritten); + dataset_kstats_update_write_kstats(&zv->zv_kstat, nwritten); task_io_account_write(nwritten); if (sync) @@ -286,7 +285,7 @@ zvol_read(void *arg) zfs_rangelock_exit(lr); int64_t nread = start_resid - uio.uio_resid; - dataset_kstats_update_read_kstats(&zv->zv_zso->zvo_kstat, nread); + dataset_kstats_update_read_kstats(&zv->zv_kstat, nread); task_io_account_read(nread); rw_exit(&zv->zv_suspend_lock); @@ -864,7 +863,7 @@ zvol_free(zvol_state_t *zv) MINOR(zv->zv_zso->zvo_dev) >> ZVOL_MINOR_BITS); mutex_destroy(&zv->zv_state_lock); - dataset_kstats_destroy(&zv->zv_zso->zvo_kstat); + dataset_kstats_destroy(&zv->zv_kstat); kmem_free(zv->zv_zso, sizeof (struct zvol_state_os)); kmem_free(zv, sizeof (zvol_state_t)); @@ -963,8 +962,8 @@ zvol_os_create_minor(const char *name) else zil_replay(os, zv, zvol_replay_vector); } - ASSERT3P(zv->zv_zso->zvo_kstat.dk_kstats, ==, NULL); - dataset_kstats_create(&zv->zv_zso->zvo_kstat, zv->zv_objset); + ASSERT3P(zv->zv_kstat.dk_kstats, ==, NULL); + dataset_kstats_create(&zv->zv_kstat, zv->zv_objset); /* * When udev detects the addition of the device it will immediately |