]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/bio.h
bio: define __BIOVEC_PHYS_MERGEABLE
[linux-2.6-omap-h63xx.git] / include / linux / bio.h
index 1beda208cbfbf17d1980dee03c49cd7d43678b7e..6a642098e5c3524ad69fd15993268f35ef02cad9 100644 (file)
@@ -79,6 +79,13 @@ struct bio {
 
        unsigned int            bi_size;        /* residual I/O count */
 
+       /*
+        * To keep track of the max segment size, we account for the
+        * sizes of the first and last mergeable segments in this bio.
+        */
+       unsigned int            bi_seg_front_size;
+       unsigned int            bi_seg_back_size;
+
        unsigned int            bi_max_vecs;    /* max bvl_vecs we can hold */
 
        unsigned int            bi_comp_cpu;    /* completion CPU */
@@ -229,12 +236,16 @@ static inline void *bio_data(struct bio *bio)
 #define __BVEC_END(bio)                bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
 #define __BVEC_START(bio)      bio_iovec_idx((bio), (bio)->bi_idx)
 
+/* Default implementation of BIOVEC_PHYS_MERGEABLE */
+#define __BIOVEC_PHYS_MERGEABLE(vec1, vec2)    \
+       ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
+
 /*
  * allow arch override, for eg virtualized architectures (put in asm/io.h)
  */
 #ifndef BIOVEC_PHYS_MERGEABLE
 #define BIOVEC_PHYS_MERGEABLE(vec1, vec2)      \
-       ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
+       __BIOVEC_PHYS_MERGEABLE(vec1, vec2)
 #endif
 
 #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \