Re: [PATCH V2] xfs: remove several unused and never-implemented declarations
From: Carlos Maiolino
Date: Mon Sep 07 2026 - 02:21:32 EST
On Sat, Sep 05, 2026 at 09:03:54AM +0800, Zizhi Wo wrote:
> From: Zizhi Wo <wozizhi@xxxxxxxxxx>
>
> Over time a number of function declarations in various headers have become
> stale: either their implementations were removed when their last callers
> went away, or they were never implemented in the first place. None of them
> refer to anything anymore.
>
> Remove the following dead declarations and the unused stub:
>
> - xlog_assign_tail_lsn() and xlog_assign_tail_lsn_locked()
> - xfs_iext_realloc()
> - xfs_buf_iodone()
> - xfs_scrub_tester() and xfs_scrub_setup_inode_bmap_data() (never
> implemented placeholders)
> - the !CONFIG_XFS_ONLINE_REPAIR stub of xrep_tempfile_iolock_both()
>
> Signed-off-by: Zizhi Wo <wozizhi@xxxxxxxxxx>
Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
> ---
> v2:
> - Squash the individual cleanup patches into a single patch, as suggested
> by Carlos.
> - Drop the former patch 4, since an equivalent change has already been
> merged upstream.
> - Remove the "Assisted-by:" tag.
>
> v1: https://lore.kernel.org/all/20260904060648.1966130-1-wozizhi@xxxxxxxxxxxxxxx/
>
> fs/xfs/scrub/common.h | 1 -
> fs/xfs/scrub/scrub.h | 1 -
> fs/xfs/scrub/tempfile.h | 4 ----
> fs/xfs/xfs_buf_item.h | 1 -
> fs/xfs/xfs_inode.h | 1 -
> fs/xfs/xfs_log.h | 2 --
> 6 files changed, 10 deletions(-)
>
> diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
> index 9d627fd50687..f0f073a93413 100644
> --- a/fs/xfs/scrub/common.h
> +++ b/fs/xfs/scrub/common.h
> @@ -74,7 +74,6 @@ int xchk_setup_ag_rmapbt(struct xfs_scrub *sc);
> int xchk_setup_ag_refcountbt(struct xfs_scrub *sc);
> int xchk_setup_inode(struct xfs_scrub *sc);
> int xchk_setup_inode_bmap(struct xfs_scrub *sc);
> -int xchk_setup_inode_bmap_data(struct xfs_scrub *sc);
> int xchk_setup_directory(struct xfs_scrub *sc);
> int xchk_setup_xattr(struct xfs_scrub *sc);
> int xchk_setup_symlink(struct xfs_scrub *sc);
> diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
> index 6d7d3523b71f..737a5d6db15f 100644
> --- a/fs/xfs/scrub/scrub.h
> +++ b/fs/xfs/scrub/scrub.h
> @@ -261,7 +261,6 @@ static inline int xchk_nothing(struct xfs_scrub *sc)
> }
>
> /* Metadata scrubbers */
> -int xchk_tester(struct xfs_scrub *sc);
> int xchk_superblock(struct xfs_scrub *sc);
> int xchk_agf(struct xfs_scrub *sc);
> int xchk_agfl(struct xfs_scrub *sc);
> diff --git a/fs/xfs/scrub/tempfile.h b/fs/xfs/scrub/tempfile.h
> index 71c1b54599c3..d44ed43bafe0 100644
> --- a/fs/xfs/scrub/tempfile.h
> +++ b/fs/xfs/scrub/tempfile.h
> @@ -39,10 +39,6 @@ int xrep_tempfile_roll_trans(struct xfs_scrub *sc);
> void xrep_tempfile_copyout_local(struct xfs_scrub *sc, int whichfork);
> bool xrep_is_tempfile(const struct xfs_inode *ip);
> #else
> -static inline void xrep_tempfile_iolock_both(struct xfs_scrub *sc)
> -{
> - xchk_ilock(sc, XFS_IOLOCK_EXCL);
> -}
> # define xrep_is_tempfile(ip) (false)
> # define xrep_tempfile_adjust_directory_tree(sc) (0)
> # define xrep_tempfile_rele(sc)
> diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
> index 3159325dd17b..28c79989d725 100644
> --- a/fs/xfs/xfs_buf_item.h
> +++ b/fs/xfs/xfs_buf_item.h
> @@ -60,7 +60,6 @@ static inline void xfs_buf_dquot_iodone(struct xfs_buf *bp)
> {
> }
> #endif /* CONFIG_XFS_QUOTA */
> -void xfs_buf_iodone(struct xfs_buf *);
> bool xfs_buf_log_check_iovec(struct kvec *iovec);
>
> unsigned int xfs_buf_inval_log_space(unsigned int map_count,
> diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> index 34c1038ebfcd..1602027cd0aa 100644
> --- a/fs/xfs/xfs_inode.h
> +++ b/fs/xfs/xfs_inode.h
> @@ -585,7 +585,6 @@ uint xfs_ilock_attr_map_shared(struct xfs_inode *);
> int xfs_ifree(struct xfs_trans *, struct xfs_inode *);
> int xfs_itruncate_extents_flags(struct xfs_trans **,
> struct xfs_inode *, int, xfs_fsize_t, int);
> -void xfs_iext_realloc(xfs_inode_t *, int, int);
>
> int xfs_log_force_inode(struct xfs_inode *ip);
> void xfs_iunpin_wait(xfs_inode_t *);
> diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
> index ca66429bf6c9..f715695e8fcb 100644
> --- a/fs/xfs/xfs_log.h
> +++ b/fs/xfs/xfs_log.h
> @@ -105,8 +105,6 @@ int xfs_log_mount(struct xfs_mount *mp,
> int num_bblocks);
> int xfs_log_mount_finish(struct xfs_mount *mp);
> void xfs_log_mount_cancel(struct xfs_mount *);
> -xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
> -xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp);
> void xfs_log_space_wake(struct xfs_mount *mp);
> int xfs_log_reserve(struct xfs_mount *mp, int length, int count,
> struct xlog_ticket **ticket, bool permanent);
> --
> 2.52.0
>