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

Function sf_buf_free

freebsd/kern/subr_sfbuf.c:176–196  ·  view source on GitHub ↗

* Remove a reference from the given sf_buf, adding it to the free * list when its reference count reaches zero. A freed sf_buf still, * however, retains its virtual-to-physical mapping until it is * recycled or reactivated by sf_buf_alloc(9). */

Source from the content-addressed store, hash-verified

174 * recycled or reactivated by sf_buf_alloc(9).
175 */
176void
177sf_buf_free(struct sf_buf *sf)
178{
179
180 if (PMAP_HAS_DMAP)
181 return;
182
183 mtx_lock(&sf_buf_lock);
184 sf->ref_count--;
185 if (sf->ref_count == 0) {
186 TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry);
187 nsfbufsused--;
188 if (sf_buf_unmap(sf)) {
189 sf->m = NULL;
190 LIST_REMOVE(sf, list_entry);
191 }
192 if (sf_buf_alloc_want > 0)
193 wakeup(&sf_buf_freelist);
194 }
195 mtx_unlock(&sf_buf_lock);
196}
197
198void
199sf_buf_ref(struct sf_buf *sf)

Callers 3

sendfile_free_mextFunction · 0.70
mb_unmapped_free_mextFunction · 0.70
exec_unmap_first_pageFunction · 0.70

Calls 4

mtx_lockFunction · 0.70
wakeupFunction · 0.70
mtx_unlockFunction · 0.70
sf_buf_unmapFunction · 0.50

Tested by

no test coverage detected