diff options
author | sos <sos@FreeBSD.org> | 1998-09-30 20:33:46 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1998-09-30 20:33:46 +0000 |
commit | 526ee0d833e330086b7d1a6c4deafaa6724a6fd3 (patch) | |
tree | 0a2aecbf73489ea7e69fbc2ca92289782db2ee3e /sys/miscfs | |
parent | e9048d87aac07033fb2c365e24399c33bf3440ef (diff) | |
download | FreeBSD-src-526ee0d833e330086b7d1a6c4deafaa6724a6fd3.zip FreeBSD-src-526ee0d833e330086b7d1a6c4deafaa6724a6fd3.tar.gz |
Make devfs update the atime timestamp so that 'w' works when using
options DEVFS.
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_vnops.c | 14 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfsdefs.h | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index a93ad20..213a867 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vnops.c,v 1.59 1998/08/16 01:21:51 bde Exp $ + * $Id: devfs_vnops.c,v 1.60 1998/09/04 08:06:56 dfr Exp $ */ @@ -443,6 +443,10 @@ DBPRINT(("getattr\n")); TIMEVAL_TO_TIMESPEC(&boottime,&(file_node->mtime)); TIMEVAL_TO_TIMESPEC(&boottime,&(file_node->atime)); } + if (file_node->flags & IN_ACCESS) { + nanotime(&file_node->atime); + file_node->flags &= ~IN_ACCESS; + } vap->va_ctime = file_node->ctime; vap->va_mtime = file_node->mtime; vap->va_atime = file_node->atime; @@ -1409,7 +1413,7 @@ devfs_read( struct vop_read_args *ap) error = (*dnp->by.Cdev.cdevsw->d_read) (dnp->by.Cdev.dev, uio, ap->a_ioflag); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - return (error); + break; case VBLK: if (uio->uio_offset < 0) @@ -1452,12 +1456,14 @@ devfs_read( struct vop_read_args *ap) error = uiomove((char *)bp->b_data + on, n, uio); brelse(bp); } while (error == 0 && uio->uio_resid > 0 && n != 0); - return (error); + break; default: panic("devfs_read type"); } - /* NOTREACHED */ + if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) + dnp->flags |= IN_ACCESS; + return (error); } /* diff --git a/sys/miscfs/devfs/devfsdefs.h b/sys/miscfs/devfs/devfsdefs.h index 76280dd..9144c3d 100644 --- a/sys/miscfs/devfs/devfsdefs.h +++ b/sys/miscfs/devfs/devfsdefs.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfsdefs.h,v 1.15 1998/07/04 22:30:22 julian Exp $ + * $Id: devfsdefs.h,v 1.16 1998/07/05 23:10:22 julian Exp $ */ #ifdef DEVFS_DEBUG #define DBPRINT(A) printf(A) @@ -98,6 +98,7 @@ struct devnode /* the equivalent of an INODE */ { u_short type; int flags; /* more inode compatible for now *//*XXXkill*/ +#define IN_ACCESS 0x0001 u_short mode; /* basically inode compatible (drwxrwxrwx) */ u_short uid; /* basically inode compatible */ u_short gid; /* basically inode compatible */ |