Re: [PATCH] ide barrier support, #2

From: Jens Axboe
Date: Tue Oct 14 2003 - 07:59:59 EST


On Tue, Oct 14 2003, Andi Kleen wrote:
> Jens Axboe <axboe@xxxxxxx> writes:
>
> This adds support for XFS for log writes (not for fsync).
> Based on the 2.4 XFS patch for write barriers I did some time ago.
>
> It just does a flush, not a barrier. I think that's enough for
> log writes because XFS waits until the log write has hit disk.
>
> It doesn't do anything special when the flush fails - just
> shuts down the file system as usual.
>
> diff -u linux/fs/xfs/pagebuf/page_buf.c-o linux-2.6.0test6-work/fs/xfs/pagebuf/page_buf.c
> --- linux/fs/xfs/pagebuf/page_buf.c-o 2003-09-28 10:52:55.000000000 +0200
> +++ linux/fs/xfs/pagebuf/page_buf.c 2003-10-14 14:48:44.000000000 +0200
> @@ -1403,12 +1403,12 @@
>
> submit_io:
> if (likely(bio->bi_size)) {
> - if (pb->pb_flags & PBF_READ) {
> - submit_bio(READ, bio);
> - } else {
> - submit_bio(WRITE, bio);
> - }
> -
> + int cmd = WRITE;
> + if (pb->pb_flags & PBF_READ)
> + cmd = READ;
> + else if (pb->pb_flags & PBF_FLUSH)
> + cmd = WRITESYNC;

Uh be careful! It must be WRITEBARRIER, not WRITESYNC. I think I'll kill
WRITEBARRIER and just call it WRITESYNC, it's more logical. I've added
the modified variant, thanks.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/