summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-04-12 05:00:02 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-04-12 05:00:02 +0300
commit39ab26d59f039c6190bbaa8118a8f0ffed84492a (patch)
tree7777c911884465946304bad70f194e0e0c48f0c6 /fs/xfs/libxfs/xfs_rmap.c
parent2b30cc0bf0589d1ea0506c019b9b81de77535c87 (diff)
downloadlinux-39ab26d59f039c6190bbaa8118a8f0ffed84492a.tar.xz
xfs: return a failure address from xfs_rmap_irec_offset_unpack
Currently, xfs_rmap_irec_offset_unpack returns only 0 or -EFSCORRUPTED. Change this function to return the code address of a failed conversion in preparation for the next patch, which standardizes localized record checking and reporting code. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_rmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index c2624d11f041..830b38337cd5 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -193,7 +193,7 @@ done:
}
/* Convert an internal btree record to an rmap record. */
-int
+xfs_failaddr_t
xfs_rmap_btrec_to_irec(
const union xfs_btree_rec *rec,
struct xfs_rmap_irec *irec)
@@ -2320,11 +2320,10 @@ xfs_rmap_query_range_helper(
{
struct xfs_rmap_query_range_info *query = priv;
struct xfs_rmap_irec irec;
- int error;
- error = xfs_rmap_btrec_to_irec(rec, &irec);
- if (error)
- return error;
+ if (xfs_rmap_btrec_to_irec(rec, &irec) != NULL)
+ return -EFSCORRUPTED;
+
return query->fn(cur, &irec, query->priv);
}