diff options
author | Chris Mason <chris.mason@oracle.com> | 2010-05-26 10:59:53 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-05-26 10:59:53 -0400 |
commit | 3f7c579c41a3d20af76fd6ff1f6b949edf105fd1 (patch) | |
tree | 374d50346763fb37299f5de93f48901596f21e59 /fs/btrfs/file.c | |
parent | 4845e44ffdb26be9b25610664228e8ecaf949a0d (diff) | |
download | linux-3f7c579c41a3d20af76fd6ff1f6b949edf105fd1.tar.gz linux-3f7c579c41a3d20af76fd6ff1f6b949edf105fd1.tar.bz2 linux-3f7c579c41a3d20af76fd6ff1f6b949edf105fd1.zip |
Btrfs: move O_DIRECT space reservation to btrfs_direct_IO
This moves the delalloc space reservation done for O_DIRECT
into btrfs_direct_IO. This way we don't leak reserved space
if the generic O_DIRECT write code errors out before it
calls into btrfs_direct_IO.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 54556cae4497..79437c5eeb1e 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 |