Lines Matching refs:ichdr

51 				   struct xfs_attr3_icleaf_hdr *ichdr,
54 struct xfs_attr3_icleaf_hdr *ichdr,
242 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_verify() local
249 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
254 if (ichdr.magic != XFS_ATTR3_LEAF_MAGIC) in xfs_attr3_leaf_verify()
264 if (ichdr.magic != XFS_ATTR_LEAF_MAGIC) in xfs_attr3_leaf_verify()
272 if (!xfs_log_in_recovery(mp) && ichdr.count == 0) in xfs_attr3_leaf_verify()
279 if (ichdr.firstused > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
281 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf)) in xfs_attr3_leaf_verify()
286 if ((char *)&entries[ichdr.count] > in xfs_attr3_leaf_verify()
287 (char *)bp->b_addr + ichdr.firstused) in xfs_attr3_leaf_verify()
303 if (ichdr.freemap[i].base > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
305 if (ichdr.freemap[i].base & 0x3) in xfs_attr3_leaf_verify()
307 if (ichdr.freemap[i].size > mp->m_attr_geo->blksize) in xfs_attr3_leaf_verify()
309 if (ichdr.freemap[i].size & 0x3) in xfs_attr3_leaf_verify()
313 end = (uint32_t)ichdr.freemap[i].base + ichdr.freemap[i].size; in xfs_attr3_leaf_verify()
314 if (end < ichdr.freemap[i].base) in xfs_attr3_leaf_verify()
991 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_to_shortform() local
1009 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1042 for (i = 0; i < ichdr.count; entry++, i++) { in xfs_attr3_leaf_to_shortform()
1147 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_create() local
1164 memset(&ichdr, 0, sizeof(ichdr)); in xfs_attr3_leaf_create()
1165 ichdr.firstused = args->geo->blksize; in xfs_attr3_leaf_create()
1170 ichdr.magic = XFS_ATTR3_LEAF_MAGIC; in xfs_attr3_leaf_create()
1176 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr); in xfs_attr3_leaf_create()
1178 ichdr.magic = XFS_ATTR_LEAF_MAGIC; in xfs_attr3_leaf_create()
1179 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr); in xfs_attr3_leaf_create()
1181 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base; in xfs_attr3_leaf_create()
1183 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1258 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_add() local
1268 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1269 ASSERT(args->index >= 0 && args->index <= ichdr.count); in xfs_attr3_leaf_add()
1276 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add()
1279 if (tablesize > ichdr.firstused) { in xfs_attr3_leaf_add()
1280 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1283 if (!ichdr.freemap[i].size) in xfs_attr3_leaf_add()
1286 if (ichdr.freemap[i].base < ichdr.firstused) in xfs_attr3_leaf_add()
1288 if (ichdr.freemap[i].size >= tmp) { in xfs_attr3_leaf_add()
1289 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i); in xfs_attr3_leaf_add()
1292 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1300 if (!ichdr.holes && sum < entsize) in xfs_attr3_leaf_add()
1307 xfs_attr3_leaf_compact(args, &ichdr, bp); in xfs_attr3_leaf_add()
1313 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) { in xfs_attr3_leaf_add()
1318 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0); in xfs_attr3_leaf_add()
1321 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1334 struct xfs_attr3_icleaf_hdr *ichdr, in xfs_attr3_leaf_add_work() argument
1350 ASSERT(args->index >= 0 && args->index <= ichdr->count); in xfs_attr3_leaf_add_work()
1356 if (args->index < ichdr->count) { in xfs_attr3_leaf_add_work()
1357 tmp = ichdr->count - args->index; in xfs_attr3_leaf_add_work()
1363 ichdr->count++; in xfs_attr3_leaf_add_work()
1369 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize); in xfs_attr3_leaf_add_work()
1370 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); in xfs_attr3_leaf_add_work()
1371 ASSERT(ichdr->freemap[mapindex].size >= in xfs_attr3_leaf_add_work()
1373 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize); in xfs_attr3_leaf_add_work()
1374 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); in xfs_attr3_leaf_add_work()
1376 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp); in xfs_attr3_leaf_add_work()
1378 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + in xfs_attr3_leaf_add_work()
1379 ichdr->freemap[mapindex].size); in xfs_attr3_leaf_add_work()
1394 ASSERT((args->index == ichdr->count - 1) || in xfs_attr3_leaf_add_work()
1430 if (be16_to_cpu(entry->nameidx) < ichdr->firstused) in xfs_attr3_leaf_add_work()
1431 ichdr->firstused = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_add_work()
1433 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1435 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1439 if (ichdr->freemap[i].base == tmp) { in xfs_attr3_leaf_add_work()
1440 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1441 ichdr->freemap[i].size -= in xfs_attr3_leaf_add_work()
1442 min_t(uint16_t, ichdr->freemap[i].size, in xfs_attr3_leaf_add_work()
1446 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1857 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_toosmall() local
1875 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1877 ichdr.count * sizeof(xfs_attr_leaf_entry_t) + in xfs_attr3_leaf_toosmall()
1878 ichdr.usedbytes; in xfs_attr3_leaf_toosmall()
1890 if (ichdr.count == 0) { in xfs_attr3_leaf_toosmall()
1895 forward = (ichdr.forw != 0); in xfs_attr3_leaf_toosmall()
1917 forward = ichdr.forw < ichdr.back; in xfs_attr3_leaf_toosmall()
1921 blkno = ichdr.forw; in xfs_attr3_leaf_toosmall()
1923 blkno = ichdr.back; in xfs_attr3_leaf_toosmall()
1935 ichdr.usedbytes - ichdr2.usedbytes - in xfs_attr3_leaf_toosmall()
1936 ((ichdr.count + ichdr2.count) * in xfs_attr3_leaf_toosmall()
1983 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_remove() local
1996 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
1998 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_remove()
1999 ASSERT(args->index >= 0 && args->index < ichdr.count); in xfs_attr3_leaf_remove()
2000 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) + in xfs_attr3_leaf_remove()
2005 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
2014 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_remove()
2016 tmp = ichdr.freemap[0].size; in xfs_attr3_leaf_remove()
2021 ASSERT(ichdr.freemap[i].base < args->geo->blksize); in xfs_attr3_leaf_remove()
2022 ASSERT(ichdr.freemap[i].size < args->geo->blksize); in xfs_attr3_leaf_remove()
2023 if (ichdr.freemap[i].base == tablesize) { in xfs_attr3_leaf_remove()
2024 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2025 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2028 if (ichdr.freemap[i].base + ichdr.freemap[i].size == in xfs_attr3_leaf_remove()
2031 } else if (ichdr.freemap[i].base == in xfs_attr3_leaf_remove()
2034 } else if (ichdr.freemap[i].size < tmp) { in xfs_attr3_leaf_remove()
2035 tmp = ichdr.freemap[i].size; in xfs_attr3_leaf_remove()
2046 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
2047 ichdr.freemap[before].size += ichdr.freemap[after].size; in xfs_attr3_leaf_remove()
2048 ichdr.freemap[after].base = 0; in xfs_attr3_leaf_remove()
2049 ichdr.freemap[after].size = 0; in xfs_attr3_leaf_remove()
2051 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
2053 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
2054 ichdr.freemap[after].size += entsize; in xfs_attr3_leaf_remove()
2060 if (ichdr.freemap[smallest].size < entsize) { in xfs_attr3_leaf_remove()
2061 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
2062 ichdr.freemap[smallest].size = entsize; in xfs_attr3_leaf_remove()
2069 if (be16_to_cpu(entry->nameidx) == ichdr.firstused) in xfs_attr3_leaf_remove()
2078 ichdr.usedbytes -= entsize; in xfs_attr3_leaf_remove()
2083 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2085 ichdr.count--; in xfs_attr3_leaf_remove()
2089 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
2101 for (i = ichdr.count - 1; i >= 0; entry++, i--) { in xfs_attr3_leaf_remove()
2102 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
2108 ichdr.firstused = tmp; in xfs_attr3_leaf_remove()
2109 ASSERT(ichdr.firstused != 0); in xfs_attr3_leaf_remove()
2111 ichdr.holes = 1; /* mark as needing compaction */ in xfs_attr3_leaf_remove()
2113 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2122 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2123 ichdr.count * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2263 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_lookup_int() local
2275 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2277 if (ichdr.count >= args->geo->blksize / 8) in xfs_attr3_leaf_lookup_int()
2284 probe = span = ichdr.count / 2; in xfs_attr3_leaf_lookup_int()
2294 if (!(probe >= 0 && (!ichdr.count || probe < ichdr.count))) in xfs_attr3_leaf_lookup_int()
2307 while (probe < ichdr.count && in xfs_attr3_leaf_lookup_int()
2312 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) { in xfs_attr3_leaf_lookup_int()
2320 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval); in xfs_attr3_leaf_lookup_int()
2376 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_getvalue() local
2383 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2384 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_getvalue()
2385 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_getvalue()
2582 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr_leaf_lasthash() local
2586 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr); in xfs_attr_leaf_lasthash()
2589 *count = ichdr.count; in xfs_attr_leaf_lasthash()
2590 if (!ichdr.count) in xfs_attr_leaf_lasthash()
2592 return be32_to_cpu(entries[ichdr.count - 1].hashval); in xfs_attr_leaf_lasthash()
2661 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_clearflag() local
2680 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2681 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_clearflag()
2730 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_setflag() local
2744 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2745 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_setflag()