X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=blobdiff_plain;f=fs%2Fbtrfs%2Ffile.c;h=787b50a16a146eea9bb4ec4202fcdab1f3f4bec0;hp=233aea2e5ef2e69281296cc29e6930c351a94e14;hb=7ea8085910ef3dd4f3cad6845aaa2b580d39b115;hpb=11c65dccf70be9ace5dbd3906778e1a099b1fee1 diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 233aea2..787b50a 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -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;