MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sendfile_free_mext_pg

Function sendfile_free_mext_pg

freebsd/kern/kern_sendfile.c:188–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static void
189sendfile_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.

Callers

nothing calls this directly

Calls 3

PHYS_TO_VM_PAGEFunction · 0.85
vm_page_releaseFunction · 0.85
sendfile_sync_signalFunction · 0.85

Tested by

no test coverage detected