]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MD: change the parameter of md thread
authorShaohua Li <shli@kernel.org>
Sat, 18 Aug 2012 00:03:23 +0000 (10:03 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 18 Aug 2012 00:03:23 +0000 (10:03 +1000)
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>
drivers/md/md.c
drivers/md/md.h
drivers/md/multipath.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c

index 3f6203a4c7ea0dd730b80a6b441b99e8a4da3216..289987e0b7e28f63551265aa344ec69c9f5ab8b2 100644 (file)
@@ -6679,7 +6679,7 @@ static int md_thread(void * arg)
 
                clear_bit(THREAD_WAKEUP, &thread->flags);
                if (!kthread_should_stop())
-                       thread->run(thread->mddev);
+                       thread->run(thread);
        }
 
        return 0;
@@ -6694,8 +6694,8 @@ void md_wakeup_thread(struct md_thread *thread)
        }
 }
 
-struct md_thread *md_register_thread(void (*run) (struct mddev *), struct mddev *mddev,
-                                const char *name)
+struct md_thread *md_register_thread(void (*run) (struct md_thread *),
+               struct mddev *mddev, const char *name)
 {
        struct md_thread *thread;
 
@@ -7244,8 +7244,9 @@ EXPORT_SYMBOL_GPL(md_allow_write);
 
 #define SYNC_MARKS     10
 #define        SYNC_MARK_STEP  (3*HZ)
-void md_do_sync(struct mddev *mddev)
+void md_do_sync(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct mddev *mddev2;
        unsigned int currspeed = 0,
                 window;
index f385b038589d32313014e07af203b8f742bec4a7..93ada214b50e5b3d391561131c841d4dad627b7e 100644 (file)
@@ -540,12 +540,13 @@ static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
        list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
 
 struct md_thread {
-       void                    (*run) (struct mddev *mddev);
+       void                    (*run) (struct md_thread *thread);
        struct mddev            *mddev;
        wait_queue_head_t       wqueue;
        unsigned long           flags;
        struct task_struct      *tsk;
        unsigned long           timeout;
+       void                    *private;
 };
 
 #define THREAD_WAKEUP  0
@@ -584,7 +585,7 @@ static inline void safe_put_page(struct page *p)
 extern int register_md_personality(struct md_personality *p);
 extern int unregister_md_personality(struct md_personality *p);
 extern struct md_thread *md_register_thread(
-       void (*run)(struct mddev *mddev),
+       void (*run)(struct md_thread *thread),
        struct mddev *mddev,
        const char *name);
 extern void md_unregister_thread(struct md_thread **threadp);
@@ -603,7 +604,7 @@ extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
 extern void md_super_wait(struct mddev *mddev);
 extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, 
                        struct page *page, int rw, bool metadata_op);
-extern void md_do_sync(struct mddev *mddev);
+extern void md_do_sync(struct md_thread *thread);
 extern void md_new_event(struct mddev *mddev);
 extern int md_allow_write(struct mddev *mddev);
 extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
index 61a1833ebaf33ec40afaf752db9a849439c9bd13..2ab23d074dc6673951b59d19b78207388f59e2dc 100644 (file)
@@ -335,8 +335,9 @@ abort:
  *     3.      Performs writes following reads for array syncronising.
  */
 
-static void multipathd (struct mddev *mddev)
+static void multipathd (struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct multipath_bh *mp_bh;
        struct bio *bio;
        unsigned long flags;
index 1c79ea93ddc43a441c2eefaacf8ac669a82b44d5..3092afe635dbcb4318b58fc88988981e3f3ad2a2 100644 (file)
@@ -2293,8 +2293,9 @@ read_more:
        }
 }
 
-static void raid1d(struct mddev *mddev)
+static void raid1d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r1bio *r1_bio;
        unsigned long flags;
        struct r1conf *conf = mddev->private;
index ef0a7336c7231bdd959983bde916815ea1d9bf82..13ffd82975d604cc4670929b5c317e815fa2f78c 100644 (file)
@@ -2680,8 +2680,9 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio)
        }
 }
 
-static void raid10d(struct mddev *mddev)
+static void raid10d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r10bio *r10_bio;
        unsigned long flags;
        struct r10conf *conf = mddev->private;
index adda94df5eb2352775e64fb7fae4e88c6e89a98b..81c02d63440b647e9fc6145206f0d53b6efc90d9 100644 (file)
@@ -4625,8 +4625,9 @@ static int handle_active_stripes(struct r5conf *conf)
  * During the scan, completed stripes are saved for us by the interrupt
  * handler, so that they will not have to wait for our next wakeup.
  */
-static void raid5d(struct mddev *mddev)
+static void raid5d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r5conf *conf = mddev->private;
        int handled;
        struct blk_plug plug;