diff mbox series

[14/15] xfs: always defer agfl block frees

Message ID 20180730164520.36882-15-bfoster@redhat.com (mailing list archive)
State Superseded, archived
Headers show
Series xfs: condense dfops and automatic relogging | expand

Commit Message

Brian Foster July 30, 2018, 4:45 p.m. UTC
The AGFL fixup code conditionally defers block frees from the free
list based on whether the current transaction has an associated
xfs_defer_ops structure. Now that dfops is embedded in the
transaction and the internal dfops is used unconditionally, this
invariant is always true.

Remove the now dead logic to check for ->t_dfops in
xfs_alloc_fix_freelist() and unconditionally defer AGFL block frees.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/libxfs/xfs_alloc.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Darrick J. Wong July 30, 2018, 8:49 p.m. UTC | #1
On Mon, Jul 30, 2018 at 12:45:19PM -0400, Brian Foster wrote:
> The AGFL fixup code conditionally defers block frees from the free
> list based on whether the current transaction has an associated
> xfs_defer_ops structure. Now that dfops is embedded in the
> transaction and the internal dfops is used unconditionally, this
> invariant is always true.
> 
> Remove the now dead logic to check for ->t_dfops in
> xfs_alloc_fix_freelist() and unconditionally defer AGFL block frees.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

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

--D

> ---
>  fs/xfs/libxfs/xfs_alloc.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 6bacdc31a439..32a370665d71 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -2323,15 +2323,8 @@ xfs_alloc_fix_freelist(
>  		if (error)
>  			goto out_agbp_relse;
>  
> -		/* defer agfl frees if dfops is provided */
> -		if (tp->t_dfops) {
> -			xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo);
> -		} else {
> -			error = xfs_free_agfl_block(tp, args->agno, bno, agbp,
> -						    &targs.oinfo);
> -			if (error)
> -				goto out_agbp_relse;
> -		}
> +		/* defer agfl frees */
> +		xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo);
>  	}
>  
>  	targs.tp = tp;
> -- 
> 2.17.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig July 31, 2018, 8:32 a.m. UTC | #2
On Mon, Jul 30, 2018 at 12:45:19PM -0400, Brian Foster wrote:
> The AGFL fixup code conditionally defers block frees from the free
> list based on whether the current transaction has an associated
> xfs_defer_ops structure. Now that dfops is embedded in the
> transaction and the internal dfops is used unconditionally, this
> invariant is always true.
> 
> Remove the now dead logic to check for ->t_dfops in
> xfs_alloc_fix_freelist() and unconditionally defer AGFL block frees.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 6bacdc31a439..32a370665d71 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -2323,15 +2323,8 @@  xfs_alloc_fix_freelist(
 		if (error)
 			goto out_agbp_relse;
 
-		/* defer agfl frees if dfops is provided */
-		if (tp->t_dfops) {
-			xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo);
-		} else {
-			error = xfs_free_agfl_block(tp, args->agno, bno, agbp,
-						    &targs.oinfo);
-			if (error)
-				goto out_agbp_relse;
-		}
+		/* defer agfl frees */
+		xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo);
 	}
 
 	targs.tp = tp;