Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Encapsulate the test for a pool needing a pool_catc...
details: https://anonhg.NetBSD.org/src/rev/26972cea879b
branches: trunk
changeset: 509675:26972cea879b
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu May 10 01:37:40 2001 +0000
description:
Encapsulate the test for a pool needing a pool_catchup() in a macro.
diffstat:
sys/kern/subr_pool.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (38 lines):
diff -r ee00b692429a -r 26972cea879b sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c Thu May 10 01:31:40 2001 +0000
+++ b/sys/kern/subr_pool.c Thu May 10 01:37:40 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pool.c,v 1.52 2001/05/09 23:46:03 thorpej Exp $ */
+/* $NetBSD: subr_pool.c,v 1.53 2001/05/10 01:37:40 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1999, 2000 The NetBSD Foundation, Inc.
@@ -103,6 +103,9 @@
#define PR_HASH_INDEX(pp,addr) \
(((u_long)(addr) >> (pp)->pr_pageshift) & (PR_HASHTABSIZE - 1))
+#define POOL_NEEDS_CATCHUP(pp) \
+ ((pp)->pr_nitems < (pp)->pr_minitems)
+
/*
* Pool cache management.
*
@@ -775,7 +778,7 @@
* If we have a low water mark and we are now below that low
* water mark, add more items to the pool.
*/
- if (pp->pr_nitems < pp->pr_minitems && pool_catchup(pp) != 0) {
+ if (POOL_NEEDS_CATCHUP(pp) && pool_catchup(pp) != 0) {
/*
* XXX: Should we log a warning? Should we set up a timeout
* to try again in a second or so? The latter could break
@@ -1083,8 +1086,7 @@
: roundup(n, pp->pr_itemsperpage) / pp->pr_itemsperpage;
/* Make sure we're caught up with the newly-set low water mark. */
- if ((pp->pr_nitems < pp->pr_minitems) &&
- (error = pool_catchup(pp)) != 0) {
+ if (POOL_NEEDS_CATCHUP(pp) && (error = pool_catchup(pp) != 0)) {
/*
* XXX: Should we log a warning? Should we set up a timeout
* to try again in a second or so? The latter could break
Home |
Main Index |
Thread Index |
Old Index