X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fblkdev_compat.h;h=a5294ceba3f0504219110ec7629f40811bc959b3;hb=9dcb97198338ba2d8764dd5604b278118612f74d;hp=bd1b2bf540031c0f1bdc9aad6da12ebd8b5344c2;hpb=30930fba219642cb1dadf1c8ef60ff799e3dc424;p=zfs.git diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index bd1b2bf..a5294ce 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -433,6 +433,21 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) #endif /* + * 2.6.33 API change + * Discard granularity and alignment restrictions may now be set. For + * older kernels which do not support this it is safe to skip it. + */ +#ifdef HAVE_DISCARD_GRANULARITY +static inline void +blk_queue_discard_granularity(struct request_queue *q, unsigned int dg) +{ + q->limits.discard_granularity = dg; +} +#else +#define blk_queue_discard_granularity(x, dg) ((void)0) +#endif /* HAVE_DISCARD_GRANULARITY */ + +/* * 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