Merge to Fedora kernel-2.6.7-1.492
[linux-2.6.git] / include / linux / bio.h
index c4dd287..601531c 100644 (file)
 
 /* 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 */