Lines Matching refs:pfreecnt

411 getpbuf(int *pfreecnt)  in getpbuf()  argument
418 while (pfreecnt && *pfreecnt <= 0) { in getpbuf()
419 tsleep_interlock(pfreecnt, 0); in getpbuf()
420 if ((int)atomic_fetchadd_int(pfreecnt, 0) <= 0) in getpbuf()
421 tsleep(pfreecnt, PINTERLOCKED, "wswbuf0", 0); in getpbuf()
444 if (pfreecnt) in getpbuf()
445 atomic_add_int(pfreecnt, -1); in getpbuf()
456 getpbuf_kva(int *pfreecnt) in getpbuf_kva() argument
463 while (pfreecnt && *pfreecnt <= 0) { in getpbuf_kva()
464 tsleep_interlock(pfreecnt, 0); in getpbuf_kva()
465 if ((int)atomic_fetchadd_int(pfreecnt, 0) <= 0) in getpbuf_kva()
466 tsleep(pfreecnt, PINTERLOCKED, "wswbuf2", 0); in getpbuf_kva()
489 if (pfreecnt) in getpbuf_kva()
490 atomic_add_int(pfreecnt, -1); in getpbuf_kva()
505 getpbuf_mem(int *pfreecnt) in getpbuf_mem() argument
512 while (pfreecnt && *pfreecnt <= 0) { in getpbuf_mem()
513 tsleep_interlock(pfreecnt, 0); in getpbuf_mem()
514 if ((int)atomic_fetchadd_int(pfreecnt, 0) <= 0) in getpbuf_mem()
515 tsleep(pfreecnt, PINTERLOCKED, "wswbuf4", 0); in getpbuf_mem()
538 if (pfreecnt) in getpbuf_mem()
539 atomic_add_int(pfreecnt, -1); in getpbuf_mem()
558 trypbuf(int *pfreecnt) in trypbuf() argument
565 if (*pfreecnt <= 0 || TAILQ_FIRST(&bswlist_raw[iter]) == NULL) { in trypbuf()
570 if (*pfreecnt <= 0 || in trypbuf()
578 atomic_add_int(pfreecnt, -1); in trypbuf()
590 trypbuf_kva(int *pfreecnt) in trypbuf_kva() argument
597 if (*pfreecnt <= 0 || TAILQ_FIRST(&bswlist_kva[iter]) == NULL) { in trypbuf_kva()
602 if (*pfreecnt <= 0 || in trypbuf_kva()
610 atomic_add_int(pfreecnt, -1); in trypbuf_kva()
630 relpbuf(struct buf *bp, int *pfreecnt) in relpbuf() argument
647 if (pfreecnt) { in relpbuf()
648 if (atomic_fetchadd_int(pfreecnt, 1) == 1) in relpbuf()
661 if (pfreecnt) { in relpbuf()
662 if (atomic_fetchadd_int(pfreecnt, 1) == 1) in relpbuf()
676 if (pfreecnt) { in relpbuf()
677 if (atomic_fetchadd_int(pfreecnt, 1) == 1) in relpbuf()
685 wakeup(pfreecnt); in relpbuf()
689 pbuf_adjcount(int *pfreecnt, int n) in pbuf_adjcount() argument
692 atomic_add_int(pfreecnt, n); in pbuf_adjcount()
693 wakeup(pfreecnt); in pbuf_adjcount()