X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/2b60d8cec561348fc42a4fcbcd49ddbab7d3fc54..41cbf46c7a2138bac55dc1e57cba06ae2f58e3b5:/sys/kern/vfs_bio.c diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f9f45156b3..e0ec0de25a 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -12,7 +12,7 @@ * John S. Dyson. * * $FreeBSD: src/sys/kern/vfs_bio.c,v 1.242.2.20 2003/05/28 18:38:10 alc Exp $ - * $DragonFly: src/sys/kern/vfs_bio.c,v 1.62 2006/04/24 21:44:52 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_bio.c,v 1.63 2006/04/27 23:28:32 dillon Exp $ */ /* @@ -3481,6 +3481,26 @@ vunmapbuf(struct buf *bp) bp->b_data = bp->b_saveaddr; } +/* + * Scan all buffers in the system and issue the callback. + */ +int +scan_all_buffers(int (*callback)(struct buf *, void *), void *info) +{ + int count = 0; + int error; + int n; + + for (n = 0; n < nbuf; ++n) { + if ((error = callback(&buf[n], info)) < 0) { + count = error; + break; + } + count += error; + } + return (count); +} + /* * print out statistics from the current status of the buffer pool * this can be toggeled by the system control option debug.syncprt