aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 11:03:02 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 11:03:02 -0500
commitf6c427663a158056cd8ca71c01f30653e4b313f7 (patch)
tree7756753c37db84c1dd6cde1c99487f10e8a63878 /include/linux
parent9ef38eaf4289a99beb3bc13d1ded220a68cc8877 (diff)
parentfa2fc7f4813bfec1ae3232d49e3befbd601e8a6f (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: libata: implement drain buffers libata: eliminate the home grown dma padding in favour of block: clear drain buffer if draining for write command block: implement request_queue->dma_drain_needed block: add request->raw_data_len block: update bio according to DMA alignment padding libata: update ATAPI overflow draining elevator: make elevator_get() attempt to load the appropriate module cfq-iosched: add hlist for browsing parallel to the radix tree block: make blk_rq_map_user() clear ->bio if it unmaps it fs/block_dev.c: remove #if 0'ed code make struct def_blk_aops static make blk_settings_init() static make blk_ioc_init() static make blk-core.c:request_cachep static again
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/aio.h1
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/blkdev.h8
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/iocontext.h2
-rw-r--r--include/linux/libata.h28
6 files changed, 9 insertions, 32 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h
index a9931e2e5624..0d0b7f629bd3 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -105,7 +105,6 @@ struct kiocb {
105 wait_queue_t ki_wait; 105 wait_queue_t ki_wait;
106 loff_t ki_pos; 106 loff_t ki_pos;
107 107
108 atomic_t ki_bio_count; /* num bio used for this iocb */
109 void *private; 108 void *private;
110 /* State that we remember to be able to restart/retry */ 109 /* State that we remember to be able to restart/retry */
111 unsigned short ki_opcode; 110 unsigned short ki_opcode;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4da441337d6e..4c59bdccd3ee 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -326,7 +326,6 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
326 gfp_t); 326 gfp_t);
327extern void bio_set_pages_dirty(struct bio *bio); 327extern void bio_set_pages_dirty(struct bio *bio);
328extern void bio_check_pages_dirty(struct bio *bio); 328extern void bio_check_pages_dirty(struct bio *bio);
329extern void bio_release_pages(struct bio *bio);
330extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
331extern int bio_uncopy_user(struct bio *); 330extern int bio_uncopy_user(struct bio *);
332void zero_fill_bio(struct bio *bio); 331void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e1888cc5b8ae..6fe67d1939c2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -216,6 +216,7 @@ struct request {
216 unsigned int cmd_len; 216 unsigned int cmd_len;
217 unsigned char cmd[BLK_MAX_CDB]; 217 unsigned char cmd[BLK_MAX_CDB];
218 218
219 unsigned int raw_data_len;
219 unsigned int data_len; 220 unsigned int data_len;
220 unsigned int sense_len; 221 unsigned int sense_len;
221 void *data; 222 void *data;
@@ -258,6 +259,7 @@ struct bio_vec;
258typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); 259typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *);
259typedef void (prepare_flush_fn) (struct request_queue *, struct request *); 260typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
260typedef void (softirq_done_fn)(struct request *); 261typedef void (softirq_done_fn)(struct request *);
262typedef int (dma_drain_needed_fn)(struct request *);
261 263
262enum blk_queue_state { 264enum blk_queue_state {
263 Queue_down, 265 Queue_down,
@@ -294,6 +296,7 @@ struct request_queue
294 merge_bvec_fn *merge_bvec_fn; 296 merge_bvec_fn *merge_bvec_fn;
295 prepare_flush_fn *prepare_flush_fn; 297 prepare_flush_fn *prepare_flush_fn;
296 softirq_done_fn *softirq_done_fn; 298 softirq_done_fn *softirq_done_fn;
299 dma_drain_needed_fn *dma_drain_needed;
297 300
298 /* 301 /*
299 * Dispatch queue sorting 302 * Dispatch queue sorting
@@ -698,8 +701,9 @@ extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
698extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 701extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
699extern void blk_queue_hardsect_size(struct request_queue *, unsigned short); 702extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
700extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); 703extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
701extern int blk_queue_dma_drain(struct request_queue *q, void *buf, 704extern int blk_queue_dma_drain(struct request_queue *q,
702 unsigned int size); 705 dma_drain_needed_fn *dma_drain_needed,
706 void *buf, unsigned int size);
703extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); 707extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
704extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); 708extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn);
705extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); 709extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 98ffb6ead434..b84b848431f2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1590,7 +1590,6 @@ extern void bd_set_size(struct block_device *, loff_t size);
1590extern void bd_forget(struct inode *inode); 1590extern void bd_forget(struct inode *inode);
1591extern void bdput(struct block_device *); 1591extern void bdput(struct block_device *);
1592extern struct block_device *open_by_devnum(dev_t, unsigned); 1592extern struct block_device *open_by_devnum(dev_t, unsigned);
1593extern const struct address_space_operations def_blk_aops;
1594#else 1593#else
1595static inline void bd_forget(struct inode *inode) {} 1594static inline void bd_forget(struct inode *inode) {}
1596#endif 1595#endif
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 593b222d9dcc..1b4ccf25b4d2 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -50,6 +50,7 @@ struct cfq_io_context {
50 sector_t seek_mean; 50 sector_t seek_mean;
51 51
52 struct list_head queue_list; 52 struct list_head queue_list;
53 struct hlist_node cic_list;
53 54
54 void (*dtor)(struct io_context *); /* destructor */ 55 void (*dtor)(struct io_context *); /* destructor */
55 void (*exit)(struct io_context *); /* called on task exit */ 56 void (*exit)(struct io_context *); /* called on task exit */
@@ -77,6 +78,7 @@ struct io_context {
77 78
78 struct as_io_context *aic; 79 struct as_io_context *aic;
79 struct radix_tree_root radix_root; 80 struct radix_tree_root radix_root;
81 struct hlist_head cic_list;
80 void *ioc_data; 82 void *ioc_data;
81}; 83};
82 84
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bc5a8d0c7090..2e098f940cec 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -278,7 +278,6 @@ enum {
278 278
279 /* size of buffer to pad xfers ending on unaligned boundaries */ 279 /* size of buffer to pad xfers ending on unaligned boundaries */
280 ATA_DMA_PAD_SZ = 4, 280 ATA_DMA_PAD_SZ = 4,
281 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
282 281
283 /* ering size */ 282 /* ering size */
284 ATA_ERING_SIZE = 32, 283 ATA_ERING_SIZE = 32,
@@ -457,24 +456,18 @@ struct ata_queued_cmd {
457 unsigned long flags; /* ATA_QCFLAG_xxx */ 456 unsigned long flags; /* ATA_QCFLAG_xxx */
458 unsigned int tag; 457 unsigned int tag;
459 unsigned int n_elem; 458 unsigned int n_elem;
460 unsigned int mapped_n_elem;
461 459
462 int dma_dir; 460 int dma_dir;
463 461
464 unsigned int pad_len;
465 unsigned int sect_size; 462 unsigned int sect_size;
466 463
467 unsigned int nbytes; 464 unsigned int nbytes;
468 unsigned int raw_nbytes;
469 unsigned int curbytes; 465 unsigned int curbytes;
470 466
471 struct scatterlist *cursg; 467 struct scatterlist *cursg;
472 unsigned int cursg_ofs; 468 unsigned int cursg_ofs;
473 469
474 struct scatterlist *last_sg;
475 struct scatterlist saved_last_sg;
476 struct scatterlist sgent; 470 struct scatterlist sgent;
477 struct scatterlist extra_sg[2];
478 471
479 struct scatterlist *sg; 472 struct scatterlist *sg;
480 473
@@ -619,9 +612,6 @@ struct ata_port {
619 struct ata_prd *prd; /* our SG list */ 612 struct ata_prd *prd; /* our SG list */
620 dma_addr_t prd_dma; /* and its DMA mapping */ 613 dma_addr_t prd_dma; /* and its DMA mapping */
621 614
622 void *pad; /* array of DMA pad buffers */
623 dma_addr_t pad_dma;
624
625 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 615 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
626 616
627 u8 ctl; /* cache of ATA control register */ 617 u8 ctl; /* cache of ATA control register */
@@ -1363,12 +1353,9 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1363 qc->flags = 0; 1353 qc->flags = 0;
1364 qc->cursg = NULL; 1354 qc->cursg = NULL;
1365 qc->cursg_ofs = 0; 1355 qc->cursg_ofs = 0;
1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; 1356 qc->nbytes = qc->curbytes = 0;
1367 qc->n_elem = 0; 1357 qc->n_elem = 0;
1368 qc->mapped_n_elem = 0;
1369 qc->err_mask = 0; 1358 qc->err_mask = 0;
1370 qc->pad_len = 0;
1371 qc->last_sg = NULL;
1372 qc->sect_size = ATA_SECT_SIZE; 1359 qc->sect_size = ATA_SECT_SIZE;
1373 1360
1374 ata_tf_init(qc->dev, &qc->tf); 1361 ata_tf_init(qc->dev, &qc->tf);
@@ -1423,19 +1410,6 @@ static inline unsigned int __ac_err_mask(u8 status)
1423 return mask; 1410 return mask;
1424} 1411}
1425 1412
1426static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
1427{
1428 ap->pad_dma = 0;
1429 ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
1430 &ap->pad_dma, GFP_KERNEL);
1431 return (ap->pad == NULL) ? -ENOMEM : 0;
1432}
1433
1434static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
1435{
1436 dmam_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
1437}
1438
1439static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) 1413static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1440{ 1414{
1441 return *(struct ata_port **)&host->hostdata[0]; 1415 return *(struct ata_port **)&host->hostdata[0];