+ if (nbdwrite > ((nbuf/4)*3) && operation == BLK_WRITE) {
+#define __BUFFERS_RECLAIMED 2
+ struct buf *tbp[__BUFFERS_RECLAIMED];
+ int i;
+
+ /* too many delayed writes, try to free up some buffers */
+ for (i = 0; i < __BUFFERS_RECLAIMED; i++)
+ tbp[i] = geteblk(512);
+
+ /* Yield to IO thread */
+ (void)tsleep((caddr_t)&nbdwrite, PCATCH, "nbdwrite", 1);
+
+ for (i = (__BUFFERS_RECLAIMED - 1); i >= 0; i--)
+ brelse(tbp[i]);
+ }
+