Lines Matching refs:ichdr

49 				   struct xfs_attr3_icleaf_hdr *ichdr,
52 struct xfs_attr3_icleaf_hdr *ichdr,
295 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_verify() local
306 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
316 if (ichdr.firstused > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
318 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf)) in xfs_attr3_leaf_verify()
323 if ((char *)&entries[ichdr.count] > in xfs_attr3_leaf_verify()
324 (char *)bp->b_addr + ichdr.firstused) in xfs_attr3_leaf_verify()
335 for (i = 0, ent = entries; i < ichdr.count; ent++, i++) { in xfs_attr3_leaf_verify()
336 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr, in xfs_attr3_leaf_verify()
352 if (ichdr.freemap[i].base > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
354 if (ichdr.freemap[i].base & 0x3) in xfs_attr3_leaf_verify()
356 if (ichdr.freemap[i].size > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
358 if (ichdr.freemap[i].size & 0x3) in xfs_attr3_leaf_verify()
362 end = (uint32_t)ichdr.freemap[i].base + ichdr.freemap[i].size; in xfs_attr3_leaf_verify()
363 if (end < ichdr.freemap[i].base) in xfs_attr3_leaf_verify()
1098 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_to_shortform() local
1116 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1149 for (i = 0; i < ichdr.count; entry++, i++) { in xfs_attr3_leaf_to_shortform()
1252 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_create() local
1269 memset(&ichdr, 0, sizeof(ichdr)); in xfs_attr3_leaf_create()
1270 ichdr.firstused = args->geo->blksize; in xfs_attr3_leaf_create()
1275 ichdr.magic = XFS_ATTR3_LEAF_MAGIC; in xfs_attr3_leaf_create()
1281 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr); in xfs_attr3_leaf_create()
1283 ichdr.magic = XFS_ATTR_LEAF_MAGIC; in xfs_attr3_leaf_create()
1284 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr); in xfs_attr3_leaf_create()
1286 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base; in xfs_attr3_leaf_create()
1288 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1363 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_add() local
1373 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1374 ASSERT(args->index >= 0 && args->index <= ichdr.count); in xfs_attr3_leaf_add()
1381 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add()
1384 if (tablesize > ichdr.firstused) { in xfs_attr3_leaf_add()
1385 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1388 if (!ichdr.freemap[i].size) in xfs_attr3_leaf_add()
1391 if (ichdr.freemap[i].base < ichdr.firstused) in xfs_attr3_leaf_add()
1393 if (ichdr.freemap[i].size >= tmp) { in xfs_attr3_leaf_add()
1394 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i); in xfs_attr3_leaf_add()
1397 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1405 if (!ichdr.holes && sum < entsize) in xfs_attr3_leaf_add()
1412 xfs_attr3_leaf_compact(args, &ichdr, bp); in xfs_attr3_leaf_add()
1418 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) { in xfs_attr3_leaf_add()
1423 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0); in xfs_attr3_leaf_add()
1426 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1439 struct xfs_attr3_icleaf_hdr *ichdr, in xfs_attr3_leaf_add_work() argument
1455 ASSERT(args->index >= 0 && args->index <= ichdr->count); in xfs_attr3_leaf_add_work()
1461 if (args->index < ichdr->count) { in xfs_attr3_leaf_add_work()
1462 tmp = ichdr->count - args->index; in xfs_attr3_leaf_add_work()
1468 ichdr->count++; in xfs_attr3_leaf_add_work()
1474 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize); in xfs_attr3_leaf_add_work()
1475 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); in xfs_attr3_leaf_add_work()
1476 ASSERT(ichdr->freemap[mapindex].size >= in xfs_attr3_leaf_add_work()
1478 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize); in xfs_attr3_leaf_add_work()
1479 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); in xfs_attr3_leaf_add_work()
1481 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp); in xfs_attr3_leaf_add_work()
1483 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + in xfs_attr3_leaf_add_work()
1484 ichdr->freemap[mapindex].size); in xfs_attr3_leaf_add_work()
1500 ASSERT((args->index == ichdr->count - 1) || in xfs_attr3_leaf_add_work()
1536 if (be16_to_cpu(entry->nameidx) < ichdr->firstused) in xfs_attr3_leaf_add_work()
1537 ichdr->firstused = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_add_work()
1539 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1541 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1545 if (ichdr->freemap[i].base == tmp) { in xfs_attr3_leaf_add_work()
1546 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1547 ichdr->freemap[i].size -= in xfs_attr3_leaf_add_work()
1548 min_t(uint16_t, ichdr->freemap[i].size, in xfs_attr3_leaf_add_work()
1552 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1963 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_toosmall() local
1981 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1983 ichdr.count * sizeof(xfs_attr_leaf_entry_t) + in xfs_attr3_leaf_toosmall()
1984 ichdr.usedbytes; in xfs_attr3_leaf_toosmall()
1996 if (ichdr.count == 0) { in xfs_attr3_leaf_toosmall()
2001 forward = (ichdr.forw != 0); in xfs_attr3_leaf_toosmall()
2023 forward = ichdr.forw < ichdr.back; in xfs_attr3_leaf_toosmall()
2027 blkno = ichdr.forw; in xfs_attr3_leaf_toosmall()
2029 blkno = ichdr.back; in xfs_attr3_leaf_toosmall()
2041 ichdr.usedbytes - ichdr2.usedbytes - in xfs_attr3_leaf_toosmall()
2042 ((ichdr.count + ichdr2.count) * in xfs_attr3_leaf_toosmall()
2089 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_remove() local
2102 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
2104 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_remove()
2105 ASSERT(args->index >= 0 && args->index < ichdr.count); in xfs_attr3_leaf_remove()
2106 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) + in xfs_attr3_leaf_remove()
2111 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
2120 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_remove()
2122 tmp = ichdr.freemap[0].size; in xfs_attr3_leaf_remove()
2127 ASSERT(ichdr.freemap[i].base < args->geo->blksize); in xfs_attr3_leaf_remove()
2128 ASSERT(ichdr.freemap[i].size < args->geo->blksize); in xfs_attr3_leaf_remove()
2129 if (ichdr.freemap[i].base == tablesize) { in xfs_attr3_leaf_remove()
2130 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2131 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2134 if (ichdr.freemap[i].base + ichdr.freemap[i].size == in xfs_attr3_leaf_remove()
2137 } else if (ichdr.freemap[i].base == in xfs_attr3_leaf_remove()
2140 } else if (ichdr.freemap[i].size < tmp) { in xfs_attr3_leaf_remove()
2141 tmp = ichdr.freemap[i].size; in xfs_attr3_leaf_remove()
2152 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
2153 ichdr.freemap[before].size += ichdr.freemap[after].size; in xfs_attr3_leaf_remove()
2154 ichdr.freemap[after].base = 0; in xfs_attr3_leaf_remove()
2155 ichdr.freemap[after].size = 0; in xfs_attr3_leaf_remove()
2157 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
2159 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
2160 ichdr.freemap[after].size += entsize; in xfs_attr3_leaf_remove()
2166 if (ichdr.freemap[smallest].size < entsize) { in xfs_attr3_leaf_remove()
2167 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
2168 ichdr.freemap[smallest].size = entsize; in xfs_attr3_leaf_remove()
2175 if (be16_to_cpu(entry->nameidx) == ichdr.firstused) in xfs_attr3_leaf_remove()
2184 ichdr.usedbytes -= entsize; in xfs_attr3_leaf_remove()
2189 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2191 ichdr.count--; in xfs_attr3_leaf_remove()
2195 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
2207 for (i = ichdr.count - 1; i >= 0; entry++, i--) { in xfs_attr3_leaf_remove()
2208 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
2214 ichdr.firstused = tmp; in xfs_attr3_leaf_remove()
2215 ASSERT(ichdr.firstused != 0); in xfs_attr3_leaf_remove()
2217 ichdr.holes = 1; /* mark as needing compaction */ in xfs_attr3_leaf_remove()
2219 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2228 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2229 ichdr.count * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2369 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_lookup_int() local
2381 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2383 if (ichdr.count >= args->geo->blksize / 8) { in xfs_attr3_leaf_lookup_int()
2392 probe = span = ichdr.count / 2; in xfs_attr3_leaf_lookup_int()
2402 if (!(probe >= 0 && (!ichdr.count || probe < ichdr.count))) { in xfs_attr3_leaf_lookup_int()
2419 while (probe < ichdr.count && in xfs_attr3_leaf_lookup_int()
2424 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) { in xfs_attr3_leaf_lookup_int()
2432 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval); in xfs_attr3_leaf_lookup_int()
2476 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_getvalue() local
2482 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2483 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_getvalue()
2484 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_getvalue()
2664 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr_leaf_lasthash() local
2668 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr); in xfs_attr_leaf_lasthash()
2671 *count = ichdr.count; in xfs_attr_leaf_lasthash()
2672 if (!ichdr.count) in xfs_attr_leaf_lasthash()
2674 return be32_to_cpu(entries[ichdr.count - 1].hashval); in xfs_attr_leaf_lasthash()
2743 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_clearflag() local
2762 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2763 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_clearflag()
2809 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_setflag() local
2823 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2824 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_setflag()