Make devfs update the atime timestamp so that 'w' works when using

options DEVFS.
This commit is contained in:
Søren Schmidt 1998-09-30 20:33:46 +00:00
parent d8a42175b2
commit 4d075b334c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39836
2 changed files with 12 additions and 5 deletions

View File

@ -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);
}
/*

View File

@ -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 */