diff options
| author | Jens Axboe <axboe@suse.de> | 2003-05-25 05:28:57 -0700 |
|---|---|---|
| committer | Jens Axboe <axboe@suse.de> | 2003-05-25 05:28:57 -0700 |
| commit | 15e9369dee2f26eb23a05c627815a329974648f6 (patch) | |
| tree | 1cec45c7193196e4eca767026d382be569ccf965 /include/linux | |
| parent | 4a2b3e53132b54507e6ff467c3f03403dcb37821 (diff) | |
[PATCH] bio splitting
So here it is, easy split support for md and dm. Neil, the changes over
your version are merely:
- Make a global bio split pool instead of requring device setup of one.
Will waste 8 * sizeof(struct bio_pair) of RAM, but... For 2.6 at least
it has to be a core functionality.
- Various style changes to follow the kernel guide lines.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index bbc69dd67b28..3921d3b751b9 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -22,6 +22,7 @@ #include <linux/kdev_t.h> #include <linux/highmem.h> +#include <linux/mempool.h> /* Platforms may set this to teach the BIO layer about IOMMU hardware. */ #include <asm/io.h> @@ -202,6 +203,27 @@ struct bio { */ #define bio_get(bio) atomic_inc(&(bio)->bi_cnt) + +/* + * A bio_pair is used when we need to split a bio. + * This can only happen for a bio that refers to just one + * page of data, and in the unusual situation when the + * page crosses a chunk/device boundary + * + * The address of the master bio is stored in bio1.bi_private + * The address of the pool the pair was allocated from is stored + * in bio2.bi_private + */ +struct bio_pair { + struct bio bio1, bio2; + struct bio_vec bv1, bv2; + atomic_t cnt; + int error; +}; +extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, + int first_sectors); +extern void bio_pair_release(struct bio_pair *dbio); + extern struct bio *bio_alloc(int, int); extern void bio_put(struct bio *); |
