diff options
author | Roland McGrath <roland@gnu.org> | 1999-10-03 10:23:23 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-10-03 10:23:23 +0000 |
commit | 1a47f0938f3ad432da4cca31a1a4b86af1699a70 (patch) | |
tree | e1444dd712a41c09e2042ce37514d54bd64dc5c3 /ext2fs/truncate.c | |
parent | 85771440500ca6234a3bc9d609123dd99b680a4c (diff) |
1999-10-03 Roland McGrath <roland@baalperazim.frob.com>
* truncate.c (diskfs_truncate): Add missing call to
diskfs_end_catch_exception.
Diffstat (limited to 'ext2fs/truncate.c')
-rw-r--r-- | ext2fs/truncate.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c index 5c8e0829..336981cc 100644 --- a/ext2fs/truncate.c +++ b/ext2fs/truncate.c @@ -226,11 +226,11 @@ force_delayed_copies (struct node *node, off_t length) if (pager) ports_port_ref (pager); spin_unlock (&node_to_page_lock); - + if (pager) { mach_port_t obj; - + pager_change_attributes (pager, MAY_CACHE, MEMORY_OBJECT_COPY_NONE, 1); obj = diskfs_get_filemap (node, VM_PROT_READ); if (obj != MACH_PORT_NULL) @@ -238,10 +238,10 @@ force_delayed_copies (struct node *node, off_t length) /* XXX should cope with errors from diskfs_get_filemap */ poke_pages (obj, round_page (length), round_page (node->allocsize)); mach_port_deallocate (mach_task_self (), obj); - pager_flush_some (pager, round_page(length), + pager_flush_some (pager, round_page(length), node->allocsize - length, 1); } - + ports_port_deref (pager); } } @@ -269,7 +269,7 @@ enable_delayed_copies (struct node *node) /* The user must define this function. Truncate locked node NODE to be SIZE bytes long. (If NODE is already less than or equal to SIZE bytes long, do nothing.) If this is a symlink (and diskfs_shortcut_symlink - is set) then this should clear the symlink, even if + is set) then this should clear the symlink, even if diskfs_create_symlink_hook stores the link target elsewhere. */ error_t diskfs_truncate (struct node *node, off_t length) @@ -322,7 +322,7 @@ diskfs_truncate (struct node *node, off_t length) node->dn_set_ctime = 1; diskfs_node_update (node, 1); - err = diskfs_catch_exception(); + err = diskfs_catch_exception (); if (!err) { block_t end = boffs_block (round_block (length)), offs; @@ -348,6 +348,8 @@ diskfs_truncate (struct node *node, off_t length) won't hurt if is wrong. */ node->dn->last_page_partially_writable = trunc_page (node->allocsize) != node->allocsize; + + diskfs_end_catch_exception (); } node->dn_set_mtime = 1; |