#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/dlm.h>
#include <linux/sched.h>
#include <linux/raid/md_p.h>
#include "md.h"
#include "md-bitmap.h"
#include "md-cluster.h"
#define LVB_SIZE …
#define NEW_DEV_TIMEOUT …
#define WAIT_DLM_LOCK_TIMEOUT …
struct dlm_lock_resource { … };
struct resync_info { … };
#define MD_CLUSTER_WAITING_FOR_NEWDISK …
#define MD_CLUSTER_SUSPEND_READ_BALANCING …
#define MD_CLUSTER_BEGIN_JOIN_CLUSTER …
#define MD_CLUSTER_SEND_LOCK …
#define MD_CLUSTER_SEND_LOCKED_ALREADY …
#define MD_CLUSTER_ALREADY_IN_CLUSTER …
#define MD_CLUSTER_PENDING_RECV_EVENT …
#define MD_CLUSTER_HOLDING_MUTEX_FOR_RECVD …
#define MD_CLUSTER_WAITING_FOR_SYNC …
struct md_cluster_info { … };
enum msg_type { … };
struct cluster_msg { … };
static void sync_ast(void *arg)
{ … }
static int dlm_lock_sync(struct dlm_lock_resource *res, int mode)
{ … }
static int dlm_unlock_sync(struct dlm_lock_resource *res)
{ … }
static int dlm_lock_sync_interruptible(struct dlm_lock_resource *res, int mode,
struct mddev *mddev)
{ … }
static struct dlm_lock_resource *lockres_init(struct mddev *mddev,
char *name, void (*bastfn)(void *arg, int mode), int with_lvb)
{ … }
static void lockres_free(struct dlm_lock_resource *res)
{ … }
static void add_resync_info(struct dlm_lock_resource *lockres,
sector_t lo, sector_t hi)
{ … }
static int read_resync_info(struct mddev *mddev,
struct dlm_lock_resource *lockres)
{ … }
static void recover_bitmaps(struct md_thread *thread)
{ … }
static void recover_prep(void *arg)
{ … }
static void __recover_slot(struct mddev *mddev, int slot)
{ … }
static void recover_slot(void *arg, struct dlm_slot *slot)
{ … }
static void recover_done(void *arg, struct dlm_slot *slots,
int num_slots, int our_slot,
uint32_t generation)
{ … }
static const struct dlm_lockspace_ops md_ls_ops = …;
static void ack_bast(void *arg, int mode)
{ … }
static void remove_suspend_info(struct mddev *mddev, int slot)
{ … }
static void process_suspend_info(struct mddev *mddev,
int slot, sector_t lo, sector_t hi)
{ … }
static int process_add_new_disk(struct mddev *mddev, struct cluster_msg *cmsg)
{ … }
static void process_metadata_update(struct mddev *mddev, struct cluster_msg *msg)
{ … }
static void process_remove_disk(struct mddev *mddev, struct cluster_msg *msg)
{ … }
static void process_readd_disk(struct mddev *mddev, struct cluster_msg *msg)
{ … }
static int process_recvd_msg(struct mddev *mddev, struct cluster_msg *msg)
{ … }
static void recv_daemon(struct md_thread *thread)
{ … }
static int lock_token(struct md_cluster_info *cinfo)
{ … }
static int lock_comm(struct md_cluster_info *cinfo, bool mddev_locked)
{ … }
static void unlock_comm(struct md_cluster_info *cinfo)
{ … }
static int __sendmsg(struct md_cluster_info *cinfo, struct cluster_msg *cmsg)
{ … }
static int sendmsg(struct md_cluster_info *cinfo, struct cluster_msg *cmsg,
bool mddev_locked)
{ … }
static int gather_all_resync_info(struct mddev *mddev, int total_slots)
{ … }
static int join(struct mddev *mddev, int nodes)
{ … }
static void load_bitmaps(struct mddev *mddev, int total_slots)
{ … }
static void resync_bitmap(struct mddev *mddev)
{ … }
static void unlock_all_bitmaps(struct mddev *mddev);
static int leave(struct mddev *mddev)
{ … }
static int slot_number(struct mddev *mddev)
{ … }
static int metadata_update_start(struct mddev *mddev)
{ … }
static int metadata_update_finish(struct mddev *mddev)
{ … }
static void metadata_update_cancel(struct mddev *mddev)
{ … }
static int update_bitmap_size(struct mddev *mddev, sector_t size)
{ … }
static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsize)
{ … }
static int cluster_check_sync_size(struct mddev *mddev)
{ … }
static void update_size(struct mddev *mddev, sector_t old_dev_sectors)
{ … }
static int resync_start(struct mddev *mddev)
{ … }
static void resync_info_get(struct mddev *mddev, sector_t *lo, sector_t *hi)
{ … }
static int resync_status_get(struct mddev *mddev)
{ … }
static int resync_start_notify(struct mddev *mddev)
{ … }
static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
{ … }
static int resync_finish(struct mddev *mddev)
{ … }
static int area_resyncing(struct mddev *mddev, int direction,
sector_t lo, sector_t hi)
{ … }
static int add_new_disk(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static void add_new_disk_cancel(struct mddev *mddev)
{ … }
static int new_disk_ack(struct mddev *mddev, bool ack)
{ … }
static int remove_disk(struct mddev *mddev, struct md_rdev *rdev)
{ … }
static int lock_all_bitmaps(struct mddev *mddev)
{ … }
static void unlock_all_bitmaps(struct mddev *mddev)
{ … }
static int gather_bitmaps(struct md_rdev *rdev)
{ … }
static const struct md_cluster_operations cluster_ops = …;
static int __init cluster_init(void)
{ … }
static void cluster_exit(void)
{ … }
module_init(…) …;
module_exit(cluster_exit);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;