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

Function vnode_pager_putpages

freebsd/vm/vnode_pager.c:1209–1241  ·  view source on GitHub ↗

* EOPNOTSUPP is no longer legal. For local media VFS's that do not * implement their own VOP_PUTPAGES, their VOP_PUTPAGES should call to * vnode_pager_generic_putpages() to implement the previous behaviour. * * All other FS's should use the bypass to get to the local media * backing vp's VOP_PUTPAGES. */

Source from the content-addressed store, hash-verified

1207 * backing vp's VOP_PUTPAGES.
1208 */
1209static void
1210vnode_pager_putpages(vm_object_t object, vm_page_t *m, int count,
1211 int flags, int *rtvals)
1212{
1213 int rtval;
1214 struct vnode *vp;
1215 int bytes = count * PAGE_SIZE;
1216
1217 /*
1218 * Force synchronous operation if we are extremely low on memory
1219 * to prevent a low-memory deadlock. VOP operations often need to
1220 * allocate more memory to initiate the I/O ( i.e. do a BMAP
1221 * operation ). The swapper handles the case by limiting the amount
1222 * of asynchronous I/O, but that sort of solution doesn't scale well
1223 * for the vnode pager without a lot of work.
1224 *
1225 * Also, the backing vnode's iodone routine may not wake the pageout
1226 * daemon up. This should be probably be addressed XXX.
1227 */
1228
1229 if (vm_page_count_min())
1230 flags |= VM_PAGER_PUT_SYNC;
1231
1232 /*
1233 * Call device-specific putpages function
1234 */
1235 vp = object->handle;
1236 VM_OBJECT_WUNLOCK(object);
1237 rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals);
1238 KASSERT(rtval != EOPNOTSUPP,
1239 ("vnode_pager: stale FS putpages\n"));
1240 VM_OBJECT_WLOCK(object);
1241}
1242
1243static int
1244vn_off2bidx(vm_ooffset_t offset)

Callers

nothing calls this directly

Calls 1

vm_page_count_minFunction · 0.85

Tested by

no test coverage detected