@@ -1362,6 +1362,27 @@ static inline bool blkdev_dio_unaligned(struct block_device *bdev, loff_t p,
!bdev_iter_is_aligned(bdev, iter);
}
+static inline bool blkdev_bit_bucket(struct block_device *bdev, loff_t pos,
+ loff_t len, struct iov_iter *iter, u16 *skip,
+ u16 *trunc)
+{
+ unsigned int blksz = bdev_logical_block_size(bdev);
+
+ if (iov_iter_rw(iter) != READ ||
+ !blk_queue_bb(bdev_get_queue(bdev)) ||
+ iter->nr_segs > 1)
+ return false;
+
+ if (!iov_iter_is_aligned(iter, bdev_dma_alignment(bdev),
+ bdev_dma_alignment(bdev)))
+ return false;
+
+ *skip = pos & (blksz - 1);
+ *trunc = blksz - ((pos + len) & (blksz - 1));
+
+ return true;
+}
+
static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
unsigned int len)
{