summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-10-04 08:11:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-10-04 08:11:03 +0000
commitbffcbc4a301ed3d8680cb02d51b34a354edd5db7 (patch)
tree7fc7a621395b957699d41b7eb5947e4410f67c14 /sys/ufs
parent7e174fc2f0c87344167c4296f0a42c2b2cd0b478 (diff)
Use the fact the vnodes are locked when operations are inflight.
Remove the v_inflight member and alter the ffs and ext2fs sync code to track inflight by checking if the node is locked or not (which it already did before but for a different reason). OK mpi@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c8
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c7
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index 4561dda88be..371ca53f096 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.115 2020/06/24 22:03:44 cheloha Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.116 2021/10/04 08:11:02 claudio Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -717,9 +717,6 @@ ext2fs_sync_vnode(struct vnode *vp, void *args)
if (vp->v_type == VNON)
return (0);
- if (vp->v_inflight)
- esa->inflight = MIN(esa->inflight+1, 65536);
-
ip = VTOI(vp);
if (ip->i_e2fs_nlink == 0)
@@ -731,7 +728,7 @@ ext2fs_sync_vnode(struct vnode *vp, void *args)
}
if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT)) {
- nlink0 = 1; /* potentially */
+ esa->inflight = MIN(esa->inflight+1, 65536);
goto end;
}
@@ -742,6 +739,7 @@ end:
esa->nlink0 = MIN(esa->nlink0 + nlink0, 65536);
return (0);
}
+
/*
* Go through the disk queues to initiate sandbagged IO;
* go through the inodes to write those that have been modified;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index a7cc61b2b51..48303e6a811 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.189 2021/05/01 16:18:29 gnezdo Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.190 2021/10/04 08:11:02 claudio Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -1165,9 +1165,6 @@ ffs_sync_vnode(struct vnode *vp, void *arg)
ip = VTOI(vp);
- if (vp->v_inflight && !(vp->v_type == VCHR || vp->v_type == VBLK))
- fsa->inflight = MIN(fsa->inflight+1, 65536);
-
/*
* If unmounting or converting rw to ro, then stop deferring
* timestamp writes.
@@ -1187,7 +1184,7 @@ ffs_sync_vnode(struct vnode *vp, void *arg)
}
if (vget(vp, LK_EXCLUSIVE | LK_NOWAIT)) {
- nlink0 = 1; /* potentially.. */
+ fsa->inflight = MIN(fsa->inflight+1, 65536);
goto end;
}