Re: [PATCH 4/5] xfs_metadump: Zap unused space in inode btrees

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

 



On Mon, Nov 05, 2018 at 10:31:44PM +0100, Stefan Ring wrote:
> Signed-off-by: Stefan Ring <stefanrin@xxxxxxxxx>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

> ---
>  db/metadump.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index d4c751c0..59765263 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -2173,6 +2173,19 @@ process_btinode(
>  	}
>  
>  	pp = XFS_BMDR_PTR_ADDR(dib, 1, maxrecs);
> +
> +	if (zero_stale_data) {
> +		char	*top;
> +
> +		/* Unused btree key space */
> +		top = (char*)XFS_BMDR_KEY_ADDR(dib, nrecs + 1);
> +		memset(top, 0, (char*)pp - top);
> +
> +		/* Unused btree ptr space */
> +		top = (char*)&pp[nrecs];
> +		memset(top, 0, (char*)dib + XFS_DFORK_SIZE(dip, mp, whichfork) - top);
> +	}
> +
>  	for (i = 0; i < nrecs; i++) {
>  		xfs_agnumber_t	ag;
>  		xfs_agblock_t	bno;
> -- 
> 2.14.5
> 



[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