]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/bsd_vm.c
xnu-1699.26.8.tar.gz
[apple/xnu.git] / osfmk / vm / bsd_vm.c
index 347a76883c2f50d0a8c9294859cbbfa0ebaf2ceb..cd8dc83173b6daa18a65d8ccf5847cc0595e31a8 100644 (file)
@@ -92,26 +92,6 @@ mach_get_vm_end(vm_map_t map)
        return( vm_map_last_entry(map)->vme_end);
 }
 
-/*
- * Legacy routines to get the start and end for a vm_map_t.  They
- * return them in the vm_offset_t format.  So, they should only be
- * called on maps that are the same size as the kernel map for
- * accurate results.
- */
-vm_offset_t
-get_vm_start(
-       vm_map_t map)
-{
-       return(CAST_DOWN(vm_offset_t, vm_map_first_entry(map)->vme_start));
-}
-
-vm_offset_t
-get_vm_end(
-       vm_map_t map)
-{
-       return(CAST_DOWN(vm_offset_t, vm_map_last_entry(map)->vme_end));
-}
-
 /* 
  * BSD VNODE PAGER 
  */
@@ -128,6 +108,7 @@ const struct memory_object_pager_ops vnode_pager_ops = {
        vnode_pager_synchronize,
        vnode_pager_map,
        vnode_pager_last_unmap,
+       NULL, /* data_reclaim */
        "vnode pager"
 };
 
@@ -452,11 +433,14 @@ memory_object_control_uiomove(
                                         */
                                        break;
                                }
-                               if (dst_page->pageout) {
+                               if (dst_page->pageout || dst_page->cleaning) {
                                        /*
                                         * this is the list_req_pending | pageout | busy case
-                                        * which can originate from both the pageout_scan and
-                                        * msync worlds... we need to reset the state of this page to indicate
+                                        * or the list_req_pending | cleaning case...
+                                        * which originate from the pageout_scan and
+                                        * msync worlds for the pageout case and the hibernate
+                                        * pre-cleaning world for the cleaning case...
+                                        * we need to reset the state of this page to indicate
                                         * it should stay in the cache marked dirty... nothing else we
                                         * can do at this point... we can't block on it, we can't busy
                                         * it and we can't clean it from this routine.
@@ -599,6 +583,10 @@ vnode_pager_bootstrap(void)
        size = (vm_size_t) sizeof(struct vnode_pager);
        vnode_pager_zone = zinit(size, (vm_size_t) MAX_VNODE*size,
                                PAGE_SIZE, "vnode pager structures");
+       zone_change(vnode_pager_zone, Z_CALLERACCT, FALSE);
+       zone_change(vnode_pager_zone, Z_NOENCRYPT, TRUE);
+
+
 #if CONFIG_CODE_DECRYPTION
        apple_protect_pager_bootstrap();
 #endif /* CONFIG_CODE_DECRYPTION */
@@ -744,6 +732,22 @@ vnode_pager_check_hard_throttle(
        return KERN_SUCCESS;
 }
 
+kern_return_t
+vnode_pager_get_isSSD(
+       memory_object_t         mem_obj,
+       boolean_t               *isSSD)
+{
+       vnode_pager_t   vnode_object;
+
+       if (mem_obj->mo_pager_ops != &vnode_pager_ops)
+               return KERN_INVALID_ARGUMENT;
+
+       vnode_object = vnode_pager_lookup(mem_obj);
+
+       *isSSD = vnode_pager_isSSD(vnode_object->vnode_handle);
+       return KERN_SUCCESS;
+}
+
 kern_return_t
 vnode_pager_get_object_size(
        memory_object_t         mem_obj,
@@ -816,6 +820,25 @@ vnode_pager_get_object_cs_blobs(
                                        blobs);
 }
 
+#if CHECK_CS_VALIDATION_BITMAP
+kern_return_t
+vnode_pager_cs_check_validation_bitmap( 
+       memory_object_t mem_obj, 
+       memory_object_offset_t  offset,
+        int            optype  )
+{
+       vnode_pager_t   vnode_object;
+
+       if (mem_obj == MEMORY_OBJECT_NULL ||
+           mem_obj->mo_pager_ops != &vnode_pager_ops) {
+               return KERN_INVALID_ARGUMENT;
+       }
+
+       vnode_object = vnode_pager_lookup(mem_obj);
+       return ubc_cs_check_validation_bitmap( vnode_object->vnode_handle, offset, optype );
+}
+#endif /* CHECK_CS_VALIDATION_BITMAP */
+
 /*
  *
  */