summaryrefslogtreecommitdiff
path: root/sys/gnu/ext2fs/ext2_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu/ext2fs/ext2_vnops.c')
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index f3b9bcc171096..07e94b84ef9f6 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -182,6 +182,7 @@ ext2_fsync(ap)
{
register struct vnode *vp = ap->a_vp;
register struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s;
@@ -196,8 +197,8 @@ ext2_fsync(ap)
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -221,14 +222,15 @@ loop:
tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0);
}
#if DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("ext2_fsync: dirty", vp);
goto loop;
}
#endif
}
splx(s);
- return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
/*
@@ -318,6 +320,7 @@ 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
@@ -346,7 +349,8 @@ ext2_link(ap)
}
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(vp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
if (!error)
error = ext2_direnter(ip, tdvp, cnp);
if (error) {
@@ -385,6 +389,7 @@ 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;
@@ -522,7 +527,8 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -583,7 +589,7 @@ abortit:
}
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(tdvp, 1);
+ error = UFS_UPDATE(tdvp, &tv, &tv, 1);
if (error)
goto bad;
}
@@ -592,7 +598,7 @@ abortit:
if (doingdirectory && newparent) {
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -801,6 +807,7 @@ ext2_mkdir(ap)
register struct inode *ip, *dp;
struct vnode *tvp;
struct dirtemplate dirtemplate, *dtp;
+ struct timeval tv;
int error, dmode;
#ifdef DIAGNOSTIC
@@ -889,7 +896,8 @@ ext2_mkdir(ap)
ip->i_nlink = 2;
if (cnp->cn_flags & ISWHITEOUT)
ip->i_flags |= UF_OPAQUE;
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
/*
* Bump link count in parent directory
@@ -899,7 +907,7 @@ ext2_mkdir(ap)
*/
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(dvp, 1);
+ error = UFS_UPDATE(dvp, &tv, &tv, 1);
if (error)
goto bad;
@@ -1069,6 +1077,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
struct componentname *cnp;
{
register struct inode *ip, *pdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -1161,7 +1170,8 @@ ext2_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
if (error)
goto bad;
error = ext2_direnter(ip, dvp, cnp);