From 0e7f79687840aaa2905dbd7d780100fa342e61e9 Mon Sep 17 00:00:00 2001 From: Roland McGrath <roland@gnu.org> Date: Sun, 6 May 2001 00:39:20 +0000 Subject: 2001-05-05 Roland McGrath <roland@frob.com> * node.c (diskfs_truncate): Set st_size before rounding it up, and do set it when there is a memory object. --- tmpfs/node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmpfs/node.c b/tmpfs/node.c index cfaa2d90..32d7b062 100644 --- a/tmpfs/node.c +++ b/tmpfs/node.c @@ -394,6 +394,8 @@ diskfs_truncate (struct node *np, off_t size) if (default_pager == MACH_PORT_NULL) return EIO; + np->dn_stat.st_size = size; + size = round_page (size); if (np->dn->u.reg.memobj != MACH_PORT_NULL) @@ -405,7 +407,6 @@ diskfs_truncate (struct node *np, off_t size) adjust_used (size - np->allocsize); np->dn_stat.st_blocks += (size - np->allocsize) / 512; - np->dn_stat.st_size = size; np->allocsize = size; return 0; -- cgit v1.2.3