From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Pass the per-AG structure to the xfs_ici_walk execute function. This isn't needed now, but deferred inactivation will need it to modify some per-ag data. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- fs/xfs/xfs_icache.c | 24 ++++++++++++++++-------- fs/xfs/xfs_icache.h | 2 +- fs/xfs/xfs_qm_syscalls.c | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 1a09d4854266..d9bfc78a1b85 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -26,8 +26,10 @@ #include <linux/iversion.h> -STATIC int xfs_inode_free_eofblocks(struct xfs_inode *ip, void *args); -STATIC int xfs_inode_free_cowblocks(struct xfs_inode *ip, void *args); +STATIC int xfs_inode_free_eofblocks(struct xfs_inode *ip, struct xfs_perag *pag, + void *args); +STATIC int xfs_inode_free_cowblocks(struct xfs_inode *ip, struct xfs_perag *pag, + void *args); /* * Allocate and initialise an xfs_inode. @@ -798,7 +800,8 @@ STATIC int xfs_ici_walk_ag( struct xfs_mount *mp, struct xfs_perag *pag, - int (*execute)(struct xfs_inode *ip, void *args), + int (*execute)(struct xfs_inode *ip, + struct xfs_perag *pag, void *args), void *args, int tag, int iter_flags) @@ -874,7 +877,7 @@ xfs_ici_walk_ag( if ((iter_flags & XFS_ICI_WALK_INEW_WAIT) && xfs_iflags_test(batch[i], XFS_INEW)) xfs_inew_wait(batch[i]); - error = execute(batch[i], args); + error = execute(batch[i], pag, args); xfs_irele(batch[i]); if (error == -EAGAIN) { skipped++; @@ -919,7 +922,8 @@ STATIC int xfs_ici_walk( struct xfs_mount *mp, int iter_flags, - int (*execute)(struct xfs_inode *ip, void *args), + int (*execute)(struct xfs_inode *ip, + struct xfs_perag *pag, void *args), void *args, int tag) { @@ -950,7 +954,8 @@ xfs_ici_walk( int xfs_ici_walk_all( struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, void *args), + int (*execute)(struct xfs_inode *ip, + struct xfs_perag *pag, void *args), void *args) { return xfs_ici_walk(mp, XFS_ICI_WALK_INEW_WAIT, execute, args, @@ -977,15 +982,16 @@ xfs_queue_blockgc( static int xfs_blockgc_scan_inode( struct xfs_inode *ip, + struct xfs_perag *pag, void *args) { int error; - error = xfs_inode_free_eofblocks(ip, args); + error = xfs_inode_free_eofblocks(ip, pag, args); if (error && error != -EAGAIN) return error; - return xfs_inode_free_cowblocks(ip, args); + return xfs_inode_free_cowblocks(ip, pag, args); } /* Scan an AG's inodes for block preallocations that we can remove. */ @@ -1528,6 +1534,7 @@ xfs_inode_matches_eofb( STATIC int xfs_inode_free_eofblocks( struct xfs_inode *ip, + struct xfs_perag *pag, void *args) { struct xfs_eofblocks *eofb = args; @@ -1806,6 +1813,7 @@ xfs_prep_free_cowblocks( STATIC int xfs_inode_free_cowblocks( struct xfs_inode *ip, + struct xfs_perag *pag, void *args) { struct xfs_eofblocks *eofb = args; diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h index ee4e05b59afb..d7713eb0734d 100644 --- a/fs/xfs/xfs_icache.h +++ b/fs/xfs/xfs_icache.h @@ -70,7 +70,7 @@ void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip); int xfs_icache_free_cowblocks(struct xfs_mount *, struct xfs_eofblocks *); int xfs_ici_walk_all(struct xfs_mount *mp, - int (*execute)(struct xfs_inode *ip, void *args), + int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, void *args), void *args); int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp, diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index d93bf0c39d3d..fa0db72f8d0d 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -733,6 +733,7 @@ struct xfs_dqrele { STATIC int xfs_dqrele_inode( struct xfs_inode *ip, + struct xfs_perag *pag, void *args) { struct xfs_dqrele *dqr = args;