[Top] [All Lists]

[PATCH 4/7] btrfs: Use generic handlers of O_SYNC AIO DIO

To: linux-fsdevel@xxxxxxxxxxxxxxx
Subject: [PATCH 4/7] btrfs: Use generic handlers of O_SYNC AIO DIO
From: Jeff Moyer <jmoyer@xxxxxxxxxx>
Date: Thu, 29 Mar 2012 18:05:02 -0400
Cc: linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, jack@xxxxxxx, hch@xxxxxxxxxxxxx, Jeff Moyer <jmoyer@xxxxxxxxxx>
In-reply-to: <1333058705-31512-1-git-send-email-jmoyer@xxxxxxxxxx>
References: <1333058705-31512-1-git-send-email-jmoyer@xxxxxxxxxx>
From: Jan Kara <jack@xxxxxxx>

Use generic handlers to queue fsync() when AIO DIO is completed for O_SYNC
file. Although we use our own bio->end_io function, we call dio_end_io()
from it and thus, because we don't set any specific dio->end_io function,
generic code ends up calling generic_dio_end_io() which is all what we need
for proper O_SYNC AIO DIO handling.

Signed-off-by: Jan Kara <jack@xxxxxxx>
Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 3a0b5c1..5cb3e22 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6249,7 +6249,7 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
        ret = __blockdev_direct_IO(rw, iocb, inode,
                   iov, offset, nr_segs, btrfs_get_blocks_direct, NULL,
-                  btrfs_submit_direct, 0);
+                  btrfs_submit_direct, DIO_SYNC_WRITES);
        if (ret < 0 && ret != -EIOCBQUEUED) {
                clear_extent_bit(&BTRFS_I(inode)->io_tree, offset,

<Prev in Thread] Current Thread [Next in Thread>