]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/bio.h
block: add gfp_mask argument to blk_rq_map_user and blk_rq_map_user_iov
[linux-2.6-omap-h63xx.git] / include / linux / bio.h
index dfc3556d311cba057298780b8f45a3efe7da6a53..200b185c3e83430bb1f87c0c4e4f3319a63afd5a 100644 (file)
@@ -75,12 +75,14 @@ struct bio {
        /* Number of segments in this BIO after
         * physical address coalescing is performed.
         */
-       unsigned short          bi_phys_segments;
+       unsigned int            bi_phys_segments;
 
        unsigned int            bi_size;        /* residual I/O count */
 
        unsigned int            bi_max_vecs;    /* max bvl_vecs we can hold */
 
+       unsigned int            bi_comp_cpu;    /* completion CPU */
+
        struct bio_vec          *bi_io_vec;     /* the actual vec list */
 
        bio_end_io_t            *bi_end_io;
@@ -105,6 +107,7 @@ struct bio {
 #define BIO_BOUNCED    5       /* bio is a bounce bio */
 #define BIO_USER_MAPPED 6      /* contains user pages */
 #define BIO_EOPNOTSUPP 7       /* not supported */
+#define BIO_CPU_AFFINE 8       /* complete bio on same CPU as submitted */
 #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
 
 /*
@@ -322,11 +325,11 @@ extern int bio_add_pc_page(struct request_queue *, 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);
+                               unsigned long, unsigned int, int, gfp_t);
 struct sg_iovec;
 extern struct bio *bio_map_user_iov(struct request_queue *,
                                    struct block_device *,
-                                   struct sg_iovec *, int, int);
+                                   struct sg_iovec *, int, int, gfp_t);
 extern void bio_unmap_user(struct bio *);
 extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
                                gfp_t);
@@ -334,14 +337,23 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
                                 gfp_t, int);
 extern void bio_set_pages_dirty(struct bio *bio);
 extern void bio_check_pages_dirty(struct bio *bio);
-extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
+extern struct bio *bio_copy_user(struct request_queue *, unsigned long,
+                                unsigned int, int, gfp_t);
 extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *,
-                                    int, int);
+                                    int, int, gfp_t);
 extern int bio_uncopy_user(struct bio *);
 void zero_fill_bio(struct bio *bio);
 extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *);
 extern unsigned int bvec_nr_vecs(unsigned short idx);
 
+/*
+ * Allow queuer to specify a completion CPU for this bio
+ */
+static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu)
+{
+       bio->bi_comp_cpu = cpu;
+}
+
 /*
  * bio_set is used to allow other portions of the IO system to
  * allocate their own private memory pools for bio and iovec structures.