diff options
author | kib <kib@FreeBSD.org> | 2015-12-16 08:39:51 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-12-16 08:39:51 +0000 |
commit | 764a2409cb5541ae3a247c163556269e90a152bb (patch) | |
tree | 761b89f6580ed8e2e69eef77fc083157231df543 /sys/kern | |
parent | 2ae0fa54367a7d2d581cb9b2796991efb291293d (diff) | |
download | FreeBSD-src-764a2409cb5541ae3a247c163556269e90a152bb.zip FreeBSD-src-764a2409cb5541ae3a247c163556269e90a152bb.tar.gz |
Simplify the loop step in the flushbuflist() and make it independed on
the type stability of the buffers memory. Instead of memoizing
pointer to the next buffer and validating it, remember the next
logical block number in the bo list and re-lookup.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2ec5bc1..9f9be55 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1652,10 +1652,9 @@ flushbuflist(struct bufv *bufv, int flags, struct bufobj *bo, int slpflag, bp->b_flags &= ~B_ASYNC; brelse(bp); BO_LOCK(bo); - if (nbp != NULL && - (nbp->b_bufobj != bo || - nbp->b_lblkno != lblkno || - (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) != xflags)) + nbp = gbincore(bo, lblkno); + if (nbp == NULL || (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) + != xflags) break; /* nbp invalid */ } return (retval); |