Lines Matching refs:ichdr
63 struct xfs_attr3_icleaf_hdr *ichdr,
66 struct xfs_attr3_icleaf_hdr *ichdr,
256 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_verify() local
258 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
263 if (ichdr.magic != XFS_ATTR3_LEAF_MAGIC) in xfs_attr3_leaf_verify()
273 if (ichdr.magic != XFS_ATTR_LEAF_MAGIC) in xfs_attr3_leaf_verify()
276 if (ichdr.count == 0) in xfs_attr3_leaf_verify()
878 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_to_shortform() local
896 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
931 for (i = 0; i < ichdr.count; entry++, i++) { in xfs_attr3_leaf_to_shortform()
1036 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_create() local
1053 memset(&ichdr, 0, sizeof(ichdr)); in xfs_attr3_leaf_create()
1054 ichdr.firstused = args->geo->blksize; in xfs_attr3_leaf_create()
1059 ichdr.magic = XFS_ATTR3_LEAF_MAGIC; in xfs_attr3_leaf_create()
1065 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr); in xfs_attr3_leaf_create()
1067 ichdr.magic = XFS_ATTR_LEAF_MAGIC; in xfs_attr3_leaf_create()
1068 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr); in xfs_attr3_leaf_create()
1070 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base; in xfs_attr3_leaf_create()
1072 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1147 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_add() local
1157 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1158 ASSERT(args->index >= 0 && args->index <= ichdr.count); in xfs_attr3_leaf_add()
1165 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add()
1168 if (tablesize > ichdr.firstused) { in xfs_attr3_leaf_add()
1169 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1172 if (!ichdr.freemap[i].size) in xfs_attr3_leaf_add()
1175 if (ichdr.freemap[i].base < ichdr.firstused) in xfs_attr3_leaf_add()
1177 if (ichdr.freemap[i].size >= tmp) { in xfs_attr3_leaf_add()
1178 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i); in xfs_attr3_leaf_add()
1181 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1189 if (!ichdr.holes && sum < entsize) in xfs_attr3_leaf_add()
1196 xfs_attr3_leaf_compact(args, &ichdr, bp); in xfs_attr3_leaf_add()
1202 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) { in xfs_attr3_leaf_add()
1207 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0); in xfs_attr3_leaf_add()
1210 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1223 struct xfs_attr3_icleaf_hdr *ichdr, in xfs_attr3_leaf_add_work() argument
1239 ASSERT(args->index >= 0 && args->index <= ichdr->count); in xfs_attr3_leaf_add_work()
1245 if (args->index < ichdr->count) { in xfs_attr3_leaf_add_work()
1246 tmp = ichdr->count - args->index; in xfs_attr3_leaf_add_work()
1252 ichdr->count++; in xfs_attr3_leaf_add_work()
1258 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize); in xfs_attr3_leaf_add_work()
1259 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); in xfs_attr3_leaf_add_work()
1260 ASSERT(ichdr->freemap[mapindex].size >= in xfs_attr3_leaf_add_work()
1262 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize); in xfs_attr3_leaf_add_work()
1263 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); in xfs_attr3_leaf_add_work()
1265 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp); in xfs_attr3_leaf_add_work()
1267 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + in xfs_attr3_leaf_add_work()
1268 ichdr->freemap[mapindex].size); in xfs_attr3_leaf_add_work()
1283 ASSERT((args->index == ichdr->count - 1) || in xfs_attr3_leaf_add_work()
1319 if (be16_to_cpu(entry->nameidx) < ichdr->firstused) in xfs_attr3_leaf_add_work()
1320 ichdr->firstused = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_add_work()
1322 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1324 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1328 if (ichdr->freemap[i].base == tmp) { in xfs_attr3_leaf_add_work()
1329 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1330 ichdr->freemap[i].size -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1333 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1751 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_toosmall() local
1769 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1771 ichdr.count * sizeof(xfs_attr_leaf_entry_t) + in xfs_attr3_leaf_toosmall()
1772 ichdr.usedbytes; in xfs_attr3_leaf_toosmall()
1784 if (ichdr.count == 0) { in xfs_attr3_leaf_toosmall()
1789 forward = (ichdr.forw != 0); in xfs_attr3_leaf_toosmall()
1811 forward = ichdr.forw < ichdr.back; in xfs_attr3_leaf_toosmall()
1815 blkno = ichdr.forw; in xfs_attr3_leaf_toosmall()
1817 blkno = ichdr.back; in xfs_attr3_leaf_toosmall()
1829 ichdr.usedbytes - ichdr2.usedbytes - in xfs_attr3_leaf_toosmall()
1830 ((ichdr.count + ichdr2.count) * in xfs_attr3_leaf_toosmall()
1877 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_remove() local
1890 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
1892 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_remove()
1893 ASSERT(args->index >= 0 && args->index < ichdr.count); in xfs_attr3_leaf_remove()
1894 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) + in xfs_attr3_leaf_remove()
1899 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
1908 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_remove()
1910 tmp = ichdr.freemap[0].size; in xfs_attr3_leaf_remove()
1915 ASSERT(ichdr.freemap[i].base < args->geo->blksize); in xfs_attr3_leaf_remove()
1916 ASSERT(ichdr.freemap[i].size < args->geo->blksize); in xfs_attr3_leaf_remove()
1917 if (ichdr.freemap[i].base == tablesize) { in xfs_attr3_leaf_remove()
1918 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1919 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1922 if (ichdr.freemap[i].base + ichdr.freemap[i].size == in xfs_attr3_leaf_remove()
1925 } else if (ichdr.freemap[i].base == in xfs_attr3_leaf_remove()
1928 } else if (ichdr.freemap[i].size < tmp) { in xfs_attr3_leaf_remove()
1929 tmp = ichdr.freemap[i].size; in xfs_attr3_leaf_remove()
1940 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
1941 ichdr.freemap[before].size += ichdr.freemap[after].size; in xfs_attr3_leaf_remove()
1942 ichdr.freemap[after].base = 0; in xfs_attr3_leaf_remove()
1943 ichdr.freemap[after].size = 0; in xfs_attr3_leaf_remove()
1945 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
1947 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
1948 ichdr.freemap[after].size += entsize; in xfs_attr3_leaf_remove()
1954 if (ichdr.freemap[smallest].size < entsize) { in xfs_attr3_leaf_remove()
1955 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
1956 ichdr.freemap[smallest].size = entsize; in xfs_attr3_leaf_remove()
1963 if (be16_to_cpu(entry->nameidx) == ichdr.firstused) in xfs_attr3_leaf_remove()
1972 ichdr.usedbytes -= entsize; in xfs_attr3_leaf_remove()
1977 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1979 ichdr.count--; in xfs_attr3_leaf_remove()
1983 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
1995 for (i = ichdr.count - 1; i >= 0; entry++, i--) { in xfs_attr3_leaf_remove()
1996 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
2002 ichdr.firstused = tmp; in xfs_attr3_leaf_remove()
2003 ASSERT(ichdr.firstused != 0); in xfs_attr3_leaf_remove()
2005 ichdr.holes = 1; /* mark as needing compaction */ in xfs_attr3_leaf_remove()
2007 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2016 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2017 ichdr.count * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2157 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_lookup_int() local
2169 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2171 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_lookup_int()
2177 probe = span = ichdr.count / 2; in xfs_attr3_leaf_lookup_int()
2187 ASSERT(probe >= 0 && (!ichdr.count || probe < ichdr.count)); in xfs_attr3_leaf_lookup_int()
2198 while (probe < ichdr.count && in xfs_attr3_leaf_lookup_int()
2203 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) { in xfs_attr3_leaf_lookup_int()
2211 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval); in xfs_attr3_leaf_lookup_int()
2267 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_getvalue() local
2274 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2275 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_getvalue()
2276 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_getvalue()
2473 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr_leaf_lasthash() local
2477 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr); in xfs_attr_leaf_lasthash()
2480 *count = ichdr.count; in xfs_attr_leaf_lasthash()
2481 if (!ichdr.count) in xfs_attr_leaf_lasthash()
2483 return be32_to_cpu(entries[ichdr.count - 1].hashval); in xfs_attr_leaf_lasthash()
2552 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_clearflag() local
2571 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2572 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_clearflag()
2621 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_setflag() local
2635 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2636 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_setflag()