Data Flushing

A kernel extension uses the vm_write or vm_writep kernel services depending on the addressability to the data area.

A kernel extension can initiate the writing of a data area to external storage with the vm_write kernel service, if it has addressability to the data area. The vm_writep kernel service can be used if the virtual memory object is not currently addressable.

If the kernel extension needs to ensure that the data is moved successfully, it can wait on the I/O completion by calling the vms_iowait service, giving the virtual memory object as an argument.