]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Linux 2.6.37 compat, WRITE_FLUSH_FUA
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 16 Jun 2011 18:20:22 +0000 (20:20 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Jun 2011 21:37:26 +0000 (14:37 -0700)
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
module/zfs/vdev_disk.c

index 3bf1f4574036eb699f5e0ca09f4ac71be47014d9..0a7c985d8ad58fcdf5598a5b2d9ee2506e32c287 100644 (file)
@@ -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
index 4145dec4aef17d4be942ab36707ee9e59edbd396..28a4861abd7260c2c1feb7246fbcfe5d64fd71c4 100644 (file)
@@ -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;
 }