Lines Matching refs:ichdr

51 				   struct xfs_attr3_icleaf_hdr *ichdr,
54 struct xfs_attr3_icleaf_hdr *ichdr,
314 struct xfs_attr3_icleaf_hdr ichdr;
325 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
335 if (ichdr.firstused > mp->m_attr_geo->blksize)
337 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf))
342 if ((char *)&entries[ichdr.count] >
343 (char *)bp->b_addr + ichdr.firstused)
354 for (i = 0, ent = entries; i < ichdr.count; ent++, i++) {
355 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr,
371 if (ichdr.freemap[i].base > mp->m_attr_geo->blksize)
373 if (ichdr.freemap[i].base & 0x3)
375 if (ichdr.freemap[i].size > mp->m_attr_geo->blksize)
377 if (ichdr.freemap[i].size & 0x3)
381 end = (uint32_t)ichdr.freemap[i].base + ichdr.freemap[i].size;
382 if (end < ichdr.freemap[i].base)
1051 struct xfs_attr3_icleaf_hdr ichdr;
1069 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1110 for (i = 0; i < ichdr.count; entry++, i++) {
1214 struct xfs_attr3_icleaf_hdr ichdr;
1231 memset(&ichdr, 0, sizeof(ichdr));
1232 ichdr.firstused = args->geo->blksize;
1237 ichdr.magic = XFS_ATTR3_LEAF_MAGIC;
1243 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr);
1245 ichdr.magic = XFS_ATTR_LEAF_MAGIC;
1246 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr);
1248 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base;
1250 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1325 struct xfs_attr3_icleaf_hdr ichdr;
1335 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1336 ASSERT(args->index >= 0 && args->index <= ichdr.count);
1343 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t)
1346 if (tablesize > ichdr.firstused) {
1347 sum += ichdr.freemap[i].size;
1350 if (!ichdr.freemap[i].size)
1353 if (ichdr.freemap[i].base < ichdr.firstused)
1355 if (ichdr.freemap[i].size >= tmp) {
1356 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i);
1359 sum += ichdr.freemap[i].size;
1367 if (!ichdr.holes && sum < entsize)
1374 xfs_attr3_leaf_compact(args, &ichdr, bp);
1380 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) {
1385 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0);
1388 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1401 struct xfs_attr3_icleaf_hdr *ichdr,
1417 ASSERT(args->index >= 0 && args->index <= ichdr->count);
1423 if (args->index < ichdr->count) {
1424 tmp = ichdr->count - args->index;
1430 ichdr->count++;
1436 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize);
1437 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0);
1438 ASSERT(ichdr->freemap[mapindex].size >=
1440 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize);
1441 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0);
1443 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp);
1445 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base +
1446 ichdr->freemap[mapindex].size);
1463 ASSERT((args->index == ichdr->count - 1) ||
1499 if (be16_to_cpu(entry->nameidx) < ichdr->firstused)
1500 ichdr->firstused = be16_to_cpu(entry->nameidx);
1502 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t)
1504 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t)
1508 if (ichdr->freemap[i].base == tmp) {
1509 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t);
1510 ichdr->freemap[i].size -=
1511 min_t(uint16_t, ichdr->freemap[i].size,
1515 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index);
1926 struct xfs_attr3_icleaf_hdr ichdr;
1944 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
1946 ichdr.count * sizeof(xfs_attr_leaf_entry_t) +
1947 ichdr.usedbytes;
1959 if (ichdr.count == 0) {
1964 forward = (ichdr.forw != 0);
1986 forward = ichdr.forw < ichdr.back;
1990 blkno = ichdr.forw;
1992 blkno = ichdr.back;
2004 ichdr.usedbytes - ichdr2.usedbytes -
2005 ((ichdr.count + ichdr2.count) *
2052 struct xfs_attr3_icleaf_hdr ichdr;
2065 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2067 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8);
2068 ASSERT(args->index >= 0 && args->index < ichdr.count);
2069 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) +
2074 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused);
2083 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t)
2085 tmp = ichdr.freemap[0].size;
2090 ASSERT(ichdr.freemap[i].base < args->geo->blksize);
2091 ASSERT(ichdr.freemap[i].size < args->geo->blksize);
2092 if (ichdr.freemap[i].base == tablesize) {
2093 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t);
2094 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t);
2097 if (ichdr.freemap[i].base + ichdr.freemap[i].size ==
2100 } else if (ichdr.freemap[i].base ==
2103 } else if (ichdr.freemap[i].size < tmp) {
2104 tmp = ichdr.freemap[i].size;
2115 ichdr.freemap[before].size += entsize;
2116 ichdr.freemap[before].size += ichdr.freemap[after].size;
2117 ichdr.freemap[after].base = 0;
2118 ichdr.freemap[after].size = 0;
2120 ichdr.freemap[before].size += entsize;
2122 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx);
2123 ichdr.freemap[after].size += entsize;
2129 if (ichdr.freemap[smallest].size < entsize) {
2130 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx);
2131 ichdr.freemap[smallest].size = entsize;
2138 if (be16_to_cpu(entry->nameidx) == ichdr.firstused)
2147 ichdr.usedbytes -= entsize;
2152 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t);
2154 ichdr.count--;
2158 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count];
2170 for (i = ichdr.count - 1; i >= 0; entry++, i--) {
2171 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused);
2177 ichdr.firstused = tmp;
2178 ASSERT(ichdr.firstused != 0);
2180 ichdr.holes = 1; /* mark as needing compaction */
2182 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
2191 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) +
2192 ichdr.count * sizeof(xfs_attr_leaf_entry_t);
2331 struct xfs_attr3_icleaf_hdr ichdr;
2343 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2345 if (ichdr.count >= args->geo->blksize / 8) {
2355 probe = span = ichdr.count / 2;
2365 if (!(probe >= 0 && (!ichdr.count || probe < ichdr.count))) {
2384 while (probe < ichdr.count &&
2389 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) {
2397 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval);
2441 struct xfs_attr3_icleaf_hdr ichdr;
2447 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2448 ASSERT(ichdr.count < args->geo->blksize / 8);
2449 ASSERT(args->index < ichdr.count);
2629 struct xfs_attr3_icleaf_hdr ichdr;
2633 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr);
2636 *count = ichdr.count;
2637 if (!ichdr.count)
2639 return be32_to_cpu(entries[ichdr.count - 1].hashval);
2708 struct xfs_attr3_icleaf_hdr ichdr;
2727 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2728 ASSERT(args->index < ichdr.count);
2774 struct xfs_attr3_icleaf_hdr ichdr;
2788 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2789 ASSERT(args->index < ichdr.count);