diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2006-10-21 18:09:53 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2006-10-21 18:09:53 +0000 |
commit | e29586cef7eeb80ae2b3911bad15c289f94a2332 (patch) | |
tree | 21ee8166215291f9bb424cc80aa5c306be491b44 /sys | |
parent | d0e8f636ee6a51ad73fd6c2617eeaf1aae162618 (diff) |
Retire B_LOCKED and BQ_LOCKED. The last real usage of the
flag and the buffer queue went away when LFS was removed.
ok, pedro@
"looks sane", deraadt@
testing: tybollt@solace.miun.se
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_bio.c | 39 | ||||
-rw-r--r-- | sys/sys/buf.h | 5 |
2 files changed, 17 insertions, 27 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 689f6a82bb0..eed078a6701 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.86 2006/10/19 12:04:31 mickey Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.87 2006/10/21 18:09:52 thib Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /*- @@ -78,12 +78,11 @@ u_long bufhash; /* * Definitions for the buffer free lists. */ -#define BQUEUES 4 /* number of free buffer queues */ +#define BQUEUES 3 /* number of free buffer queues */ -#define BQ_LOCKED 0 /* super-blocks &c */ -#define BQ_CLEAN 1 /* LRU queue with clean buffers */ -#define BQ_DIRTY 2 /* LRU queue with dirty buffers */ -#define BQ_EMPTY 3 /* buffer headers with no memory */ +#define BQ_CLEAN 0 /* LRU queue with clean buffers */ +#define BQ_DIRTY 1 /* LRU queue with dirty buffers */ +#define BQ_EMPTY 2 /* buffer headers with no memory */ TAILQ_HEAD(bqueues, buf) bufqueues[BQUEUES]; int needbuffer; @@ -152,7 +151,7 @@ bremfree(struct buf *bp) } if (bp->b_bufsize <= 0) { numemptybufs--; - } else if (!ISSET(bp->b_flags, B_LOCKED)) { + } else { numfreepages -= btoc(bp->b_bufsize); if (!ISSET(bp->b_flags, B_DELWRI)) { numcleanpages -= btoc(bp->b_bufsize); @@ -494,10 +493,6 @@ brelse(struct buf *bp) * Determine which queue the buffer should be on, then put it there. */ - /* If it's locked, don't report an error; try again later. */ - if (ISSET(bp->b_flags, (B_LOCKED|B_ERROR)) == (B_LOCKED|B_ERROR)) - CLR(bp->b_flags, B_ERROR); - /* If it's not cacheable, or an error, mark it invalid. */ if (ISSET(bp->b_flags, (B_NOCACHE|B_ERROR))) SET(bp->b_flags, B_INVAL); @@ -533,18 +528,14 @@ brelse(struct buf *bp) * It has valid data. Put it on the end of the appropriate * queue, so that it'll stick around for as long as possible. */ - if (ISSET(bp->b_flags, B_LOCKED)) - /* locked in core */ - bufq = &bufqueues[BQ_LOCKED]; - else { - numfreepages += btoc(bp->b_bufsize); - if (!ISSET(bp->b_flags, B_DELWRI)) { - numcleanpages += btoc(bp->b_bufsize); - bufq = &bufqueues[BQ_CLEAN]; - } else { - numdirtypages += btoc(bp->b_bufsize); - bufq = &bufqueues[BQ_DIRTY]; - } + numfreepages += btoc(bp->b_bufsize); + + if (!ISSET(bp->b_flags, B_DELWRI)) { + numcleanpages += btoc(bp->b_bufsize); + bufq = &bufqueues[BQ_CLEAN]; + } else { + numdirtypages += btoc(bp->b_bufsize); + bufq = &bufqueues[BQ_DIRTY]; } if (ISSET(bp->b_flags, B_AGE)) binsheadfree(bp, bufq); @@ -999,7 +990,7 @@ vfs_bufstats(void) int totals[BQUEUES]; long ptotals[BQUEUES]; long pages; - static char *bname[BQUEUES] = { "LOCKED", "CLEAN", "DIRTY", "EMPTY" }; + static char *bname[BQUEUES] = { "CLEAN", "DIRTY", "EMPTY" }; s = splbio(); for (dp = bufqueues, i = 0; dp < &bufqueues[BQUEUES]; dp++, i++) { diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 7d61ab6020a..15a7cde33e4 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.h,v 1.52 2006/10/19 12:04:31 mickey Exp $ */ +/* $OpenBSD: buf.h,v 1.53 2006/10/21 18:09:52 thib Exp $ */ /* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */ /* @@ -152,7 +152,6 @@ struct buf *bufq_default_get(struct bufq *); #define B_EINTR 0x00000400 /* I/O was interrupted */ #define B_ERROR 0x00000800 /* I/O error occurred. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ -#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_PAGET 0x00010000 /* Page in/out of page table space. */ #define B_PGIN 0x00020000 /* Pagein op, so swap() can count it. */ @@ -171,7 +170,7 @@ struct buf *bufq_default_get(struct bufq *); #define B_BITS "\010\001AGE\002NEEDCOMMIT\003ASYNC\004BAD\005BUSY\006CACHE" \ "\007CALL\010DELWRI\011DIRTY\012DONE\013EINTR\014ERROR" \ - "\016INVAL\017LOCKED\020NOCACHE\021PAGET\022PGIN\023PHYS\024RAW\025READ" \ + "\016INVAL\020NOCACHE\021PAGET\022PGIN\023PHYS\024RAW\025READ" \ "\026TAPE\027UAREA\030WANTED\031WRITEINPROG\032XXX\033DEFERRED" \ "\034SCANNED\035PDAEMON" |