diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 6d3dac7548..7bcf80bf5a 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4141,6 +4141,9 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind, if (lr != NULL) zfs_rangelock_exit(lr); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); + + dataset_kstats_update_read_kstats(&zfsvfs->z_kstat, count*PAGE_SIZE); + ZFS_EXIT(zfsvfs); if (error != 0) @@ -4318,6 +4321,9 @@ out: if ((flags & (zfs_vm_pagerput_sync | zfs_vm_pagerput_inval)) != 0 || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zfsvfs->z_log, zp->z_id); + + dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, len); + ZFS_EXIT(zfsvfs); return (rtvals[0]); } diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index a1a0e44bb3..2958439ace 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -3635,6 +3635,8 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc) zil_commit(zfsvfs->z_log, zp->z_id); } + dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, pglen); + ZFS_EXIT(zfsvfs); return (err); } @@ -3830,6 +3832,8 @@ zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages) err = zfs_fillpage(ip, pl, nr_pages); + dataset_kstats_update_read_kstats(&zfsvfs->z_kstat, nr_pages*PAGESIZE); + ZFS_EXIT(zfsvfs); return (err); }