diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
commit | 482368b1a8e45430672c58c9a42e7d2004367126 (patch) | |
tree | ce2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /fs/open.c | |
parent | e4d0251c6f56ab2e191afb70f80f382793e23f74 (diff) |
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -69,12 +69,6 @@ int do_truncate(struct dentry *dentry, loff_t length) newattrs.ia_size = length; newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; error = notify_change(dentry, &newattrs); - if (!error) { - /* truncate virtual mappings of this file */ - vmtruncate(inode, length); - if (inode->i_op && inode->i_op->truncate) - inode->i_op->truncate(inode); - } up(&inode->i_sem); return error; } @@ -118,9 +112,7 @@ static inline long do_sys_truncate(const char * path, loff_t length) if (error) goto dput_and_out; - error = locks_verify_area(FLOCK_VERIFY_WRITE, inode, NULL, - length < inode->i_size ? length : inode->i_size, - abs(inode->i_size - length)); + error = locks_verify_truncate(inode, NULL, length); if (!error) { DQUOT_INIT(inode); error = do_truncate(dentry, length); @@ -163,9 +155,7 @@ static inline long do_sys_ftruncate(unsigned int fd, loff_t length) error = -EPERM; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) goto out_putf; - error = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file, - length<inode->i_size ? length : inode->i_size, - abs(inode->i_size - length)); + error = locks_verify_truncate(inode, file, length); lock_kernel(); if (!error) error = do_truncate(dentry, length); |