diff options
-rw-r--r-- | include/linux/blkdev_compat.h | 14 | ||||
-rw-r--r-- | module/zfs/vdev_disk.c | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index 3bf1f4574..0a7c985d8 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -339,6 +339,20 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) #endif /* + * 2.6.37 API change + * The WRITE_FLUSH, WRITE_FUA, and WRITE_FLUSH_FUA flags have been + * introduced as a replacement for WRITE_BARRIER. This was done to + * allow richer semantics to be expressed to the block layer. It is + * the block layers responsibility to choose the correct way to + * implement these semantics. + */ +#ifdef WRITE_FLUSH_FUA +# define VDEV_WRITE_FLUSH_FUA WRITE_FLUSH_FUA +#else +# define VDEV_WRITE_FLUSH_FUA WRITE_BARRIER +#endif + +/* * Default Linux IO Scheduler, * Setting the scheduler to noop will allow the Linux IO scheduler to * still perform front and back merging, while leaving the request diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index 4145dec4a..28a4861ab 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -559,7 +559,7 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio) bio->bi_private = zio; bio->bi_bdev = bdev; zio->io_delay = jiffies_64; - submit_bio(WRITE_BARRIER, bio); + submit_bio(VDEV_WRITE_FLUSH_FUA, bio); return 0; } |