diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bio.h | 19 | ||||
-rw-r--r-- | include/linux/blkdev.h | 8 | ||||
-rw-r--r-- | include/linux/ide.h | 5 |
3 files changed, 21 insertions, 11 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 089a8bc55dd4..4da441337d6e 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -176,13 +176,28 @@ struct bio { | |||
176 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 176 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
177 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 177 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
178 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 178 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
179 | #define bio_cur_sectors(bio) (bio_iovec(bio)->bv_len >> 9) | ||
180 | #define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio))) | ||
181 | #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) | 179 | #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) |
182 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | 180 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) |
183 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 181 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
184 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 182 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
185 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | 183 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) |
184 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size) | ||
185 | |||
186 | static inline unsigned int bio_cur_sectors(struct bio *bio) | ||
187 | { | ||
188 | if (bio->bi_vcnt) | ||
189 | return bio_iovec(bio)->bv_len >> 9; | ||
190 | |||
191 | return 0; | ||
192 | } | ||
193 | |||
194 | static inline void *bio_data(struct bio *bio) | ||
195 | { | ||
196 | if (bio->bi_vcnt) | ||
197 | return page_address(bio_page(bio)) + bio_offset(bio); | ||
198 | |||
199 | return NULL; | ||
200 | } | ||
186 | 201 | ||
187 | /* | 202 | /* |
188 | * will die | 203 | * will die |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5ed888b04b29..bbf906a0b419 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -330,7 +330,6 @@ typedef void (unplug_fn) (struct request_queue *); | |||
330 | 330 | ||
331 | struct bio_vec; | 331 | struct bio_vec; |
332 | typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); | 332 | typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); |
333 | typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *); | ||
334 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); | 333 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); |
335 | typedef void (softirq_done_fn)(struct request *); | 334 | typedef void (softirq_done_fn)(struct request *); |
336 | 335 | ||
@@ -368,7 +367,6 @@ struct request_queue | |||
368 | prep_rq_fn *prep_rq_fn; | 367 | prep_rq_fn *prep_rq_fn; |
369 | unplug_fn *unplug_fn; | 368 | unplug_fn *unplug_fn; |
370 | merge_bvec_fn *merge_bvec_fn; | 369 | merge_bvec_fn *merge_bvec_fn; |
371 | issue_flush_fn *issue_flush_fn; | ||
372 | prepare_flush_fn *prepare_flush_fn; | 370 | prepare_flush_fn *prepare_flush_fn; |
373 | softirq_done_fn *softirq_done_fn; | 371 | softirq_done_fn *softirq_done_fn; |
374 | 372 | ||
@@ -540,6 +538,7 @@ enum { | |||
540 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 538 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
541 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 539 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
542 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 540 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
541 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | ||
543 | 542 | ||
544 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 543 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
545 | 544 | ||
@@ -729,7 +728,9 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
729 | extern int end_that_request_first(struct request *, int, int); | 728 | extern int end_that_request_first(struct request *, int, int); |
730 | extern int end_that_request_chunk(struct request *, int, int); | 729 | extern int end_that_request_chunk(struct request *, int, int); |
731 | extern void end_that_request_last(struct request *, int); | 730 | extern void end_that_request_last(struct request *, int); |
732 | extern void end_request(struct request *req, int uptodate); | 731 | extern void end_request(struct request *, int); |
732 | extern void end_queued_request(struct request *, int); | ||
733 | extern void end_dequeued_request(struct request *, int); | ||
733 | extern void blk_complete_request(struct request *); | 734 | extern void blk_complete_request(struct request *); |
734 | 735 | ||
735 | /* | 736 | /* |
@@ -767,7 +768,6 @@ extern void blk_queue_dma_alignment(struct request_queue *, int); | |||
767 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 768 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
768 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 769 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
769 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 770 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
770 | extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *); | ||
771 | extern int blk_do_ordered(struct request_queue *, struct request **); | 771 | extern int blk_do_ordered(struct request_queue *, struct request **); |
772 | extern unsigned blk_ordered_cur_seq(struct request_queue *); | 772 | extern unsigned blk_ordered_cur_seq(struct request_queue *); |
773 | extern unsigned blk_ordered_req_seq(struct request *); | 773 | extern unsigned blk_ordered_req_seq(struct request *); |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 02a27e8cbad2..234fa3df24f6 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1093,11 +1093,6 @@ extern ide_startstop_t ide_do_reset (ide_drive_t *); | |||
1093 | extern void ide_init_drive_cmd (struct request *rq); | 1093 | extern void ide_init_drive_cmd (struct request *rq); |
1094 | 1094 | ||
1095 | /* | 1095 | /* |
1096 | * this function returns error location sector offset in case of a write error | ||
1097 | */ | ||
1098 | extern u64 ide_get_error_location(ide_drive_t *, char *); | ||
1099 | |||
1100 | /* | ||
1101 | * "action" parameter type for ide_do_drive_cmd() below. | 1096 | * "action" parameter type for ide_do_drive_cmd() below. |
1102 | */ | 1097 | */ |
1103 | typedef enum { | 1098 | typedef enum { |