block = dbp->data;
xfs_dir2_data_check(dp, dbp);
btp = XFS_DIR2_BLOCK_TAIL_P(mp, block);
- blp = XFS_DIR2_BLOCK_LEAF_P_ARCH(btp, ARCH_CONVERT);
+ blp = XFS_DIR2_BLOCK_LEAF_P(btp);
/*
* Set the counts in the leaf header.
*/
*/
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
INT_SET(ltp->bestcount, ARCH_CONVERT, 1);
- bestsp = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT);
+ bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
INT_COPY(bestsp[0], block->hdr.bestfree[0].length, ARCH_CONVERT);
/*
* Log the data header and leaf bests table.
index = xfs_dir2_leaf_search_hash(args, lbp);
leaf = lbp->data;
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
- bestsp = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT);
+ bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
length = XFS_DIR2_DATA_ENTSIZE(args->namelen);
/*
* See if there are any entries with the same hash value
* How many bytes do we need in the leaf block?
*/
needbytes =
- (!INT_ISZERO(leaf->hdr.stale, ARCH_CONVERT) ? 0 : (uint)sizeof(leaf->ents[0])) +
+ (leaf->hdr.stale ? 0 : (uint)sizeof(leaf->ents[0])) +
(use_block != -1 ? 0 : (uint)sizeof(leaf->bests[0]));
/*
* Now kill use_block if it refers to a missing block, so we
* Now we need to make room to insert the leaf entry.
* If there are no stale entries, we just insert a hole at index.
*/
- if (INT_ISZERO(leaf->hdr.stale, ARCH_CONVERT)) {
+ if (!leaf->hdr.stale) {
/*
* lep is still good as the index leaf entry.
*/
* Leaves and bests don't overlap.
*/
ASSERT((char *)&leaf->ents[INT_GET(leaf->hdr.count, ARCH_CONVERT)] <=
- (char *)XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT));
+ (char *)XFS_DIR2_LEAF_BESTS_P(ltp));
/*
* Check hash value order, count stale entries.
*/
int to; /* target leaf index */
leaf = bp->data;
- if (INT_ISZERO(leaf->hdr.stale, ARCH_CONVERT)) {
+ if (!leaf->hdr.stale) {
return;
}
/*
*/
ASSERT(INT_GET(leaf->hdr.stale, ARCH_CONVERT) == from - to);
INT_MOD(leaf->hdr.count, ARCH_CONVERT, -(INT_GET(leaf->hdr.stale, ARCH_CONVERT)));
- INT_ZERO(leaf->hdr.stale, ARCH_CONVERT);
+ leaf->hdr.stale = 0;
xfs_dir2_leaf_log_header(args->trans, bp);
if (loglow != -1)
xfs_dir2_leaf_log_ents(args->trans, bp, loglow, to - 1);
* Initialize the header.
*/
INT_SET(leaf->hdr.info.magic, ARCH_CONVERT, magic);
- INT_ZERO(leaf->hdr.info.forw, ARCH_CONVERT);
- INT_ZERO(leaf->hdr.info.back, ARCH_CONVERT);
- INT_ZERO(leaf->hdr.count, ARCH_CONVERT);
- INT_ZERO(leaf->hdr.stale, ARCH_CONVERT);
+ leaf->hdr.info.forw = 0;
+ leaf->hdr.info.back = 0;
+ leaf->hdr.count = 0;
+ leaf->hdr.stale = 0;
xfs_dir2_leaf_log_header(tp, bp);
/*
* If it's a leaf-format directory initialize the tail.
*/
if (magic == XFS_DIR2_LEAF1_MAGIC) {
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
- INT_ZERO(ltp->bestcount, ARCH_CONVERT);
+ ltp->bestcount = 0;
xfs_dir2_leaf_log_tail(tp, bp);
}
*bpp = bp;
leaf = bp->data;
ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAF1_MAGIC);
ltp = XFS_DIR2_LEAF_TAIL_P(tp->t_mountp, leaf);
- firstb = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT) + first;
- lastb = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT) + last;
+ firstb = XFS_DIR2_LEAF_BESTS_P(ltp) + first;
+ lastb = XFS_DIR2_LEAF_BESTS_P(ltp) + last;
xfs_da_log_buf(tp, bp, (uint)((char *)firstb - (char *)leaf),
(uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1));
}
needscan = needlog = 0;
oldbest = INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT);
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
- bestsp = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT);
+ bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest);
/*
* Mark the former data entry unused.
leaf = lbp->data;
#ifndef __KERNEL__
- if (INT_ISZERO(leaf->hdr.count, ARCH_CONVERT))
+ if (!leaf->hdr.count)
return 0;
#endif
/*
/*
* Eliminate the last bests entry from the table.
*/
- bestsp = XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT);
+ bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
INT_MOD(ltp->bestcount, ARCH_CONVERT, -1);
memmove(&bestsp[1], &bestsp[0], INT_GET(ltp->bestcount, ARCH_CONVERT) * sizeof(*bestsp));
xfs_dir2_leaf_log_tail(tp, lbp);
}
free = fbp->data;
ASSERT(INT_GET(free->hdr.magic, ARCH_CONVERT) == XFS_DIR2_FREE_MAGIC);
- ASSERT(INT_ISZERO(free->hdr.firstdb, ARCH_CONVERT));
+ ASSERT(!free->hdr.firstdb);
/*
* Now see if the leafn and free data will fit in a leaf1.
* If not, release the buffer and give up.
/*
* Set up the leaf bests table.
*/
- memcpy(XFS_DIR2_LEAF_BESTS_P_ARCH(ltp, ARCH_CONVERT), free->bests,
+ memcpy(XFS_DIR2_LEAF_BESTS_P(ltp), free->bests,
INT_GET(ltp->bestcount, ARCH_CONVERT) * sizeof(leaf->bests[0]));
xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1);
xfs_dir2_leaf_log_tail(tp, lbp);