]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - block/blk-settings.c
Merge tag 'for-linus-20190715' of git://git.kernel.org/pub/scm/linux/kernel/git/braun...
[linux.git] / block / blk-settings.c
index 6375afaedcec1a5e1046a23441e5e410f080cec8..2ae348c101a05f004a069d04726445436e68acef 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Functions related to setting various queue properties from drivers
  */
@@ -309,6 +310,9 @@ void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size)
                       __func__, max_size);
        }
 
+       /* see blk_queue_virt_boundary() for the explanation */
+       WARN_ON_ONCE(q->limits.virt_boundary_mask);
+
        q->limits.max_segment_size = max_size;
 }
 EXPORT_SYMBOL(blk_queue_max_segment_size);
@@ -662,22 +666,6 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
 }
 EXPORT_SYMBOL(disk_stack_limits);
 
-/**
- * blk_queue_dma_pad - set pad mask
- * @q:     the request queue for the device
- * @mask:  pad mask
- *
- * Set dma pad mask.
- *
- * Appending pad buffer to a request modifies the last entry of a
- * scatter list such that it includes the pad buffer.
- **/
-void blk_queue_dma_pad(struct request_queue *q, unsigned int mask)
-{
-       q->dma_pad_mask = mask;
-}
-EXPORT_SYMBOL(blk_queue_dma_pad);
-
 /**
  * blk_queue_update_dma_pad - update pad mask
  * @q:     the request queue for the device
@@ -757,6 +745,14 @@ EXPORT_SYMBOL(blk_queue_segment_boundary);
 void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask)
 {
        q->limits.virt_boundary_mask = mask;
+
+       /*
+        * Devices that require a virtual boundary do not support scatter/gather
+        * I/O natively, but instead require a descriptor list entry for each
+        * page (which might not be idential to the Linux PAGE_SIZE).  Because
+        * of that they are not limited by our notion of "segment size".
+        */
+       q->limits.max_segment_size = UINT_MAX;
 }
 EXPORT_SYMBOL(blk_queue_virt_boundary);