Lines Matching refs:ARCH_CONVERT

163 	XFS_DIR_SF_PUT_DIRINO_ARCH(&parent, &hdr->parent, ARCH_CONVERT);  in xfs_dir_shortform_create()
165 INT_ZERO(hdr->count, ARCH_CONVERT); in xfs_dir_shortform_create()
197 for (i = INT_GET(sf->hdr.count, ARCH_CONVERT)-1; i >= 0; i--) { in xfs_dir_shortform_addname()
211 XFS_DIR_SF_PUT_DIRINO_ARCH(&args->inumber, &sfe->inumber, ARCH_CONVERT); in xfs_dir_shortform_addname()
214 INT_MOD(sf->hdr.count, ARCH_CONVERT, +1); in xfs_dir_shortform_addname()
248 for (i = INT_GET(sf->hdr.count, ARCH_CONVERT)-1; i >= 0; i--) { in xfs_dir_shortform_removename()
266 INT_MOD(sf->hdr.count, ARCH_CONVERT, -1); in xfs_dir_shortform_removename()
301 XFS_DIR_SF_GET_DIRINO_ARCH(&sf->hdr.parent, &args->inumber, ARCH_CONVERT); in xfs_dir_shortform_lookup()
309 for (i = INT_GET(sf->hdr.count, ARCH_CONVERT)-1; i >= 0; i--) { in xfs_dir_shortform_lookup()
313 XFS_DIR_SF_GET_DIRINO_ARCH(&sfe->inumber, &args->inumber, ARCH_CONVERT); in xfs_dir_shortform_lookup()
356 XFS_DIR_SF_GET_DIRINO_ARCH(&sf->hdr.parent, &inumber, ARCH_CONVERT); in xfs_dir_shortform_to_leaf()
396 for (i = 0; i < INT_GET(sf->hdr.count, ARCH_CONVERT); i++) { in xfs_dir_shortform_to_leaf()
401 XFS_DIR_SF_GET_DIRINO_ARCH(&sfe->inumber, &args.inumber, ARCH_CONVERT); in xfs_dir_shortform_to_leaf()
449 nsbuf = INT_GET(sf->hdr.count, ARCH_CONVERT) + 2; in xfs_dir_shortform_getdents()
473 sbp->ino = XFS_GET_DIR_INO_ARCH(mp, sf->hdr.parent, ARCH_CONVERT); in xfs_dir_shortform_getdents()
482 i < INT_GET(sf->hdr.count, ARCH_CONVERT); i++) { in xfs_dir_shortform_getdents()
497 sbp->ino = XFS_GET_DIR_INO_ARCH(mp, sfe->inumber, ARCH_CONVERT); in xfs_dir_shortform_getdents()
615 XFS_DIR_SF_PUT_DIRINO_ARCH(&args->inumber, &sf->hdr.parent, ARCH_CONVERT); in xfs_dir_shortform_replace()
621 for (i = INT_GET(sf->hdr.count, ARCH_CONVERT)-1; i >= 0; i--) { in xfs_dir_shortform_replace()
627 XFS_DIR_SF_PUT_DIRINO_ARCH(&args->inumber, &sfe->inumber, ARCH_CONVERT); in xfs_dir_shortform_replace()
665 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_to_shortform()
673 for (i = INT_GET(hdr->count, ARCH_CONVERT)-1; i >= 0; entry++, i--) { in xfs_dir_leaf_to_shortform()
674 namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_to_shortform()
678 XFS_DIR_SF_GET_DIRINO_ARCH(&namest->inumber, &parent, ARCH_CONVERT); in xfs_dir_leaf_to_shortform()
679 INT_ZERO(entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_to_shortform()
681 INT_ZERO(entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_to_shortform()
703 for (i = 0; i < INT_GET(hdr->count, ARCH_CONVERT); entry++, i++) { in xfs_dir_leaf_to_shortform()
704 if (INT_ISZERO(entry->nameidx, ARCH_CONVERT)) in xfs_dir_leaf_to_shortform()
706 namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_to_shortform()
709 args.hashval = INT_GET(entry->hashval, ARCH_CONVERT); in xfs_dir_leaf_to_shortform()
710 XFS_DIR_SF_GET_DIRINO_ARCH(&namest->inumber, &args.inumber, ARCH_CONVERT); in xfs_dir_leaf_to_shortform()
763 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_to_node()
764 …T(node->btree[0].hashval, ARCH_CONVERT, INT_GET(leaf->entries[ INT_GET(leaf->hdr.count, ARCH_CONVE… in xfs_dir_leaf_to_node()
766 INT_SET(node->btree[0].before, ARCH_CONVERT, blkno); in xfs_dir_leaf_to_node()
767 INT_SET(node->hdr.count, ARCH_CONVERT, 1); in xfs_dir_leaf_to_node()
802 INT_SET(hdr->info.magic, ARCH_CONVERT, XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_create()
803 INT_SET(hdr->firstused, ARCH_CONVERT, XFS_LBSIZE(dp->i_mount)); in xfs_dir_leaf_create()
804 if (INT_ISZERO(hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_create()
805 INT_SET(hdr->firstused, ARCH_CONVERT, XFS_LBSIZE(dp->i_mount) - 1); in xfs_dir_leaf_create()
806 INT_SET(hdr->freemap[0].base, ARCH_CONVERT, sizeof(xfs_dir_leaf_hdr_t)); in xfs_dir_leaf_create()
807 …T_SET(hdr->freemap[0].size, ARCH_CONVERT, INT_GET(hdr->firstused, ARCH_CONVERT) - INT_GET(hdr->fre… in xfs_dir_leaf_create()
881 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_add()
882 ASSERT((index >= 0) && (index <= INT_GET(leaf->hdr.count, ARCH_CONVERT))); in xfs_dir_leaf_add()
890 tablesize = (INT_GET(hdr->count, ARCH_CONVERT) + 1) * (uint)sizeof(xfs_dir_leaf_entry_t) in xfs_dir_leaf_add()
894 if (tablesize > INT_GET(hdr->firstused, ARCH_CONVERT)) { in xfs_dir_leaf_add()
895 sum += INT_GET(map->size, ARCH_CONVERT); in xfs_dir_leaf_add()
898 if (INT_ISZERO(map->size, ARCH_CONVERT)) in xfs_dir_leaf_add()
901 if (INT_GET(map->base, ARCH_CONVERT) < INT_GET(hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_add()
903 if (INT_GET(map->size, ARCH_CONVERT) >= tmp) { in xfs_dir_leaf_add()
908 sum += INT_GET(map->size, ARCH_CONVERT); in xfs_dir_leaf_add()
935 if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) < in xfs_dir_leaf_add()
961 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_add_work()
964 ASSERT((index >= 0) && (index <= INT_GET(hdr->count, ARCH_CONVERT))); in xfs_dir_leaf_add_work()
970 if (index < INT_GET(hdr->count, ARCH_CONVERT)) { in xfs_dir_leaf_add_work()
971 tmp = INT_GET(hdr->count, ARCH_CONVERT) - index; in xfs_dir_leaf_add_work()
977 INT_MOD(hdr->count, ARCH_CONVERT, +1); in xfs_dir_leaf_add_work()
984 ASSERT(INT_GET(map->base, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_add_work()
985 ASSERT(INT_GET(map->size, ARCH_CONVERT) >= XFS_DIR_LEAF_ENTSIZE_BYNAME(args->namelen)); in xfs_dir_leaf_add_work()
986 ASSERT(INT_GET(map->size, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_add_work()
987 INT_MOD(map->size, ARCH_CONVERT, -(XFS_DIR_LEAF_ENTSIZE_BYNAME(args->namelen))); in xfs_dir_leaf_add_work()
988 …INT_SET(entry->nameidx, ARCH_CONVERT, INT_GET(map->base, ARCH_CONVERT) + INT_GET(map->size, ARCH_C… in xfs_dir_leaf_add_work()
989 INT_SET(entry->hashval, ARCH_CONVERT, args->hashval); in xfs_dir_leaf_add_work()
997 namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_add_work()
998 XFS_DIR_SF_PUT_DIRINO_ARCH(&args->inumber, &namest->inumber, ARCH_CONVERT); in xfs_dir_leaf_add_work()
1006 if (INT_GET(entry->nameidx, ARCH_CONVERT) < INT_GET(hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_add_work()
1007 INT_COPY(hdr->firstused, entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_add_work()
1008 …ASSERT(INT_GET(hdr->firstused, ARCH_CONVERT) >= ((INT_GET(hdr->count, ARCH_CONVERT)*sizeof(*entry)… in xfs_dir_leaf_add_work()
1009 tmp = (INT_GET(hdr->count, ARCH_CONVERT)-1) * (uint)sizeof(xfs_dir_leaf_entry_t) in xfs_dir_leaf_add_work()
1013 if (INT_GET(map->base, ARCH_CONVERT) == tmp) { in xfs_dir_leaf_add_work()
1014 INT_MOD(map->base, ARCH_CONVERT, (uint)sizeof(xfs_dir_leaf_entry_t)); in xfs_dir_leaf_add_work()
1015 INT_MOD(map->size, ARCH_CONVERT, -((uint)sizeof(xfs_dir_leaf_entry_t))); in xfs_dir_leaf_add_work()
1018 INT_MOD(hdr->namebytes, ARCH_CONVERT, args->namelen); in xfs_dir_leaf_add_work()
1062 INT_SET(hdr_d->firstused, ARCH_CONVERT, lbsize); in xfs_dir_leaf_compact()
1063 if (INT_ISZERO(hdr_d->firstused, ARCH_CONVERT)) in xfs_dir_leaf_compact()
1064 INT_SET(hdr_d->firstused, ARCH_CONVERT, lbsize - 1); in xfs_dir_leaf_compact()
1065 INT_ZERO(hdr_d->namebytes, ARCH_CONVERT); in xfs_dir_leaf_compact()
1066 INT_ZERO(hdr_d->count, ARCH_CONVERT); in xfs_dir_leaf_compact()
1068 INT_SET(hdr_d->freemap[0].base, ARCH_CONVERT, sizeof(xfs_dir_leaf_hdr_t)); in xfs_dir_leaf_compact()
1069 …T(hdr_d->freemap[0].size, ARCH_CONVERT, INT_GET(hdr_d->firstused, ARCH_CONVERT) - INT_GET(hdr_d->f… in xfs_dir_leaf_compact()
1076 xfs_dir_leaf_moveents(leaf_s, 0, leaf_d, 0, (int)INT_GET(hdr_s->count, ARCH_CONVERT), mp); in xfs_dir_leaf_compact()
1078 if (musthave && INT_GET(hdr_d->freemap[0].size, ARCH_CONVERT) < musthave) in xfs_dir_leaf_compact()
1118 ASSERT(INT_GET(leaf1->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_rebalance()
1119 ASSERT(INT_GET(leaf2->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_rebalance()
1149 if (count < INT_GET(hdr1->count, ARCH_CONVERT)) { in xfs_dir_leaf_rebalance()
1153 count = INT_GET(hdr1->count, ARCH_CONVERT) - count; /* number entries being moved */ in xfs_dir_leaf_rebalance()
1154 space = INT_GET(hdr1->namebytes, ARCH_CONVERT) - totallen; in xfs_dir_leaf_rebalance()
1161 max = INT_GET(hdr2->firstused, ARCH_CONVERT) - (uint)sizeof(xfs_dir_leaf_hdr_t); in xfs_dir_leaf_rebalance()
1162 max -= INT_GET(hdr2->count, ARCH_CONVERT) * (uint)sizeof(xfs_dir_leaf_entry_t); in xfs_dir_leaf_rebalance()
1171 xfs_dir_leaf_moveents(leaf1, INT_GET(hdr1->count, ARCH_CONVERT) - count, in xfs_dir_leaf_rebalance()
1179 } else if (count > INT_GET(hdr1->count, ARCH_CONVERT)) { in xfs_dir_leaf_rebalance()
1183 count -= INT_GET(hdr1->count, ARCH_CONVERT); /* number entries being moved */ in xfs_dir_leaf_rebalance()
1184 space = totallen - INT_GET(hdr1->namebytes, ARCH_CONVERT); in xfs_dir_leaf_rebalance()
1191 max = INT_GET(hdr1->firstused, ARCH_CONVERT) - (uint)sizeof(xfs_dir_leaf_hdr_t); in xfs_dir_leaf_rebalance()
1192 max -= INT_GET(hdr1->count, ARCH_CONVERT) * (uint)sizeof(xfs_dir_leaf_entry_t); in xfs_dir_leaf_rebalance()
1201 xfs_dir_leaf_moveents(leaf2, 0, leaf1, (int)INT_GET(hdr1->count, ARCH_CONVERT), in xfs_dir_leaf_rebalance()
1213 …shval = INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); in xfs_dir_leaf_rebalance()
1214 …shval = INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); in xfs_dir_leaf_rebalance()
1221 blk2->index = blk1->index - INT_GET(leaf1->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_rebalance()
1258 max = INT_GET(hdr1->count, ARCH_CONVERT) + INT_GET(hdr2->count, ARCH_CONVERT); in xfs_dir_leaf_figure_balance()
1260 …half += INT_GET(hdr1->namebytes, ARCH_CONVERT) + INT_GET(hdr2->namebytes, ARCH_CONVERT) + state->a… in xfs_dir_leaf_figure_balance()
1283 if (count == INT_GET(hdr1->count, ARCH_CONVERT)) { in xfs_dir_leaf_figure_balance()
1346 ASSERT(INT_GET(info->magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_toosmall()
1348 count = INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1352 INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1369 forward = !INT_ISZERO(info->forw, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1390 …forward = (INT_GET(info->forw, ARCH_CONVERT) < INT_GET(info->back, ARCH_CONVERT)); /* start with s… in xfs_dir_leaf_toosmall()
1393 blkno = INT_GET(info->forw, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1395 blkno = INT_GET(info->back, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1406 count = INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1408 bytes -= INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1410 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_toosmall()
1411 count += INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1412 bytes -= INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); in xfs_dir_leaf_toosmall()
1468 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_remove()
1471 …ASSERT((INT_GET(hdr->count, ARCH_CONVERT) > 0) && (INT_GET(hdr->count, ARCH_CONVERT) < (XFS_LBSIZE… in xfs_dir_leaf_remove()
1472 ASSERT((index >= 0) && (index < INT_GET(hdr->count, ARCH_CONVERT))); in xfs_dir_leaf_remove()
1473 …ASSERT(INT_GET(hdr->firstused, ARCH_CONVERT) >= ((INT_GET(hdr->count, ARCH_CONVERT)*sizeof(*entry)… in xfs_dir_leaf_remove()
1475 ASSERT(INT_GET(entry->nameidx, ARCH_CONVERT) >= INT_GET(hdr->firstused, ARCH_CONVERT)); in xfs_dir_leaf_remove()
1476 ASSERT(INT_GET(entry->nameidx, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_remove()
1484 tablesize = INT_GET(hdr->count, ARCH_CONVERT) * (uint)sizeof(xfs_dir_leaf_entry_t) in xfs_dir_leaf_remove()
1487 tmp = INT_GET(map->size, ARCH_CONVERT); in xfs_dir_leaf_remove()
1492 ASSERT(INT_GET(map->base, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_remove()
1493 ASSERT(INT_GET(map->size, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_remove()
1494 if (INT_GET(map->base, ARCH_CONVERT) == tablesize) { in xfs_dir_leaf_remove()
1495 INT_MOD(map->base, ARCH_CONVERT, -((uint)sizeof(xfs_dir_leaf_entry_t))); in xfs_dir_leaf_remove()
1496 INT_MOD(map->size, ARCH_CONVERT, (uint)sizeof(xfs_dir_leaf_entry_t)); in xfs_dir_leaf_remove()
1499 …if ((INT_GET(map->base, ARCH_CONVERT) + INT_GET(map->size, ARCH_CONVERT)) == INT_GET(entry->nameid… in xfs_dir_leaf_remove()
1501 …} else if (INT_GET(map->base, ARCH_CONVERT) == (INT_GET(entry->nameidx, ARCH_CONVERT) + entsize)) { in xfs_dir_leaf_remove()
1503 } else if (INT_GET(map->size, ARCH_CONVERT) < tmp) { in xfs_dir_leaf_remove()
1504 tmp = INT_GET(map->size, ARCH_CONVERT); in xfs_dir_leaf_remove()
1516 INT_MOD(map->size, ARCH_CONVERT, entsize); in xfs_dir_leaf_remove()
1517 INT_MOD(map->size, ARCH_CONVERT, INT_GET(hdr->freemap[after].size, ARCH_CONVERT)); in xfs_dir_leaf_remove()
1518 INT_ZERO(hdr->freemap[after].base, ARCH_CONVERT); in xfs_dir_leaf_remove()
1519 INT_ZERO(hdr->freemap[after].size, ARCH_CONVERT); in xfs_dir_leaf_remove()
1522 INT_MOD(map->size, ARCH_CONVERT, entsize); in xfs_dir_leaf_remove()
1525 INT_COPY(map->base, entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_remove()
1526 INT_MOD(map->size, ARCH_CONVERT, entsize); in xfs_dir_leaf_remove()
1533 if (INT_GET(map->size, ARCH_CONVERT) < entsize) { in xfs_dir_leaf_remove()
1534 INT_COPY(map->base, entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_remove()
1535 INT_SET(map->size, ARCH_CONVERT, entsize); in xfs_dir_leaf_remove()
1542 if (INT_GET(entry->nameidx, ARCH_CONVERT) == INT_GET(hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_remove()
1550 namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_remove()
1554 INT_MOD(hdr->namebytes, ARCH_CONVERT, -(entry->namelen)); in xfs_dir_leaf_remove()
1555 tmp = (INT_GET(hdr->count, ARCH_CONVERT) - index) * (uint)sizeof(xfs_dir_leaf_entry_t); in xfs_dir_leaf_remove()
1557 INT_MOD(hdr->count, ARCH_CONVERT, -1); in xfs_dir_leaf_remove()
1560 entry = &leaf->entries[INT_GET(hdr->count, ARCH_CONVERT)]; in xfs_dir_leaf_remove()
1572 for (i = INT_GET(hdr->count, ARCH_CONVERT)-1; i >= 0; entry++, i--) { in xfs_dir_leaf_remove()
1573 ASSERT(INT_GET(entry->nameidx, ARCH_CONVERT) >= INT_GET(hdr->firstused, ARCH_CONVERT)); in xfs_dir_leaf_remove()
1574 ASSERT(INT_GET(entry->nameidx, ARCH_CONVERT) < XFS_LBSIZE(mp)); in xfs_dir_leaf_remove()
1575 if (INT_GET(entry->nameidx, ARCH_CONVERT) < tmp) in xfs_dir_leaf_remove()
1576 tmp = INT_GET(entry->nameidx, ARCH_CONVERT); in xfs_dir_leaf_remove()
1578 INT_SET(hdr->firstused, ARCH_CONVERT, tmp); in xfs_dir_leaf_remove()
1579 if (INT_ISZERO(hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_remove()
1580 INT_SET(hdr->firstused, ARCH_CONVERT, tmp - 1); in xfs_dir_leaf_remove()
1592 tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * (uint)sizeof(xfs_dir_leaf_entry_t); in xfs_dir_leaf_remove()
1593 tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * ((uint)sizeof(xfs_dir_leaf_name_t) - 1); in xfs_dir_leaf_remove()
1594 tmp += INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); in xfs_dir_leaf_remove()
1620 ASSERT(INT_GET(drop_leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_unbalance()
1621 ASSERT(INT_GET(save_leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_unbalance()
1628 drop_blk->hashval = INT_GET(drop_leaf->entries[ drop_leaf->hdr.count-1 ].hashval, ARCH_CONVERT); in xfs_dir_leaf_unbalance()
1642 (int)INT_GET(drop_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1645 save_leaf, INT_GET(save_hdr->count, ARCH_CONVERT), in xfs_dir_leaf_unbalance()
1646 (int)INT_GET(drop_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1659 INT_ZERO(tmp_hdr->count, ARCH_CONVERT); in xfs_dir_leaf_unbalance()
1660 INT_SET(tmp_hdr->firstused, ARCH_CONVERT, state->blocksize); in xfs_dir_leaf_unbalance()
1661 if (INT_ISZERO(tmp_hdr->firstused, ARCH_CONVERT)) in xfs_dir_leaf_unbalance()
1662 INT_SET(tmp_hdr->firstused, ARCH_CONVERT, state->blocksize - 1); in xfs_dir_leaf_unbalance()
1663 INT_ZERO(tmp_hdr->namebytes, ARCH_CONVERT); in xfs_dir_leaf_unbalance()
1666 (int)INT_GET(drop_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1668 tmp_leaf, INT_GET(tmp_leaf->hdr.count, ARCH_CONVERT), in xfs_dir_leaf_unbalance()
1669 (int)INT_GET(save_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1672 (int)INT_GET(save_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1674 tmp_leaf, INT_GET(tmp_leaf->hdr.count, ARCH_CONVERT), in xfs_dir_leaf_unbalance()
1675 (int)INT_GET(drop_hdr->count, ARCH_CONVERT), mp); in xfs_dir_leaf_unbalance()
1687 …INT_GET(save_leaf->entries[ INT_GET(save_leaf->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); in xfs_dir_leaf_unbalance()
1716 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_lookup_int()
1717 ASSERT(INT_GET(leaf->hdr.count, ARCH_CONVERT) < (XFS_LBSIZE(args->dp->i_mount)/8)); in xfs_dir_leaf_lookup_int()
1723 probe = span = INT_GET(leaf->hdr.count, ARCH_CONVERT) / 2; in xfs_dir_leaf_lookup_int()
1727 if (INT_GET(entry->hashval, ARCH_CONVERT) < hashval) in xfs_dir_leaf_lookup_int()
1729 else if (INT_GET(entry->hashval, ARCH_CONVERT) > hashval) in xfs_dir_leaf_lookup_int()
1735 …((INT_ISZERO(leaf->hdr.count, ARCH_CONVERT)) || (probe < INT_GET(leaf->hdr.count, ARCH_CONVERT)))); in xfs_dir_leaf_lookup_int()
1736 ASSERT((span <= 4) || (INT_GET(entry->hashval, ARCH_CONVERT) == hashval)); in xfs_dir_leaf_lookup_int()
1742 while ((probe > 0) && (INT_GET(entry->hashval, ARCH_CONVERT) >= hashval)) { in xfs_dir_leaf_lookup_int()
1746 …while ((probe < INT_GET(leaf->hdr.count, ARCH_CONVERT)) && (INT_GET(entry->hashval, ARCH_CONVERT) … in xfs_dir_leaf_lookup_int()
1750 …if ((probe == INT_GET(leaf->hdr.count, ARCH_CONVERT)) || (INT_GET(entry->hashval, ARCH_CONVERT) !=… in xfs_dir_leaf_lookup_int()
1759 …while ((probe < INT_GET(leaf->hdr.count, ARCH_CONVERT)) && (INT_GET(entry->hashval, ARCH_CONVERT) … in xfs_dir_leaf_lookup_int()
1760 namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_lookup_int()
1764 XFS_DIR_SF_GET_DIRINO_ARCH(&namest->inumber, &args->inumber, ARCH_CONVERT); in xfs_dir_leaf_lookup_int()
1772 ASSERT(probe == INT_GET(leaf->hdr.count, ARCH_CONVERT) || args->oknoent); in xfs_dir_leaf_lookup_int()
1803 ASSERT(INT_GET(leaf_s->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_moveents()
1804 ASSERT(INT_GET(leaf_d->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_moveents()
1807 …ASSERT((INT_GET(hdr_s->count, ARCH_CONVERT) > 0) && (INT_GET(hdr_s->count, ARCH_CONVERT) < (XFS_LB… in xfs_dir_leaf_moveents()
1808 ASSERT(INT_GET(hdr_s->firstused, ARCH_CONVERT) >= in xfs_dir_leaf_moveents()
1809 ((INT_GET(hdr_s->count, ARCH_CONVERT)*sizeof(*entry_s))+sizeof(*hdr_s))); in xfs_dir_leaf_moveents()
1810 ASSERT(INT_GET(hdr_d->count, ARCH_CONVERT) < (XFS_LBSIZE(mp)/8)); in xfs_dir_leaf_moveents()
1811 ASSERT(INT_GET(hdr_d->firstused, ARCH_CONVERT) >= in xfs_dir_leaf_moveents()
1812 ((INT_GET(hdr_d->count, ARCH_CONVERT)*sizeof(*entry_d))+sizeof(*hdr_d))); in xfs_dir_leaf_moveents()
1814 ASSERT(start_s < INT_GET(hdr_s->count, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1815 ASSERT(start_d <= INT_GET(hdr_d->count, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1816 ASSERT(count <= INT_GET(hdr_s->count, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1821 if (start_d < INT_GET(hdr_d->count, ARCH_CONVERT)) { in xfs_dir_leaf_moveents()
1822 tmp = INT_GET(hdr_d->count, ARCH_CONVERT) - start_d; in xfs_dir_leaf_moveents()
1836 ASSERT(INT_GET(entry_s->nameidx, ARCH_CONVERT) >= INT_GET(hdr_s->firstused, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1838 INT_MOD(hdr_d->firstused, ARCH_CONVERT, -(tmp)); in xfs_dir_leaf_moveents()
1840 INT_COPY(entry_d->nameidx, hdr_d->firstused, ARCH_CONVERT); in xfs_dir_leaf_moveents()
1842 ASSERT(INT_GET(entry_d->nameidx, ARCH_CONVERT) + tmp <= XFS_LBSIZE(mp)); in xfs_dir_leaf_moveents()
1843 memcpy(XFS_DIR_LEAF_NAMESTRUCT(leaf_d, INT_GET(entry_d->nameidx, ARCH_CONVERT)), in xfs_dir_leaf_moveents()
1844 XFS_DIR_LEAF_NAMESTRUCT(leaf_s, INT_GET(entry_s->nameidx, ARCH_CONVERT)), tmp); in xfs_dir_leaf_moveents()
1845 ASSERT(INT_GET(entry_s->nameidx, ARCH_CONVERT) + tmp <= XFS_LBSIZE(mp)); in xfs_dir_leaf_moveents()
1846 memset((char *)XFS_DIR_LEAF_NAMESTRUCT(leaf_s, INT_GET(entry_s->nameidx, ARCH_CONVERT)), in xfs_dir_leaf_moveents()
1848 INT_MOD(hdr_s->namebytes, ARCH_CONVERT, -(entry_d->namelen)); in xfs_dir_leaf_moveents()
1849 INT_MOD(hdr_d->namebytes, ARCH_CONVERT, entry_d->namelen); in xfs_dir_leaf_moveents()
1850 INT_MOD(hdr_s->count, ARCH_CONVERT, -1); in xfs_dir_leaf_moveents()
1851 INT_MOD(hdr_d->count, ARCH_CONVERT, +1); in xfs_dir_leaf_moveents()
1852 tmp = INT_GET(hdr_d->count, ARCH_CONVERT) * (uint)sizeof(xfs_dir_leaf_entry_t) in xfs_dir_leaf_moveents()
1854 ASSERT(INT_GET(hdr_d->firstused, ARCH_CONVERT) >= tmp); in xfs_dir_leaf_moveents()
1861 if (start_s == INT_GET(hdr_s->count, ARCH_CONVERT)) { in xfs_dir_leaf_moveents()
1871 tmp = INT_GET(hdr_s->count, ARCH_CONVERT) - count; in xfs_dir_leaf_moveents()
1878 entry_s = &leaf_s->entries[INT_GET(hdr_s->count, ARCH_CONVERT)]; in xfs_dir_leaf_moveents()
1886 INT_SET(hdr_d->freemap[0].base, ARCH_CONVERT, (uint)sizeof(xfs_dir_leaf_hdr_t)); in xfs_dir_leaf_moveents()
1887 …INT_MOD(hdr_d->freemap[0].base, ARCH_CONVERT, INT_GET(hdr_d->count, ARCH_CONVERT) * (uint)sizeof(x… in xfs_dir_leaf_moveents()
1888 …T(hdr_d->freemap[0].size, ARCH_CONVERT, INT_GET(hdr_d->firstused, ARCH_CONVERT) - INT_GET(hdr_d->f… in xfs_dir_leaf_moveents()
1889 INT_SET(hdr_d->freemap[1].base, ARCH_CONVERT, INT_ZERO(hdr_d->freemap[2].base, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1890 INT_SET(hdr_d->freemap[1].size, ARCH_CONVERT, INT_ZERO(hdr_d->freemap[2].size, ARCH_CONVERT)); in xfs_dir_leaf_moveents()
1904 ASSERT((INT_GET(leaf1->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC) && in xfs_dir_leaf_order()
1905 (INT_GET(leaf2->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC)); in xfs_dir_leaf_order()
1906 …if ((INT_GET(leaf1->hdr.count, ARCH_CONVERT) > 0) && (INT_GET(leaf2->hdr.count, ARCH_CONVERT) > 0)… in xfs_dir_leaf_order()
1907 ((INT_GET(leaf2->entries[ 0 ].hashval, ARCH_CONVERT) < in xfs_dir_leaf_order()
1908 INT_GET(leaf1->entries[ 0 ].hashval, ARCH_CONVERT)) || in xfs_dir_leaf_order()
1909 (INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < in xfs_dir_leaf_order()
1910 … INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { in xfs_dir_leaf_order()
1925 ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC); in xfs_dir_leaf_lasthash()
1927 *count = INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_lasthash()
1928 if (INT_ISZERO(leaf->hdr.count, ARCH_CONVERT)) in xfs_dir_leaf_lasthash()
1930 return(INT_GET(leaf->entries[ INT_GET(leaf->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)); in xfs_dir_leaf_lasthash()
1961 if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) { in xfs_dir_leaf_getdents_int()
1976 i < INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_getdents_int()
1980 INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_getdents_int()
1990 if (INT_GET(entry->hashval, ARCH_CONVERT) >= cookhash) { in xfs_dir_leaf_getdents_int()
1992 && INT_GET(entry->hashval, ARCH_CONVERT) in xfs_dir_leaf_getdents_int()
2001 && INT_GET(entry->hashval, ARCH_CONVERT) in xfs_dir_leaf_getdents_int()
2011 if (i == INT_GET(leaf->hdr.count, ARCH_CONVERT)) { in xfs_dir_leaf_getdents_int()
2013 if (!INT_GET(leaf->hdr.info.forw, ARCH_CONVERT)) in xfs_dir_leaf_getdents_int()
2032 for (; entno >= 0 && i < INT_GET(leaf->hdr.count, ARCH_CONVERT); in xfs_dir_leaf_getdents_int()
2043 INT_GET(entry->nameidx, ARCH_CONVERT)); in xfs_dir_leaf_getdents_int()
2057 if (i < (INT_GET(leaf->hdr.count, ARCH_CONVERT) - 1)) { in xfs_dir_leaf_getdents_int()
2058 nexthash = INT_GET(entry[1].hashval, ARCH_CONVERT); in xfs_dir_leaf_getdents_int()
2060 if (nexthash == INT_GET(entry->hashval, ARCH_CONVERT)) in xfs_dir_leaf_getdents_int()
2069 ARCH_CONVERT))) { in xfs_dir_leaf_getdents_int()
2085 (INT_GET(leaf2->hdr.info.magic, ARCH_CONVERT) in xfs_dir_leaf_getdents_int()
2087 || (INT_GET(leaf2->hdr.info.back, ARCH_CONVERT) in xfs_dir_leaf_getdents_int()
2098 ARCH_CONVERT); in xfs_dir_leaf_getdents_int()
2123 if ((thishash = INT_GET(entry->hashval, ARCH_CONVERT)) in xfs_dir_leaf_getdents_int()
2133 thishash = INT_GET(entry->hashval, ARCH_CONVERT); in xfs_dir_leaf_getdents_int()
2143 p.ino = XFS_GET_DIR_INO_ARCH(mp, namest->inumber, ARCH_CONVERT); in xfs_dir_leaf_getdents_int()