18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef _MD_CLUSTER_H 58c2ecf20Sopenharmony_ci#define _MD_CLUSTER_H 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include "md.h" 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cistruct mddev; 108c2ecf20Sopenharmony_cistruct md_rdev; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_cistruct md_cluster_operations { 138c2ecf20Sopenharmony_ci int (*join)(struct mddev *mddev, int nodes); 148c2ecf20Sopenharmony_ci int (*leave)(struct mddev *mddev); 158c2ecf20Sopenharmony_ci int (*slot_number)(struct mddev *mddev); 168c2ecf20Sopenharmony_ci int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi); 178c2ecf20Sopenharmony_ci void (*resync_info_get)(struct mddev *mddev, sector_t *lo, sector_t *hi); 188c2ecf20Sopenharmony_ci int (*metadata_update_start)(struct mddev *mddev); 198c2ecf20Sopenharmony_ci int (*metadata_update_finish)(struct mddev *mddev); 208c2ecf20Sopenharmony_ci void (*metadata_update_cancel)(struct mddev *mddev); 218c2ecf20Sopenharmony_ci int (*resync_start)(struct mddev *mddev); 228c2ecf20Sopenharmony_ci int (*resync_finish)(struct mddev *mddev); 238c2ecf20Sopenharmony_ci int (*area_resyncing)(struct mddev *mddev, int direction, sector_t lo, sector_t hi); 248c2ecf20Sopenharmony_ci int (*add_new_disk)(struct mddev *mddev, struct md_rdev *rdev); 258c2ecf20Sopenharmony_ci void (*add_new_disk_cancel)(struct mddev *mddev); 268c2ecf20Sopenharmony_ci int (*new_disk_ack)(struct mddev *mddev, bool ack); 278c2ecf20Sopenharmony_ci int (*remove_disk)(struct mddev *mddev, struct md_rdev *rdev); 288c2ecf20Sopenharmony_ci void (*load_bitmaps)(struct mddev *mddev, int total_slots); 298c2ecf20Sopenharmony_ci int (*gather_bitmaps)(struct md_rdev *rdev); 308c2ecf20Sopenharmony_ci int (*resize_bitmaps)(struct mddev *mddev, sector_t newsize, sector_t oldsize); 318c2ecf20Sopenharmony_ci int (*lock_all_bitmaps)(struct mddev *mddev); 328c2ecf20Sopenharmony_ci void (*unlock_all_bitmaps)(struct mddev *mddev); 338c2ecf20Sopenharmony_ci void (*update_size)(struct mddev *mddev, sector_t old_dev_sectors); 348c2ecf20Sopenharmony_ci}; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#endif /* _MD_CLUSTER_H */ 37