diff --git a/contrib/sys/softupdates/ffs_softdep.c b/contrib/sys/softupdates/ffs_softdep.c index fb67658a436e..433cafe5faf5 100644 --- a/contrib/sys/softupdates/ffs_softdep.c +++ b/contrib/sys/softupdates/ffs_softdep.c @@ -54,7 +54,7 @@ * SUCH DAMAGE. * * from: @(#)ffs_softdep.c 9.28 (McKusick) 8/8/98 - * $Id: ffs_softdep.c,v 1.18 1998/12/10 20:11:47 julian Exp $ + * $Id: ffs_softdep.c,v 1.19 1999/01/06 18:18:04 bde Exp $ */ /* @@ -3583,7 +3583,9 @@ softdep_fsync(vp) struct fs *fs; struct proc *p = CURPROC; /* XXX */ int error, ret, flushparent; +#ifndef __FreeBSD__ struct timeval tv; +#endif ino_t parentino; ufs_lbn_t lbn; @@ -3650,12 +3652,13 @@ softdep_fsync(vp) } vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); if (flushparent) { -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) { + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) { vput(pvp); return (error); } @@ -4009,7 +4012,9 @@ flush_pagedep_deps(pvp, mp, diraddhdp) struct inodedep *inodedep; struct ufsmount *ump; struct diradd *dap; +#ifndef __FreeBSD__ struct timeval tv; +#endif struct vnode *vp; int gotit, error = 0; struct buf *bp; @@ -4022,13 +4027,14 @@ flush_pagedep_deps(pvp, mp, diraddhdp) * has a MKDIR_PARENT dependency. */ if (dap->da_state & MKDIR_PARENT) { -#ifndef __FreeBSD__ - tv = time; -#else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ FREE_LOCK(&lk); - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); +#else + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) break; ACQUIRE_LOCK(&lk); /* @@ -4110,12 +4116,12 @@ flush_pagedep_deps(pvp, mp, diraddhdp) } FREE_LOCK(&lk); } -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(vp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ + tv = time; error = UFS_UPDATE(vp, &tv, &tv, 1); +#endif vput(vp); if (error) break; diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index 7bd467a83f2b..b401cd346744 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vnops.c,v 1.10 1998/12/04 18:44:21 rvb Exp $ + * $Id: coda_vnops.c,v 1.11 1999/01/05 18:49:51 eivind Exp $ * */ @@ -48,6 +48,9 @@ /* * HISTORY * $Log: coda_vnops.c,v $ + * Revision 1.11 1999/01/05 18:49:51 eivind + * Remove the 'waslocked' parameter to vfs_object_create(). + * * Revision 1.10 1998/12/04 18:44:21 rvb * Don't print diagnostic anymore * @@ -362,7 +365,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = { #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) #define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) -#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) missing { &vop_reallocblks_desc, (vop_t *) ufs_missingop }, diff --git a/sys/contrib/softupdates/ffs_softdep.c b/sys/contrib/softupdates/ffs_softdep.c index fb67658a436e..433cafe5faf5 100644 --- a/sys/contrib/softupdates/ffs_softdep.c +++ b/sys/contrib/softupdates/ffs_softdep.c @@ -54,7 +54,7 @@ * SUCH DAMAGE. * * from: @(#)ffs_softdep.c 9.28 (McKusick) 8/8/98 - * $Id: ffs_softdep.c,v 1.18 1998/12/10 20:11:47 julian Exp $ + * $Id: ffs_softdep.c,v 1.19 1999/01/06 18:18:04 bde Exp $ */ /* @@ -3583,7 +3583,9 @@ softdep_fsync(vp) struct fs *fs; struct proc *p = CURPROC; /* XXX */ int error, ret, flushparent; +#ifndef __FreeBSD__ struct timeval tv; +#endif ino_t parentino; ufs_lbn_t lbn; @@ -3650,12 +3652,13 @@ softdep_fsync(vp) } vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); if (flushparent) { -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) { + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) { vput(pvp); return (error); } @@ -4009,7 +4012,9 @@ flush_pagedep_deps(pvp, mp, diraddhdp) struct inodedep *inodedep; struct ufsmount *ump; struct diradd *dap; +#ifndef __FreeBSD__ struct timeval tv; +#endif struct vnode *vp; int gotit, error = 0; struct buf *bp; @@ -4022,13 +4027,14 @@ flush_pagedep_deps(pvp, mp, diraddhdp) * has a MKDIR_PARENT dependency. */ if (dap->da_state & MKDIR_PARENT) { -#ifndef __FreeBSD__ - tv = time; -#else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ FREE_LOCK(&lk); - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); +#else + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) break; ACQUIRE_LOCK(&lk); /* @@ -4110,12 +4116,12 @@ flush_pagedep_deps(pvp, mp, diraddhdp) } FREE_LOCK(&lk); } -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(vp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ + tv = time; error = UFS_UPDATE(vp, &tv, &tv, 1); +#endif vput(vp); if (error) break; diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index 7bd467a83f2b..b401cd346744 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: coda_vnops.c,v 1.10 1998/12/04 18:44:21 rvb Exp $ + * $Id: coda_vnops.c,v 1.11 1999/01/05 18:49:51 eivind Exp $ * */ @@ -48,6 +48,9 @@ /* * HISTORY * $Log: coda_vnops.c,v $ + * Revision 1.11 1999/01/05 18:49:51 eivind + * Remove the 'waslocked' parameter to vfs_object_create(). + * * Revision 1.10 1998/12/04 18:44:21 rvb * Don't print diagnostic anymore * @@ -362,7 +365,7 @@ struct vnodeopv_entry_desc coda_vnodeop_entries[] = { #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) #define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) -#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) missing { &vop_reallocblks_desc, (vop_t *) ufs_missingop }, diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c index 186b227e6a5c..0d4dfe3621fc 100644 --- a/sys/gnu/ext2fs/ext2_alloc.c +++ b/sys/gnu/ext2fs/ext2_alloc.c @@ -232,7 +232,6 @@ return ENOSPC; daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; int i, len, start_lvl, end_lvl, pref, ssize; - struct timeval tv; vp = ap->a_vp; ip = VTOI(vp); @@ -339,10 +338,8 @@ return ENOSPC; bwrite(sbp); } else { ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (!doasyncfree) { - gettime(&tv); - UFS_UPDATE(vp, &tv, &tv, 1); - } + if (!doasyncfree) + UFS_UPDATE(vp, 1); } if (ssize < len) if (doasyncfree) diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h index 0afd890403a1..317f540af1e1 100644 --- a/sys/gnu/ext2fs/ext2_extern.h +++ b/sys/gnu/ext2fs/ext2_extern.h @@ -62,7 +62,7 @@ int ext2_reallocblks __P((struct vop_reallocblks_args *)); int ext2_reclaim __P((struct vop_reclaim_args *)); void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t)); int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); -int ext2_update __P((struct vnode *, struct timeval *, struct timeval *, int)); +int ext2_update __P((struct vnode *, int)); int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **)); int ext2_vfree __P((struct vnode *, ino_t, int)); int ext2_lookup __P((struct vop_cachedlookup_args *)); diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c index fedacbbdccb9..b287c1648857 100644 --- a/sys/gnu/ext2fs/ext2_inode.c +++ b/sys/gnu/ext2fs/ext2_inode.c @@ -80,10 +80,8 @@ ext2_init(struct vfsconf *vfsp) * set, then wait for the write to complete. */ int -ext2_update(vp, access, modify, waitfor) +ext2_update(vp, waitfor) struct vnode *vp; - struct timeval *access; - struct timeval *modify; int waitfor; { register struct ext2_sb_info *fs; @@ -143,7 +141,6 @@ ext2_truncate(vp, length, flags, cred, p) struct buf *bp; int offset, size, level; long count, nblocks, blocksreleased = 0; - struct timeval tv; register int i; int aflags, error, allerror; off_t osize; @@ -157,7 +154,6 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); return EFBIG; oip = VTOI(ovp); - getmicrotime(&tv); if (ovp->v_type == VLNK && oip->i_size < ovp->v_mount->mnt_maxsymlinklen) { #if DIAGNOSTIC @@ -167,11 +163,11 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); bzero((char *)&oip->i_shortlink, (u_int)oip->i_size); oip->i_size = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } if (oip->i_size == length) { oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 0)); + return (UFS_UPDATE(ovp, 0)); } #if QUOTA if (error = getinoquota(oip)) @@ -201,7 +197,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); else bawrite(bp); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } /* * Shorten the size of the file. If the file is not being @@ -257,7 +253,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - allerror = UFS_UPDATE(ovp, &tv, &tv, 1); + allerror = UFS_UPDATE(ovp, 1); /* * Having written the new inode to disk, save its new configuration diff --git a/sys/gnu/ext2fs/ext2_mount.h b/sys/gnu/ext2fs/ext2_mount.h index c62b736034f5..70652b58f9ba 100644 --- a/sys/gnu/ext2fs/ext2_mount.h +++ b/sys/gnu/ext2fs/ext2_mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.12 1997/10/16 20:32:40 phk Exp $ + * $Id: ufsmount.h,v 1.13 1998/01/30 11:34:06 phk Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -97,14 +97,14 @@ struct ufsmount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **)); int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); - int (*um_update) __P((struct vnode *, struct timeval *, struct timeval *, int)); + int (*um_update) __P((struct vnode *, int)); int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **)); int (*um_vfree) __P((struct vnode *, ino_t, int)); }; #define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) #define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) -#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c index 7efe39afe4a0..d5881e2e6f49 100644 --- a/sys/gnu/ext2fs/ext2_readwrite.c +++ b/sys/gnu/ext2fs/ext2_readwrite.c @@ -173,7 +173,6 @@ WRITE(ap) daddr_t lbn; off_t osize; int blkoffset, error, flags, ioflag, resid, size, xfersize; - struct timeval tv; ioflag = ap->a_ioflag; uio = ap->a_uio; @@ -289,9 +288,7 @@ WRITE(ap) uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) { - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, 1); - } + } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) + error = UFS_UPDATE(vp, 1); return (error); } diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 8b7ac7d96eda..f3b9bcc17109 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -182,7 +182,6 @@ ext2_fsync(ap) { register struct vnode *vp = ap->a_vp; register struct buf *bp; - struct timeval tv; struct buf *nbp; int s; @@ -229,8 +228,7 @@ ext2_fsync(ap) #endif } splx(s); - getmicrotime(&tv); - return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT)); + return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT)); } /* @@ -320,7 +318,6 @@ ext2_link(ap) struct componentname *cnp = ap->a_cnp; struct proc *p = cnp->cn_proc; struct inode *ip; - struct timeval tv; int error; #ifdef DIAGNOSTIC @@ -349,8 +346,7 @@ ext2_link(ap) } ip->i_nlink++; ip->i_flag |= IN_CHANGE; - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, 1); + error = UFS_UPDATE(vp, 1); if (!error) error = ext2_direnter(ip, tdvp, cnp); if (error) { @@ -389,7 +385,6 @@ ext2_rename(ap) struct proc *p = fcnp->cn_proc; struct inode *ip, *xp, *dp; struct dirtemplate dirbuf; - struct timeval tv; int doingdirectory = 0, oldparent = 0, newparent = 0; int error = 0; u_char namlen; @@ -527,8 +522,7 @@ ext2_rename(ap) */ ip->i_nlink++; ip->i_flag |= IN_CHANGE; - getmicrotime(&tv); - if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) { + if (error = UFS_UPDATE(fvp, 1)) { VOP_UNLOCK(fvp, 0, p); goto bad; } @@ -589,7 +583,7 @@ ext2_rename(ap) } dp->i_nlink++; dp->i_flag |= IN_CHANGE; - error = UFS_UPDATE(tdvp, &tv, &tv, 1); + error = UFS_UPDATE(tdvp, 1); if (error) goto bad; } @@ -598,7 +592,7 @@ ext2_rename(ap) if (doingdirectory && newparent) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; - (void)UFS_UPDATE(tdvp, &tv, &tv, 1); + (void)UFS_UPDATE(tdvp, 1); } goto bad; } @@ -807,7 +801,6 @@ ext2_mkdir(ap) register struct inode *ip, *dp; struct vnode *tvp; struct dirtemplate dirtemplate, *dtp; - struct timeval tv; int error, dmode; #ifdef DIAGNOSTIC @@ -896,8 +889,7 @@ ext2_mkdir(ap) ip->i_nlink = 2; if (cnp->cn_flags & ISWHITEOUT) ip->i_flags |= UF_OPAQUE; - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, 1); + error = UFS_UPDATE(tvp, 1); /* * Bump link count in parent directory @@ -907,7 +899,7 @@ ext2_mkdir(ap) */ dp->i_nlink++; dp->i_flag |= IN_CHANGE; - error = UFS_UPDATE(dvp, &tv, &tv, 1); + error = UFS_UPDATE(dvp, 1); if (error) goto bad; @@ -1077,7 +1069,6 @@ ext2_makeinode(mode, dvp, vpp, cnp) struct componentname *cnp; { register struct inode *ip, *pdir; - struct timeval tv; struct vnode *tvp; int error; @@ -1170,8 +1161,7 @@ ext2_makeinode(mode, dvp, vpp, cnp) /* * Make sure inode goes to disk before directory entry. */ - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, 1); + error = UFS_UPDATE(tvp, 1); if (error) goto bad; error = ext2_direnter(ip, dvp, cnp); diff --git a/sys/gnu/fs/ext2fs/ext2_alloc.c b/sys/gnu/fs/ext2fs/ext2_alloc.c index 186b227e6a5c..0d4dfe3621fc 100644 --- a/sys/gnu/fs/ext2fs/ext2_alloc.c +++ b/sys/gnu/fs/ext2fs/ext2_alloc.c @@ -232,7 +232,6 @@ return ENOSPC; daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; int i, len, start_lvl, end_lvl, pref, ssize; - struct timeval tv; vp = ap->a_vp; ip = VTOI(vp); @@ -339,10 +338,8 @@ return ENOSPC; bwrite(sbp); } else { ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (!doasyncfree) { - gettime(&tv); - UFS_UPDATE(vp, &tv, &tv, 1); - } + if (!doasyncfree) + UFS_UPDATE(vp, 1); } if (ssize < len) if (doasyncfree) diff --git a/sys/gnu/fs/ext2fs/ext2_extern.h b/sys/gnu/fs/ext2fs/ext2_extern.h index 0afd890403a1..317f540af1e1 100644 --- a/sys/gnu/fs/ext2fs/ext2_extern.h +++ b/sys/gnu/fs/ext2fs/ext2_extern.h @@ -62,7 +62,7 @@ int ext2_reallocblks __P((struct vop_reallocblks_args *)); int ext2_reclaim __P((struct vop_reclaim_args *)); void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t)); int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); -int ext2_update __P((struct vnode *, struct timeval *, struct timeval *, int)); +int ext2_update __P((struct vnode *, int)); int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **)); int ext2_vfree __P((struct vnode *, ino_t, int)); int ext2_lookup __P((struct vop_cachedlookup_args *)); diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c index fedacbbdccb9..b287c1648857 100644 --- a/sys/gnu/fs/ext2fs/ext2_inode.c +++ b/sys/gnu/fs/ext2fs/ext2_inode.c @@ -80,10 +80,8 @@ ext2_init(struct vfsconf *vfsp) * set, then wait for the write to complete. */ int -ext2_update(vp, access, modify, waitfor) +ext2_update(vp, waitfor) struct vnode *vp; - struct timeval *access; - struct timeval *modify; int waitfor; { register struct ext2_sb_info *fs; @@ -143,7 +141,6 @@ ext2_truncate(vp, length, flags, cred, p) struct buf *bp; int offset, size, level; long count, nblocks, blocksreleased = 0; - struct timeval tv; register int i; int aflags, error, allerror; off_t osize; @@ -157,7 +154,6 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); return EFBIG; oip = VTOI(ovp); - getmicrotime(&tv); if (ovp->v_type == VLNK && oip->i_size < ovp->v_mount->mnt_maxsymlinklen) { #if DIAGNOSTIC @@ -167,11 +163,11 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); bzero((char *)&oip->i_shortlink, (u_int)oip->i_size); oip->i_size = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } if (oip->i_size == length) { oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 0)); + return (UFS_UPDATE(ovp, 0)); } #if QUOTA if (error = getinoquota(oip)) @@ -201,7 +197,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); else bawrite(bp); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } /* * Shorten the size of the file. If the file is not being @@ -257,7 +253,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length); for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - allerror = UFS_UPDATE(ovp, &tv, &tv, 1); + allerror = UFS_UPDATE(ovp, 1); /* * Having written the new inode to disk, save its new configuration diff --git a/sys/gnu/fs/ext2fs/ext2_mount.h b/sys/gnu/fs/ext2fs/ext2_mount.h index c62b736034f5..70652b58f9ba 100644 --- a/sys/gnu/fs/ext2fs/ext2_mount.h +++ b/sys/gnu/fs/ext2fs/ext2_mount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.12 1997/10/16 20:32:40 phk Exp $ + * $Id: ufsmount.h,v 1.13 1998/01/30 11:34:06 phk Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -97,14 +97,14 @@ struct ufsmount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **)); int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); - int (*um_update) __P((struct vnode *, struct timeval *, struct timeval *, int)); + int (*um_update) __P((struct vnode *, int)); int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **)); int (*um_vfree) __P((struct vnode *, ino_t, int)); }; #define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) #define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) -#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c index 7efe39afe4a0..d5881e2e6f49 100644 --- a/sys/gnu/fs/ext2fs/ext2_readwrite.c +++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c @@ -173,7 +173,6 @@ WRITE(ap) daddr_t lbn; off_t osize; int blkoffset, error, flags, ioflag, resid, size, xfersize; - struct timeval tv; ioflag = ap->a_ioflag; uio = ap->a_uio; @@ -289,9 +288,7 @@ WRITE(ap) uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) { - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, 1); - } + } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) + error = UFS_UPDATE(vp, 1); return (error); } diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 8b7ac7d96eda..f3b9bcc17109 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -182,7 +182,6 @@ ext2_fsync(ap) { register struct vnode *vp = ap->a_vp; register struct buf *bp; - struct timeval tv; struct buf *nbp; int s; @@ -229,8 +228,7 @@ ext2_fsync(ap) #endif } splx(s); - getmicrotime(&tv); - return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT)); + return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT)); } /* @@ -320,7 +318,6 @@ ext2_link(ap) struct componentname *cnp = ap->a_cnp; struct proc *p = cnp->cn_proc; struct inode *ip; - struct timeval tv; int error; #ifdef DIAGNOSTIC @@ -349,8 +346,7 @@ ext2_link(ap) } ip->i_nlink++; ip->i_flag |= IN_CHANGE; - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, 1); + error = UFS_UPDATE(vp, 1); if (!error) error = ext2_direnter(ip, tdvp, cnp); if (error) { @@ -389,7 +385,6 @@ ext2_rename(ap) struct proc *p = fcnp->cn_proc; struct inode *ip, *xp, *dp; struct dirtemplate dirbuf; - struct timeval tv; int doingdirectory = 0, oldparent = 0, newparent = 0; int error = 0; u_char namlen; @@ -527,8 +522,7 @@ ext2_rename(ap) */ ip->i_nlink++; ip->i_flag |= IN_CHANGE; - getmicrotime(&tv); - if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) { + if (error = UFS_UPDATE(fvp, 1)) { VOP_UNLOCK(fvp, 0, p); goto bad; } @@ -589,7 +583,7 @@ ext2_rename(ap) } dp->i_nlink++; dp->i_flag |= IN_CHANGE; - error = UFS_UPDATE(tdvp, &tv, &tv, 1); + error = UFS_UPDATE(tdvp, 1); if (error) goto bad; } @@ -598,7 +592,7 @@ ext2_rename(ap) if (doingdirectory && newparent) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; - (void)UFS_UPDATE(tdvp, &tv, &tv, 1); + (void)UFS_UPDATE(tdvp, 1); } goto bad; } @@ -807,7 +801,6 @@ ext2_mkdir(ap) register struct inode *ip, *dp; struct vnode *tvp; struct dirtemplate dirtemplate, *dtp; - struct timeval tv; int error, dmode; #ifdef DIAGNOSTIC @@ -896,8 +889,7 @@ ext2_mkdir(ap) ip->i_nlink = 2; if (cnp->cn_flags & ISWHITEOUT) ip->i_flags |= UF_OPAQUE; - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, 1); + error = UFS_UPDATE(tvp, 1); /* * Bump link count in parent directory @@ -907,7 +899,7 @@ ext2_mkdir(ap) */ dp->i_nlink++; dp->i_flag |= IN_CHANGE; - error = UFS_UPDATE(dvp, &tv, &tv, 1); + error = UFS_UPDATE(dvp, 1); if (error) goto bad; @@ -1077,7 +1069,6 @@ ext2_makeinode(mode, dvp, vpp, cnp) struct componentname *cnp; { register struct inode *ip, *pdir; - struct timeval tv; struct vnode *tvp; int error; @@ -1170,8 +1161,7 @@ ext2_makeinode(mode, dvp, vpp, cnp) /* * Make sure inode goes to disk before directory entry. */ - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, 1); + error = UFS_UPDATE(tvp, 1); if (error) goto bad; error = ext2_direnter(ip, dvp, cnp); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 146054095233..2794e32be088 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 - * $Id: ffs_alloc.c,v 1.54 1998/11/13 01:01:44 dg Exp $ + * $Id: ffs_alloc.c,v 1.55 1999/01/06 17:04:33 bde Exp $ */ #include "opt_quota.h" @@ -363,7 +363,6 @@ ffs_reallocblks(ap) ufs_daddr_t start_lbn, end_lbn, soff, newblk, blkno; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; int i, len, start_lvl, end_lvl, pref, ssize; - struct timeval tv; if (doreallocblks == 0) return (ENOSPC); @@ -503,10 +502,8 @@ ffs_reallocblks(ap) bwrite(sbp); } else { ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (!doasyncfree) { - getmicrotime(&tv); - UFS_UPDATE(vp, &tv, &tv, 1); - } + if (!doasyncfree) + UFS_UPDATE(vp, 1); } if (ssize < len) if (doasyncfree) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 0cb97ee83707..938899a81248 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 - * $Id: ffs_extern.h,v 1.23 1998/03/08 09:58:50 julian Exp $ + * $Id: ffs_extern.h,v 1.24 1998/03/23 14:12:37 bde Exp $ */ #ifndef _UFS_FFS_EXTERN_H @@ -94,7 +94,7 @@ int ffs_statfs __P((struct mount *, struct statfs *, struct proc *)); int ffs_sync __P((struct mount *, int, struct ucred *, struct proc *)); int ffs_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); int ffs_unmount __P((struct mount *, int, struct proc *)); -int ffs_update __P((struct vnode *, struct timeval *, struct timeval *, int)); +int ffs_update __P((struct vnode *, int)); int ffs_valloc __P((struct vnode *, int, struct ucred *, struct vnode **)); int ffs_vfree __P((struct vnode *, ino_t, int)); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 5f6ab9ccb3e4..b474bc5413a3 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95 - * $Id: ffs_inode.c,v 1.50 1999/01/06 16:52:38 bde Exp $ + * $Id: ffs_inode.c,v 1.51 1999/01/06 18:18:06 bde Exp $ */ #include "opt_quota.h" @@ -70,10 +70,8 @@ static int ffs_indirtrunc __P((struct inode *, ufs_daddr_t, ufs_daddr_t, * set, then wait for the write to complete. */ int -ffs_update(vp, access, modify, waitfor) +ffs_update(vp, waitfor) struct vnode *vp; - struct timeval *access; - struct timeval *modify; int waitfor; { register struct fs *fs; @@ -143,7 +141,6 @@ ffs_truncate(vp, length, flags, cred, p) struct buf *bp; int offset, size, level; long count, nblocks, blocksreleased = 0; - struct timeval tv; register int i; int aflags, error, allerror; off_t osize; @@ -156,7 +153,6 @@ ffs_truncate(vp, length, flags, cred, p) return (EINVAL); if (length > fs->fs_maxfilesize) return (EFBIG); - getmicrotime(&tv); if (ovp->v_type == VLNK && (oip->i_size < ovp->v_mount->mnt_maxsymlinklen || oip->i_din.di_blocks == 0)) { #ifdef DIAGNOSTIC @@ -166,11 +162,11 @@ ffs_truncate(vp, length, flags, cred, p) bzero((char *)&oip->i_shortlink, (u_int)oip->i_size); oip->i_size = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } if (oip->i_size == length) { oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 0)); + return (UFS_UPDATE(ovp, 0)); } #ifdef QUOTA error = getinoquota(oip); @@ -199,7 +195,7 @@ ffs_truncate(vp, length, flags, cred, p) softdep_setup_freeblocks(oip, length); vinvalbuf(ovp, 0, cred, p, 0, 0); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (ffs_update(ovp, &tv, &tv, 0)); + return (ffs_update(ovp, 0)); } } osize = oip->i_size; @@ -227,7 +223,7 @@ ffs_truncate(vp, length, flags, cred, p) else bawrite(bp); oip->i_flag |= IN_CHANGE | IN_UPDATE; - return (UFS_UPDATE(ovp, &tv, &tv, 1)); + return (UFS_UPDATE(ovp, 1)); } /* * Shorten the size of the file. If the file is not being @@ -291,7 +287,7 @@ ffs_truncate(vp, length, flags, cred, p) for (i = NDADDR - 1; i > lastblock; i--) oip->i_db[i] = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; - allerror = UFS_UPDATE(ovp, &tv, &tv, ((length > 0) ? 0 : 1)); + allerror = UFS_UPDATE(ovp, ((length > 0) ? 0 : 1)); /* * Having written the new inode to disk, save its new configuration diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index fb67658a436e..433cafe5faf5 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -54,7 +54,7 @@ * SUCH DAMAGE. * * from: @(#)ffs_softdep.c 9.28 (McKusick) 8/8/98 - * $Id: ffs_softdep.c,v 1.18 1998/12/10 20:11:47 julian Exp $ + * $Id: ffs_softdep.c,v 1.19 1999/01/06 18:18:04 bde Exp $ */ /* @@ -3583,7 +3583,9 @@ softdep_fsync(vp) struct fs *fs; struct proc *p = CURPROC; /* XXX */ int error, ret, flushparent; +#ifndef __FreeBSD__ struct timeval tv; +#endif ino_t parentino; ufs_lbn_t lbn; @@ -3650,12 +3652,13 @@ softdep_fsync(vp) } vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); if (flushparent) { -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) { + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) { vput(pvp); return (error); } @@ -4009,7 +4012,9 @@ flush_pagedep_deps(pvp, mp, diraddhdp) struct inodedep *inodedep; struct ufsmount *ump; struct diradd *dap; +#ifndef __FreeBSD__ struct timeval tv; +#endif struct vnode *vp; int gotit, error = 0; struct buf *bp; @@ -4022,13 +4027,14 @@ flush_pagedep_deps(pvp, mp, diraddhdp) * has a MKDIR_PARENT dependency. */ if (dap->da_state & MKDIR_PARENT) { -#ifndef __FreeBSD__ - tv = time; -#else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ FREE_LOCK(&lk); - if (error = UFS_UPDATE(pvp, &tv, &tv, 1)) +#ifdef __FreeBSD__ + error = UFS_UPDATE(pvp, 1); +#else + tv = time; + error = UFS_UPDATE(pvp, &tv, &tv, 1); +#endif + if (error) break; ACQUIRE_LOCK(&lk); /* @@ -4110,12 +4116,12 @@ flush_pagedep_deps(pvp, mp, diraddhdp) } FREE_LOCK(&lk); } -#ifndef __FreeBSD__ - tv = time; +#ifdef __FreeBSD__ + error = UFS_UPDATE(vp, 1); #else - getmicrotime(&tv); -#endif /* __FreeBSD__ */ + tv = time; error = UFS_UPDATE(vp, &tv, &tv, 1); +#endif vput(vp); if (error) break; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 42f25bc9a5e2..2973703da405 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 - * $Id: ffs_vfsops.c,v 1.93 1999/01/02 01:32:36 eivind Exp $ + * $Id: ffs_vfsops.c,v 1.94 1999/01/05 18:50:03 eivind Exp $ */ #include "opt_quota.h" @@ -951,7 +951,6 @@ ffs_sync(mp, waitfor, cred, p) struct inode *ip; struct ufsmount *ump = VFSTOUFS(mp); struct fs *fs; - struct timeval tv; int error, allerror = 0; fs = ump->um_fs; @@ -998,9 +997,8 @@ ffs_sync(mp, waitfor, cred, p) } else { simple_unlock(&mntvnode_slock); simple_unlock(&vp->v_interlock); - getmicrotime(&tv); - /* UFS_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); */ - UFS_UPDATE(vp, &tv, &tv, 0); + /* UFS_UPDATE(vp, waitfor == MNT_WAIT); */ + UFS_UPDATE(vp, 0); simple_lock(&mntvnode_slock); } } diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index b14cd686bac5..1823c0f0af13 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 - * $Id: ffs_vnops.c,v 1.52 1998/09/24 15:02:46 luoqi Exp $ + * $Id: ffs_vnops.c,v 1.53 1998/10/31 15:31:27 peter Exp $ */ #include @@ -122,7 +122,6 @@ ffs_fsync(ap) { struct vnode *vp = ap->a_vp; struct buf *bp; - struct timeval tv; struct buf *nbp; int s, error, passes, skipmeta; daddr_t lbn; @@ -248,6 +247,5 @@ ffs_fsync(ap) } } splx(s); - getmicrotime(&tv); - return (UFS_UPDATE(vp, &tv, &tv, ap->a_waitfor == MNT_WAIT)); + return (UFS_UPDATE(vp, ap->a_waitfor == MNT_WAIT)); } diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index be4d2bb4f18b..1f4e0b1af8d7 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_inode.c 8.9 (Berkeley) 5/14/95 - * $Id: ufs_inode.c,v 1.22 1998/03/30 09:56:16 phk Exp $ + * $Id: ufs_inode.c,v 1.23 1998/07/03 22:17:02 bde Exp $ */ #include "opt_quota.h" @@ -66,7 +66,6 @@ ufs_inactive(ap) struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct proc *p = ap->a_p; - struct timeval tv; int mode, error = 0; if (prtactive && vp->v_usecount != 0) @@ -89,10 +88,8 @@ ufs_inactive(ap) ip->i_flag |= IN_CHANGE | IN_UPDATE; UFS_VFREE(vp, ip->i_number, mode); } - if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) { - getmicrotime(&tv); - UFS_UPDATE(vp, &tv, &tv, 0); - } + if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) + UFS_UPDATE(vp, 0); out: VOP_UNLOCK(vp, 0, p); /* @@ -116,7 +113,6 @@ ufs_reclaim(ap) { register struct inode *ip; register struct vnode *vp = ap->a_vp; - struct timeval tv; #ifdef QUOTA int i; #endif @@ -126,8 +122,7 @@ ufs_reclaim(ap) ip = VTOI(vp); if (ip->i_flag & IN_LAZYMOD) { ip->i_flag |= IN_MODIFIED; - getmicrotime(&tv); - UFS_UPDATE(vp, &tv, &tv, 0); + UFS_UPDATE(vp, 0); } /* * Remove the inode from its hash chain. diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 936be19cb5ef..bd5e96f0e03e 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95 - * $Id: ufs_lookup.c,v 1.24 1998/04/15 12:27:31 bde Exp $ + * $Id: ufs_lookup.c,v 1.25 1998/07/11 07:46:07 bde Exp $ */ #include @@ -670,7 +670,6 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) struct direct *ep, *nep; int error, ret, blkoff, loc, spacefree, flags; char *dirbuf; - struct timeval tv; p = curproc; /* XXX */ cr = p->p_ucred; @@ -722,8 +721,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) } else { error = VOP_BWRITE(bp); } - getmicrotime(&tv); - ret = UFS_UPDATE(dvp, &tv, &tv, !DOINGSOFTDEP(dvp)); + ret = UFS_UPDATE(dvp, !DOINGSOFTDEP(dvp)); if (error == 0) return (ret); return (error); diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 9200b39f0f70..026d348696de 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 - * $Id: ufs_readwrite.c,v 1.53 1998/10/07 13:59:26 luoqi Exp $ + * $Id: ufs_readwrite.c,v 1.54 1998/12/15 03:29:52 julian Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -358,7 +358,6 @@ WRITE(ap) ufs_daddr_t lbn; off_t osize; int blkoffset, error, extended, flags, ioflag, resid, size, xfersize; - struct timeval tv; vm_object_t object; extended = 0; @@ -493,10 +492,8 @@ WRITE(ap) uio->uio_offset -= resid - uio->uio_resid; uio->uio_resid = resid; } - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) { - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, 1); - } + } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) + error = UFS_UPDATE(vp, 1); if (!error) VN_POLLEVENT(vp, POLLWRITE | (extended ? POLLEXTEND : 0)); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index a0f0a53e413a..101008513ac9 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 - * $Id: ufs_vnops.c,v 1.102 1998/12/20 12:36:01 dfr Exp $ + * $Id: ufs_vnops.c,v 1.103 1998/12/24 09:45:10 bde Exp $ */ #include "opt_quota.h" @@ -510,8 +510,7 @@ ufs_setattr(ap) ip->i_atime = vap->va_atime.tv_sec; if (vap->va_mtime.tv_sec != VNOVAL) ip->i_mtime = vap->va_mtime.tv_sec; - error = UFS_UPDATE(vp, (struct timeval *)0, - (struct timeval *)0, 0); + error = UFS_UPDATE(vp, 0); if (error) return (error); } @@ -721,7 +720,6 @@ ufs_link(ap) struct componentname *cnp = ap->a_cnp; struct proc *p = cnp->cn_proc; struct inode *ip; - struct timeval tv; struct direct newdir; int error; @@ -754,8 +752,7 @@ ufs_link(ap) ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(vp)) softdep_increase_linkcnt(ip); - getmicrotime(&tv); - error = UFS_UPDATE(vp, &tv, &tv, !DOINGSOFTDEP(vp)); + error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp)); if (!error) { ufs_makedirentry(ip, cnp, &newdir); error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL); @@ -879,7 +876,6 @@ ufs_rename(ap) struct proc *p = fcnp->cn_proc; struct inode *ip, *xp, *dp; struct direct newdir; - struct timeval tv; int doingdirectory = 0, oldparent = 0, newparent = 0; int error = 0; @@ -1019,8 +1015,7 @@ ufs_rename(ap) ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(fvp)) softdep_increase_linkcnt(ip); - getmicrotime(&tv); - if (error = UFS_UPDATE(fvp, &tv, &tv, !DOINGSOFTDEP(fvp))) { + if (error = UFS_UPDATE(fvp, !DOINGSOFTDEP(fvp))) { VOP_UNLOCK(fvp, 0, p); goto bad; } @@ -1084,7 +1079,7 @@ ufs_rename(ap) dp->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(tdvp)) softdep_increase_linkcnt(dp); - error = UFS_UPDATE(tdvp, &tv, &tv, !DOINGSOFTDEP(tdvp)); + error = UFS_UPDATE(tdvp, !DOINGSOFTDEP(tdvp)); if (error) goto bad; } @@ -1095,7 +1090,7 @@ ufs_rename(ap) dp->i_effnlink--; dp->i_nlink--; dp->i_flag |= IN_CHANGE; - (void)UFS_UPDATE(tdvp, &tv, &tv, 1); + (void)UFS_UPDATE(tdvp, 1); } goto bad; } @@ -1275,7 +1270,6 @@ ufs_mkdir(ap) struct buf *bp; struct dirtemplate dirtemplate, *dtp; struct direct newdir; - struct timeval tv; int error, dmode; long blkoff; @@ -1378,8 +1372,7 @@ ufs_mkdir(ap) dp->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(dvp)) softdep_increase_linkcnt(dp); - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(dvp)); + error = UFS_UPDATE(tvp, !DOINGSOFTDEP(dvp)); if (error) goto bad; @@ -1415,7 +1408,7 @@ ufs_mkdir(ap) blkoff += DIRBLKSIZ; } } - if ((error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp))) != 0) { + if ((error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp))) != 0) { (void)VOP_BWRITE(bp); goto bad; } @@ -2074,7 +2067,6 @@ ufs_makeinode(mode, dvp, vpp, cnp) { register struct inode *ip, *pdir; struct direct newdir; - struct timeval tv; struct vnode *tvp; int error; @@ -2168,8 +2160,7 @@ ufs_makeinode(mode, dvp, vpp, cnp) /* * Make sure inode goes to disk before directory entry. */ - getmicrotime(&tv); - error = UFS_UPDATE(tvp, &tv, &tv, !DOINGSOFTDEP(tvp)); + error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp)); if (error) goto bad; ufs_makedirentry(ip, cnp, &newdir); diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index c62b736034f5..70652b58f9ba 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 - * $Id: ufsmount.h,v 1.12 1997/10/16 20:32:40 phk Exp $ + * $Id: ufsmount.h,v 1.13 1998/01/30 11:34:06 phk Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -97,14 +97,14 @@ struct ufsmount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **)); int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *)); - int (*um_update) __P((struct vnode *, struct timeval *, struct timeval *, int)); + int (*um_update) __P((struct vnode *, int)); int (*um_valloc) __P((struct vnode *, int, struct ucred *, struct vnode **)); int (*um_vfree) __P((struct vnode *, ino_t, int)); }; #define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) #define UFS_TRUNCATE(aa, bb, cc, dd, ee) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd, ee) -#define UFS_UPDATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_update(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) #define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) #define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)