block: convert blkdev_issue_flush() to use empty barriers
Then we can get rid of ->issue_flush_fn() and all the driver private implementations of that. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
@@ -611,36 +611,6 @@ static void raid10_unplug(struct request_queue *q)
|
||||
md_wakeup_thread(mddev->thread);
|
||||
}
|
||||
|
||||
static int raid10_issue_flush(struct request_queue *q, struct gendisk *disk,
|
||||
sector_t *error_sector)
|
||||
{
|
||||
mddev_t *mddev = q->queuedata;
|
||||
conf_t *conf = mddev_to_conf(mddev);
|
||||
int i, ret = 0;
|
||||
|
||||
rcu_read_lock();
|
||||
for (i=0; i<mddev->raid_disks && ret == 0; i++) {
|
||||
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev);
|
||||
if (rdev && !test_bit(Faulty, &rdev->flags)) {
|
||||
struct block_device *bdev = rdev->bdev;
|
||||
struct request_queue *r_queue = bdev_get_queue(bdev);
|
||||
|
||||
if (!r_queue->issue_flush_fn)
|
||||
ret = -EOPNOTSUPP;
|
||||
else {
|
||||
atomic_inc(&rdev->nr_pending);
|
||||
rcu_read_unlock();
|
||||
ret = r_queue->issue_flush_fn(r_queue, bdev->bd_disk,
|
||||
error_sector);
|
||||
rdev_dec_pending(rdev, mddev);
|
||||
rcu_read_lock();
|
||||
}
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int raid10_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
@@ -2118,7 +2088,6 @@ static int run(mddev_t *mddev)
|
||||
mddev->resync_max_sectors = size << conf->chunk_shift;
|
||||
|
||||
mddev->queue->unplug_fn = raid10_unplug;
|
||||
mddev->queue->issue_flush_fn = raid10_issue_flush;
|
||||
mddev->queue->backing_dev_info.congested_fn = raid10_congested;
|
||||
mddev->queue->backing_dev_info.congested_data = mddev;
|
||||
|
||||
|
Reference in New Issue
Block a user