mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
[XFS] endianess annotate XFS_BMAP_BROOT_PTR_ADDR Make sure it returns a
__be64 and let the callers use the proper macros. SGI-PV: 954580 SGI-Modid: xfs-linux-melb:xfs-kern:26560a Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nathan Scott <nathans@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:
parent
397b5208d5
commit
576039cf3c
@ -2999,7 +2999,7 @@ xfs_bmap_btree_to_extents(
|
|||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
xfs_ifork_t *ifp; /* inode fork data */
|
xfs_ifork_t *ifp; /* inode fork data */
|
||||||
xfs_mount_t *mp; /* mount point structure */
|
xfs_mount_t *mp; /* mount point structure */
|
||||||
xfs_bmbt_ptr_t *pp; /* ptr to block address */
|
__be64 *pp; /* ptr to block address */
|
||||||
xfs_bmbt_block_t *rblock;/* root btree block */
|
xfs_bmbt_block_t *rblock;/* root btree block */
|
||||||
|
|
||||||
ifp = XFS_IFORK_PTR(ip, whichfork);
|
ifp = XFS_IFORK_PTR(ip, whichfork);
|
||||||
@ -3011,12 +3011,12 @@ xfs_bmap_btree_to_extents(
|
|||||||
ASSERT(XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes) == 1);
|
ASSERT(XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes) == 1);
|
||||||
mp = ip->i_mount;
|
mp = ip->i_mount;
|
||||||
pp = XFS_BMAP_BROOT_PTR_ADDR(rblock, 1, ifp->if_broot_bytes);
|
pp = XFS_BMAP_BROOT_PTR_ADDR(rblock, 1, ifp->if_broot_bytes);
|
||||||
|
cbno = be64_to_cpu(*pp);
|
||||||
*logflagsp = 0;
|
*logflagsp = 0;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ((error = xfs_btree_check_lptr_disk(cur, *pp, 1)))
|
if ((error = xfs_btree_check_lptr(cur, cbno, 1)))
|
||||||
return error;
|
return error;
|
||||||
#endif
|
#endif
|
||||||
cbno = INT_GET(*pp, ARCH_CONVERT);
|
|
||||||
if ((error = xfs_btree_read_bufl(mp, tp, cbno, 0, &cbp,
|
if ((error = xfs_btree_read_bufl(mp, tp, cbno, 0, &cbp,
|
||||||
XFS_BMAP_BTREE_REF)))
|
XFS_BMAP_BTREE_REF)))
|
||||||
return error;
|
return error;
|
||||||
@ -3514,7 +3514,7 @@ xfs_bmap_extents_to_btree(
|
|||||||
arp = XFS_BMAP_REC_IADDR(ablock, 1, cur);
|
arp = XFS_BMAP_REC_IADDR(ablock, 1, cur);
|
||||||
INT_SET(kp->br_startoff, ARCH_CONVERT, xfs_bmbt_disk_get_startoff(arp));
|
INT_SET(kp->br_startoff, ARCH_CONVERT, xfs_bmbt_disk_get_startoff(arp));
|
||||||
pp = XFS_BMAP_PTR_IADDR(block, 1, cur);
|
pp = XFS_BMAP_PTR_IADDR(block, 1, cur);
|
||||||
INT_SET(*pp, ARCH_CONVERT, args.fsbno);
|
*pp = cpu_to_be64(args.fsbno);
|
||||||
/*
|
/*
|
||||||
* Do all this logging at the end so that
|
* Do all this logging at the end so that
|
||||||
* the root is at the right level.
|
* the root is at the right level.
|
||||||
@ -4494,7 +4494,7 @@ xfs_bmap_read_extents(
|
|||||||
xfs_ifork_t *ifp; /* fork structure */
|
xfs_ifork_t *ifp; /* fork structure */
|
||||||
int level; /* btree level, for checking */
|
int level; /* btree level, for checking */
|
||||||
xfs_mount_t *mp; /* file system mount structure */
|
xfs_mount_t *mp; /* file system mount structure */
|
||||||
xfs_bmbt_ptr_t *pp; /* pointer to block address */
|
__be64 *pp; /* pointer to block address */
|
||||||
/* REFERENCED */
|
/* REFERENCED */
|
||||||
xfs_extnum_t room; /* number of entries there's room for */
|
xfs_extnum_t room; /* number of entries there's room for */
|
||||||
|
|
||||||
@ -4510,10 +4510,10 @@ xfs_bmap_read_extents(
|
|||||||
level = be16_to_cpu(block->bb_level);
|
level = be16_to_cpu(block->bb_level);
|
||||||
ASSERT(level > 0);
|
ASSERT(level > 0);
|
||||||
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
||||||
ASSERT(INT_GET(*pp, ARCH_CONVERT) != NULLDFSBNO);
|
bno = be64_to_cpu(*pp);
|
||||||
ASSERT(XFS_FSB_TO_AGNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agcount);
|
ASSERT(bno != NULLDFSBNO);
|
||||||
ASSERT(XFS_FSB_TO_AGBNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agblocks);
|
ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
|
||||||
/*
|
/*
|
||||||
* Go down the tree until leaf level is reached, following the first
|
* Go down the tree until leaf level is reached, following the first
|
||||||
* pointer (leftmost) at each level.
|
* pointer (leftmost) at each level.
|
||||||
@ -4530,10 +4530,8 @@ xfs_bmap_read_extents(
|
|||||||
break;
|
break;
|
||||||
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize, xfs_bmbt, block,
|
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize, xfs_bmbt, block,
|
||||||
1, mp->m_bmap_dmxr[1]);
|
1, mp->m_bmap_dmxr[1]);
|
||||||
XFS_WANT_CORRUPTED_GOTO(
|
bno = be64_to_cpu(*pp);
|
||||||
XFS_FSB_SANITY_CHECK(mp, INT_GET(*pp, ARCH_CONVERT)),
|
XFS_WANT_CORRUPTED_GOTO(XFS_FSB_SANITY_CHECK(mp, bno), error0);
|
||||||
error0);
|
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
|
||||||
xfs_trans_brelse(tp, bp);
|
xfs_trans_brelse(tp, bp);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -6141,7 +6139,7 @@ xfs_check_block(
|
|||||||
short sz)
|
short sz)
|
||||||
{
|
{
|
||||||
int i, j, dmxr;
|
int i, j, dmxr;
|
||||||
xfs_bmbt_ptr_t *pp, *thispa; /* pointer to block address */
|
__be64 *pp, *thispa; /* pointer to block address */
|
||||||
xfs_bmbt_key_t *prevp, *keyp;
|
xfs_bmbt_key_t *prevp, *keyp;
|
||||||
|
|
||||||
ASSERT(be16_to_cpu(block->bb_level) > 0);
|
ASSERT(be16_to_cpu(block->bb_level) > 0);
|
||||||
@ -6179,11 +6177,10 @@ xfs_check_block(
|
|||||||
thispa = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize,
|
thispa = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize,
|
||||||
xfs_bmbt, block, j, dmxr);
|
xfs_bmbt, block, j, dmxr);
|
||||||
}
|
}
|
||||||
if (INT_GET(*thispa, ARCH_CONVERT) ==
|
if (*thispa == *pp) {
|
||||||
INT_GET(*pp, ARCH_CONVERT)) {
|
|
||||||
cmn_err(CE_WARN, "%s: thispa(%d) == pp(%d) %Ld",
|
cmn_err(CE_WARN, "%s: thispa(%d) == pp(%d) %Ld",
|
||||||
__FUNCTION__, j, i,
|
__FUNCTION__, j, i,
|
||||||
INT_GET(*thispa, ARCH_CONVERT));
|
(unsigned long long)be64_to_cpu(*thispa));
|
||||||
panic("%s: ptrs are equal in node\n",
|
panic("%s: ptrs are equal in node\n",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
}
|
}
|
||||||
@ -6210,7 +6207,7 @@ xfs_bmap_check_leaf_extents(
|
|||||||
xfs_ifork_t *ifp; /* fork structure */
|
xfs_ifork_t *ifp; /* fork structure */
|
||||||
int level; /* btree level, for checking */
|
int level; /* btree level, for checking */
|
||||||
xfs_mount_t *mp; /* file system mount structure */
|
xfs_mount_t *mp; /* file system mount structure */
|
||||||
xfs_bmbt_ptr_t *pp; /* pointer to block address */
|
__be64 *pp; /* pointer to block address */
|
||||||
xfs_bmbt_rec_t *ep; /* pointer to current extent */
|
xfs_bmbt_rec_t *ep; /* pointer to current extent */
|
||||||
xfs_bmbt_rec_t *lastp; /* pointer to previous extent */
|
xfs_bmbt_rec_t *lastp; /* pointer to previous extent */
|
||||||
xfs_bmbt_rec_t *nextp; /* pointer to next extent */
|
xfs_bmbt_rec_t *nextp; /* pointer to next extent */
|
||||||
@ -6231,10 +6228,12 @@ xfs_bmap_check_leaf_extents(
|
|||||||
ASSERT(level > 0);
|
ASSERT(level > 0);
|
||||||
xfs_check_block(block, mp, 1, ifp->if_broot_bytes);
|
xfs_check_block(block, mp, 1, ifp->if_broot_bytes);
|
||||||
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
||||||
ASSERT(INT_GET(*pp, ARCH_CONVERT) != NULLDFSBNO);
|
bno = be64_to_cpu(*pp);
|
||||||
ASSERT(XFS_FSB_TO_AGNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agcount);
|
|
||||||
ASSERT(XFS_FSB_TO_AGBNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agblocks);
|
ASSERT(bno != NULLDFSBNO);
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
|
||||||
|
ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Go down the tree until leaf level is reached, following the first
|
* Go down the tree until leaf level is reached, following the first
|
||||||
* pointer (leftmost) at each level.
|
* pointer (leftmost) at each level.
|
||||||
@ -6265,8 +6264,8 @@ xfs_bmap_check_leaf_extents(
|
|||||||
xfs_check_block(block, mp, 0, 0);
|
xfs_check_block(block, mp, 0, 0);
|
||||||
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize, xfs_bmbt, block,
|
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize, xfs_bmbt, block,
|
||||||
1, mp->m_bmap_dmxr[1]);
|
1, mp->m_bmap_dmxr[1]);
|
||||||
XFS_WANT_CORRUPTED_GOTO(XFS_FSB_SANITY_CHECK(mp, INT_GET(*pp, ARCH_CONVERT)), error0);
|
bno = be64_to_cpu(*pp);
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
XFS_WANT_CORRUPTED_GOTO(XFS_FSB_SANITY_CHECK(mp, bno), error0);
|
||||||
if (bp_release) {
|
if (bp_release) {
|
||||||
bp_release = 0;
|
bp_release = 0;
|
||||||
xfs_trans_brelse(NULL, bp);
|
xfs_trans_brelse(NULL, bp);
|
||||||
@ -6372,7 +6371,7 @@ xfs_bmap_count_blocks(
|
|||||||
xfs_ifork_t *ifp; /* fork structure */
|
xfs_ifork_t *ifp; /* fork structure */
|
||||||
int level; /* btree level, for checking */
|
int level; /* btree level, for checking */
|
||||||
xfs_mount_t *mp; /* file system mount structure */
|
xfs_mount_t *mp; /* file system mount structure */
|
||||||
xfs_bmbt_ptr_t *pp; /* pointer to block address */
|
__be64 *pp; /* pointer to block address */
|
||||||
|
|
||||||
bno = NULLFSBLOCK;
|
bno = NULLFSBLOCK;
|
||||||
mp = ip->i_mount;
|
mp = ip->i_mount;
|
||||||
@ -6395,10 +6394,10 @@ xfs_bmap_count_blocks(
|
|||||||
level = be16_to_cpu(block->bb_level);
|
level = be16_to_cpu(block->bb_level);
|
||||||
ASSERT(level > 0);
|
ASSERT(level > 0);
|
||||||
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
pp = XFS_BMAP_BROOT_PTR_ADDR(block, 1, ifp->if_broot_bytes);
|
||||||
ASSERT(INT_GET(*pp, ARCH_CONVERT) != NULLDFSBNO);
|
bno = be64_to_cpu(*pp);
|
||||||
ASSERT(XFS_FSB_TO_AGNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agcount);
|
ASSERT(bno != NULLDFSBNO);
|
||||||
ASSERT(XFS_FSB_TO_AGBNO(mp, INT_GET(*pp, ARCH_CONVERT)) < mp->m_sb.sb_agblocks);
|
ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
|
||||||
|
|
||||||
if (unlikely(xfs_bmap_count_tree(mp, tp, ifp, bno, level, count) < 0)) {
|
if (unlikely(xfs_bmap_count_tree(mp, tp, ifp, bno, level, count) < 0)) {
|
||||||
XFS_ERROR_REPORT("xfs_bmap_count_blocks(2)", XFS_ERRLEVEL_LOW,
|
XFS_ERROR_REPORT("xfs_bmap_count_blocks(2)", XFS_ERRLEVEL_LOW,
|
||||||
@ -6425,7 +6424,7 @@ xfs_bmap_count_tree(
|
|||||||
int error;
|
int error;
|
||||||
xfs_buf_t *bp, *nbp;
|
xfs_buf_t *bp, *nbp;
|
||||||
int level = levelin;
|
int level = levelin;
|
||||||
xfs_bmbt_ptr_t *pp;
|
__be64 *pp;
|
||||||
xfs_fsblock_t bno = blockno;
|
xfs_fsblock_t bno = blockno;
|
||||||
xfs_fsblock_t nextbno;
|
xfs_fsblock_t nextbno;
|
||||||
xfs_bmbt_block_t *block, *nextblock;
|
xfs_bmbt_block_t *block, *nextblock;
|
||||||
@ -6452,7 +6451,7 @@ xfs_bmap_count_tree(
|
|||||||
/* Dive to the next level */
|
/* Dive to the next level */
|
||||||
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize,
|
pp = XFS_BTREE_PTR_ADDR(mp->m_sb.sb_blocksize,
|
||||||
xfs_bmbt, block, 1, mp->m_bmap_dmxr[1]);
|
xfs_bmbt, block, 1, mp->m_bmap_dmxr[1]);
|
||||||
bno = INT_GET(*pp, ARCH_CONVERT);
|
bno = be64_to_cpu(*pp);
|
||||||
if (unlikely((error =
|
if (unlikely((error =
|
||||||
xfs_bmap_count_tree(mp, tp, ifp, bno, level, count)) < 0)) {
|
xfs_bmap_count_tree(mp, tp, ifp, bno, level, count)) < 0)) {
|
||||||
xfs_trans_brelse(tp, bp);
|
xfs_trans_brelse(tp, bp);
|
||||||
|
@ -870,14 +870,13 @@ xfs_bmbt_insrec(
|
|||||||
memmove(&pp[ptr], &pp[ptr - 1], /* INT_: direct copy */
|
memmove(&pp[ptr], &pp[ptr - 1], /* INT_: direct copy */
|
||||||
(numrecs - ptr + 1) * sizeof(*pp));
|
(numrecs - ptr + 1) * sizeof(*pp));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ((error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)*bnop,
|
if ((error = xfs_btree_check_lptr(cur, *bnop, level))) {
|
||||||
level))) {
|
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
kp[ptr - 1] = key;
|
kp[ptr - 1] = key;
|
||||||
INT_SET(pp[ptr - 1], ARCH_CONVERT, *bnop);
|
pp[ptr - 1] = cpu_to_be64(*bnop);
|
||||||
numrecs++;
|
numrecs++;
|
||||||
block->bb_numrecs = cpu_to_be16(numrecs);
|
block->bb_numrecs = cpu_to_be16(numrecs);
|
||||||
xfs_bmbt_log_keys(cur, bp, ptr, numrecs);
|
xfs_bmbt_log_keys(cur, bp, ptr, numrecs);
|
||||||
@ -1189,13 +1188,13 @@ xfs_bmbt_lookup(
|
|||||||
if (diff > 0 && --keyno < 1)
|
if (diff > 0 && --keyno < 1)
|
||||||
keyno = 1;
|
keyno = 1;
|
||||||
pp = XFS_BMAP_PTR_IADDR(block, keyno, cur);
|
pp = XFS_BMAP_PTR_IADDR(block, keyno, cur);
|
||||||
|
fsbno = be64_to_cpu(*pp);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ((error = xfs_btree_check_lptr_disk(cur, *pp, level))) {
|
if ((error = xfs_btree_check_lptr(cur, fsbno, level))) {
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fsbno = INT_GET(*pp, ARCH_CONVERT);
|
|
||||||
cur->bc_ptrs[level] = keyno;
|
cur->bc_ptrs[level] = keyno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1445,7 +1444,7 @@ xfs_bmbt_rshift(
|
|||||||
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
|
rpp = XFS_BMAP_PTR_IADDR(right, 1, cur);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) {
|
for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) {
|
||||||
if ((error = xfs_btree_check_lptr_disk(cur, rpp[i] level))) {
|
if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) {
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -1728,9 +1727,9 @@ xfs_bmdr_to_bmbt(
|
|||||||
{
|
{
|
||||||
int dmxr;
|
int dmxr;
|
||||||
xfs_bmbt_key_t *fkp;
|
xfs_bmbt_key_t *fkp;
|
||||||
xfs_bmbt_ptr_t *fpp;
|
__be64 *fpp;
|
||||||
xfs_bmbt_key_t *tkp;
|
xfs_bmbt_key_t *tkp;
|
||||||
xfs_bmbt_ptr_t *tpp;
|
__be64 *tpp;
|
||||||
|
|
||||||
rblock->bb_magic = cpu_to_be32(XFS_BMAP_MAGIC);
|
rblock->bb_magic = cpu_to_be32(XFS_BMAP_MAGIC);
|
||||||
rblock->bb_level = dblock->bb_level;
|
rblock->bb_level = dblock->bb_level;
|
||||||
@ -1745,7 +1744,7 @@ xfs_bmdr_to_bmbt(
|
|||||||
tpp = XFS_BMAP_BROOT_PTR_ADDR(rblock, 1, rblocklen);
|
tpp = XFS_BMAP_BROOT_PTR_ADDR(rblock, 1, rblocklen);
|
||||||
dmxr = be16_to_cpu(dblock->bb_numrecs);
|
dmxr = be16_to_cpu(dblock->bb_numrecs);
|
||||||
memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
|
memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
|
||||||
memcpy(tpp, fpp, sizeof(*fpp) * dmxr); /* INT_: direct copy */
|
memcpy(tpp, fpp, sizeof(*fpp) * dmxr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1805,7 +1804,7 @@ xfs_bmbt_decrement(
|
|||||||
tp = cur->bc_tp;
|
tp = cur->bc_tp;
|
||||||
mp = cur->bc_mp;
|
mp = cur->bc_mp;
|
||||||
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
|
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
|
||||||
fsbno = INT_GET(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
|
fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur));
|
||||||
if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
|
if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
|
||||||
XFS_BMAP_BTREE_REF))) {
|
XFS_BMAP_BTREE_REF))) {
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
@ -2135,7 +2134,7 @@ xfs_bmbt_increment(
|
|||||||
tp = cur->bc_tp;
|
tp = cur->bc_tp;
|
||||||
mp = cur->bc_mp;
|
mp = cur->bc_mp;
|
||||||
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
|
for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) {
|
||||||
fsbno = INT_GET(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
|
fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur));
|
||||||
if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
|
if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp,
|
||||||
XFS_BMAP_BTREE_REF))) {
|
XFS_BMAP_BTREE_REF))) {
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
@ -2361,7 +2360,7 @@ xfs_bmbt_newroot(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
args.fsbno = INT_GET(*pp, ARCH_CONVERT);
|
args.fsbno = be64_to_cpu(*pp);
|
||||||
args.type = XFS_ALLOCTYPE_START_BNO;
|
args.type = XFS_ALLOCTYPE_START_BNO;
|
||||||
} else
|
} else
|
||||||
args.type = XFS_ALLOCTYPE_NEAR_BNO;
|
args.type = XFS_ALLOCTYPE_NEAR_BNO;
|
||||||
@ -2401,13 +2400,12 @@ xfs_bmbt_newroot(
|
|||||||
#endif
|
#endif
|
||||||
memcpy(cpp, pp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*pp));
|
memcpy(cpp, pp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*pp));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ((error = xfs_btree_check_lptr(cur, (xfs_bmbt_ptr_t)args.fsbno,
|
if ((error = xfs_btree_check_lptr(cur, args.fsbno, level))) {
|
||||||
level))) {
|
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
INT_SET(*pp, ARCH_CONVERT, args.fsbno);
|
*pp = cpu_to_be64(args.fsbno);
|
||||||
xfs_iroot_realloc(cur->bc_private.b.ip, 1 - be16_to_cpu(cblock->bb_numrecs),
|
xfs_iroot_realloc(cur->bc_private.b.ip, 1 - be16_to_cpu(cblock->bb_numrecs),
|
||||||
cur->bc_private.b.whichfork);
|
cur->bc_private.b.whichfork);
|
||||||
xfs_btree_setbuf(cur, level, bp);
|
xfs_btree_setbuf(cur, level, bp);
|
||||||
@ -2681,9 +2679,9 @@ xfs_bmbt_to_bmdr(
|
|||||||
{
|
{
|
||||||
int dmxr;
|
int dmxr;
|
||||||
xfs_bmbt_key_t *fkp;
|
xfs_bmbt_key_t *fkp;
|
||||||
xfs_bmbt_ptr_t *fpp;
|
__be64 *fpp;
|
||||||
xfs_bmbt_key_t *tkp;
|
xfs_bmbt_key_t *tkp;
|
||||||
xfs_bmbt_ptr_t *tpp;
|
__be64 *tpp;
|
||||||
|
|
||||||
ASSERT(be32_to_cpu(rblock->bb_magic) == XFS_BMAP_MAGIC);
|
ASSERT(be32_to_cpu(rblock->bb_magic) == XFS_BMAP_MAGIC);
|
||||||
ASSERT(be64_to_cpu(rblock->bb_leftsib) == NULLDFSBNO);
|
ASSERT(be64_to_cpu(rblock->bb_leftsib) == NULLDFSBNO);
|
||||||
@ -2698,7 +2696,7 @@ xfs_bmbt_to_bmdr(
|
|||||||
tpp = XFS_BTREE_PTR_ADDR(dblocklen, xfs_bmdr, dblock, 1, dmxr);
|
tpp = XFS_BTREE_PTR_ADDR(dblocklen, xfs_bmdr, dblock, 1, dmxr);
|
||||||
dmxr = be16_to_cpu(dblock->bb_numrecs);
|
dmxr = be16_to_cpu(dblock->bb_numrecs);
|
||||||
memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
|
memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
|
||||||
memcpy(tpp, fpp, sizeof(*fpp) * dmxr); /* INT_: direct copy */
|
memcpy(tpp, fpp, sizeof(*fpp) * dmxr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -244,7 +244,7 @@ xfs_btree_check_lptr(
|
|||||||
int level); /* btree block level */
|
int level); /* btree block level */
|
||||||
|
|
||||||
#define xfs_btree_check_lptr_disk(cur, ptr, level) \
|
#define xfs_btree_check_lptr_disk(cur, ptr, level) \
|
||||||
xfs_btree_check_lptr(cur, INT_GET(ptr, ARCH_CONVERT), level)
|
xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checking routine: check that short form block header is ok.
|
* Checking routine: check that short form block header is ok.
|
||||||
|
Loading…
Reference in New Issue
Block a user