Just open code the trivial logic in the two callers. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- fs/xfs/xfs_icache.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 6c6f8015ab6ef..b638d12fb56a2 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1504,30 +1504,17 @@ xfs_inode_free_eofblocks( return ret; } -static int -__xfs_icache_free_eofblocks( +int +xfs_icache_free_eofblocks( struct xfs_mount *mp, - struct xfs_eofblocks *eofb, - int (*execute)(struct xfs_inode *ip, int flags, - void *args), - int tag) + struct xfs_eofblocks *eofb) { int flags = SYNC_TRYLOCK; if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)) flags = SYNC_WAIT; - - return xfs_inode_ag_iterator_tag(mp, execute, flags, - eofb, tag); -} - -int -xfs_icache_free_eofblocks( - struct xfs_mount *mp, - struct xfs_eofblocks *eofb) -{ - return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks, - XFS_ICI_EOFBLOCKS_TAG); + return xfs_inode_ag_iterator_tag(mp, xfs_inode_free_eofblocks, flags, + eofb, XFS_ICI_EOFBLOCKS_TAG); } /* @@ -1789,8 +1776,12 @@ xfs_icache_free_cowblocks( struct xfs_mount *mp, struct xfs_eofblocks *eofb) { - return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_cowblocks, - XFS_ICI_COWBLOCKS_TAG); + int flags = SYNC_TRYLOCK; + + if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC)) + flags = SYNC_WAIT; + return xfs_inode_ag_iterator_tag(mp, xfs_inode_free_cowblocks, flags, + eofb, XFS_ICI_COWBLOCKS_TAG); } int -- 2.26.2