From 96801d290652812780cf6c070729154d4af8e1ce Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 16 Jun 2011 20:20:22 +0200 Subject: Linux 2.6.37 compat, WRITE_FLUSH_FUA 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. This change simply updates the bio's to use the new kernel API which should be absolutely safe. However, since ZFS depends entirely on this working as designed for correctness we do want to be careful. Closes #281 --- include/linux/blkdev_compat.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux') 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 @@ -338,6 +338,20 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) # define vdev_bdev_block_size(bdev) bdev_hardsect_size(bdev) #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 -- cgit v1.2.3