summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-04-13 11:15:10 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-04-15 09:35:50 -0700
commit2ac131df03d4f06bb0d825335663cc5064421993 (patch)
tree72461f91e843e100e594b9115edb11ebf58c6a3c /fs/xfs/libxfs/xfs_bmap.c
parent862a804aae3031e91bd0ae0b13c90a1b13d77af3 (diff)
xfs: rename and simplify xfs_bmap_one_block
xfs_bmap_one_block is only called for the attribute fork. Move it to xfs_attr.c, drop the unused whichfork argument and code only executed for the data fork and rename the result to xfs_attr_is_leaf. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 1b1b58af41fa..e32b8228d9cc 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1442,38 +1442,6 @@ xfs_bmap_last_offset(
}
/*
- * Returns whether the selected fork of the inode has exactly one
- * block or not. For the data fork we check this matches i_disk_size,
- * implying the file's range is 0..bsize-1.
- */
-int /* 1=>1 block, 0=>otherwise */
-xfs_bmap_one_block(
- struct xfs_inode *ip, /* incore inode */
- int whichfork) /* data or attr fork */
-{
- struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
- int rval; /* return value */
- struct xfs_bmbt_irec s; /* internal version of extent */
- struct xfs_iext_cursor icur;
-
-#ifndef DEBUG
- if (whichfork == XFS_DATA_FORK)
- return XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize;
-#endif /* !DEBUG */
- if (ifp->if_nextents != 1)
- return 0;
- if (ifp->if_format != XFS_DINODE_FMT_EXTENTS)
- return 0;
- ASSERT(ifp->if_flags & XFS_IFEXTENTS);
- xfs_iext_first(ifp, &icur);
- xfs_iext_get_extent(ifp, &icur, &s);
- rval = s.br_startoff == 0 && s.br_blockcount == 1;
- if (rval && whichfork == XFS_DATA_FORK)
- ASSERT(XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize);
- return rval;
-}
-
-/*
* Extent tree manipulation functions used during allocation.
*/