diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-01-18 01:36:30 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-01-18 01:36:30 +0000 |
commit | 375fde38b392d0769b355259e78da6d1e861f578 (patch) | |
tree | 9ff2340fc0807d4a976b336843af6c5d7f300e86 /sys | |
parent | 64b7b53ecef0173b17a295519f6c51414221b815 (diff) |
record ctime for the mountpoint, mount time or last mount update; art@ ok
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 7 | ||||
-rw-r--r-- | sys/sys/mount.h | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a74fd9eedf9..bacf1ff55d3 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.84 2001/12/19 08:58:06 art Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.85 2002/01/18 01:36:29 mickey Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -108,6 +108,7 @@ sys_mount(p, v, retval) struct vattr va; struct nameidata nd; struct vfsconf *vfsp; + struct timeval tv; if (usermount == 0 && (error = suser(p->p_ucred, &p->p_acflag))) return (error); @@ -260,6 +261,10 @@ update: * Mount the filesystem. */ error = VFS_MOUNT(mp, SCARG(uap, path), SCARG(uap, data), &nd, p); + if (!error) { + microtime(&tv); + mp->mnt_stat.f_ctime = tv.tv_sec; + } if (mp->mnt_flag & MNT_UPDATE) { vrele(vp); if (mp->mnt_flag & MNT_WANTRDWR) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 6709ef88a7b..551f22b76d7 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.h,v 1.42 2001/12/19 08:58:06 art Exp $ */ +/* $OpenBSD: mount.h,v 1.43 2002/01/18 01:36:29 mickey Exp $ */ /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */ /* @@ -266,7 +266,8 @@ struct statfs { uid_t f_owner; /* user that mounted the file system */ u_int32_t f_syncwrites; /* count of sync writes since mount */ u_int32_t f_asyncwrites; /* count of async writes since mount */ - u_int32_t f_spare[4]; /* spare for later */ + u_int32_t f_ctime; /* last mount [-u] time */ + u_int32_t f_spare[3]; /* spare for later */ char f_fstypename[MFSNAMELEN]; /* fs type name */ char f_mntonname[MNAMELEN]; /* directory on which mounted */ char f_mntfromname[MNAMELEN]; /* mounted file system */ |