[BACK]Return to subr_pool.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/subr_pool.c between version 1.71 and 1.72

version 1.71, 2002/03/09 01:37:19 version 1.72, 2002/03/09 01:56:27
Line 1041  pool_put(struct pool *pp, void *v)
Line 1041  pool_put(struct pool *pp, void *v)
 #endif  #endif
   
 /*  /*
  * Add N items to the pool.  
  */  
 int  
 pool_prime(struct pool *pp, int n)  
 {  
         struct pool_item_header *ph;  
         caddr_t cp;  
         int newpages, error = 0;  
   
         simple_lock(&pp->pr_slock);  
   
         newpages = roundup(n, pp->pr_itemsperpage) / pp->pr_itemsperpage;  
   
         while (newpages-- > 0) {  
                 simple_unlock(&pp->pr_slock);  
                 cp = pool_allocator_alloc(pp, PR_NOWAIT);  
                 if (__predict_true(cp != NULL))  
                         ph = pool_alloc_item_header(pp, cp, PR_NOWAIT);  
                 simple_lock(&pp->pr_slock);  
   
                 if (__predict_false(cp == NULL || ph == NULL)) {  
                         error = ENOMEM;  
                         if (cp != NULL)  
                                 pool_allocator_free(pp, cp);  
                         break;  
                 }  
   
                 pool_prime_page(pp, cp, ph);  
                 pp->pr_npagealloc++;  
                 pp->pr_minpages++;  
         }  
   
         if (pp->pr_minpages >= pp->pr_maxpages)  
                 pp->pr_maxpages = pp->pr_minpages + 1;  /* XXX */  
   
         simple_unlock(&pp->pr_slock);  
         return (0);  
 }  
   
 /*  
  * Add a page worth of items to the pool.   * Add a page worth of items to the pool.
  *   *
  * Note, we must be called with the pool descriptor LOCKED.   * Note, we must be called with the pool descriptor LOCKED.

Legend:
Removed from v.1.71  
changed lines
  Added in v.1.72

CVSweb <webmaster@jp.NetBSD.org>