Commit cfac4b47 authored by Marco Stornelli's avatar Marco Stornelli Committed by Al Viro

reiserfs: drop vmtruncate

Removed vmtruncate
Signed-off-by: default avatarMarco Stornelli <marco.stornelli@gmail.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent fa4d62ae
...@@ -126,7 +126,7 @@ static int reiserfs_file_open(struct inode *inode, struct file *file) ...@@ -126,7 +126,7 @@ static int reiserfs_file_open(struct inode *inode, struct file *file)
return err; return err;
} }
static void reiserfs_vfs_truncate_file(struct inode *inode) void reiserfs_vfs_truncate_file(struct inode *inode)
{ {
mutex_lock(&(REISERFS_I(inode)->tailpack)); mutex_lock(&(REISERFS_I(inode)->tailpack));
reiserfs_truncate_file(inode, 1); reiserfs_truncate_file(inode, 1);
...@@ -312,7 +312,6 @@ const struct file_operations reiserfs_file_operations = { ...@@ -312,7 +312,6 @@ const struct file_operations reiserfs_file_operations = {
}; };
const struct inode_operations reiserfs_file_inode_operations = { const struct inode_operations reiserfs_file_inode_operations = {
.truncate = reiserfs_vfs_truncate_file,
.setattr = reiserfs_setattr, .setattr = reiserfs_setattr,
.setxattr = reiserfs_setxattr, .setxattr = reiserfs_setxattr,
.getxattr = reiserfs_getxattr, .getxattr = reiserfs_getxattr,
......
...@@ -3085,8 +3085,10 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb, ...@@ -3085,8 +3085,10 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
loff_t isize = i_size_read(inode); loff_t isize = i_size_read(inode);
loff_t end = offset + iov_length(iov, nr_segs); loff_t end = offset + iov_length(iov, nr_segs);
if (end > isize) if ((end > isize) && inode_newsize_ok(inode, isize) == 0) {
vmtruncate(inode, isize); truncate_setsize(inode, isize);
reiserfs_vfs_truncate_file(inode);
}
} }
return ret; return ret;
...@@ -3200,8 +3202,13 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -3200,8 +3202,13 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
*/ */
reiserfs_write_unlock_once(inode->i_sb, depth); reiserfs_write_unlock_once(inode->i_sb, depth);
if ((attr->ia_valid & ATTR_SIZE) && if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode)) attr->ia_size != i_size_read(inode)) {
error = vmtruncate(inode, attr->ia_size); error = inode_newsize_ok(inode, attr->ia_size);
if (!error) {
truncate_setsize(inode, attr->ia_size);
reiserfs_vfs_truncate_file(inode);
}
}
if (!error) { if (!error) {
setattr_copy(inode, attr); setattr_copy(inode, attr);
......
...@@ -2455,6 +2455,7 @@ struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct ...@@ -2455,6 +2455,7 @@ struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
*, *,
int count); int count);
int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *); int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *);
void reiserfs_vfs_truncate_file(struct inode *inode);
int reiserfs_commit_page(struct inode *inode, struct page *page, int reiserfs_commit_page(struct inode *inode, struct page *page,
unsigned from, unsigned to); unsigned from, unsigned to);
void reiserfs_flush_old_commits(struct super_block *); void reiserfs_flush_old_commits(struct super_block *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment