]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/bio.h
Merge /spare/repo/linux-2.6/
[linux-2.6-omap-h63xx.git] / include / linux / bio.h
index 1dd2bc2e84ae4f0257d075f85cad8e55fb324035..cdaf03a14a5115333ea424944ba320b1f687bedb 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <linux/highmem.h>
 #include <linux/mempool.h>
+#include <linux/ioprio.h>
 
 /* Platforms may set this to teach the BIO layer about IOMMU hardware. */
 #include <asm/io.h>
@@ -110,7 +111,6 @@ struct bio {
        void                    *bi_private;
 
        bio_destructor_t        *bi_destructor; /* destructor */
-       struct bio_set          *bi_set;        /* memory pools set */
 };
 
 /*
@@ -149,6 +149,19 @@ struct bio {
 #define BIO_RW_FAILFAST        3
 #define BIO_RW_SYNC    4
 
+/*
+ * upper 16 bits of bi_rw define the io priority of this bio
+ */
+#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
+#define bio_prio(bio)  ((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio_valid(bio)    ioprio_valid(bio_prio(bio))
+
+#define bio_set_prio(bio, prio)                do {                    \
+       WARN_ON(prio >= (1 << IOPRIO_BITS));                    \
+       (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);          \
+       (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);     \
+} while (0)
+
 /*
  * various member access, note that bio_data should of course not be used
  * on highmem page vectors
@@ -266,6 +279,7 @@ extern void bioset_free(struct bio_set *);
 extern struct bio *bio_alloc(unsigned int __nocast, int);
 extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *);
 extern void bio_put(struct bio *);
+extern void bio_free(struct bio *, struct bio_set *);
 
 extern void bio_endio(struct bio *, unsigned int, int);
 struct request_queue;
@@ -281,6 +295,10 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
 extern int bio_get_nr_vecs(struct block_device *);
 extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
                                unsigned long, unsigned int, int);
+struct sg_iovec;
+extern struct bio *bio_map_user_iov(struct request_queue *,
+                                   struct block_device *,
+                                   struct sg_iovec *, int, int);
 extern void bio_unmap_user(struct bio *);
 extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
                                unsigned int);