aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShaohua Li <shli@kernel.org>2012-10-10 22:34:00 -0400
committerNeilBrown <neilb@suse.de>2012-10-10 22:34:00 -0400
commit4ed8731d8e6bd2a88a30697fbf4f7e6e979a6c46 (patch)
tree3bb77592fa5a89b8e7f0ef84b8d7f53122bbd071 /drivers
parent57c67df48866d57b50d72eb198ffcc0cf7a6232d (diff)
MD: change the parameter of md thread
Change the thread parameter, so the thread can carry extra info. Next patch will use it. Signed-off-by: Shaohua Li <shli@fusionio.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c9
-rw-r--r--drivers/md/md.h7
-rw-r--r--drivers/md/multipath.c3
-rw-r--r--drivers/md/raid1.c3
-rw-r--r--drivers/md/raid10.c3
-rw-r--r--drivers/md/raid5.c3
6 files changed, 17 insertions, 11 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7a2b0793f66e..8e842b326ebd 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6641,7 +6641,7 @@ static int md_thread(void * arg)
6641 6641
6642 clear_bit(THREAD_WAKEUP, &thread->flags); 6642 clear_bit(THREAD_WAKEUP, &thread->flags);
6643 if (!kthread_should_stop()) 6643 if (!kthread_should_stop())
6644 thread->run(thread->mddev); 6644 thread->run(thread);
6645 } 6645 }
6646 6646
6647 return 0; 6647 return 0;
@@ -6656,8 +6656,8 @@ void md_wakeup_thread(struct md_thread *thread)
6656 } 6656 }
6657} 6657}
6658 6658
6659struct md_thread *md_register_thread(void (*run) (struct mddev *), struct mddev *mddev, 6659struct md_thread *md_register_thread(void (*run) (struct md_thread *),
6660 const char *name) 6660 struct mddev *mddev, const char *name)
6661{ 6661{
6662 struct md_thread *thread; 6662 struct md_thread *thread;
6663 6663
@@ -7206,8 +7206,9 @@ EXPORT_SYMBOL_GPL(md_allow_write);
7206 7206
7207#define SYNC_MARKS 10 7207#define SYNC_MARKS 10
7208#define SYNC_MARK_STEP (3*HZ) 7208#define SYNC_MARK_STEP (3*HZ)
7209void md_do_sync(struct mddev *mddev) 7209void md_do_sync(struct md_thread *thread)
7210{ 7210{
7211 struct mddev *mddev = thread->mddev;
7211 struct mddev *mddev2; 7212 struct mddev *mddev2;
7212 unsigned int currspeed = 0, 7213 unsigned int currspeed = 0,
7213 window; 7214 window;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index f385b038589d..93ada214b50e 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -540,12 +540,13 @@ static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
540 list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) 540 list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
541 541
542struct md_thread { 542struct md_thread {
543 void (*run) (struct mddev *mddev); 543 void (*run) (struct md_thread *thread);
544 struct mddev *mddev; 544 struct mddev *mddev;
545 wait_queue_head_t wqueue; 545 wait_queue_head_t wqueue;
546 unsigned long flags; 546 unsigned long flags;
547 struct task_struct *tsk; 547 struct task_struct *tsk;
548 unsigned long timeout; 548 unsigned long timeout;
549 void *private;
549}; 550};
550 551
551#define THREAD_WAKEUP 0 552#define THREAD_WAKEUP 0
@@ -584,7 +585,7 @@ static inline void safe_put_page(struct page *p)
584extern int register_md_personality(struct md_personality *p); 585extern int register_md_personality(struct md_personality *p);
585extern int unregister_md_personality(struct md_personality *p); 586extern int unregister_md_personality(struct md_personality *p);
586extern struct md_thread *md_register_thread( 587extern struct md_thread *md_register_thread(
587 void (*run)(struct mddev *mddev), 588 void (*run)(struct md_thread *thread),
588 struct mddev *mddev, 589 struct mddev *mddev,
589 const char *name); 590 const char *name);
590extern void md_unregister_thread(struct md_thread **threadp); 591extern void md_unregister_thread(struct md_thread **threadp);
@@ -603,7 +604,7 @@ extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
603extern void md_super_wait(struct mddev *mddev); 604extern void md_super_wait(struct mddev *mddev);
604extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, 605extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
605 struct page *page, int rw, bool metadata_op); 606 struct page *page, int rw, bool metadata_op);
606extern void md_do_sync(struct mddev *mddev); 607extern void md_do_sync(struct md_thread *thread);
607extern void md_new_event(struct mddev *mddev); 608extern void md_new_event(struct mddev *mddev);
608extern int md_allow_write(struct mddev *mddev); 609extern int md_allow_write(struct mddev *mddev);
609extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev); 610extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 61a1833ebaf3..1642eae75a33 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -335,8 +335,9 @@ abort:
335 * 3. Performs writes following reads for array syncronising. 335 * 3. Performs writes following reads for array syncronising.
336 */ 336 */
337 337
338static void multipathd (struct mddev *mddev) 338static void multipathd(struct md_thread *thread)
339{ 339{
340 struct mddev *mddev = thread->mddev;
340 struct multipath_bh *mp_bh; 341 struct multipath_bh *mp_bh;
341 struct bio *bio; 342 struct bio *bio;
342 unsigned long flags; 343 unsigned long flags;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 05c557e8f862..55ccf4730536 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2294,8 +2294,9 @@ read_more:
2294 } 2294 }
2295} 2295}
2296 2296
2297static void raid1d(struct mddev *mddev) 2297static void raid1d(struct md_thread *thread)
2298{ 2298{
2299 struct mddev *mddev = thread->mddev;
2299 struct r1bio *r1_bio; 2300 struct r1bio *r1_bio;
2300 unsigned long flags; 2301 unsigned long flags;
2301 struct r1conf *conf = mddev->private; 2302 struct r1conf *conf = mddev->private;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 05dc96a950d5..54860604d097 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2732,8 +2732,9 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio)
2732 } 2732 }
2733} 2733}
2734 2734
2735static void raid10d(struct mddev *mddev) 2735static void raid10d(struct md_thread *thread)
2736{ 2736{
2737 struct mddev *mddev = thread->mddev;
2737 struct r10bio *r10_bio; 2738 struct r10bio *r10_bio;
2738 unsigned long flags; 2739 unsigned long flags;
2739 struct r10conf *conf = mddev->private; 2740 struct r10conf *conf = mddev->private;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index adda94df5eb2..81c02d63440b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4625,8 +4625,9 @@ static int handle_active_stripes(struct r5conf *conf)
4625 * During the scan, completed stripes are saved for us by the interrupt 4625 * During the scan, completed stripes are saved for us by the interrupt
4626 * handler, so that they will not have to wait for our next wakeup. 4626 * handler, so that they will not have to wait for our next wakeup.
4627 */ 4627 */
4628static void raid5d(struct mddev *mddev) 4628static void raid5d(struct md_thread *thread)
4629{ 4629{
4630 struct mddev *mddev = thread->mddev;
4630 struct r5conf *conf = mddev->private; 4631 struct r5conf *conf = mddev->private;
4631 int handled; 4632 int handled;
4632 struct blk_plug plug; 4633 struct blk_plug plug;