1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2edb39c9dSGoldwyn Rodrigues 3edb39c9dSGoldwyn Rodrigues 4edb39c9dSGoldwyn Rodrigues #ifndef _MD_CLUSTER_H 5edb39c9dSGoldwyn Rodrigues #define _MD_CLUSTER_H 6edb39c9dSGoldwyn Rodrigues 7edb39c9dSGoldwyn Rodrigues #include "md.h" 8edb39c9dSGoldwyn Rodrigues 9edb39c9dSGoldwyn Rodrigues struct mddev; 101aee41f6SGoldwyn Rodrigues struct md_rdev; 11edb39c9dSGoldwyn Rodrigues 12edb39c9dSGoldwyn Rodrigues struct md_cluster_operations { 13cf921cc1SGoldwyn Rodrigues int (*join)(struct mddev *mddev, int nodes); 14edb39c9dSGoldwyn Rodrigues int (*leave)(struct mddev *mddev); 15cf921cc1SGoldwyn Rodrigues int (*slot_number)(struct mddev *mddev); 16c40f341fSGoldwyn Rodrigues int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi); 17293467aaSGoldwyn Rodrigues int (*metadata_update_start)(struct mddev *mddev); 18293467aaSGoldwyn Rodrigues int (*metadata_update_finish)(struct mddev *mddev); 19dbb64f86SGoldwyn Rodrigues void (*metadata_update_cancel)(struct mddev *mddev); 20c186b128SGoldwyn Rodrigues int (*resync_start)(struct mddev *mddev); 21c186b128SGoldwyn Rodrigues int (*resync_finish)(struct mddev *mddev); 2290382ed9SGoldwyn Rodrigues int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi); 23dbb64f86SGoldwyn Rodrigues int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev); 24dbb64f86SGoldwyn Rodrigues void (*add_new_disk_cancel)(struct mddev *mddev); 25fa8259daSGoldwyn Rodrigues int (*new_disk_ack)(struct mddev *mddev, bool ack); 2688bcfef7SGoldwyn Rodrigues int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev); 2751e453aeSGuoqing Jiang void (*load_bitmaps)(struct mddev *mddev, int total_slots); 2897f6cd39SGoldwyn Rodrigues int (*gather_bitmaps)(struct md_rdev *rdev); 29f6a2dc64SGuoqing Jiang int (*lock_all_bitmaps)(struct mddev *mddev); 30f6a2dc64SGuoqing Jiang void (*unlock_all_bitmaps)(struct mddev *mddev); 31818da59fSGuoqing Jiang void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors); 32edb39c9dSGoldwyn Rodrigues }; 33edb39c9dSGoldwyn Rodrigues 34edb39c9dSGoldwyn Rodrigues #endif /* _MD_CLUSTER_H */ 35