/* 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
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 */