summaryrefslogtreecommitdiff
path: root/tmpfs/node.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-05-06 00:39:20 +0000
committerRoland McGrath <roland@gnu.org>2001-05-06 00:39:20 +0000
commit0e7f79687840aaa2905dbd7d780100fa342e61e9 (patch)
tree96ffc3f4b4535312a769f71db99532181d87a411 /tmpfs/node.c
parentbe3cc8ffddbba873709ed7f51b3975a6e4838e1a (diff)
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.
Diffstat (limited to 'tmpfs/node.c')
-rw-r--r--tmpfs/node.c3
1 files changed, 2 insertions, 1 deletions
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;