Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Keep free block statistics.



details:   https://anonhg.NetBSD.org/src/rev/c9522f680202
branches:  trunk
changeset: 484164:c9522f680202
user:      augustss <augustss%NetBSD.org@localhost>
date:      Mon Mar 27 08:27:03 2000 +0000

description:
Keep free block statistics.

diffstat:

 sys/dev/usb/usb_mem.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 7cd24b2ef1d2 -r c9522f680202 sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c     Mon Mar 27 08:01:09 2000 +0000
+++ b/sys/dev/usb/usb_mem.c     Mon Mar 27 08:27:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_mem.c,v 1.17 1999/12/18 22:47:11 augustss Exp $    */
+/*     $NetBSD: usb_mem.c,v 1.18 2000/03/27 08:27:03 augustss Exp $    */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -87,6 +87,7 @@
 
 static LIST_HEAD(, usb_dma_block) usb_blk_freelist = 
        LIST_HEAD_INITIALIZER(usb_blk_freelist);
+int usb_blk_nfree = 0;
 /* XXX should have different free list for different tags (for speed) */
 static LIST_HEAD(, usb_frag_dma) usb_frag_freelist =
        LIST_HEAD_INITIALIZER(usb_frag_freelist);
@@ -117,6 +118,7 @@
        for (p = LIST_FIRST(&usb_blk_freelist); p; p = LIST_NEXT(p, next)) {
                if (p->tag == tag && p->size >= size && p->align >= align) {
                        LIST_REMOVE(p, next);
+                       usb_blk_nfree--;
                        splx(s);
                        *dmap = p;
                        DPRINTFN(6,("usb_block_allocmem: free list size=%lu\n",
@@ -206,6 +208,7 @@
        DPRINTFN(6, ("usb_block_freemem: size=%lu\n", (u_long)p->size));
        s = splusb();
        LIST_INSERT_HEAD(&usb_blk_freelist, p, next);
+       usb_blk_nfree++;
        splx(s);
 }
 



Home | Main Index | Thread Index | Old Index