Commit ee4fb16c authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: decrease indenting problems in xfs_dabuf_map

Refactor the code that complains when a dir/attr mapping doesn't exist
but the caller requires a mapping.  This small restructuring helps us to
reduce the indenting level.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 50f83009
...@@ -2567,26 +2567,30 @@ xfs_dabuf_map( ...@@ -2567,26 +2567,30 @@ xfs_dabuf_map(
} }
if (!xfs_da_map_covers_blocks(nirecs, irecs, bno, nfsb)) { if (!xfs_da_map_covers_blocks(nirecs, irecs, bno, nfsb)) {
error = mappedbno == -2 ? -1 : -EFSCORRUPTED; /* Caller ok with no mapping. */
if (unlikely(error == -EFSCORRUPTED)) { if (mappedbno == -2) {
if (xfs_error_level >= XFS_ERRLEVEL_LOW) { error = -1;
int i; goto out;
xfs_alert(mp, "%s: bno %lld dir: inode %lld", }
__func__, (long long)bno,
(long long)dp->i_ino); /* Caller expected a mapping, so abort. */
for (i = 0; i < *nmaps; i++) { if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
xfs_alert(mp, int i;
xfs_alert(mp, "%s: bno %lld dir: inode %lld", __func__,
(long long)bno, (long long)dp->i_ino);
for (i = 0; i < *nmaps; i++) {
xfs_alert(mp,
"[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d", "[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d",
i, i,
(long long)irecs[i].br_startoff, (long long)irecs[i].br_startoff,
(long long)irecs[i].br_startblock, (long long)irecs[i].br_startblock,
(long long)irecs[i].br_blockcount, (long long)irecs[i].br_blockcount,
irecs[i].br_state); irecs[i].br_state);
}
} }
XFS_ERROR_REPORT("xfs_da_do_buf(1)",
XFS_ERRLEVEL_LOW, mp);
} }
XFS_ERROR_REPORT("xfs_da_do_buf(1)", XFS_ERRLEVEL_LOW, mp);
error = -EFSCORRUPTED;
goto out; goto out;
} }
error = xfs_buf_map_from_irec(mp, map, nmaps, irecs, nirecs); error = xfs_buf_map_from_irec(mp, map, nmaps, irecs, nirecs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment