Commit 92952632 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: remove md_flush_all

Following are 7 patches for md

They all grew out of a desire to redo the locking in unplug_slave.  Getting
and dropping a spinlock so often for very little gain (it would be nearly
impossible to lose the relevant race) really bothered me.

I finally figured that I could reply it with rcu locking which is very light
wait, and quite up to the task.

One the way I found an number of inconsistencies that needed cleaning up and
even a few bugs to fix.  The first 6 patches deal with these inconsistencies
and bugs.  The last redoes the locking for adding/removing/accessing devices
within md personalities.


This patch:

md_flush_all() isn't needed as each personality defines its own
issue_flush_fn.
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 94fe0f3e
......@@ -154,38 +154,6 @@ static spinlock_t all_mddevs_lock = SPIN_LOCK_UNLOCKED;
tmp = tmp->next;}) \
)
int md_flush_mddev(mddev_t *mddev, sector_t *error_sector)
{
struct list_head *tmp;
mdk_rdev_t *rdev;
int ret = 0;
/*
* this list iteration is done without any locking in md?!
*/
ITERATE_RDEV(mddev, rdev, tmp) {
request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
int err;
if (!r_queue->issue_flush_fn)
err = -EOPNOTSUPP;
else
err = r_queue->issue_flush_fn(r_queue, rdev->bdev->bd_disk, error_sector);
if (!ret)
ret = err;
}
return ret;
}
static int md_flush_all(request_queue_t *q, struct gendisk *disk,
sector_t *error_sector)
{
mddev_t *mddev = q->queuedata;
return md_flush_mddev(mddev, error_sector);
}
static int md_fail_request (request_queue_t *q, struct bio *bio)
{
......@@ -1714,7 +1682,6 @@ static int do_md_run(mddev_t * mddev)
*/
mddev->queue->queuedata = mddev;
mddev->queue->make_request_fn = mddev->pers->make_request;
mddev->queue->issue_flush_fn = md_flush_all;
mddev->changed = 1;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment