md.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) | md.h (1532d9e87e8b2377f12929f9e40724d5fbe6ecc5) |
---|---|
1/* 2 md.h : kernel internal structure of the Linux MD driver 3 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. --- 471 unchanged lines hidden (view full) --- 480 MD_RECOVERY_INTR, /* resync needs to be aborted for some reason */ 481 MD_RECOVERY_DONE, /* thread is done and is waiting to be reaped */ 482 MD_RECOVERY_NEEDED, /* we might need to start a resync/recover */ 483 MD_RECOVERY_REQUESTED, /* user-space has requested a sync (used with SYNC) */ 484 MD_RECOVERY_CHECK, /* user-space request for check-only, no repair */ 485 MD_RECOVERY_RESHAPE, /* A reshape is happening */ 486 MD_RECOVERY_FROZEN, /* User request to abort, and not restart, any action */ 487 MD_RECOVERY_ERROR, /* sync-action interrupted because io-error */ | 1/* 2 md.h : kernel internal structure of the Linux MD driver 3 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. --- 471 unchanged lines hidden (view full) --- 480 MD_RECOVERY_INTR, /* resync needs to be aborted for some reason */ 481 MD_RECOVERY_DONE, /* thread is done and is waiting to be reaped */ 482 MD_RECOVERY_NEEDED, /* we might need to start a resync/recover */ 483 MD_RECOVERY_REQUESTED, /* user-space has requested a sync (used with SYNC) */ 484 MD_RECOVERY_CHECK, /* user-space request for check-only, no repair */ 485 MD_RECOVERY_RESHAPE, /* A reshape is happening */ 486 MD_RECOVERY_FROZEN, /* User request to abort, and not restart, any action */ 487 MD_RECOVERY_ERROR, /* sync-action interrupted because io-error */ |
488 MD_RECOVERY_WAIT, /* waiting for pers->start() to finish */ |
|
488}; 489 490static inline int __must_check mddev_lock(struct mddev *mddev) 491{ 492 return mutex_lock_interruptible(&mddev->reconfig_mutex); 493} 494 495/* Sometimes we need to take the lock in a situation where --- 22 unchanged lines hidden (view full) --- 518 519struct md_personality 520{ 521 char *name; 522 int level; 523 struct list_head list; 524 struct module *owner; 525 bool (*make_request)(struct mddev *mddev, struct bio *bio); | 489}; 490 491static inline int __must_check mddev_lock(struct mddev *mddev) 492{ 493 return mutex_lock_interruptible(&mddev->reconfig_mutex); 494} 495 496/* Sometimes we need to take the lock in a situation where --- 22 unchanged lines hidden (view full) --- 519 520struct md_personality 521{ 522 char *name; 523 int level; 524 struct list_head list; 525 struct module *owner; 526 bool (*make_request)(struct mddev *mddev, struct bio *bio); |
527 /* 528 * start up works that do NOT require md_thread. tasks that 529 * requires md_thread should go into start() 530 */ |
|
526 int (*run)(struct mddev *mddev); | 531 int (*run)(struct mddev *mddev); |
532 /* start up works that require md threads */ 533 int (*start)(struct mddev *mddev); |
|
527 void (*free)(struct mddev *mddev, void *priv); 528 void (*status)(struct seq_file *seq, struct mddev *mddev); 529 /* error_handler must set ->faulty and clear ->in_sync 530 * if appropriate, and should abort recovery if needed 531 */ 532 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev); 533 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev); 534 int (*hot_remove_disk) (struct mddev *mddev, struct md_rdev *rdev); --- 147 unchanged lines hidden (view full) --- 682extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors); 683extern int md_check_no_bitmap(struct mddev *mddev); 684extern int md_integrity_register(struct mddev *mddev); 685extern int md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev); 686extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); 687 688extern void mddev_init(struct mddev *mddev); 689extern int md_run(struct mddev *mddev); | 534 void (*free)(struct mddev *mddev, void *priv); 535 void (*status)(struct seq_file *seq, struct mddev *mddev); 536 /* error_handler must set ->faulty and clear ->in_sync 537 * if appropriate, and should abort recovery if needed 538 */ 539 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev); 540 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev); 541 int (*hot_remove_disk) (struct mddev *mddev, struct md_rdev *rdev); --- 147 unchanged lines hidden (view full) --- 689extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors); 690extern int md_check_no_bitmap(struct mddev *mddev); 691extern int md_integrity_register(struct mddev *mddev); 692extern int md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev); 693extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); 694 695extern void mddev_init(struct mddev *mddev); 696extern int md_run(struct mddev *mddev); |
697extern int md_start(struct mddev *mddev); |
|
690extern void md_stop(struct mddev *mddev); 691extern void md_stop_writes(struct mddev *mddev); 692extern int md_rdev_init(struct md_rdev *rdev); 693extern void md_rdev_clear(struct md_rdev *rdev); 694 695extern void md_handle_request(struct mddev *mddev, struct bio *bio); 696extern void mddev_suspend(struct mddev *mddev); 697extern void mddev_resume(struct mddev *mddev); 698extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, 699 struct mddev *mddev); 700 701extern void md_reload_sb(struct mddev *mddev, int raid_disk); 702extern void md_update_sb(struct mddev *mddev, int force); 703extern void md_kick_rdev_from_array(struct md_rdev * rdev); 704struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr); | 698extern void md_stop(struct mddev *mddev); 699extern void md_stop_writes(struct mddev *mddev); 700extern int md_rdev_init(struct md_rdev *rdev); 701extern void md_rdev_clear(struct md_rdev *rdev); 702 703extern void md_handle_request(struct mddev *mddev, struct bio *bio); 704extern void mddev_suspend(struct mddev *mddev); 705extern void mddev_resume(struct mddev *mddev); 706extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, 707 struct mddev *mddev); 708 709extern void md_reload_sb(struct mddev *mddev, int raid_disk); 710extern void md_update_sb(struct mddev *mddev, int force); 711extern void md_kick_rdev_from_array(struct md_rdev * rdev); 712struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr); |
713struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev); |
|
705 706static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) 707{ 708 int faulty = test_bit(Faulty, &rdev->flags); 709 if (atomic_dec_and_test(&rdev->nr_pending) && faulty) { 710 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 711 md_wakeup_thread(mddev->thread); 712 } --- 29 unchanged lines hidden --- | 714 715static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) 716{ 717 int faulty = test_bit(Faulty, &rdev->flags); 718 if (atomic_dec_and_test(&rdev->nr_pending) && faulty) { 719 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 720 md_wakeup_thread(mddev->thread); 721 } --- 29 unchanged lines hidden --- |