#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/blkdev.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/ratelimit.h>
#include <linux/interval_tree_generic.h>
#include <trace/events/block.h>
#include "md.h"
#include "raid1.h"
#include "md-bitmap.h"
#define UNSUPPORTED_MDDEV_FLAGS …
static void allow_barrier(struct r1conf *conf, sector_t sector_nr);
static void lower_barrier(struct r1conf *conf, sector_t sector_nr);
#define RAID_1_10_NAME …
#include "raid1-10.c"
#define START(node) …
#define LAST(node) …
INTERVAL_TREE_DEFINE(struct serial_info, node, sector_t, _subtree_last,
START, LAST, static inline, raid1_rb);
static int check_and_add_serial(struct md_rdev *rdev, struct r1bio *r1_bio,
struct serial_info *si, int idx)
{ … }
static void wait_for_serialization(struct md_rdev *rdev, struct r1bio *r1_bio)
{ … }
static void remove_serial(struct md_rdev *rdev, sector_t lo, sector_t hi)
{ … }
static inline struct r1bio *get_resync_r1bio(struct bio *bio)
{ … }
static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data)
{ … }
#define RESYNC_DEPTH …
#define RESYNC_SECTORS …
#define RESYNC_WINDOW …
#define RESYNC_WINDOW_SECTORS …
#define CLUSTER_RESYNC_WINDOW …
#define CLUSTER_RESYNC_WINDOW_SECTORS …
static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
{ … }
static void r1buf_pool_free(void *__r1_bio, void *data)
{ … }
static void put_all_bios(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static void free_r1bio(struct r1bio *r1_bio)
{ … }
static void put_buf(struct r1bio *r1_bio)
{ … }
static void reschedule_retry(struct r1bio *r1_bio)
{ … }
static void call_bio_endio(struct r1bio *r1_bio)
{ … }
static void raid_end_bio_io(struct r1bio *r1_bio)
{ … }
static inline void update_head_pos(int disk, struct r1bio *r1_bio)
{ … }
static int find_bio_disk(struct r1bio *r1_bio, struct bio *bio)
{ … }
static void raid1_end_read_request(struct bio *bio)
{ … }
static void close_write(struct r1bio *r1_bio)
{ … }
static void r1_bio_write_done(struct r1bio *r1_bio)
{ … }
static void raid1_end_write_request(struct bio *bio)
{ … }
static sector_t align_to_barrier_unit_end(sector_t start_sector,
sector_t sectors)
{ … }
static void update_read_sectors(struct r1conf *conf, int disk,
sector_t this_sector, int len)
{ … }
static int choose_first_rdev(struct r1conf *conf, struct r1bio *r1_bio,
int *max_sectors)
{ … }
static int choose_bb_rdev(struct r1conf *conf, struct r1bio *r1_bio,
int *max_sectors)
{ … }
static int choose_slow_rdev(struct r1conf *conf, struct r1bio *r1_bio,
int *max_sectors)
{ … }
static bool is_sequential(struct r1conf *conf, int disk, struct r1bio *r1_bio)
{ … }
static bool should_choose_next(struct r1conf *conf, int disk)
{ … }
static bool rdev_readable(struct md_rdev *rdev, struct r1bio *r1_bio)
{ … }
struct read_balance_ctl { … };
static int choose_best_rdev(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static int read_balance(struct r1conf *conf, struct r1bio *r1_bio,
int *max_sectors)
{ … }
static void wake_up_barrier(struct r1conf *conf)
{ … }
static void flush_bio_list(struct r1conf *conf, struct bio *bio)
{ … }
static void flush_pending_writes(struct r1conf *conf)
{ … }
static int raise_barrier(struct r1conf *conf, sector_t sector_nr)
{ … }
static void lower_barrier(struct r1conf *conf, sector_t sector_nr)
{ … }
static bool _wait_barrier(struct r1conf *conf, int idx, bool nowait)
{ … }
static bool wait_read_barrier(struct r1conf *conf, sector_t sector_nr, bool nowait)
{ … }
static bool wait_barrier(struct r1conf *conf, sector_t sector_nr, bool nowait)
{ … }
static void _allow_barrier(struct r1conf *conf, int idx)
{ … }
static void allow_barrier(struct r1conf *conf, sector_t sector_nr)
{ … }
static int get_unqueued_pending(struct r1conf *conf)
{ … }
static void freeze_array(struct r1conf *conf, int extra)
{ … }
static void unfreeze_array(struct r1conf *conf)
{ … }
static void alloc_behind_master_bio(struct r1bio *r1_bio,
struct bio *bio)
{ … }
static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule)
{ … }
static void init_r1bio(struct r1bio *r1_bio, struct mddev *mddev, struct bio *bio)
{ … }
static inline struct r1bio *
alloc_r1bio(struct mddev *mddev, struct bio *bio)
{ … }
static void raid1_read_request(struct mddev *mddev, struct bio *bio,
int max_read_sectors, struct r1bio *r1_bio)
{ … }
static void raid1_write_request(struct mddev *mddev, struct bio *bio,
int max_write_sectors)
{ … }
static bool raid1_make_request(struct mddev *mddev, struct bio *bio)
{ … }
static void raid1_status(struct seq_file *seq, struct mddev *mddev)
{ … }
static void raid1_error(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static void print_conf(struct r1conf *conf)
{ … }
static void close_sync(struct r1conf *conf)
{ … }
static int raid1_spare_active(struct mddev *mddev)
{ … }
static bool raid1_add_conf(struct r1conf *conf, struct md_rdev *rdev, int disk,
bool replacement)
{ … }
static bool raid1_remove_conf(struct r1conf *conf, int disk)
{ … }
static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static void end_sync_read(struct bio *bio)
{ … }
static void abort_sync_write(struct mddev *mddev, struct r1bio *r1_bio)
{ … }
static void put_sync_write_buf(struct r1bio *r1_bio, int uptodate)
{ … }
static void end_sync_write(struct bio *bio)
{ … }
static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector,
int sectors, struct page *page, blk_opf_t rw)
{ … }
static int fix_sync_read_error(struct r1bio *r1_bio)
{ … }
static void process_checks(struct r1bio *r1_bio)
{ … }
static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio)
{ … }
static void fix_read_error(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static int narrow_write_error(struct r1bio *r1_bio, int i)
{ … }
static void handle_sync_write_finished(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static void handle_write_finished(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
{ … }
static void raid1d(struct md_thread *thread)
{ … }
static int init_resync(struct r1conf *conf)
{ … }
static struct r1bio *raid1_alloc_init_r1buf(struct r1conf *conf)
{ … }
static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
sector_t max_sector, int *skipped)
{ … }
static sector_t raid1_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{ … }
static struct r1conf *setup_conf(struct mddev *mddev)
{ … }
static int raid1_set_limits(struct mddev *mddev)
{ … }
static int raid1_run(struct mddev *mddev)
{ … }
static void raid1_free(struct mddev *mddev, void *priv)
{ … }
static int raid1_resize(struct mddev *mddev, sector_t sectors)
{ … }
static int raid1_reshape(struct mddev *mddev)
{ … }
static void raid1_quiesce(struct mddev *mddev, int quiesce)
{ … }
static void *raid1_takeover(struct mddev *mddev)
{ … }
static struct md_personality raid1_personality = …;
static int __init raid_init(void)
{ … }
static void raid_exit(void)
{ … }
module_init(…) …;
module_exit(raid_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;