aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index c4dd287dd1c8d9..601531cf4976f1 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -25,6 +25,15 @@
/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
#include <asm/io.h>
+
+#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
+#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
+#define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE)
+#else
+#define BIOVEC_VIRT_START_SIZE(x) 0
+#define BIOVEC_VIRT_OVERSIZE(x) 0
+#endif
+
#ifndef BIO_VMERGE_BOUNDARY
#define BIO_VMERGE_BOUNDARY 0
#endif
@@ -81,6 +90,15 @@ struct bio {
unsigned short bi_hw_segments;
unsigned int bi_size; /* residual I/O count */
+
+ /*
+ * To keep track of the max hw size, we account for the
+ * sizes of the first and last virtually mergeable segments
+ * in this bio
+ */
+ unsigned int bi_hw_front_size;
+ unsigned int bi_hw_back_size;
+
unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
struct bio_vec *bi_io_vec; /* the actual vec list */