Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Goldwyn Rodrigues | edb39c9 | 2014-03-29 10:01:53 -0500 | [diff] [blame] | 2 | |
| 3 | |
| 4 | #ifndef _MD_CLUSTER_H |
| 5 | #define _MD_CLUSTER_H |
| 6 | |
| 7 | #include "md.h" |
| 8 | |
| 9 | struct mddev; |
Goldwyn Rodrigues | 1aee41f | 2014-10-29 18:51:31 -0500 | [diff] [blame] | 10 | struct md_rdev; |
Goldwyn Rodrigues | edb39c9 | 2014-03-29 10:01:53 -0500 | [diff] [blame] | 11 | |
| 12 | struct md_cluster_operations { |
Goldwyn Rodrigues | cf921cc | 2014-03-30 00:42:49 -0500 | [diff] [blame] | 13 | int (*join)(struct mddev *mddev, int nodes); |
Goldwyn Rodrigues | edb39c9 | 2014-03-29 10:01:53 -0500 | [diff] [blame] | 14 | int (*leave)(struct mddev *mddev); |
Goldwyn Rodrigues | cf921cc | 2014-03-30 00:42:49 -0500 | [diff] [blame] | 15 | int (*slot_number)(struct mddev *mddev); |
Goldwyn Rodrigues | c40f341 | 2015-08-19 08:14:42 +1000 | [diff] [blame] | 16 | int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi); |
Guoqing Jiang | 5ebaf80 | 2018-10-18 16:37:43 +0800 | [diff] [blame] | 17 | void (*resync_info_get)(struct mddev *mddev, sector_t *lo, sector_t *hi); |
Goldwyn Rodrigues | 293467a | 2014-06-07 01:44:51 -0500 | [diff] [blame] | 18 | int (*metadata_update_start)(struct mddev *mddev); |
| 19 | int (*metadata_update_finish)(struct mddev *mddev); |
Goldwyn Rodrigues | dbb64f8 | 2015-10-01 13:20:27 -0500 | [diff] [blame] | 20 | void (*metadata_update_cancel)(struct mddev *mddev); |
Goldwyn Rodrigues | c186b12 | 2015-09-30 13:20:35 -0500 | [diff] [blame] | 21 | int (*resync_start)(struct mddev *mddev); |
| 22 | int (*resync_finish)(struct mddev *mddev); |
Goldwyn Rodrigues | 90382ed | 2015-06-24 09:30:32 -0500 | [diff] [blame] | 23 | int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi); |
Goldwyn Rodrigues | dbb64f8 | 2015-10-01 13:20:27 -0500 | [diff] [blame] | 24 | int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev); |
| 25 | void (*add_new_disk_cancel)(struct mddev *mddev); |
Goldwyn Rodrigues | fa8259d | 2015-03-02 10:55:49 -0600 | [diff] [blame] | 26 | int (*new_disk_ack)(struct mddev *mddev, bool ack); |
Goldwyn Rodrigues | 88bcfef | 2015-04-14 10:44:44 -0500 | [diff] [blame] | 27 | int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev); |
Guoqing Jiang | 51e453a | 2016-05-04 02:17:09 -0400 | [diff] [blame] | 28 | void (*load_bitmaps)(struct mddev *mddev, int total_slots); |
Goldwyn Rodrigues | 97f6cd3 | 2015-04-14 10:45:42 -0500 | [diff] [blame] | 29 | int (*gather_bitmaps)(struct md_rdev *rdev); |
Guoqing Jiang | afd7562 | 2018-10-18 16:37:41 +0800 | [diff] [blame] | 30 | int (*resize_bitmaps)(struct mddev *mddev, sector_t newsize, sector_t oldsize); |
Guoqing Jiang | f6a2dc6 | 2015-12-21 10:51:00 +1100 | [diff] [blame] | 31 | int (*lock_all_bitmaps)(struct mddev *mddev); |
| 32 | void (*unlock_all_bitmaps)(struct mddev *mddev); |
Guoqing Jiang | 818da59 | 2017-03-01 16:42:40 +0800 | [diff] [blame] | 33 | void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors); |
Goldwyn Rodrigues | edb39c9 | 2014-03-29 10:01:53 -0500 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #endif /* _MD_CLUSTER_H */ |