Lines Matching defs:anon
56 * A->K anon page to wired kernel page (e.g. mbuf data area)
57 * O->A uvm_object to anon loan (e.g. vnode page to an anon)
63 * of page is considered "owned" by the uvm_object (not the anon).
72 * object/anon which the page is owned by. this is a good side-effect,
78 * an anon may "adopt" an orphaned page.
143 struct vm_anon *anon;
161 * find the page we want. check the anon layer first.
165 anon = amap_lookup(aref, curaddr - ufi->entry->start);
167 anon = NULL;
171 if (anon) {
172 rv = uvm_loananon(ufi, output, flags, anon);
230 * => result is either an array of anon's or vm_pages (depending on flags)
332 * uvm_loananon: loan a page from an anon out
344 struct vm_anon *anon)
352 * if we are loaning to "another" anon then it is easy, we just
353 * bump the reference count on the current anon and return a
358 KASSERT(rw_write_held(anon->an_lock));
359 pg = anon->an_page;
360 if (pg && (pg->flags & PG_ANON) != 0 && anon->an_ref == 1) {
371 anon->an_ref++;
372 **output = anon;
384 KASSERT(rw_write_held(anon->an_lock));
385 error = uvmfault_anonget(ufi, ufi->entry->aref.ar_amap, anon);
388 * if we were unable to get the anon, then uvmfault_anonget has
415 pg = anon->an_page;
735 * must be a loan to an anon. check to see if there is already
736 * an anon associated with this page. if so, then just return
743 anon = pg->uanon;
744 anon->an_ref++;
751 **output = anon;
757 * need to allocate a new anon
760 anon = uvm_analloc();
761 if (anon == NULL) {
774 pg->uanon = anon;
775 anon->an_page = pg;
776 anon->an_lock = /* TODO: share amap lock */
783 rw_exit(&anon->an_lock);
784 **output = anon;
799 if (anon) {
800 anon->an_ref--;
801 uvm_anfree(anon);
874 * loaning to an anon. check to see if there is already an anon
880 anon = pg->uanon;
881 rw_enter(&anon->an_lock, RW_WRITER);
882 anon->an_ref++;
883 rw_exit(&anon->an_lock);
885 **output = anon;
891 * need to allocate a new anon
894 anon = uvm_analloc();
895 if (anon == NULL) {
901 anon->an_page = pg;
902 pg->uanon = anon;
908 rw_exit(&anon->an_lock);
910 **output = anon;
929 struct vm_anon *anon, *to_free = NULL;
934 anon = *aloans++;
935 if (--anon->an_ref == 0) {
936 uvm_anfree(anon);
959 * do a little dance to acquire the object or anon lock
981 * drop our loan. if page is owned by an anon but
982 * PG_ANON is not set, the page was loaned to the anon
984 * this by turning the anon's loan into real ownership
988 * an anon) or free it (if the page is now unowned).
1129 * an anon (i.e. we are breaking an O->K
1161 uvm_loanbreak_anon(struct vm_anon *anon, struct uvm_object *uobj)
1166 KASSERT(rw_write_held(anon->an_lock));
1168 KASSERT(anon->an_page->loan_count > 0);
1176 oldpg = anon->an_page;
1183 oldstatus = uvm_pagegetdirty(anon->an_page);
1205 /* install new page in anon */
1206 anon->an_page = newpg;
1207 newpg->uanon = anon;