Re: [PATCH 4/7] xfs: only look at the fork format in xfs_idestroy_fork

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

 



On Fri, Apr 02, 2021 at 04:24:06PM +0200, Christoph Hellwig wrote:
> Stop using the XFS_IFEXTENTS flag, and instead switch on the fork format
> in xfs_idestroy_fork to decide how to cleanup.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

And FWIW the remaining patches seem generally reasonable to me at a
quick read through. I'll probably have to take a closer look at the
details once this is more solidified..

Brian

>  fs/xfs/libxfs/xfs_inode_fork.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
> index 1851d6f266d06b..9bdeb2d474b038 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.c
> +++ b/fs/xfs/libxfs/xfs_inode_fork.c
> @@ -522,17 +522,16 @@ xfs_idestroy_fork(
>  		ifp->if_broot = NULL;
>  	}
>  
> -	/*
> -	 * If the format is local, then we can't have an extents array so just
> -	 * look for an inline data array.  If we're not local then we may or may
> -	 * not have an extents list, so check and free it up if we do.
> -	 */
> -	if (ifp->if_format == XFS_DINODE_FMT_LOCAL) {
> +	switch (ifp->if_format) {
> +	case XFS_DINODE_FMT_LOCAL:
>  		kmem_free(ifp->if_u1.if_data);
>  		ifp->if_u1.if_data = NULL;
> -	} else if (ifp->if_flags & XFS_IFEXTENTS) {
> +		break;
> +	case XFS_DINODE_FMT_EXTENTS:
> +	case XFS_DINODE_FMT_BTREE:
>  		if (ifp->if_height)
>  			xfs_iext_destroy(ifp);
> +		break;
>  	}
>  }
>  
> -- 
> 2.30.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