blob: c0240708f44332c3fbb8e37f32bbd3bd84eef926 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -05002
3
4#ifndef _MD_CLUSTER_H
5#define _MD_CLUSTER_H
6
7#include "md.h"
8
9struct mddev;
Goldwyn Rodrigues1aee41f2014-10-29 18:51:31 -050010struct md_rdev;
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -050011
12struct md_cluster_operations {
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -050013 int (*join)(struct mddev *mddev, int nodes);
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -050014 int (*leave)(struct mddev *mddev);
Goldwyn Rodriguescf921cc2014-03-30 00:42:49 -050015 int (*slot_number)(struct mddev *mddev);
Goldwyn Rodriguesc40f3412015-08-19 08:14:42 +100016 int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi);
Goldwyn Rodrigues293467a2014-06-07 01:44:51 -050017 int (*metadata_update_start)(struct mddev *mddev);
18 int (*metadata_update_finish)(struct mddev *mddev);
Goldwyn Rodriguesdbb64f82015-10-01 13:20:27 -050019 void (*metadata_update_cancel)(struct mddev *mddev);
Goldwyn Rodriguesc186b122015-09-30 13:20:35 -050020 int (*resync_start)(struct mddev *mddev);
21 int (*resync_finish)(struct mddev *mddev);
Goldwyn Rodrigues90382ed2015-06-24 09:30:32 -050022 int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi);
Goldwyn Rodriguesdbb64f82015-10-01 13:20:27 -050023 int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev);
24 void (*add_new_disk_cancel)(struct mddev *mddev);
Goldwyn Rodriguesfa8259d2015-03-02 10:55:49 -060025 int (*new_disk_ack)(struct mddev *mddev, bool ack);
Goldwyn Rodrigues88bcfef2015-04-14 10:44:44 -050026 int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev);
Guoqing Jiang51e453a2016-05-04 02:17:09 -040027 void (*load_bitmaps)(struct mddev *mddev, int total_slots);
Goldwyn Rodrigues97f6cd32015-04-14 10:45:42 -050028 int (*gather_bitmaps)(struct md_rdev *rdev);
Guoqing Jiangf6a2dc62015-12-21 10:51:00 +110029 int (*lock_all_bitmaps)(struct mddev *mddev);
30 void (*unlock_all_bitmaps)(struct mddev *mddev);
Guoqing Jiang818da592017-03-01 16:42:40 +080031 void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors);
Goldwyn Rodriguesedb39c92014-03-29 10:01:53 -050032};
33
34#endif /* _MD_CLUSTER_H */