diff mbox series

[3/3] xfs: pass struct xfs_eofblocks to the inode scan callback

Message ID 20210324070307.908462-4-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [1/3] xfs: use s_inodes in xfs_qm_dqrele_all_inodes | expand

Commit Message

Christoph Hellwig March 24, 2021, 7:03 a.m. UTC
Pass the actual structure instead of a void pointer here now
that none of the functions is used as a callback.

Signed-off-by: Christoph Hellwig <hch@lst.de>
 xfs_inode_free_cowblocks(
---
 fs/xfs/xfs_icache.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Darrick J. Wong March 24, 2021, 6:03 p.m. UTC | #1
On Wed, Mar 24, 2021 at 08:03:07AM +0100, Christoph Hellwig wrote:
> Pass the actual structure instead of a void pointer here now
> that none of the functions is used as a callback.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>  xfs_inode_free_cowblocks(

Assuming this ends up fitting in somewhere,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_icache.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 7fdf77df66269c..06286b5b613252 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -763,7 +763,7 @@ xfs_inode_walk_ag_grab(
>  static int
>  xfs_blockgc_scan_inode(
>  	struct xfs_inode	*ip,
> -	void			*args);
> +	struct xfs_eofblocks	*eofb);
>  
>  /*
>   * For a given per-AG structure @pag, grab, @execute, and rele all incore
> @@ -1228,10 +1228,9 @@ xfs_reclaim_worker(
>  STATIC int
>  xfs_inode_free_eofblocks(
>  	struct xfs_inode	*ip,
> -	void			*args,
> +	struct xfs_eofblocks	*eofb,
>  	unsigned int		*lockflags)
>  {
> -	struct xfs_eofblocks	*eofb = args;
>  	bool			wait;
>  
>  	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
> @@ -1436,10 +1435,9 @@ xfs_prep_free_cowblocks(
>  STATIC int
>  xfs_inode_free_cowblocks(
>  	struct xfs_inode	*ip,
> -	void			*args,
> +	struct xfs_eofblocks	*eofb,
>  	unsigned int		*lockflags)
>  {
> -	struct xfs_eofblocks	*eofb = args;
>  	bool			wait;
>  	int			ret = 0;
>  
> @@ -1534,16 +1532,16 @@ xfs_blockgc_start(
>  static int
>  xfs_blockgc_scan_inode(
>  	struct xfs_inode	*ip,
> -	void			*args)
> +	struct xfs_eofblocks	*eofb)
>  {
>  	unsigned int		lockflags = 0;
>  	int			error;
>  
> -	error = xfs_inode_free_eofblocks(ip, args, &lockflags);
> +	error = xfs_inode_free_eofblocks(ip, eofb, &lockflags);
>  	if (error)
>  		goto unlock;
>  
> -	error = xfs_inode_free_cowblocks(ip, args, &lockflags);
> +	error = xfs_inode_free_cowblocks(ip, eofb, &lockflags);
>  unlock:
>  	if (lockflags)
>  		xfs_iunlock(ip, lockflags);
> -- 
> 2.30.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 7fdf77df66269c..06286b5b613252 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -763,7 +763,7 @@  xfs_inode_walk_ag_grab(
 static int
 xfs_blockgc_scan_inode(
 	struct xfs_inode	*ip,
-	void			*args);
+	struct xfs_eofblocks	*eofb);
 
 /*
  * For a given per-AG structure @pag, grab, @execute, and rele all incore
@@ -1228,10 +1228,9 @@  xfs_reclaim_worker(
 STATIC int
 xfs_inode_free_eofblocks(
 	struct xfs_inode	*ip,
-	void			*args,
+	struct xfs_eofblocks	*eofb,
 	unsigned int		*lockflags)
 {
-	struct xfs_eofblocks	*eofb = args;
 	bool			wait;
 
 	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
@@ -1436,10 +1435,9 @@  xfs_prep_free_cowblocks(
 STATIC int
 xfs_inode_free_cowblocks(
 	struct xfs_inode	*ip,
-	void			*args,
+	struct xfs_eofblocks	*eofb,
 	unsigned int		*lockflags)
 {
-	struct xfs_eofblocks	*eofb = args;
 	bool			wait;
 	int			ret = 0;
 
@@ -1534,16 +1532,16 @@  xfs_blockgc_start(
 static int
 xfs_blockgc_scan_inode(
 	struct xfs_inode	*ip,
-	void			*args)
+	struct xfs_eofblocks	*eofb)
 {
 	unsigned int		lockflags = 0;
 	int			error;
 
-	error = xfs_inode_free_eofblocks(ip, args, &lockflags);
+	error = xfs_inode_free_eofblocks(ip, eofb, &lockflags);
 	if (error)
 		goto unlock;
 
-	error = xfs_inode_free_cowblocks(ip, args, &lockflags);
+	error = xfs_inode_free_cowblocks(ip, eofb, &lockflags);
 unlock:
 	if (lockflags)
 		xfs_iunlock(ip, lockflags);