Skip to content

Commit

Permalink
Add dataset_kstats_update.. to mmap read/write path on Linux
Browse files Browse the repository at this point in the history
This allows reads/writes caused by accesses to mmap files to be
accounted correctly in the per-dataset kstats.

Signed-off-by: Matthias Blankertz <[email protected]>
Issue openzfs#12994
  • Loading branch information
drowfx committed Jan 30, 2022
1 parent 73e972a commit 5c0b9cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/os/linux/zfs/zfs_vnops_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -3610,6 +3610,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);
}
Expand Down Expand Up @@ -3805,6 +3807,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);
}
Expand Down

0 comments on commit 5c0b9cf

Please sign in to comment.