diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 23:58:48 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 23:58:48 -0800 |
| commit | b1507c9acd944c8703612c0e38ac580bf9064e8a (patch) | |
| tree | 11380ae8589c069d185ae2b0ffe7af33837ab7ff /include/linux | |
| parent | 098b795507a08d023833c751381f885daa70436a (diff) | |
v2.5.0.8 -> v2.5.0.9
- Jeff Garzik: separate out handling of older tulip chips
- Jens Axboe: more bio stuff
- Anton Altaparmakov: NTFS 1.1.21 update
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 22 | ||||
| -rw-r--r-- | include/linux/blk.h | 3 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 09819839310d..8c3de39a5c75 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -57,8 +57,9 @@ struct bio { * top bits priority */ - unsigned int bi_vcnt; /* how many bio_vec's */ - unsigned int bi_idx; /* current index into bvl_vec */ + unsigned short bi_vcnt; /* how many bio_vec's */ + unsigned short bi_idx; /* current index into bvl_vec */ + unsigned short bi_hw_seg; /* actual mapped segments */ unsigned int bi_size; /* total size in bytes */ unsigned int bi_max; /* max bvl_vecs we can hold, used as index into pool */ @@ -79,7 +80,7 @@ struct bio { #define BIO_UPTODATE 0 /* ok after I/O completion */ #define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ #define BIO_EOF 2 /* out-out-bounds error */ -#define BIO_PREBUILT 3 /* not merged big */ +#define BIO_SEG_VALID 3 /* nr_hw_seg valid */ #define BIO_CLONED 4 /* doesn't own data */ /* @@ -108,8 +109,8 @@ struct bio { /* * will die */ -#define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + bio_offset((bio))) -#define bvec_to_phys(bv) (page_to_phys((bv)->bv_page) + (bv)->bv_offset) +#define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio))) +#define bvec_to_phys(bv) (page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset) /* * queues that have highmem support enabled may still need to revert to @@ -125,13 +126,16 @@ struct bio { /* * merge helpers etc */ -#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1) +#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1) +#define __BVEC_START(bio) bio_iovec_idx((bio), 0) #define BIO_CONTIG(bio, nxt) \ - (bvec_to_phys(__BVEC_END((bio))) + (bio)->bi_size == bio_to_phys((nxt))) + BIOVEC_MERGEABLE(__BVEC_END((bio)), __BVEC_START((nxt))) #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ (((addr1) | (mask)) == (((addr2) - 1) | (mask))) +#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ + __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask) #define BIO_SEG_BOUNDARY(q, b1, b2) \ - __BIO_SEG_BOUNDARY(bvec_to_phys(__BVEC_END((b1))), bio_to_phys((b2)) + (b2)->bi_size, (q)->seg_boundary_mask) + BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2))) #define bio_io_error(bio) bio_endio((bio), 0, bio_sectors((bio))) @@ -167,6 +171,8 @@ extern struct bio *bio_alloc(int, int); extern void bio_put(struct bio *); extern int bio_endio(struct bio *, int, int); +struct request_queue; +extern inline int bio_hw_segments(struct request_queue *, struct bio *); extern inline void __bio_clone(struct bio *, struct bio *); extern struct bio *bio_clone(struct bio *, int); diff --git a/include/linux/blk.h b/include/linux/blk.h index e3155fcaaf47..adaa84c0fad1 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -84,11 +84,12 @@ extern inline struct request *elv_next_request(request_queue_t *q) (q)->elevator.elevator_add_req_fn((q), (rq), (where)); \ } while (0) -#define __elv_add_request(q, rq, back, p) \ +#define __elv_add_request(q, rq, back, p) do { \ if ((back)) \ __elv_add_request_core((q), (rq), (q)->queue_head.prev, (p)); \ else \ __elv_add_request_core((q), (rq), &(q)->queue_head, 0); \ +} while (0) #define elv_add_request(q, rq, back) __elv_add_request((q), (rq), (back), 1) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e9e0cf21005a..204ab9765514 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -256,6 +256,8 @@ extern void blk_attempt_remerge(request_queue_t *, struct request *); extern struct request *blk_get_request(request_queue_t *, int, int); extern void blk_put_request(struct request *); extern void blk_plug_device(request_queue_t *); +extern void blk_recount_segments(request_queue_t *, struct bio *); +extern inline int blk_contig_segment(request_queue_t *q, struct bio *, struct bio *); extern int block_ioctl(kdev_t, unsigned int, unsigned long); |
