summaryrefslogtreecommitdiff
path: root/libdiskfs/file-set-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/file-set-size.c')
-rw-r--r--libdiskfs/file-set-size.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libdiskfs/file-set-size.c b/libdiskfs/file-set-size.c
index f4d3f110..18abb469 100644
--- a/libdiskfs/file-set-size.c
+++ b/libdiskfs/file-set-size.c
@@ -29,7 +29,13 @@ diskfs_S_file_set_size (struct protid *cred,
if (!(cred->po->openstat & O_WRITE))
err = EINVAL;
else if (size < np->dn_stat.st_size)
- err = diskfs_truncate (np, size);
+ {
+ err = diskfs_truncate (np, size);
+ if (!err && np->filemod_reqs)
+ diskfs_notice_filechange (np,
+ FILE_CHANGED_TRUNCATE,
+ 0, size);
+ }
else if (size > np->dn_stat.st_size)
{
err = diskfs_grow (np, size, cred);
@@ -37,6 +43,10 @@ diskfs_S_file_set_size (struct protid *cred,
{
np->dn_stat.st_size = size;
np->dn_set_ctime = np->dn_set_mtime = 1;
+ if (np->filemod_reqs)
+ diskfs_notice_filechange (np,
+ FILE_CHANGED_EXTEND,
+ 0, size);
}
}
else