提交 00fff265 编写于 作者: F FUJITA Tomonori 提交者: Jens Axboe

block: remove q->prepare_flush_fn completely

This removes q->prepare_flush_fn completely (changes the
blk_queue_ordered API).
Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 afc23068
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* blk_queue_ordered - does this queue support ordered writes * blk_queue_ordered - does this queue support ordered writes
* @q: the request queue * @q: the request queue
* @ordered: one of QUEUE_ORDERED_* * @ordered: one of QUEUE_ORDERED_*
* @prepare_flush_fn: rq setup helper for cache flush ordered writes
* *
* Description: * Description:
* For journalled file systems, doing ordered writes on a commit * For journalled file systems, doing ordered writes on a commit
...@@ -22,8 +21,7 @@ ...@@ -22,8 +21,7 @@
* feature should call this function and indicate so. * feature should call this function and indicate so.
* *
**/ **/
int blk_queue_ordered(struct request_queue *q, unsigned ordered, int blk_queue_ordered(struct request_queue *q, unsigned ordered)
prepare_flush_fn *prepare_flush_fn)
{ {
if (ordered != QUEUE_ORDERED_NONE && if (ordered != QUEUE_ORDERED_NONE &&
ordered != QUEUE_ORDERED_DRAIN && ordered != QUEUE_ORDERED_DRAIN &&
...@@ -38,7 +36,6 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered, ...@@ -38,7 +36,6 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,
q->ordered = ordered; q->ordered = ordered;
q->next_ordered = ordered; q->next_ordered = ordered;
q->prepare_flush_fn = prepare_flush_fn;
return 0; return 0;
} }
...@@ -140,8 +137,6 @@ static void queue_flush(struct request_queue *q, unsigned which) ...@@ -140,8 +137,6 @@ static void queue_flush(struct request_queue *q, unsigned which)
rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH; rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH;
rq->rq_disk = q->bar_rq.rq_disk; rq->rq_disk = q->bar_rq.rq_disk;
rq->end_io = end_io; rq->end_io = end_io;
if (q->prepare_flush_fn)
q->prepare_flush_fn(q, rq);
elv_insert(q, rq, ELEVATOR_INSERT_FRONT); elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
} }
......
...@@ -479,7 +479,7 @@ static struct brd_device *brd_alloc(int i) ...@@ -479,7 +479,7 @@ static struct brd_device *brd_alloc(int i)
if (!brd->brd_queue) if (!brd->brd_queue)
goto out_free_dev; goto out_free_dev;
blk_queue_make_request(brd->brd_queue, brd_make_request); blk_queue_make_request(brd->brd_queue, brd_make_request);
blk_queue_ordered(brd->brd_queue, QUEUE_ORDERED_TAG, NULL); blk_queue_ordered(brd->brd_queue, QUEUE_ORDERED_TAG);
blk_queue_max_hw_sectors(brd->brd_queue, 1024); blk_queue_max_hw_sectors(brd->brd_queue, 1024);
blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY); blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY);
......
...@@ -831,7 +831,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, ...@@ -831,7 +831,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
lo->lo_queue->unplug_fn = loop_unplug; lo->lo_queue->unplug_fn = loop_unplug;
if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync) if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
blk_queue_ordered(lo->lo_queue, QUEUE_ORDERED_DRAIN, NULL); blk_queue_ordered(lo->lo_queue, QUEUE_ORDERED_DRAIN);
set_capacity(lo->lo_disk, size); set_capacity(lo->lo_disk, size);
bd_set_size(bdev, size << 9); bd_set_size(bdev, size << 9);
......
...@@ -439,7 +439,7 @@ static int osdblk_init_disk(struct osdblk_device *osdev) ...@@ -439,7 +439,7 @@ static int osdblk_init_disk(struct osdblk_device *osdev)
blk_queue_stack_limits(q, osd_request_queue(osdev->osd)); blk_queue_stack_limits(q, osd_request_queue(osdev->osd));
blk_queue_prep_rq(q, blk_queue_start_tag); blk_queue_prep_rq(q, blk_queue_start_tag);
blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH, NULL); blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH);
disk->queue = q; disk->queue = q;
......
...@@ -468,7 +468,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) ...@@ -468,7 +468,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
blk_queue_dma_alignment(queue, dev->blk_size-1); blk_queue_dma_alignment(queue, dev->blk_size-1);
blk_queue_logical_block_size(queue, dev->blk_size); blk_queue_logical_block_size(queue, dev->blk_size);
blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, NULL); blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH);
blk_queue_max_segments(queue, -1); blk_queue_max_segments(queue, -1);
blk_queue_max_segment_size(queue, dev->bounce_size); blk_queue_max_segment_size(queue, dev->bounce_size);
......
...@@ -366,9 +366,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) ...@@ -366,9 +366,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
/* If barriers are supported, tell block layer that queue is ordered */ /* If barriers are supported, tell block layer that queue is ordered */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH)) if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH, NULL); blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH);
else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER)) else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER))
blk_queue_ordered(q, QUEUE_ORDERED_TAG, NULL); blk_queue_ordered(q, QUEUE_ORDERED_TAG);
/* If disk is read-only in the host, the guest should obey */ /* If disk is read-only in the host, the guest should obey */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO)) if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
......
...@@ -373,8 +373,7 @@ static int xlvbd_barrier(struct blkfront_info *info) ...@@ -373,8 +373,7 @@ static int xlvbd_barrier(struct blkfront_info *info)
int err; int err;
err = blk_queue_ordered(info->rq, err = blk_queue_ordered(info->rq,
info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE, info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE);
NULL);
if (err) if (err)
return err; return err;
......
...@@ -549,7 +549,7 @@ static void update_ordered(ide_drive_t *drive) ...@@ -549,7 +549,7 @@ static void update_ordered(ide_drive_t *drive)
} else } else
ordered = QUEUE_ORDERED_DRAIN; ordered = QUEUE_ORDERED_DRAIN;
blk_queue_ordered(drive->queue, ordered, NULL); blk_queue_ordered(drive->queue, ordered);
} }
ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE); ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE);
......
...@@ -1901,7 +1901,7 @@ static struct mapped_device *alloc_dev(int minor) ...@@ -1901,7 +1901,7 @@ static struct mapped_device *alloc_dev(int minor)
blk_queue_softirq_done(md->queue, dm_softirq_done); blk_queue_softirq_done(md->queue, dm_softirq_done);
blk_queue_prep_rq(md->queue, dm_prep_fn); blk_queue_prep_rq(md->queue, dm_prep_fn);
blk_queue_lld_busy(md->queue, dm_lld_busy); blk_queue_lld_busy(md->queue, dm_lld_busy);
blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN_FLUSH, NULL); blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN_FLUSH);
md->disk = alloc_disk(1); md->disk = alloc_disk(1);
if (!md->disk) if (!md->disk)
......
...@@ -128,7 +128,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock ...@@ -128,7 +128,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
mq->req = NULL; mq->req = NULL;
blk_queue_prep_rq(mq->queue, mmc_prep_request); blk_queue_prep_rq(mq->queue, mmc_prep_request);
blk_queue_ordered(mq->queue, QUEUE_ORDERED_DRAIN, NULL); blk_queue_ordered(mq->queue, QUEUE_ORDERED_DRAIN);
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue); queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue);
#ifdef CONFIG_MMC_BLOCK_BOUNCE #ifdef CONFIG_MMC_BLOCK_BOUNCE
......
...@@ -2196,7 +2196,7 @@ static void dasd_setup_queue(struct dasd_block *block) ...@@ -2196,7 +2196,7 @@ static void dasd_setup_queue(struct dasd_block *block)
*/ */
blk_queue_max_segment_size(block->request_queue, PAGE_SIZE); blk_queue_max_segment_size(block->request_queue, PAGE_SIZE);
blk_queue_segment_boundary(block->request_queue, PAGE_SIZE - 1); blk_queue_segment_boundary(block->request_queue, PAGE_SIZE - 1);
blk_queue_ordered(block->request_queue, QUEUE_ORDERED_DRAIN, NULL); blk_queue_ordered(block->request_queue, QUEUE_ORDERED_DRAIN);
} }
/* /*
......
...@@ -2135,7 +2135,7 @@ static int sd_revalidate_disk(struct gendisk *disk) ...@@ -2135,7 +2135,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
else else
ordered = QUEUE_ORDERED_DRAIN; ordered = QUEUE_ORDERED_DRAIN;
blk_queue_ordered(sdkp->disk->queue, ordered, NULL); blk_queue_ordered(sdkp->disk->queue, ordered);
set_capacity(disk, sdkp->capacity); set_capacity(disk, sdkp->capacity);
kfree(buffer); kfree(buffer);
......
...@@ -212,7 +212,6 @@ struct bvec_merge_data { ...@@ -212,7 +212,6 @@ struct bvec_merge_data {
}; };
typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
struct bio_vec *); struct bio_vec *);
typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
typedef void (softirq_done_fn)(struct request *); typedef void (softirq_done_fn)(struct request *);
typedef int (dma_drain_needed_fn)(struct request *); typedef int (dma_drain_needed_fn)(struct request *);
typedef int (lld_busy_fn) (struct request_queue *q); typedef int (lld_busy_fn) (struct request_queue *q);
...@@ -286,7 +285,6 @@ struct request_queue ...@@ -286,7 +285,6 @@ struct request_queue
unprep_rq_fn *unprep_rq_fn; unprep_rq_fn *unprep_rq_fn;
unplug_fn *unplug_fn; unplug_fn *unplug_fn;
merge_bvec_fn *merge_bvec_fn; merge_bvec_fn *merge_bvec_fn;
prepare_flush_fn *prepare_flush_fn;
softirq_done_fn *softirq_done_fn; softirq_done_fn *softirq_done_fn;
rq_timed_out_fn *rq_timed_out_fn; rq_timed_out_fn *rq_timed_out_fn;
dma_drain_needed_fn *dma_drain_needed; dma_drain_needed_fn *dma_drain_needed;
...@@ -896,7 +894,7 @@ extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); ...@@ -896,7 +894,7 @@ extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *);
extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); extern int blk_queue_ordered(struct request_queue *, unsigned);
extern bool blk_do_ordered(struct request_queue *, struct request **); extern bool blk_do_ordered(struct request_queue *, struct request **);
extern unsigned blk_ordered_cur_seq(struct request_queue *); extern unsigned blk_ordered_cur_seq(struct request_queue *);
extern unsigned blk_ordered_req_seq(struct request *); extern unsigned blk_ordered_req_seq(struct request *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册