Re: [PATCH 08/24] metadump: Introduce struct metadump_ops

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

 



On Tue, May 23, 2023 at 02:30:34PM +0530, Chandan Babu R wrote:
> We will need two sets of functions to implement two versions of metadump. This
> commit adds the definition for 'struct metadump_ops' to hold pointers to
> version specific metadump functions.
> 
> Signed-off-by: Chandan Babu R <chandan.babu@xxxxxxxxxx>
> ---
>  db/metadump.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index 212b484a2..56d8c3bdf 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -40,6 +40,14 @@ static const cmdinfo_t	metadump_cmd =
>  		N_("[-a] [-e] [-g] [-m max_extent] [-w] [-o] filename"),
>  		N_("dump metadata to a file"), metadump_help };
>  
> +struct metadump_ops {
> +	int (*init_metadump)(void);
> +	int (*write_metadump)(enum typnm type, char *data, int64_t off,
> +		int len);
> +	int (*end_write_metadump)(void);
> +	void (*release_metadump)(void);

Needs comments describing what each of these do.  Does each
->write_metadump have to have a ->end_write_metadump?

You could probably remove the _metadump suffix too.

--D

> +};
> +
>  static struct metadump {
>  	int			version;
>  	int			show_progress;
> @@ -54,6 +62,7 @@ static struct metadump {
>  	xfs_ino_t		cur_ino;
>  	/* Metadump file */
>  	FILE			*outf;
> +	struct metadump_ops	*mdops;
>  	/* header + index + buffers */
>  	struct xfs_metablock	*metablock;
>  	__be64			*block_index;
> -- 
> 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