#include <linux/sched/mm.h>
#include <linux/sched/signal.h>
#include <linux/kthread.h>
#include <linux/blkdev.h>
#include <linux/blk-integrity.h>
#include <linux/badblocks.h>
#include <linux/sysctl.h>
#include <linux/seq_file.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/hdreg.h>
#include <linux/proc_fs.h>
#include <linux/random.h>
#include <linux/major.h>
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/file.h>
#include <linux/compat.h>
#include <linux/delay.h>
#include <linux/raid/md_p.h>
#include <linux/raid/md_u.h>
#include <linux/raid/detect.h>
#include <linux/slab.h>
#include <linux/percpu-refcount.h>
#include <linux/part_stat.h>
#include "md.h"
#include "md-bitmap.h"
#include "md-cluster.h"
static const char *action_name[NR_SYNC_ACTIONS] = …;
static LIST_HEAD(pers_list);
static DEFINE_SPINLOCK(pers_lock);
static const struct kobj_type md_ktype;
const struct md_cluster_operations *md_cluster_ops;
EXPORT_SYMBOL(…);
static struct module *md_cluster_mod;
static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
static struct workqueue_struct *md_wq;
static struct workqueue_struct *md_misc_wq;
struct workqueue_struct *md_bitmap_wq;
static int remove_and_add_spares(struct mddev *mddev,
struct md_rdev *this);
static void mddev_detach(struct mddev *mddev);
static void export_rdev(struct md_rdev *rdev, struct mddev *mddev);
static void md_wakeup_thread_directly(struct md_thread __rcu *thread);
#define MD_DEFAULT_MAX_CORRECTED_READ_ERRORS …
#define DEFAULT_SAFEMODE_DELAY …
static int sysctl_speed_limit_min = …;
static int sysctl_speed_limit_max = …;
static inline int speed_min(struct mddev *mddev)
{ … }
static inline int speed_max(struct mddev *mddev)
{ … }
static void rdev_uninit_serial(struct md_rdev *rdev)
{ … }
static void rdevs_uninit_serial(struct mddev *mddev)
{ … }
static int rdev_init_serial(struct md_rdev *rdev)
{ … }
static int rdevs_init_serial(struct mddev *mddev)
{ … }
static int rdev_need_serial(struct md_rdev *rdev)
{ … }
void mddev_create_serial_pool(struct mddev *mddev, struct md_rdev *rdev)
{ … }
void mddev_destroy_serial_pool(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static struct ctl_table_header *raid_table_header;
static struct ctl_table raid_table[] = …;
static int start_readonly;
static bool create_on_open = …;
static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
static atomic_t md_event_count;
void md_new_event(void)
{ … }
EXPORT_SYMBOL_GPL(…);
static LIST_HEAD(all_mddevs);
static DEFINE_SPINLOCK(all_mddevs_lock);
static bool is_md_suspended(struct mddev *mddev)
{ … }
static bool is_suspended(struct mddev *mddev, struct bio *bio)
{ … }
bool md_handle_request(struct mddev *mddev, struct bio *bio)
{ … }
EXPORT_SYMBOL(…);
static void md_submit_bio(struct bio *bio)
{ … }
int mddev_suspend(struct mddev *mddev, bool interruptible)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __mddev_resume(struct mddev *mddev, bool recovery_needed)
{ … }
void mddev_resume(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mddev_set_closing_and_sync_blockdev(struct mddev *mddev, int opener_num)
{ … }
static void md_end_flush(struct bio *bio)
{ … }
static void md_submit_flush_data(struct work_struct *ws);
static void submit_flushes(struct work_struct *ws)
{ … }
static void md_submit_flush_data(struct work_struct *ws)
{ … }
bool md_flush_request(struct mddev *mddev, struct bio *bio)
{ … }
EXPORT_SYMBOL(…);
static inline struct mddev *mddev_get(struct mddev *mddev)
{ … }
static void mddev_delayed_delete(struct work_struct *ws);
static void __mddev_put(struct mddev *mddev)
{ … }
void mddev_put(struct mddev *mddev)
{ … }
static void md_safemode_timeout(struct timer_list *t);
static void md_start_sync(struct work_struct *ws);
static void active_io_release(struct percpu_ref *ref)
{ … }
static void no_op(struct percpu_ref *r) { … }
int mddev_init(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
void mddev_destroy(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct mddev *mddev_find_locked(dev_t unit)
{ … }
static dev_t mddev_alloc_unit(void)
{ … }
static struct mddev *mddev_alloc(dev_t unit)
{ … }
static void mddev_free(struct mddev *mddev)
{ … }
static const struct attribute_group md_redundancy_group;
void mddev_unlock(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct md_rdev *find_rdev(struct mddev *mddev, dev_t dev)
{ … }
struct md_rdev *md_find_rdev_rcu(struct mddev *mddev, dev_t dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct md_personality *find_pers(int level, char *clevel)
{ … }
static inline sector_t calc_dev_sboffset(struct md_rdev *rdev)
{ … }
static int alloc_disk_sb(struct md_rdev *rdev)
{ … }
void md_rdev_clear(struct md_rdev *rdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static void super_written(struct bio *bio)
{ … }
void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
sector_t sector, int size, struct page *page)
{ … }
int md_super_wait(struct mddev *mddev)
{ … }
int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
struct page *page, blk_opf_t opf, bool metadata_op)
{ … }
EXPORT_SYMBOL_GPL(…);
static int read_disk_sb(struct md_rdev *rdev, int size)
{ … }
static int md_uuid_equal(mdp_super_t *sb1, mdp_super_t *sb2)
{ … }
static int md_sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
{ … }
static u32 md_csum_fold(u32 csum)
{ … }
static unsigned int calc_sb_csum(mdp_super_t *sb)
{ … }
struct super_type { … };
int md_check_no_bitmap(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version)
{ … }
static int super_90_validate(struct mddev *mddev, struct md_rdev *freshest, struct md_rdev *rdev)
{ … }
static void super_90_sync(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static unsigned long long
super_90_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
{ … }
static int
super_90_allow_new_offset(struct md_rdev *rdev, unsigned long long new_offset)
{ … }
static __le32 calc_sb_1_csum(struct mdp_superblock_1 *sb)
{ … }
static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version)
{ … }
static int super_1_validate(struct mddev *mddev, struct md_rdev *freshest, struct md_rdev *rdev)
{ … }
static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static sector_t super_1_choose_bm_space(sector_t dev_size)
{ … }
static unsigned long long
super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
{ … }
static int
super_1_allow_new_offset(struct md_rdev *rdev,
unsigned long long new_offset)
{ … }
static struct super_type super_types[] = …;
static void sync_super(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2)
{ … }
static LIST_HEAD(pending_raid_disks);
int md_integrity_register(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
static bool rdev_read_only(struct md_rdev *rdev)
{ … }
static int bind_rdev_to_array(struct md_rdev *rdev, struct mddev *mddev)
{ … }
void md_autodetect_dev(dev_t dev);
static struct md_rdev claim_rdev;
static void export_rdev(struct md_rdev *rdev, struct mddev *mddev)
{ … }
static void md_kick_rdev_from_array(struct md_rdev *rdev)
{ … }
static void export_array(struct mddev *mddev)
{ … }
static bool set_in_sync(struct mddev *mddev)
{ … }
static void sync_sbs(struct mddev *mddev, int nospares)
{ … }
static bool does_sb_need_changing(struct mddev *mddev)
{ … }
void md_update_sb(struct mddev *mddev, int force_change)
{ … }
EXPORT_SYMBOL(…);
static int add_bound_rdev(struct md_rdev *rdev)
{ … }
static int cmd_match(const char *cmd, const char *str)
{ … }
struct rdev_sysfs_entry { … };
static ssize_t
state_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
state_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_state = …;
static ssize_t
errors_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
errors_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_errors = …;
static ssize_t
slot_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
slot_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_slot = …;
static ssize_t
offset_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
offset_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_offset = …;
static ssize_t new_offset_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t new_offset_store(struct md_rdev *rdev,
const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_new_offset = …;
static ssize_t
rdev_size_show(struct md_rdev *rdev, char *page)
{ … }
static int md_rdevs_overlap(struct md_rdev *a, struct md_rdev *b)
{ … }
static bool md_rdev_overlaps(struct md_rdev *rdev)
{ … }
static int strict_blocks_to_sectors(const char *buf, sector_t *sectors)
{ … }
static ssize_t
rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_size = …;
static ssize_t recovery_start_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t recovery_start_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_recovery_start = …;
static ssize_t bb_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t bb_store(struct md_rdev *rdev, const char *page, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_bad_blocks = …;
static ssize_t ubb_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t ubb_store(struct md_rdev *rdev, const char *page, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_unack_bad_blocks = …;
static ssize_t
ppl_sector_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
ppl_sector_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_ppl_sector = …;
static ssize_t
ppl_size_show(struct md_rdev *rdev, char *page)
{ … }
static ssize_t
ppl_size_store(struct md_rdev *rdev, const char *buf, size_t len)
{ … }
static struct rdev_sysfs_entry rdev_ppl_size = …;
static struct attribute *rdev_default_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static ssize_t
rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{ … }
static ssize_t
rdev_attr_store(struct kobject *kobj, struct attribute *attr,
const char *page, size_t length)
{ … }
static void rdev_free(struct kobject *ko)
{ … }
static const struct sysfs_ops rdev_sysfs_ops = …;
static const struct kobj_type rdev_ktype = …;
int md_rdev_init(struct md_rdev *rdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct md_rdev *md_import_device(dev_t newdev, int super_format, int super_minor)
{ … }
static int analyze_sbs(struct mddev *mddev)
{ … }
int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale)
{ … }
static ssize_t
safe_delay_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
safe_delay_store(struct mddev *mddev, const char *cbuf, size_t len)
{ … }
static struct md_sysfs_entry md_safe_delay = …;
static ssize_t
level_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
level_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_level = …;
static ssize_t
layout_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
layout_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_layout = …;
static ssize_t
raid_disks_show(struct mddev *mddev, char *page)
{ … }
static int update_raid_disks(struct mddev *mddev, int raid_disks);
static ssize_t
raid_disks_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_raid_disks = …;
static ssize_t
uuid_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_uuid = …;
static ssize_t
chunk_size_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
chunk_size_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_chunk_size = …;
static ssize_t
resync_start_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
resync_start_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_resync_start = …;
enum array_state { … };
static char *array_states[] = …;
static int match_word(const char *word, char **list)
{ … }
static ssize_t
array_state_show(struct mddev *mddev, char *page)
{ … }
static int do_md_stop(struct mddev *mddev, int ro);
static int md_set_readonly(struct mddev *mddev);
static int restart_array(struct mddev *mddev);
static ssize_t
array_state_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_array_state = …;
static ssize_t
max_corrected_read_errors_show(struct mddev *mddev, char *page) { … }
static ssize_t
max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry max_corr_read_errors = …;
static ssize_t
null_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
new_dev_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_new_device = …;
static ssize_t
bitmap_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_bitmap = …;
static ssize_t
size_show(struct mddev *mddev, char *page)
{ … }
static int update_size(struct mddev *mddev, sector_t num_sectors);
static ssize_t
size_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_size = …;
static ssize_t
metadata_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
metadata_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_metadata = …;
enum sync_action md_sync_action(struct mddev *mddev)
{ … }
enum sync_action md_sync_action_by_name(const char *page)
{ … }
const char *md_sync_action_name(enum sync_action action)
{ … }
static ssize_t
action_show(struct mddev *mddev, char *page)
{ … }
static void stop_sync_thread(struct mddev *mddev, bool locked)
{ … }
void md_idle_sync_thread(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
void md_frozen_sync_thread(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
void md_unfrozen_sync_thread(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mddev_start_reshape(struct mddev *mddev)
{ … }
static ssize_t
action_store(struct mddev *mddev, const char *page, size_t len)
{ … }
static struct md_sysfs_entry md_scan_mode = …;
static ssize_t
last_sync_action_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_last_scan_mode = …;
static ssize_t
mismatch_cnt_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_mismatches = …;
static ssize_t
sync_min_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
sync_min_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_sync_min = …;
static ssize_t
sync_max_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
sync_max_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_sync_max = …;
static ssize_t
degraded_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_degraded = …;
static ssize_t
sync_force_parallel_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
sync_force_parallel_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_sync_force_parallel = …;
static ssize_t
sync_speed_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_sync_speed = …;
static ssize_t
sync_completed_show(struct mddev *mddev, char *page)
{ … }
static struct md_sysfs_entry md_sync_completed = …;
static ssize_t
min_sync_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
min_sync_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_min_sync = …;
static ssize_t
max_sync_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
max_sync_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_max_sync = …;
static ssize_t
suspend_lo_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
suspend_lo_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_suspend_lo = …;
static ssize_t
suspend_hi_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
suspend_hi_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_suspend_hi = …;
static ssize_t
reshape_position_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
reshape_position_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_reshape_position = …;
static ssize_t
reshape_direction_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
reshape_direction_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_reshape_direction = …;
static ssize_t
array_size_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
array_size_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_array_size = …;
static ssize_t
consistency_policy_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
consistency_policy_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_consistency_policy = …;
static ssize_t fail_last_dev_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
fail_last_dev_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_fail_last_dev = …;
static ssize_t serialize_policy_show(struct mddev *mddev, char *page)
{ … }
static ssize_t
serialize_policy_store(struct mddev *mddev, const char *buf, size_t len)
{ … }
static struct md_sysfs_entry md_serialize_policy = …;
static struct attribute *md_default_attrs[] = …;
static const struct attribute_group md_default_group = …;
static struct attribute *md_redundancy_attrs[] = …;
static const struct attribute_group md_redundancy_group = …;
static const struct attribute_group *md_attr_groups[] = …;
static ssize_t
md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{ … }
static ssize_t
md_attr_store(struct kobject *kobj, struct attribute *attr,
const char *page, size_t length)
{ … }
static void md_kobj_release(struct kobject *ko)
{ … }
static const struct sysfs_ops md_sysfs_ops = …;
static const struct kobj_type md_ktype = …;
int mdp_major = …;
int mddev_stack_rdev_limits(struct mddev *mddev, struct queue_limits *lim,
unsigned int flags)
{ … }
EXPORT_SYMBOL_GPL(…);
int mddev_stack_new_rdev(struct mddev *mddev, struct md_rdev *rdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void mddev_update_io_opt(struct mddev *mddev, unsigned int nr_stripes)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mddev_delayed_delete(struct work_struct *ws)
{ … }
void md_init_stacking_limits(struct queue_limits *lim)
{ … }
EXPORT_SYMBOL_GPL(…);
struct mddev *md_alloc(dev_t dev, char *name)
{ … }
static int md_alloc_and_put(dev_t dev, char *name)
{ … }
static void md_probe(dev_t dev)
{ … }
static int add_named_array(const char *val, const struct kernel_param *kp)
{ … }
static void md_safemode_timeout(struct timer_list *t)
{ … }
static int start_dirty_degraded;
int md_run(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
int do_md_run(struct mddev *mddev)
{ … }
int md_start(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int restart_array(struct mddev *mddev)
{ … }
static void md_clean(struct mddev *mddev)
{ … }
static void __md_stop_writes(struct mddev *mddev)
{ … }
void md_stop_writes(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static void mddev_detach(struct mddev *mddev)
{ … }
static void __md_stop(struct mddev *mddev)
{ … }
void md_stop(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int md_set_readonly(struct mddev *mddev)
{ … }
static int do_md_stop(struct mddev *mddev, int mode)
{ … }
#ifndef MODULE
static void autorun_array(struct mddev *mddev)
{ … }
static void autorun_devices(int part)
{ … }
#endif
static int get_version(void __user *arg)
{ … }
static int get_array_info(struct mddev *mddev, void __user *arg)
{ … }
static int get_bitmap_file(struct mddev *mddev, void __user * arg)
{ … }
static int get_disk_info(struct mddev *mddev, void __user * arg)
{ … }
int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info)
{ … }
static int hot_remove_disk(struct mddev *mddev, dev_t dev)
{ … }
static int hot_add_disk(struct mddev *mddev, dev_t dev)
{ … }
static int set_bitmap_file(struct mddev *mddev, int fd)
{ … }
int md_set_array_info(struct mddev *mddev, struct mdu_array_info_s *info)
{ … }
void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors)
{ … }
EXPORT_SYMBOL(…);
static int update_size(struct mddev *mddev, sector_t num_sectors)
{ … }
static int update_raid_disks(struct mddev *mddev, int raid_disks)
{ … }
static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
{ … }
static int set_disk_faulty(struct mddev *mddev, dev_t dev)
{ … }
static int md_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{ … }
static inline int md_ioctl_valid(unsigned int cmd)
{ … }
static bool md_ioctl_need_suspend(unsigned int cmd)
{ … }
static int __md_set_array_info(struct mddev *mddev, void __user *argp)
{ … }
static int md_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned int cmd, unsigned long arg)
{ … }
#ifdef CONFIG_COMPAT
static int md_compat_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned int cmd, unsigned long arg)
{ … }
#endif
static int md_set_read_only(struct block_device *bdev, bool ro)
{ … }
static int md_open(struct gendisk *disk, blk_mode_t mode)
{ … }
static void md_release(struct gendisk *disk)
{ … }
static unsigned int md_check_events(struct gendisk *disk, unsigned int clearing)
{ … }
static void md_free_disk(struct gendisk *disk)
{ … }
const struct block_device_operations md_fops = …;
static int md_thread(void *arg)
{ … }
static void md_wakeup_thread_directly(struct md_thread __rcu *thread)
{ … }
void md_wakeup_thread(struct md_thread __rcu *thread)
{ … }
EXPORT_SYMBOL(…);
struct md_thread *md_register_thread(void (*run) (struct md_thread *),
struct mddev *mddev, const char *name)
{ … }
EXPORT_SYMBOL(…);
void md_unregister_thread(struct mddev *mddev, struct md_thread __rcu **threadp)
{ … }
EXPORT_SYMBOL(…);
void md_error(struct mddev *mddev, struct md_rdev *rdev)
{ … }
EXPORT_SYMBOL(…);
static void status_unused(struct seq_file *seq)
{ … }
static void status_personalities(struct seq_file *seq)
{ … }
static int status_resync(struct seq_file *seq, struct mddev *mddev)
{ … }
static void *md_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(&all_mddevs_lock)
{ … }
static void *md_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ … }
static void md_seq_stop(struct seq_file *seq, void *v)
__releases(&all_mddevs_lock)
{ … }
static int md_seq_show(struct seq_file *seq, void *v)
{ … }
static const struct seq_operations md_seq_ops = …;
static int md_seq_open(struct inode *inode, struct file *file)
{ … }
static int md_unloading;
static __poll_t mdstat_poll(struct file *filp, poll_table *wait)
{ … }
static const struct proc_ops mdstat_proc_ops = …;
int register_md_personality(struct md_personality *p)
{ … }
EXPORT_SYMBOL(…);
int unregister_md_personality(struct md_personality *p)
{ … }
EXPORT_SYMBOL(…);
int register_md_cluster_operations(const struct md_cluster_operations *ops,
struct module *module)
{ … }
EXPORT_SYMBOL(…);
int unregister_md_cluster_operations(void)
{ … }
EXPORT_SYMBOL(…);
int md_setup_cluster(struct mddev *mddev, int nodes)
{ … }
void md_cluster_stop(struct mddev *mddev)
{ … }
static int is_mddev_idle(struct mddev *mddev, int init)
{ … }
void md_done_sync(struct mddev *mddev, int blocks, int ok)
{ … }
EXPORT_SYMBOL(…);
void md_write_start(struct mddev *mddev, struct bio *bi)
{ … }
EXPORT_SYMBOL(…);
void md_write_inc(struct mddev *mddev, struct bio *bi)
{ … }
EXPORT_SYMBOL(…);
void md_write_end(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
void md_submit_discard_bio(struct mddev *mddev, struct md_rdev *rdev,
struct bio *bio, sector_t start, sector_t size)
{ … }
EXPORT_SYMBOL_GPL(…);
static void md_end_clone_io(struct bio *bio)
{ … }
static void md_clone_bio(struct mddev *mddev, struct bio **bio)
{ … }
void md_account_bio(struct mddev *mddev, struct bio **bio)
{ … }
EXPORT_SYMBOL_GPL(…);
void md_free_cloned_bio(struct bio *bio)
{ … }
EXPORT_SYMBOL_GPL(…);
void md_allow_write(struct mddev *mddev)
{ … }
EXPORT_SYMBOL_GPL(…);
static sector_t md_sync_max_sectors(struct mddev *mddev,
enum sync_action action)
{ … }
static sector_t md_sync_position(struct mddev *mddev, enum sync_action action)
{ … }
#define SYNC_MARKS …
#define SYNC_MARK_STEP …
#define UPDATE_FREQUENCY …
void md_do_sync(struct md_thread *thread)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool rdev_removeable(struct md_rdev *rdev)
{ … }
static bool rdev_is_spare(struct md_rdev *rdev)
{ … }
static bool rdev_addable(struct md_rdev *rdev)
{ … }
static bool md_spares_need_change(struct mddev *mddev)
{ … }
static int remove_and_add_spares(struct mddev *mddev,
struct md_rdev *this)
{ … }
static bool md_choose_sync_action(struct mddev *mddev, int *spares)
{ … }
static void md_start_sync(struct work_struct *ws)
{ … }
static void unregister_sync_thread(struct mddev *mddev)
{ … }
void md_check_recovery(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
void md_reap_sync_thread(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
void md_finish_reshape(struct mddev *mddev)
{ … }
EXPORT_SYMBOL(…);
int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new)
{ … }
EXPORT_SYMBOL_GPL(…);
int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new)
{ … }
EXPORT_SYMBOL_GPL(…);
static int md_notify_reboot(struct notifier_block *this,
unsigned long code, void *x)
{ … }
static struct notifier_block md_notifier = …;
static void md_geninit(void)
{ … }
static int __init md_init(void)
{ … }
static void check_sb_changes(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static int read_rdev(struct mddev *mddev, struct md_rdev *rdev)
{ … }
void md_reload_sb(struct mddev *mddev, int nr)
{ … }
EXPORT_SYMBOL(…);
#ifndef MODULE
static DEFINE_MUTEX(detected_devices_mutex);
static LIST_HEAD(all_detected_devices);
struct detected_devices_node { … };
void md_autodetect_dev(dev_t dev)
{ … }
void md_autostart_arrays(int part)
{ … }
#endif
static __exit void md_exit(void)
{ … }
subsys_initcall(md_init);
module_exit(…)
static int get_ro(char *buffer, const struct kernel_param *kp)
{ … }
static int set_ro(const char *val, const struct kernel_param *kp)
{ … }
module_param_call(…);
module_param(start_dirty_degraded, int, S_IRUGO|S_IWUSR);
module_param_call(…);
module_param(create_on_open, bool, S_IRUSR|S_IWUSR);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS_BLOCKDEV_MAJOR(…);