We will need two sets of functions to work with two versions of metadump formats. This commit adds the definition for 'struct mdrestore_ops' to hold pointers to version specific mdrestore functions. Signed-off-by: Chandan Babu R <chandan.babu@xxxxxxxxxx> --- mdrestore/xfs_mdrestore.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 8c847c5a3..895e5cdab 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -7,10 +7,18 @@ #include "libxfs.h" #include "xfs_metadump.h" +struct mdrestore_ops { + void (*read_header)(void *header, FILE *mdfp); + void (*show_info)(void *header, const char *mdfile); + void (*restore)(void *header, FILE *mdfp, int data_fd, + bool is_target_file); +}; + static struct mdrestore { - int show_progress; - int show_info; - int progress_since_warning; + struct mdrestore_ops *mdrops; + int show_progress; + int show_info; + int progress_since_warning; } mdrestore; static void -- 2.39.1