[PATCH V2 18/23] mdrestore: Introduce struct mdrestore_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>
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 61e06598..08f52527 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -8,10 +8,18 @@
 #include "xfs_metadump.h"
 #include <libfrog/platform.h>
 
+struct mdrestore_ops {
+	void (*read_header)(void *header, FILE *md_fp);
+	void (*show_info)(void *header, const char *md_file);
+	void (*restore)(void *header, FILE *md_fp, int ddev_fd,
+			bool is_target_file);
+};
+
 static struct mdrestore {
-	bool	show_progress;
-	bool	show_info;
-	bool	progress_since_warning;
+	struct mdrestore_ops	*mdrops;
+	bool			show_progress;
+	bool			show_info;
+	bool			progress_since_warning;
 } mdrestore;
 
 static void
-- 
2.39.1




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux