Lines Matching refs:mddev
52 struct mddev *mddev; /* RAID array if running */ member
308 struct mddev { struct
529 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev); argument
558 static inline int __must_check mddev_lock(struct mddev *mddev) in mddev_lock() argument
560 return mutex_lock_interruptible(&mddev->reconfig_mutex); in mddev_lock()
566 static inline void mddev_lock_nointr(struct mddev *mddev) in mddev_lock_nointr() argument
568 mutex_lock(&mddev->reconfig_mutex); in mddev_lock_nointr()
571 static inline int mddev_trylock(struct mddev *mddev) in mddev_trylock() argument
573 return mutex_trylock(&mddev->reconfig_mutex); in mddev_trylock()
575 extern void mddev_unlock(struct mddev *mddev);
593 bool __must_check (*make_request)(struct mddev *mddev, struct bio *bio);
598 int (*run)(struct mddev *mddev);
600 int (*start)(struct mddev *mddev);
601 void (*free)(struct mddev *mddev, void *priv);
602 void (*status)(struct seq_file *seq, struct mddev *mddev);
606 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
607 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
608 int (*hot_remove_disk) (struct mddev *mddev, struct md_rdev *rdev);
609 int (*spare_active) (struct mddev *mddev);
610 sector_t (*sync_request)(struct mddev *mddev, sector_t sector_nr, int *skipped);
611 int (*resize) (struct mddev *mddev, sector_t sectors);
612 sector_t (*size) (struct mddev *mddev, sector_t sectors, int raid_disks);
613 int (*check_reshape) (struct mddev *mddev);
614 int (*start_reshape) (struct mddev *mddev);
615 void (*finish_reshape) (struct mddev *mddev);
616 void (*update_reshape_pos) (struct mddev *mddev);
621 void (*quiesce) (struct mddev *mddev, int quiesce);
631 void *(*takeover) (struct mddev *mddev);
633 int (*change_consistency_policy)(struct mddev *mddev, const char *buf);
638 ssize_t (*show)(struct mddev *, char *);
639 ssize_t (*store)(struct mddev *, const char *, size_t);
655 static inline char * mdname (struct mddev * mddev) in mdname() argument
657 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; in mdname()
660 static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev) in sysfs_link_rdev() argument
665 mddev->kobj.sd) { in sysfs_link_rdev()
667 return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); in sysfs_link_rdev()
672 static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev) in sysfs_unlink_rdev() argument
677 mddev->kobj.sd) { in sysfs_unlink_rdev()
679 sysfs_remove_link(&mddev->kobj, nm); in sysfs_unlink_rdev()
693 #define rdev_for_each(rdev, mddev) \ argument
694 list_for_each_entry(rdev, &((mddev)->disks), same_set)
696 #define rdev_for_each_safe(rdev, tmp, mddev) \ argument
697 list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set)
699 #define rdev_for_each_rcu(rdev, mddev) \ argument
700 list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
704 struct mddev *mddev; member
730 extern int md_setup_cluster(struct mddev *mddev, int nodes);
731 extern void md_cluster_stop(struct mddev *mddev);
734 struct mddev *mddev,
738 extern void md_check_recovery(struct mddev *mddev);
739 extern void md_reap_sync_thread(struct mddev *mddev);
740 extern int mddev_init_writes_pending(struct mddev *mddev);
741 extern bool md_write_start(struct mddev *mddev, struct bio *bi);
742 extern void md_write_inc(struct mddev *mddev, struct bio *bi);
743 extern void md_write_end(struct mddev *mddev);
744 extern void md_done_sync(struct mddev *mddev, int blocks, int ok);
745 extern void md_error(struct mddev *mddev, struct md_rdev *rdev);
746 extern void md_finish_reshape(struct mddev *mddev);
747 void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
749 int acct_bioset_init(struct mddev *mddev);
750 void acct_bioset_exit(struct mddev *mddev);
751 void md_account_bio(struct mddev *mddev, struct bio **bio);
753 extern bool __must_check md_flush_request(struct mddev *mddev, struct bio *bio);
754 extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
756 extern int md_super_wait(struct mddev *mddev);
761 extern void md_allow_write(struct mddev *mddev);
762 extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
763 extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors);
764 extern int md_check_no_bitmap(struct mddev *mddev);
765 extern int md_integrity_register(struct mddev *mddev);
766 extern int md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev);
769 extern void mddev_init(struct mddev *mddev);
770 struct mddev *md_alloc(dev_t dev, char *name);
771 void mddev_put(struct mddev *mddev);
772 extern int md_run(struct mddev *mddev);
773 extern int md_start(struct mddev *mddev);
774 extern void md_stop(struct mddev *mddev);
775 extern void md_stop_writes(struct mddev *mddev);
779 extern void md_handle_request(struct mddev *mddev, struct bio *bio);
780 extern void mddev_suspend(struct mddev *mddev);
781 extern void mddev_resume(struct mddev *mddev);
783 extern void md_reload_sb(struct mddev *mddev, int raid_disk);
784 extern void md_update_sb(struct mddev *mddev, int force);
786 extern void mddev_create_serial_pool(struct mddev *mddev, struct md_rdev *rdev,
788 extern void mddev_destroy_serial_pool(struct mddev *mddev, struct md_rdev *rdev,
790 struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr);
791 struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev);
796 if (!test_and_set_bit(MD_BROKEN, &rdev->mddev->flags)) in is_mddev_broken()
798 mdname(rdev->mddev), md_type); in is_mddev_broken()
804 static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) in rdev_dec_pending() argument
808 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in rdev_dec_pending()
809 md_wakeup_thread(mddev->thread); in rdev_dec_pending()
814 static inline int mddev_is_clustered(struct mddev *mddev) in mddev_is_clustered() argument
816 return mddev->cluster_info && mddev->bitmap_info.nodes > 1; in mddev_is_clustered()
820 static inline void mddev_clear_unsupported_flags(struct mddev *mddev, in mddev_clear_unsupported_flags() argument
823 mddev->flags &= ~unsupported_flags; in mddev_clear_unsupported_flags()
826 static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio) in mddev_check_write_zeroes() argument
830 mddev->queue->limits.max_write_zeroes_sectors = 0; in mddev_check_write_zeroes()
838 int md_set_array_info(struct mddev *mddev, struct mdu_array_info_s *info);
839 int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info);
840 int do_md_run(struct mddev *mddev);