summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /fs/open.c
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (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.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/open.c b/fs/open.c
index 159b08bf7..7896b0a2e 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -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);