[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240621191322.GP3058325@frogsfrogsfrogs>
Date: Fri, 21 Jun 2024 12:13:22 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: John Garry <john.g.garry@...cle.com>
Cc: chandan.babu@...cle.com, dchinner@...hat.com, hch@....de,
viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, catherine.hoang@...cle.com,
martin.petersen@...cle.com
Subject: Re: [PATCH 11/13] xfs: Only free full extents for forcealign
On Fri, Jun 21, 2024 at 10:05:38AM +0000, John Garry wrote:
> Like we already do for rtvol, only free full extents for forcealign in
> xfs_free_file_space().
>
> Signed-off-by: John Garry <john.g.garry@...cle.com>
Seems fine to me.
Reviewed-by: Darrick J. Wong <djwong@...nel.org>
--D
> ---
> fs/xfs/xfs_bmap_util.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 56b80a7c0992..ee767a4fd63a 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -842,8 +842,11 @@ xfs_free_file_space(
> startoffset_fsb = XFS_B_TO_FSB(mp, offset);
> endoffset_fsb = XFS_B_TO_FSBT(mp, offset + len);
>
> - /* We can only free complete realtime extents. */
> - if (xfs_inode_has_bigrtalloc(ip)) {
> + /* Free only complete extents. */
> + if (xfs_inode_has_forcealign(ip)) {
> + startoffset_fsb = roundup_64(startoffset_fsb, ip->i_extsize);
> + endoffset_fsb = rounddown_64(endoffset_fsb, ip->i_extsize);
> + } else if (xfs_inode_has_bigrtalloc(ip)) {
> startoffset_fsb = xfs_rtb_roundup_rtx(mp, startoffset_fsb);
> endoffset_fsb = xfs_rtb_rounddown_rtx(mp, endoffset_fsb);
> }
> --
> 2.31.1
>
>
Powered by blists - more mailing lists