mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 22:44:27 +08:00
xfs: use a local variable for magic number in xfs_da3_node_lookup_int
Use a local variable for the block magic number checks instead of abusing blk->magic. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
This commit is contained in:
parent
0c60d3aa0e
commit
611995db2c
@ -1481,6 +1481,7 @@ xfs_da3_node_lookup_int(
|
||||
int error;
|
||||
int retval;
|
||||
unsigned int expected_level = 0;
|
||||
uint16_t magic;
|
||||
struct xfs_inode *dp = state->args->dp;
|
||||
|
||||
args = state->args;
|
||||
@ -1505,17 +1506,17 @@ xfs_da3_node_lookup_int(
|
||||
return error;
|
||||
}
|
||||
curr = blk->bp->b_addr;
|
||||
blk->magic = be16_to_cpu(curr->magic);
|
||||
magic = be16_to_cpu(curr->magic);
|
||||
|
||||
if (blk->magic == XFS_ATTR_LEAF_MAGIC ||
|
||||
blk->magic == XFS_ATTR3_LEAF_MAGIC) {
|
||||
if (magic == XFS_ATTR_LEAF_MAGIC ||
|
||||
magic == XFS_ATTR3_LEAF_MAGIC) {
|
||||
blk->magic = XFS_ATTR_LEAF_MAGIC;
|
||||
blk->hashval = xfs_attr_leaf_lasthash(blk->bp, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (blk->magic == XFS_DIR2_LEAFN_MAGIC ||
|
||||
blk->magic == XFS_DIR3_LEAFN_MAGIC) {
|
||||
if (magic == XFS_DIR2_LEAFN_MAGIC ||
|
||||
magic == XFS_DIR3_LEAFN_MAGIC) {
|
||||
blk->magic = XFS_DIR2_LEAFN_MAGIC;
|
||||
blk->hashval = xfs_dir2_leaf_lasthash(args->dp,
|
||||
blk->bp, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user