Lines Matching refs:sip

151 	struct swapinfo *sip;  in swap_phys_alloc()  local
156 sip = silast; in swap_phys_alloc()
160 if (sip == NULL) in swap_phys_alloc()
162 if (!(sip->si_flags & ST_INDEL) && in swap_phys_alloc()
163 (spgcnt_t)sip->si_nfpgs > 0) { in swap_phys_alloc()
166 if (*vpp != sip->si_vp || in swap_phys_alloc()
167 *offp < sip->si_soff || in swap_phys_alloc()
168 *offp >= sip->si_eoff) in swap_phys_alloc()
173 } else if (sip->si_nfpgs == 0) in swap_phys_alloc()
174 sip->si_allocs = 0; in swap_phys_alloc()
175 if ((sip = sip->si_next) == NULL) in swap_phys_alloc()
176 sip = swapinfo; in swap_phys_alloc()
177 } while (sip != silast); in swap_phys_alloc()
181 soff = swap_getoff(sip); in swap_phys_alloc()
182 sip->si_nfpgs--; in swap_phys_alloc()
187 if (sip->si_nfpgs == 0) in swap_phys_alloc()
191 noff = swap_getoff(sip); in swap_phys_alloc()
195 CLEARBIT(sip->si_swapslots, btop(noff - sip->si_soff)); in swap_phys_alloc()
198 sip->si_nfpgs--; in swap_phys_alloc()
200 *vpp = sip->si_vp; in swap_phys_alloc()
203 ASSERT((spgcnt_t)sip->si_nfpgs >= 0); in swap_phys_alloc()
204 sip->si_allocs += btop(len); in swap_phys_alloc()
205 if (sip->si_allocs >= swap_maxcontig) { in swap_phys_alloc()
206 sip->si_allocs = 0; in swap_phys_alloc()
207 if ((silast = sip->si_next) == NULL) in swap_phys_alloc()
211 "swap_alloc:sip %p offset %lx", sip, soff); in swap_phys_alloc()
223 swap_getoff(struct swapinfo *sip) in swap_getoff() argument
230 sip->si_alloccnt++; in swap_getoff()
231 for (sp = &sip->si_swapslots[sip->si_hint >> MAPSHIFT], in swap_getoff()
232 ep = &sip->si_swapslots[sip->si_mapsize / NBPW]; sp < ep; sp++) { in swap_getoff()
236 sip->si_checkcnt++; in swap_getoff()
240 sip->si_hint, 0, 0, 0, 0); in swap_getoff()
245 for (sp = &sip->si_swapslots[sip->si_hint >> MAPSHIFT], in swap_getoff()
246 ep = sip->si_swapslots; sp > ep; sp--) { in swap_getoff()
250 sip->si_checkcnt++; in swap_getoff()
253 for (sp = sip->si_swapslots, in swap_getoff()
254 ep = &sip->si_swapslots[sip->si_hint >> MAPSHIFT]; in swap_getoff()
259 sip->si_checkcnt++; in swap_getoff()
275 aoff = ((char *)sp - (char *)sip->si_swapslots) * NBBY; in swap_getoff()
277 for (boff = (sip->si_hint % NBBW); boff < NBBW; boff++) { in swap_getoff()
278 if (!TESTBIT(sip->si_swapslots, aoff + boff)) in swap_getoff()
281 sip->si_checkcnt++; in swap_getoff()
283 for (boff = 0; boff < (sip->si_hint % NBBW); boff++) { in swap_getoff()
284 if (!TESTBIT(sip->si_swapslots, aoff + boff)) in swap_getoff()
287 sip->si_checkcnt++; in swap_getoff()
289 panic("swap_getoff: didn't find slot in word hint %ld", sip->si_hint); in swap_getoff()
301 if (poff + sip->si_soff >= sip->si_eoff) in swap_getoff()
303 aoff, boff, ptob(slotnumber), (long)sip->si_eoff); in swap_getoff()
304 ASSERT(poff < sip->si_eoff); in swap_getoff()
309 SETBIT(sip->si_swapslots, slotnumber); in swap_getoff()
310 sip->si_hint = slotnumber + 1; /* hint = next slot */ in swap_getoff()
311 return (poff + sip->si_soff); in swap_getoff()
320 struct swapinfo *sip; in swap_phys_free() local
324 sip = swapinfo; in swap_phys_free()
327 if (sip->si_vp == vp && in swap_phys_free()
328 sip->si_soff <= off && off < sip->si_eoff) { in swap_phys_free()
329 for (pagenumber = btop(off - sip->si_soff), in swap_phys_free()
335 pagenumber, sip, 0, 0, 0); in swap_phys_free()
336 if (!TESTBIT(sip->si_swapslots, pagenumber)) { in swap_phys_free()
340 ptob(pagenumber) + sip->si_soff); in swap_phys_free()
342 CLEARBIT(sip->si_swapslots, pagenumber); in swap_phys_free()
343 sip->si_nfpgs++; in swap_phys_free()
345 ASSERT(sip->si_nfpgs <= sip->si_npgs); in swap_phys_free()
349 } while ((sip = sip->si_next) != NULL); in swap_phys_free()
380 struct swapinfo *sip; in swap_in_range() local
387 sip = swapinfo; in swap_in_range()
388 if (vp && sip) { in swap_in_range()
390 if (vp != sip->si_vp || eoff <= sip->si_soff || in swap_in_range()
391 offset >= sip->si_eoff) in swap_in_range()
395 } while ((sip = sip->si_next) != NULL); in swap_in_range()
446 struct swapinfo *sip, *csip, *tsip; in swapctl() local
600 for (sip = swapinfo, nswap = 0; in swapctl()
601 sip != NULL && nswap < nswapfiles; in swapctl()
602 sip = sip->si_next, nswap++) { in swapctl()
604 (sip->si_eoff - sip->si_soff) >> SCTRSHFT; in swapctl()
605 st.ste_pages += sip->si_npgs; in swapctl()
606 st.ste_free += sip->si_nfpgs; in swapctl()
673 for (sip = swapinfo, tsip = csip, tpname = pname, nswap = 0; in swapctl()
674 sip && nswap < tmp_nswapfiles; in swapctl()
675 sip = sip->si_next, tsip++, tpname += plen, nswap++) { in swapctl()
676 plen = sip->si_pnamelen; in swapctl()
682 *tsip = *sip; in swapctl()
684 (void) strcpy(tsip->si_pname, sip->si_pname); in swapctl()
688 if (sip) { in swapctl()
793 struct swapinfo *sip, *csip, *tsip; in swapctl32() local
906 for (sip = swapinfo, nswap = 0; in swapctl32()
907 sip != NULL && nswap < nswapfiles; in swapctl32()
908 sip = sip->si_next, nswap++) { in swapctl32()
910 (sip->si_eoff - sip->si_soff) >> SCTRSHFT; in swapctl32()
911 st.ste_pages += sip->si_npgs; in swapctl32()
912 st.ste_free += sip->si_nfpgs; in swapctl32()
977 for (sip = swapinfo, tsip = csip, tpname = pname, nswap = 0; in swapctl32()
978 (sip != NULL) && (nswap < tmp_nswapfiles); in swapctl32()
979 sip = sip->si_next, tsip++, tpname += plen, nswap++) { in swapctl32()
980 plen = sip->si_pnamelen; in swapctl32()
986 *tsip = *sip; in swapctl32()
988 (void) strcpy(tsip->si_pname, sip->si_pname); in swapctl32()
992 if (sip != NULL) { in swapctl32()
1595 struct swapinfo *sip) in swapslot_free() argument
1605 ASSERT(sip->si_vp != NULL); in swapslot_free()
1618 if (error || pvp != sip->si_vp || poff < sip->si_soff || in swapslot_free()
1619 poff >= sip->si_eoff) { in swapslot_free()
1663 if ((ap != NULL) && (ap->an_pvp == sip->si_vp && ap->an_poff >= in swapslot_free()
1664 sip->si_soff && ap->an_poff < sip->si_eoff)) { in swapslot_free()