Index: sys/fs/devfs/devfs_devs.c =================================================================== --- sys/fs/devfs/devfs_devs.c +++ sys/fs/devfs/devfs_devs.c @@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_DEVFS3, "DEVFS3", "DEVFS data 3"); static MALLOC_DEFINE(M_CDEVP, "DEVFS1", "DEVFS cdev_priv storage"); -static SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW, 0, "DEVFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW, 0, "DEVFS filesystem"); static unsigned devfs_generation; SYSCTL_UINT(_vfs_devfs, OID_AUTO, generation, CTLFLAG_RD, Index: sys/fs/devfs/devfs_vnops.c =================================================================== --- sys/fs/devfs/devfs_vnops.c +++ sys/fs/devfs/devfs_vnops.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,12 @@ struct mtx cdevpriv_mtx; MTX_SYSINIT(cdevpriv_mtx, &cdevpriv_mtx, "cdevpriv lock", MTX_DEF); +SYSCTL_DECL(_vfs_devfs); + +static int devfs_dotimes; +SYSCTL_INT(_vfs_devfs, OID_AUTO, dotimes, CTLFLAG_RW, + &devfs_dotimes, 0, "Update timestamps on DEVFS"); + static int devfs_fp_check(struct file *fp, struct cdev **devp, struct cdevsw **dswp, int *ref) @@ -1221,7 +1228,8 @@ foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); error = dsw->d_read(dev, uio, ioflag); - if (uio->uio_resid != resid || (error == 0 && resid != 0)) + if (devfs_dotimes && + (uio->uio_resid != resid || (error == 0 && resid != 0))) vfs_timestamp(&dev->si_atime); td->td_fpop = fpop; dev_relthread(dev, ref); @@ -1700,7 +1708,8 @@ resid = uio->uio_resid; error = dsw->d_write(dev, uio, ioflag); - if (uio->uio_resid != resid || (error == 0 && resid != 0)) { + if (devfs_dotimes && + (uio->uio_resid != resid || (error == 0 && resid != 0))) { vfs_timestamp(&dev->si_ctime); dev->si_mtime = dev->si_ctime; }