selftests/bpf: fix perf_buffer on s390
[linux-2.6-microblaze.git] / block / blk-settings.c
index 3facc41..2ae348c 100644 (file)
@@ -310,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);
@@ -742,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);