|
@@ -194,7 +194,8 @@ out:
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|
|
-int do_truncate(struct dentry *dentry, loff_t length, struct file *filp)
|
|
|
|
|
|
+int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
|
|
|
|
+ struct file *filp)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
struct iattr newattrs;
|
|
struct iattr newattrs;
|
|
@@ -204,7 +205,7 @@ int do_truncate(struct dentry *dentry, loff_t length, struct file *filp)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
newattrs.ia_size = length;
|
|
newattrs.ia_size = length;
|
|
- newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
|
|
|
|
|
|
+ newattrs.ia_valid = ATTR_SIZE | time_attrs;
|
|
if (filp) {
|
|
if (filp) {
|
|
newattrs.ia_file = filp;
|
|
newattrs.ia_file = filp;
|
|
newattrs.ia_valid |= ATTR_FILE;
|
|
newattrs.ia_valid |= ATTR_FILE;
|
|
@@ -266,7 +267,7 @@ static inline long do_sys_truncate(const char __user * path, loff_t length)
|
|
error = locks_verify_truncate(inode, NULL, length);
|
|
error = locks_verify_truncate(inode, NULL, length);
|
|
if (!error) {
|
|
if (!error) {
|
|
DQUOT_INIT(inode);
|
|
DQUOT_INIT(inode);
|
|
- error = do_truncate(nd.dentry, length, NULL);
|
|
|
|
|
|
+ error = do_truncate(nd.dentry, length, 0, NULL);
|
|
}
|
|
}
|
|
put_write_access(inode);
|
|
put_write_access(inode);
|
|
|
|
|
|
@@ -318,7 +319,7 @@ static inline long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
|
|
|
|
|
|
error = locks_verify_truncate(inode, file, length);
|
|
error = locks_verify_truncate(inode, file, length);
|
|
if (!error)
|
|
if (!error)
|
|
- error = do_truncate(dentry, length, file);
|
|
|
|
|
|
+ error = do_truncate(dentry, length, 0, file);
|
|
out_putf:
|
|
out_putf:
|
|
fput(file);
|
|
fput(file);
|
|
out:
|
|
out:
|