From bffcbc4a301ed3d8680cb02d51b34a354edd5db7 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 4 Oct 2021 08:11:03 +0000 Subject: 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@ --- sys/ufs/ext2fs/ext2fs_vfsops.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/ufs/ext2fs') 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; -- cgit v1.2.3