diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2013-01-18 08:52:05 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2013-01-18 08:52:05 +0000 |
commit | 0d78b3d36baf1c3aa5f0bd53570923edf18f0f3a (patch) | |
tree | 666c981975678596ad397a43935ad9e595f3e149 /sys/kern | |
parent | f242d92a495e2fd43920f92d919deaa0bc5ff537 (diff) |
Give buf_acquire_unmapped and B_NOTMAPPED a viking funeral as they should
really have been called "maybemapped and hope it all works out". - use
buf_acquire_nomap instead which acounts for busymapped bufs correctly.
ok krw@ guenther@ kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_biomem.c | 24 |
2 files changed, 6 insertions, 22 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index a733abcedbc..7a6a77d8ed6 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.143 2013/01/13 03:58:09 beck Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.144 2013/01/18 08:52:04 beck Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /* @@ -1035,7 +1035,7 @@ buf_get(struct vnode *vp, daddr64_t blkno, size_t size) LIST_INIT(&bp->b_dep); bp->b_bcount = size; - buf_acquire_unmapped(bp); + buf_acquire_nomap(bp); if (vp != NULL) { /* diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c index b8b160338a6..e93d071f281 100644 --- a/sys/kern/vfs_biomem.c +++ b/sys/kern/vfs_biomem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_biomem.c,v 1.21 2012/12/02 19:42:36 beck Exp $ */ +/* $OpenBSD: vfs_biomem.c,v 1.22 2013/01/18 08:52:04 beck Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> * @@ -82,18 +82,6 @@ buf_acquire(struct buf *bp) } /* - * Busy a buffer, but don't map it. - * If it has a mapping, we keep it, but we also keep the mapping on - * the list since we assume that it won't be used anymore. - */ -void -buf_acquire_unmapped(struct buf *bp) -{ - splassert(IPL_BIO); - SET(bp->b_flags, B_BUSY|B_NOTMAPPED); -} - -/* * Acquire a buf but do not map it. Preserve any mapping it did have. */ void @@ -101,9 +89,7 @@ buf_acquire_nomap(struct buf *bp) { splassert(IPL_BIO); SET(bp->b_flags, B_BUSY); - if (bp->b_data == NULL) - SET(bp->b_flags, B_NOTMAPPED); - else { + if (bp->b_data != NULL) { TAILQ_REMOVE(&buf_valist, bp, b_valist); bcstats.kvaslots_avail--; bcstats.busymapped++; @@ -162,8 +148,6 @@ buf_map(struct buf *bp) } bcstats.busymapped++; - - CLR(bp->b_flags, B_NOTMAPPED); } void @@ -171,7 +155,7 @@ buf_release(struct buf *bp) { KASSERT(bp->b_flags & B_BUSY); - KASSERT((bp->b_data != NULL) || (bp->b_flags & B_NOTMAPPED)); + KASSERT(bp->b_data != NULL); splassert(IPL_BIO); if (bp->b_data) { @@ -183,7 +167,7 @@ buf_release(struct buf *bp) wakeup(&buf_needva); } } - CLR(bp->b_flags, B_BUSY|B_NOTMAPPED); + CLR(bp->b_flags, B_BUSY); } /* |