Skip to content

Commit

Permalink
Linux 4.8 compat: REQ_PREFLUSH
Browse files Browse the repository at this point in the history
The REQ_FLUSH flag was renamed REQ_PREFLUSH to avoid confusion with
REQ_OP_FLUSH.  See torvalds/linux@28a8f0d3
for complete details.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#4892
Issue openzfs#4899
  • Loading branch information
behlendorf authored and Chunwei Chen committed Sep 7, 2016
1 parent 52d2e33 commit 6690843
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/linux/blkdev_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,23 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags)
* The existence of these flags implies that REQ_FLUSH an REQ_FUA are
* defined. Thus we can safely define VDEV_REQ_FLUSH and VDEV_REQ_FUA
* compatibility macros.
*
* Linux 4.8 renamed the REQ_FLUSH to REQ_PREFLUSH but there was no
* functional change in behavior.
*/
#ifdef WRITE_FLUSH_FUA

#define VDEV_WRITE_FLUSH_FUA WRITE_FLUSH_FUA
#ifdef REQ_PREFLUSH
#define VDEV_REQ_FLUSH REQ_PREFLUSH
#define VDEV_REQ_FUA REQ_FUA
#else
#define VDEV_REQ_FLUSH REQ_FLUSH
#define VDEV_REQ_FUA REQ_FUA
#endif

#else

#define VDEV_WRITE_FLUSH_FUA WRITE_BARRIER
#ifdef HAVE_BIO_RW_BARRIER
#define VDEV_REQ_FLUSH (1 << BIO_RW_BARRIER)
Expand All @@ -317,6 +328,7 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags)
#define VDEV_REQ_FLUSH REQ_HARDBARRIER
#define VDEV_REQ_FUA REQ_FUA
#endif

#endif

/*
Expand Down

0 comments on commit 6690843

Please sign in to comment.