From 658940525e08f0ecb72996a0146a1d16d1286490 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 20 Oct 1995 23:41:20 +0000 Subject: (enable_delayed_copies, force_delayed_copies): Replace fileinfo field with pager. (force_delayed_copies): Give diskfs_get_filemap a protection arg. --- ext2fs/truncate.c | 32 ++++++++++++++++---------------- 1 file 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); } } -- cgit v1.2.3