| 186 | } |
| 187 | |
| 188 | static void |
| 189 | sendfile_free_mext_pg(struct mbuf *m) |
| 190 | { |
| 191 | vm_page_t pg; |
| 192 | int flags, i; |
| 193 | bool cache_last; |
| 194 | |
| 195 | M_ASSERTEXTPG(m); |
| 196 | |
| 197 | cache_last = m->m_ext.ext_flags & EXT_FLAG_CACHE_LAST; |
| 198 | flags = (m->m_ext.ext_flags & EXT_FLAG_NOCACHE) != 0 ? VPR_TRYFREE : 0; |
| 199 | |
| 200 | for (i = 0; i < m->m_epg_npgs; i++) { |
| 201 | if (cache_last && i == m->m_epg_npgs - 1) |
| 202 | flags = 0; |
| 203 | pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); |
| 204 | vm_page_release(pg, flags); |
| 205 | } |
| 206 | |
| 207 | if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { |
| 208 | struct sendfile_sync *sfs = m->m_ext.ext_arg1; |
| 209 | sendfile_sync_signal(sfs); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | * Helper function to calculate how much data to put into page i of n. |
nothing calls this directly
no test coverage detected