helpers for acl caching + switch to those
[safe/jmp/linux-2.6] / fs / ext3 / file.c
index 994efd1..5b49704 100644 (file)
  */
 static int ext3_release_file (struct inode * inode, struct file * filp)
 {
+       if (EXT3_I(inode)->i_state & EXT3_STATE_FLUSH_ON_CLOSE) {
+               filemap_flush(inode->i_mapping);
+               EXT3_I(inode)->i_state &= ~EXT3_STATE_FLUSH_ON_CLOSE;
+       }
        /* 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))
@@ -48,14 +52,15 @@ static int ext3_release_file (struct inode * inode, struct file * filp)
 }
 
 static ssize_t
-ext3_file_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos)
+ext3_file_write(struct kiocb *iocb, const struct iovec *iov,
+               unsigned long nr_segs, loff_t pos)
 {
        struct file *file = iocb->ki_filp;
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        ssize_t ret;
        int err;
 
-       ret = generic_file_aio_write(iocb, buf, count, pos);
+       ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
 
        /*
         * Skip flushing if there was an error, or if nothing was written.
@@ -111,19 +116,19 @@ const struct file_operations ext3_file_operations = {
        .write          = do_sync_write,
        .aio_read       = generic_file_aio_read,
        .aio_write      = ext3_file_write,
-       .readv          = generic_file_readv,
-       .writev         = generic_file_writev,
-       .ioctl          = ext3_ioctl,
+       .unlocked_ioctl = ext3_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = ext3_compat_ioctl,
+#endif
        .mmap           = generic_file_mmap,
        .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 = {
+const struct inode_operations ext3_file_inode_operations = {
        .truncate       = ext3_truncate,
        .setattr        = ext3_setattr,
 #ifdef CONFIG_EXT3_FS_XATTR
@@ -133,5 +138,6 @@ struct inode_operations ext3_file_inode_operations = {
        .removexattr    = generic_removexattr,
 #endif
        .permission     = ext3_permission,
+       .fiemap         = ext3_fiemap,
 };