X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fblkdev_compat.h;h=0a7c985d8ad58fcdf5598a5b2d9ee2506e32c287;hb=86f35f34f419f6eaff53b25f463c13f72186b103;hp=d2e80ec88f6123283255ba4f0c80a561474386b7;hpb=45066d1f20a582fc8229776503b1cdd554d7fde4;p=zfs.git diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index d2e80ec..0a7c985 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -172,6 +172,17 @@ __blk_rq_bytes(struct request *req) #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) #endif +/* + * 2.6.27 API change, + * The blk_queue_stackable() queue flag was added in 2.6.27 to handle dm + * stacking drivers. Prior to this request stacking drivers were detected + * by checking (q->request_fn == NULL), for earlier kernels we revert to + * this legacy behavior. + */ +#ifndef blk_queue_stackable +#define blk_queue_stackable(q) ((q)->request_fn == NULL) +#endif + #ifndef HAVE_GET_DISK_RO static inline int get_disk_ro(struct gendisk *disk) @@ -328,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