Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112023967
D2104.id4314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D2104.id4314.diff
View Options
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 <sys/proc.h>
#include <sys/stat.h>
#include <sys/sx.h>
+#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/ttycom.h>
#include <sys/unistd.h>
@@ -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);
@@ -1581,7 +1589,7 @@
c = 1;
}
- if (c) {
+ if (devfs_dotimes && c) {
if (vp->v_type == VCHR)
vfs_timestamp(&vp->v_rdev->si_ctime);
else
@@ -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;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 5:37 PM (10 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17123529
Default Alt Text
D2104.id4314.diff (2 KB)
Attached To
Mode
D2104: Disable timestamping on devfs by default.
Attached
Detach File
Event Timeline
Log In to Comment