drop unused dentry argument to ->fsync
[safe/jmp/linux-2.6] / fs / btrfs / file.c
index 233aea2..787b50a 100644 (file)
@@ -888,14 +888,9 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
        BTRFS_I(inode)->sequence++;
 
        if (unlikely(file->f_flags & O_DIRECT)) {
-               ret = btrfs_delalloc_reserve_space(inode, count);
-               if (ret)
-                       goto out;
-
                num_written = generic_file_direct_write(iocb, iov, &nr_segs,
                                                        pos, ppos, count,
                                                        ocount);
-
                /*
                 * the generic O_DIRECT will update in-memory i_size after the
                 * DIOs are done.  But our endio handlers that update the on
@@ -909,13 +904,6 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
                }
 
                if (num_written < 0) {
-                       if (num_written != -EIOCBQUEUED) {
-                               /*
-                                * aio land will take care of releasing the
-                                * delalloc
-                                */
-                               btrfs_delalloc_release_space(inode, count);
-                       }
                        ret = num_written;
                        num_written = 0;
                        goto out;
@@ -924,13 +912,6 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
                        pos = *ppos;
                        goto out;
                }
-
-               /*
-                * the buffered IO will reserve bytes for the rest of the
-                * range, don't double count them here
-                */
-               btrfs_delalloc_release_space(inode, count - num_written);
-
                /*
                 * We are going to do buffered for the rest of the range, so we
                 * need to make sure to invalidate the buffered pages when we're
@@ -1120,8 +1101,9 @@ int btrfs_release_file(struct inode *inode, struct file *filp)
  * important optimization for directories because holding the mutex prevents
  * new operations on the dir while we write to disk.
  */
-int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
+int btrfs_sync_file(struct file *file, int datasync)
 {
+       struct dentry *dentry = file->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        struct btrfs_root *root = BTRFS_I(inode)->root;
        int ret = 0;