| 1038 | } |
| 1039 | |
| 1040 | static void |
| 1041 | vm_fault_zerofill(struct faultstate *fs) |
| 1042 | { |
| 1043 | |
| 1044 | /* |
| 1045 | * If there's no object left, fill the page in the top |
| 1046 | * object with zeros. |
| 1047 | */ |
| 1048 | if (fs->object != fs->first_object) { |
| 1049 | vm_object_pip_wakeup(fs->object); |
| 1050 | fs->object = fs->first_object; |
| 1051 | fs->pindex = fs->first_pindex; |
| 1052 | } |
| 1053 | MPASS(fs->first_m != NULL); |
| 1054 | MPASS(fs->m == NULL); |
| 1055 | fs->m = fs->first_m; |
| 1056 | fs->first_m = NULL; |
| 1057 | |
| 1058 | /* |
| 1059 | * Zero the page if necessary and mark it valid. |
| 1060 | */ |
| 1061 | if ((fs->m->flags & PG_ZERO) == 0) { |
| 1062 | pmap_zero_page(fs->m); |
| 1063 | } else { |
| 1064 | VM_CNT_INC(v_ozfod); |
| 1065 | } |
| 1066 | VM_CNT_INC(v_zfod); |
| 1067 | vm_page_valid(fs->m); |
| 1068 | } |
| 1069 | |
| 1070 | /* |
| 1071 | * Allocate a page directly or via the object populate method. |
no test coverage detected