diff options
author | Miles Bader <miles@gnu.org> | 1995-10-20 23:41:20 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-10-20 23:41:20 +0000 |
commit | 658940525e08f0ecb72996a0146a1d16d1286490 (patch) | |
tree | aa05ec28aba04ce4a135c06b7fa6cd64110d2429 /ext2fs | |
parent | a2b2f5603612964e252c179aa8fcea7108bdf714 (diff) |
(enable_delayed_copies, force_delayed_copies):
Replace fileinfo field with pager.
(force_delayed_copies): Give diskfs_get_filemap a protection arg.
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/truncate.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c index be843c3d..d868931f 100644 --- a/ext2fs/truncate.c +++ b/ext2fs/truncate.c @@ -219,42 +219,42 @@ poke_pages (memory_object_t obj, vm_offset_t start, vm_offset_t end) static void force_delayed_copies (struct node *node, off_t length) { - struct user_pager_info *upi; + struct pager *pager; spin_lock (&node_to_page_lock); - upi = node->dn->fileinfo; - if (upi) - ports_port_ref (upi->p); + pager = node->dn->pager; + if (pager) + ports_port_ref (pager); spin_unlock (&node_to_page_lock); - if (upi) + if (pager) { mach_port_t obj; - pager_change_attributes (upi->p, MAY_CACHE, MEMORY_OBJECT_COPY_NONE, 1); - obj = diskfs_get_filemap (node); + pager_change_attributes (pager, MAY_CACHE, MEMORY_OBJECT_COPY_NONE, 1); + obj = diskfs_get_filemap (node, VM_PROT_READ); poke_pages (obj, round_page (length), round_page (node->allocsize)); mach_port_deallocate (mach_task_self (), obj); - pager_flush_some (upi->p, round_page(length), node->allocsize - length, 1); - ports_port_deref (upi->p); + pager_flush_some (pager, round_page(length), node->allocsize - length, 1); + ports_port_deref (pager); } } static void enable_delayed_copies (struct node *node) { - struct user_pager_info *upi; + struct pager *pager; spin_lock (&node_to_page_lock); - upi = node->dn->fileinfo; - if (upi) - ports_port_ref (upi->p); + pager = node->dn->pager; + if (pager) + ports_port_ref (pager); spin_unlock (&node_to_page_lock); - if (upi) + if (pager) { - pager_change_attributes (upi->p, MAY_CACHE, MEMORY_OBJECT_COPY_DELAY, 0); - ports_port_deref (upi->p); + pager_change_attributes (pager, MAY_CACHE, MEMORY_OBJECT_COPY_DELAY, 0); + ports_port_deref (pager); } } |