diff options
author | bde <bde@FreeBSD.org> | 1999-01-07 16:14:19 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-01-07 16:14:19 +0000 |
commit | 2facf6978aee7d6b1f5ca50f86f5a3784bf8dc19 (patch) | |
tree | 35574972d06a1d702f3f738ba45c782641845a3a /sys/ufs/ffs | |
parent | 9625424b5fb4fcb6b1736c570b2cdb8125017e32 (diff) | |
download | FreeBSD-src-2facf6978aee7d6b1f5ca50f86f5a3784bf8dc19.zip FreeBSD-src-2facf6978aee7d6b1f5ca50f86f5a3784bf8dc19.tar.gz |
Don't pass unused unused timestamp args to UFS_UPDATE() or waste
time initializing them. This almost finishes centralizing (in-core)
timestamp updates in ufs_itimes().
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 9 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 18 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 38 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 6 |
6 files changed, 39 insertions, 44 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 1460540..2794e32 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 0cb97ee..938899a 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 5f6ab9c..b474bc5 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 fb67658..433cafe 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 42f25bc..2973703 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 @@ loop: } 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 b14cd68..1823c0f 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 <sys/param.h> @@ -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 @@ loop2: } } splx(s); - getmicrotime(&tv); - return (UFS_UPDATE(vp, &tv, &tv, ap->a_waitfor == MNT_WAIT)); + return (UFS_UPDATE(vp, ap->a_waitfor == MNT_WAIT)); } |