+ if (upl == NULL) {
+ int request_flags;
+
+ if (vp->v_mount->mnt_vtable->vfc_vfsflags & VFC_VFSVNOP_PAGEOUTV2) {
+ /*
+ * filesystem has requested the new form of VNOP_PAGEOUT for file
+ * backed objects... we will not grab the UPL befofe calling VNOP_PAGEOUT...
+ * it is the fileystem's responsibility to grab the range we're denoting
+ * via 'f_offset' and 'size' into a UPL... this allows the filesystem to first
+ * take any locks it needs, before effectively locking the pages into a UPL...
+ */
+ KERNEL_DEBUG_CONSTANT((MACHDBG_CODE(DBG_MACH_VM, 1)) | DBG_FUNC_START,
+ size, (int)f_offset, 0, 0, 0);
+
+ if ( (error_ret = VNOP_PAGEOUT(vp, NULL, upl_offset, (off_t)f_offset,
+ size, flags, ctx)) ) {
+ result = PAGER_ERROR;
+ }
+ KERNEL_DEBUG_CONSTANT((MACHDBG_CODE(DBG_MACH_VM, 1)) | DBG_FUNC_END,
+ size, 0, 0, 0, 0);
+
+ goto out;
+ }
+ if (flags & UPL_MSYNC)
+ request_flags = UPL_UBC_MSYNC | UPL_RET_ONLY_DIRTY;
+ else
+ request_flags = UPL_UBC_PAGEOUT | UPL_RET_ONLY_DIRTY;
+
+ ubc_create_upl(vp, f_offset, size, &upl, &pl, request_flags);
+
+ if (upl == (upl_t)NULL) {
+ result = PAGER_ERROR;
+ error_ret = EINVAL;
+ goto out;
+ }
+ upl_offset = 0;
+ } else
+ pl = ubc_upl_pageinfo(upl);
+