xref: /openbmc/linux/drivers/md/md-cluster.h (revision f16fe2d3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 
4 #ifndef _MD_CLUSTER_H
5 #define _MD_CLUSTER_H
6 
7 #include "md.h"
8 
9 struct mddev;
10 struct md_rdev;
11 
12 struct md_cluster_operations {
13 	int (*join)(struct mddev *mddev, int nodes);
14 	int (*leave)(struct mddev *mddev);
15 	int (*slot_number)(struct mddev *mddev);
16 	int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi);
17 	void (*resync_info_get)(struct mddev *mddev, sector_t *lo, sector_t *hi);
18 	int (*metadata_update_start)(struct mddev *mddev);
19 	int (*metadata_update_finish)(struct mddev *mddev);
20 	void (*metadata_update_cancel)(struct mddev *mddev);
21 	int (*resync_start)(struct mddev *mddev);
22 	int (*resync_finish)(struct mddev *mddev);
23 	int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi);
24 	int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev);
25 	void (*add_new_disk_cancel)(struct mddev *mddev);
26 	int (*new_disk_ack)(struct mddev *mddev, bool ack);
27 	int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev);
28 	void (*load_bitmaps)(struct mddev *mddev, int total_slots);
29 	int (*gather_bitmaps)(struct md_rdev *rdev);
30 	int (*resize_bitmaps)(struct mddev *mddev, sector_t newsize, sector_t oldsize);
31 	int (*lock_all_bitmaps)(struct mddev *mddev);
32 	void (*unlock_all_bitmaps)(struct mddev *mddev);
33 	void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors);
34 };
35 
36 #endif /* _MD_CLUSTER_H */
37