X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fext3%2Ffile.c;h=b83d668d82ae6e15978da7f48d1b7381a76feefd;hb=567f20a20be06ad546b5962340c4be268462055b;hp=cb02116297cd92871ad3fee43ea72c3f8a110d5d;hpb=bc77d24c47b89f1e0efed0b8e4be5f8aad102883;p=linux-2.6.git diff --git a/fs/ext3/file.c b/fs/ext3/file.c index cb0211629..b83d668d8 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c @@ -36,27 +36,17 @@ static int ext3_release_file (struct inode * inode, struct file * filp) /* if we are the last writer on the inode, drop the block reservation */ if ((filp->f_mode & FMODE_WRITE) && (atomic_read(&inode->i_writecount) == 1)) + { + mutex_lock(&EXT3_I(inode)->truncate_mutex); ext3_discard_reservation(inode); + mutex_unlock(&EXT3_I(inode)->truncate_mutex); + } if (is_dx(inode) && filp->private_data) ext3_htree_free_dir_info(filp->private_data); return 0; } -/* - * Called when an inode is about to be opened. - * We use this to disallow opening RW large files on 32bit systems if - * the caller didn't specify O_LARGEFILE. On 64bit systems we force - * on this flag in sys_open. - */ -static int ext3_open_file (struct inode *inode, struct file *filp) -{ - if (!(filp->f_flags & O_LARGEFILE) && - inode->i_size > 0x7FFFFFFFLL) - return -EFBIG; - return 0; -} - static ssize_t ext3_file_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) { @@ -115,7 +105,7 @@ force_commit: return ret; } -struct file_operations ext3_file_operations = { +const struct file_operations ext3_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, @@ -125,19 +115,24 @@ struct file_operations ext3_file_operations = { .writev = generic_file_writev, .ioctl = ext3_ioctl, .mmap = generic_file_mmap, - .open = ext3_open_file, + .open = generic_file_open, .release = ext3_release_file, .fsync = ext3_sync_file, .sendfile = generic_file_sendfile, + .splice_read = generic_file_splice_read, + .splice_write = generic_file_splice_write, }; struct inode_operations ext3_file_inode_operations = { .truncate = ext3_truncate, .setattr = ext3_setattr, - .setxattr = ext3_setxattr, - .getxattr = ext3_getxattr, +#ifdef CONFIG_EXT3_FS_XATTR + .setxattr = generic_setxattr, + .getxattr = generic_getxattr, .listxattr = ext3_listxattr, - .removexattr = ext3_removexattr, + .removexattr = generic_removexattr, +#endif .permission = ext3_permission, + .sync_flags = ext3_sync_flags, };