Commit 33c028ff authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: reduce indenting in xfs_attr_node_list

Reduce the indentation here so that we can add some things in the next
patch without going over the column limits.
Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 17a85dc6
...@@ -310,46 +310,47 @@ xfs_attr_node_list( ...@@ -310,46 +310,47 @@ xfs_attr_node_list(
*/ */
bp = NULL; bp = NULL;
if (cursor->blkno > 0) { if (cursor->blkno > 0) {
struct xfs_attr_leaf_entry *entries;
error = xfs_da3_node_read(context->tp, dp, cursor->blkno, &bp, error = xfs_da3_node_read(context->tp, dp, cursor->blkno, &bp,
XFS_ATTR_FORK); XFS_ATTR_FORK);
if (xfs_metadata_is_sick(error)) if (xfs_metadata_is_sick(error))
xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK); xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
if ((error != 0) && (error != -EFSCORRUPTED)) if (error != 0 && error != -EFSCORRUPTED)
return error; return error;
if (bp) { if (!bp)
struct xfs_attr_leaf_entry *entries; goto need_lookup;
node = bp->b_addr; node = bp->b_addr;
switch (be16_to_cpu(node->hdr.info.magic)) { switch (be16_to_cpu(node->hdr.info.magic)) {
case XFS_DA_NODE_MAGIC: case XFS_DA_NODE_MAGIC:
case XFS_DA3_NODE_MAGIC: case XFS_DA3_NODE_MAGIC:
trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp);
bp = NULL;
break;
case XFS_ATTR_LEAF_MAGIC:
case XFS_ATTR3_LEAF_MAGIC:
leaf = bp->b_addr;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo,
&leafhdr, leaf);
entries = xfs_attr3_leaf_entryp(leaf);
if (cursor->hashval > be32_to_cpu(
entries[leafhdr.count - 1].hashval)) {
trace_xfs_attr_list_wrong_blk(context); trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp); xfs_trans_brelse(context->tp, bp);
bp = NULL; bp = NULL;
break; } else if (cursor->hashval <= be32_to_cpu(
case XFS_ATTR_LEAF_MAGIC: entries[0].hashval)) {
case XFS_ATTR3_LEAF_MAGIC:
leaf = bp->b_addr;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo,
&leafhdr, leaf);
entries = xfs_attr3_leaf_entryp(leaf);
if (cursor->hashval > be32_to_cpu(
entries[leafhdr.count - 1].hashval)) {
trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp);
bp = NULL;
} else if (cursor->hashval <= be32_to_cpu(
entries[0].hashval)) {
trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp);
bp = NULL;
}
break;
default:
trace_xfs_attr_list_wrong_blk(context); trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp); xfs_trans_brelse(context->tp, bp);
bp = NULL; bp = NULL;
} }
break;
default:
trace_xfs_attr_list_wrong_blk(context);
xfs_trans_brelse(context->tp, bp);
bp = NULL;
} }
} }
...@@ -359,6 +360,7 @@ xfs_attr_node_list( ...@@ -359,6 +360,7 @@ xfs_attr_node_list(
* Note that start of node block is same as start of leaf block. * Note that start of node block is same as start of leaf block.
*/ */
if (bp == NULL) { if (bp == NULL) {
need_lookup:
error = xfs_attr_node_list_lookup(context, cursor, &bp); error = xfs_attr_node_list_lookup(context, cursor, &bp);
if (error || !bp) if (error || !bp)
return error; return error;
......
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