Lines Matching defs:ichdr
50 struct xfs_attr3_icleaf_hdr *ichdr,
53 struct xfs_attr3_icleaf_hdr *ichdr,
313 struct xfs_attr3_icleaf_hdr ichdr;
324 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
334 if (ichdr.firstused > mp->m_attr_geo->blksize)
336 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf))
341 if ((char *)&entries[ichdr.count] >
342 (char *)bp->b_addr + ichdr.firstused)
353 for (i = 0, ent = entries; i < ichdr.count; ent++, i++) {
354 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr,
370 if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
372 if (ichdr.freemap[i].base & 0x3)
374 if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
376 if (ichdr.freemap[i].size & 0x3)
380 end = (uint32_t)ichdr.freemap[i].base + ichdr.freemap[i].size;
381 if (end < ichdr.freemap[i].base)
1129 struct xfs_attr3_icleaf_hdr ichdr;
1147 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1188 for (i = 0; i < ichdr.count; entry++, i++) {
1296 struct xfs_attr3_icleaf_hdr ichdr;
1313 memset(&ichdr, 0, sizeof(ichdr));
1314 ichdr.firstused = args->geo->blksize;
1319 ichdr.magic = XFS_ATTR3_LEAF_MAGIC;
1325 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr);
1327 ichdr.magic = XFS_ATTR_LEAF_MAGIC;
1328 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr);
1330 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base;
1332 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1407 struct xfs_attr3_icleaf_hdr ichdr;
1417 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1418 ASSERT(args->index >= 0 && args->index <= ichdr.count);
1425 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t)
1428 if (tablesize > ichdr.firstused) {
1429 sum += ichdr.freemap[i].size;
1432 if (!ichdr.freemap[i].size)
1435 if (ichdr.freemap[i].base < ichdr.firstused)
1437 if (ichdr.freemap[i].size >= tmp) {
1438 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i);
1441 sum += ichdr.freemap[i].size;
1449 if (!ichdr.holes && sum < entsize)
1456 xfs_attr3_leaf_compact(args, &ichdr, bp);
1462 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) {
1467 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0);
1470 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1483 struct xfs_attr3_icleaf_hdr *ichdr,
1499 ASSERT(args->index >= 0 && args->index <= ichdr->count);
1505 if (args->index < ichdr->count) {
1506 tmp = ichdr->count - args->index;
1512 ichdr->count++;
1518 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize);
1519 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0);
1520 ASSERT(ichdr->freemap[mapindex].size >=
1522 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize);
1523 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0);
1525 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp);
1527 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base +
1528 ichdr->freemap[mapindex].size);
1545 ASSERT((args->index == ichdr->count - 1) ||
1581 if (be16_to_cpu(entry->nameidx) < ichdr->firstused)
1582 ichdr->firstused = be16_to_cpu(entry->nameidx);
1584 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t)
1586 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t)
1590 if (ichdr->freemap[i].base == tmp) {
1591 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t);
1592 ichdr->freemap[i].size -=
1593 min_t(uint16_t, ichdr->freemap[i].size,
1597 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index);
2008 struct xfs_attr3_icleaf_hdr ichdr;
2026 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
2028 ichdr.count * sizeof(xfs_attr_leaf_entry_t) +
2029 ichdr.usedbytes;
2041 if (ichdr.count == 0) {
2046 forward = (ichdr.forw != 0);
2068 forward = ichdr.forw < ichdr.back;
2072 blkno = ichdr.forw;
2074 blkno = ichdr.back;
2086 ichdr.usedbytes - ichdr2.usedbytes -
2087 ((ichdr.count + ichdr2.count) *
2134 struct xfs_attr3_icleaf_hdr ichdr;
2147 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2149 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8);
2150 ASSERT(args->index >= 0 && args->index < ichdr.count);
2151 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) +
2156 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused);
2165 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t)
2167 tmp = ichdr.freemap[0].size;
2172 ASSERT(ichdr.freemap[i].base < args->geo->blksize);
2173 ASSERT(ichdr.freemap[i].size < args->geo->blksize);
2174 if (ichdr.freemap[i].base == tablesize) {
2175 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t);
2176 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t);
2179 if (ichdr.freemap[i].base + ichdr.freemap[i].size ==
2182 } else if (ichdr.freemap[i].base ==
2185 } else if (ichdr.freemap[i].size < tmp) {
2186 tmp = ichdr.freemap[i].size;
2197 ichdr.freemap[before].size += entsize;
2198 ichdr.freemap[before].size += ichdr.freemap[after].size;
2199 ichdr.freemap[after].base = 0;
2200 ichdr.freemap[after].size = 0;
2202 ichdr.freemap[before].size += entsize;
2204 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx);
2205 ichdr.freemap[after].size += entsize;
2211 if (ichdr.freemap[smallest].size < entsize) {
2212 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx);
2213 ichdr.freemap[smallest].size = entsize;
2220 if (be16_to_cpu(entry->nameidx) == ichdr.firstused)
2229 ichdr.usedbytes -= entsize;
2234 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t);
2236 ichdr.count--;
2240 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count];
2252 for (i = ichdr.count - 1; i >= 0; entry++, i--) {
2253 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused);
2259 ichdr.firstused = tmp;
2260 ASSERT(ichdr.firstused != 0);
2262 ichdr.holes = 1; /* mark as needing compaction */
2264 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
2273 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) +
2274 ichdr.count * sizeof(xfs_attr_leaf_entry_t);
2412 struct xfs_attr3_icleaf_hdr ichdr;
2424 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2426 if (ichdr.count >= args->geo->blksize / 8) {
2435 probe = span = ichdr.count / 2;
2445 if (!(probe >= 0 && (!ichdr.count || probe < ichdr.count))) {
2462 while (probe < ichdr.count &&
2467 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) {
2475 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval);
2519 struct xfs_attr3_icleaf_hdr ichdr;
2525 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2526 ASSERT(ichdr.count < args->geo->blksize / 8);
2527 ASSERT(args->index < ichdr.count);
2707 struct xfs_attr3_icleaf_hdr ichdr;
2711 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr);
2714 *count = ichdr.count;
2715 if (!ichdr.count)
2717 return be32_to_cpu(entries[ichdr.count - 1].hashval);
2786 struct xfs_attr3_icleaf_hdr ichdr;
2805 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2806 ASSERT(args->index < ichdr.count);
2852 struct xfs_attr3_icleaf_hdr ichdr;
2866 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2867 ASSERT(args->index < ichdr.count);