#include <kern/assert.h>
#include <sys/kdebug.h>
-#include <machine/spl.h>
-
#include <nfs/rpcv2.h>
#include <nfs/nfsproto.h>
#include <nfs/nfs.h>
#include <vm/vm_protos.h>
+#include <vfs/vfs_disk_conditioner.h>
void
vnode_pager_throttle()
throttle_lowpri_io(1);
}
-
boolean_t
vnode_pager_isSSD(vnode_t vp)
{
- if (vp->v_mount->mnt_kern_flag & MNTK_SSD)
- return (TRUE);
- return (FALSE);
+ return disk_conditioner_mount_is_ssd(vp->v_mount);
}
#if CONFIG_IOSCHED
* in each call to ensure that the entire range is covered.
*/
error = VNOP_BLOCKMAP (vp, current_offset, remaining_length,
- &io_blockno, &io_bytecount, NULL, VNODE_READ, NULL);
+ &io_blockno, &io_bytecount, NULL, VNODE_READ | VNODE_BLOCKMAP_NO_TRACK, NULL);
if (error) {
goto trim_exit;
else
request_flags = UPL_UBC_PAGEOUT | UPL_RET_ONLY_DIRTY;
- if (ubc_create_upl(vp, f_offset, size, &upl, &pl, request_flags) != KERN_SUCCESS) {
+ if (ubc_create_upl_kernel(vp, f_offset, size, &upl, &pl, request_flags, VM_KERN_MEMORY_FILE) != KERN_SUCCESS) {
result = PAGER_ERROR;
error_ret = EINVAL;
goto out;
}
goto out;
}
- ubc_create_upl(vp, f_offset, size, &upl, &pl, UPL_UBC_PAGEIN | UPL_RET_ONLY_ABSENT);
+ ubc_create_upl_kernel(vp, f_offset, size, &upl, &pl, UPL_UBC_PAGEIN | UPL_RET_ONLY_ABSENT, VM_KERN_MEMORY_FILE);
if (upl == (upl_t)NULL) {
result = PAGER_ABSENT;
if(error == EAGAIN) {
ubc_upl_abort_range(upl, (upl_offset_t) xoff, xsize, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_RESTART);
}
-#if CONFIG_PROTECT
if(error == EPERM) {
ubc_upl_abort_range(upl, (upl_offset_t) xoff, xsize, UPL_ABORT_FREE_ON_EMPTY | UPL_ABORT_ERROR);
}
-#endif
}
result = PAGER_ERROR;
error = PAGER_ERROR;
return (error);
}
-void
-vnode_pager_shutdown(void)
-{
- int i;
- vnode_t vp;
-
- for(i = 0; i < MAX_BACKING_STORE; i++) {
- vp = (vnode_t)(bs_port_table[i]).vp;
- if (vp) {
- (bs_port_table[i]).vp = 0;
-
- /* get rid of macx_swapon() reference */
- vnode_rele(vp);
- }
- }
-}
-
-
void *
upl_get_internal_page_list(upl_t upl)
{