David Woodhouse <dwmw2@xxxxxxxxxxxxx> writes: > On Mon, 2008-08-11 at 02:55 +0900, OGAWA Hirofumi wrote: >> Or another options is caller should do? e.g. (WRITE | (1 << >> BIO_RW_DISCARD)) > > Yeah, I thought about that. Figured it was better just to sort it out in > submit_bio() rather than relying on the callers. Although admittedly > there is precisely _one_ caller right now... Although I don't have strong opinion, however, I've noticed WRITE_BARRIER seems to be already doing similar thing. So, I just imaged it like following... [I don't know whether blkdev_issue_flush() really want to use (1 << BIO_RW_BARRIER) or not.] diff -puN include/linux/fs.h~test include/linux/fs.h --- linux-2.6/include/linux/fs.h~test 2008-08-11 06:22:38.000000000 +0900 +++ linux-2.6-hirofumi/include/linux/fs.h 2008-08-11 06:24:23.000000000 +0900 @@ -86,7 +86,8 @@ extern int dir_notify_enable; #define READ_META (READ | (1 << BIO_RW_META)) #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) -#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) +#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) +#define WRITE_DISCARD (WRITE | (1 << BIO_RW_DISCARD)) #define SEL_IN 1 #define SEL_OUT 2 diff -puN block/blk-barrier.c~test block/blk-barrier.c --- linux-2.6/block/blk-barrier.c~test 2008-08-11 06:29:13.000000000 +0900 +++ linux-2.6-hirofumi/block/blk-barrier.c 2008-08-11 06:30:16.000000000 +0900 @@ -293,7 +293,7 @@ int blkdev_issue_flush(struct block_devi bio->bi_end_io = bio_end_empty_barrier; bio->bi_private = &wait; bio->bi_bdev = bdev; - submit_bio(1 << BIO_RW_BARRIER, bio); + submit_bio(WRITE_BARRIER, bio); wait_for_completion(&wait); _ -- OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html