Lines Matching refs:ichdr
62 struct xfs_attr3_icleaf_hdr *ichdr,
65 struct xfs_attr3_icleaf_hdr *ichdr,
255 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_verify() local
257 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
262 if (ichdr.magic != XFS_ATTR3_LEAF_MAGIC) in xfs_attr3_leaf_verify()
270 if (ichdr.magic != XFS_ATTR_LEAF_MAGIC) in xfs_attr3_leaf_verify()
273 if (ichdr.count == 0) in xfs_attr3_leaf_verify()
874 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_to_shortform() local
892 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
927 for (i = 0; i < ichdr.count; entry++, i++) { in xfs_attr3_leaf_to_shortform()
1032 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_create() local
1049 memset(&ichdr, 0, sizeof(ichdr)); in xfs_attr3_leaf_create()
1050 ichdr.firstused = args->geo->blksize; in xfs_attr3_leaf_create()
1055 ichdr.magic = XFS_ATTR3_LEAF_MAGIC; in xfs_attr3_leaf_create()
1061 ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr); in xfs_attr3_leaf_create()
1063 ichdr.magic = XFS_ATTR_LEAF_MAGIC; in xfs_attr3_leaf_create()
1064 ichdr.freemap[0].base = sizeof(struct xfs_attr_leaf_hdr); in xfs_attr3_leaf_create()
1066 ichdr.freemap[0].size = ichdr.firstused - ichdr.freemap[0].base; in xfs_attr3_leaf_create()
1068 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1143 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_add() local
1153 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1154 ASSERT(args->index >= 0 && args->index <= ichdr.count); in xfs_attr3_leaf_add()
1161 tablesize = (ichdr.count + 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add()
1164 if (tablesize > ichdr.firstused) { in xfs_attr3_leaf_add()
1165 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1168 if (!ichdr.freemap[i].size) in xfs_attr3_leaf_add()
1171 if (ichdr.freemap[i].base < ichdr.firstused) in xfs_attr3_leaf_add()
1173 if (ichdr.freemap[i].size >= tmp) { in xfs_attr3_leaf_add()
1174 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, i); in xfs_attr3_leaf_add()
1177 sum += ichdr.freemap[i].size; in xfs_attr3_leaf_add()
1185 if (!ichdr.holes && sum < entsize) in xfs_attr3_leaf_add()
1192 xfs_attr3_leaf_compact(args, &ichdr, bp); in xfs_attr3_leaf_add()
1198 if (ichdr.freemap[0].size < (entsize + sizeof(xfs_attr_leaf_entry_t))) { in xfs_attr3_leaf_add()
1203 tmp = xfs_attr3_leaf_add_work(bp, &ichdr, args, 0); in xfs_attr3_leaf_add()
1206 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1219 struct xfs_attr3_icleaf_hdr *ichdr, in xfs_attr3_leaf_add_work() argument
1235 ASSERT(args->index >= 0 && args->index <= ichdr->count); in xfs_attr3_leaf_add_work()
1241 if (args->index < ichdr->count) { in xfs_attr3_leaf_add_work()
1242 tmp = ichdr->count - args->index; in xfs_attr3_leaf_add_work()
1248 ichdr->count++; in xfs_attr3_leaf_add_work()
1254 ASSERT(ichdr->freemap[mapindex].base < args->geo->blksize); in xfs_attr3_leaf_add_work()
1255 ASSERT((ichdr->freemap[mapindex].base & 0x3) == 0); in xfs_attr3_leaf_add_work()
1256 ASSERT(ichdr->freemap[mapindex].size >= in xfs_attr3_leaf_add_work()
1258 ASSERT(ichdr->freemap[mapindex].size < args->geo->blksize); in xfs_attr3_leaf_add_work()
1259 ASSERT((ichdr->freemap[mapindex].size & 0x3) == 0); in xfs_attr3_leaf_add_work()
1261 ichdr->freemap[mapindex].size -= xfs_attr_leaf_newentsize(args, &tmp); in xfs_attr3_leaf_add_work()
1263 entry->nameidx = cpu_to_be16(ichdr->freemap[mapindex].base + in xfs_attr3_leaf_add_work()
1264 ichdr->freemap[mapindex].size); in xfs_attr3_leaf_add_work()
1279 ASSERT((args->index == ichdr->count - 1) || in xfs_attr3_leaf_add_work()
1315 if (be16_to_cpu(entry->nameidx) < ichdr->firstused) in xfs_attr3_leaf_add_work()
1316 ichdr->firstused = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_add_work()
1318 ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1320 tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_add_work()
1324 if (ichdr->freemap[i].base == tmp) { in xfs_attr3_leaf_add_work()
1325 ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1326 ichdr->freemap[i].size -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_add_work()
1329 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1747 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_toosmall() local
1765 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1767 ichdr.count * sizeof(xfs_attr_leaf_entry_t) + in xfs_attr3_leaf_toosmall()
1768 ichdr.usedbytes; in xfs_attr3_leaf_toosmall()
1780 if (ichdr.count == 0) { in xfs_attr3_leaf_toosmall()
1785 forward = (ichdr.forw != 0); in xfs_attr3_leaf_toosmall()
1807 forward = ichdr.forw < ichdr.back; in xfs_attr3_leaf_toosmall()
1811 blkno = ichdr.forw; in xfs_attr3_leaf_toosmall()
1813 blkno = ichdr.back; in xfs_attr3_leaf_toosmall()
1825 ichdr.usedbytes - ichdr2.usedbytes - in xfs_attr3_leaf_toosmall()
1826 ((ichdr.count + ichdr2.count) * in xfs_attr3_leaf_toosmall()
1873 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_remove() local
1886 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
1888 ASSERT(ichdr.count > 0 && ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_remove()
1889 ASSERT(args->index >= 0 && args->index < ichdr.count); in xfs_attr3_leaf_remove()
1890 ASSERT(ichdr.firstused >= ichdr.count * sizeof(*entry) + in xfs_attr3_leaf_remove()
1895 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
1904 tablesize = ichdr.count * sizeof(xfs_attr_leaf_entry_t) in xfs_attr3_leaf_remove()
1906 tmp = ichdr.freemap[0].size; in xfs_attr3_leaf_remove()
1911 ASSERT(ichdr.freemap[i].base < args->geo->blksize); in xfs_attr3_leaf_remove()
1912 ASSERT(ichdr.freemap[i].size < args->geo->blksize); in xfs_attr3_leaf_remove()
1913 if (ichdr.freemap[i].base == tablesize) { in xfs_attr3_leaf_remove()
1914 ichdr.freemap[i].base -= sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1915 ichdr.freemap[i].size += sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1918 if (ichdr.freemap[i].base + ichdr.freemap[i].size == in xfs_attr3_leaf_remove()
1921 } else if (ichdr.freemap[i].base == in xfs_attr3_leaf_remove()
1924 } else if (ichdr.freemap[i].size < tmp) { in xfs_attr3_leaf_remove()
1925 tmp = ichdr.freemap[i].size; in xfs_attr3_leaf_remove()
1936 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
1937 ichdr.freemap[before].size += ichdr.freemap[after].size; in xfs_attr3_leaf_remove()
1938 ichdr.freemap[after].base = 0; in xfs_attr3_leaf_remove()
1939 ichdr.freemap[after].size = 0; in xfs_attr3_leaf_remove()
1941 ichdr.freemap[before].size += entsize; in xfs_attr3_leaf_remove()
1943 ichdr.freemap[after].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
1944 ichdr.freemap[after].size += entsize; in xfs_attr3_leaf_remove()
1950 if (ichdr.freemap[smallest].size < entsize) { in xfs_attr3_leaf_remove()
1951 ichdr.freemap[smallest].base = be16_to_cpu(entry->nameidx); in xfs_attr3_leaf_remove()
1952 ichdr.freemap[smallest].size = entsize; in xfs_attr3_leaf_remove()
1959 if (be16_to_cpu(entry->nameidx) == ichdr.firstused) in xfs_attr3_leaf_remove()
1968 ichdr.usedbytes -= entsize; in xfs_attr3_leaf_remove()
1973 tmp = (ichdr.count - args->index) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
1975 ichdr.count--; in xfs_attr3_leaf_remove()
1979 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
1991 for (i = ichdr.count - 1; i >= 0; entry++, i--) { in xfs_attr3_leaf_remove()
1992 ASSERT(be16_to_cpu(entry->nameidx) >= ichdr.firstused); in xfs_attr3_leaf_remove()
1998 ichdr.firstused = tmp; in xfs_attr3_leaf_remove()
1999 ASSERT(ichdr.firstused != 0); in xfs_attr3_leaf_remove()
2001 ichdr.holes = 1; /* mark as needing compaction */ in xfs_attr3_leaf_remove()
2003 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2012 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2013 ichdr.count * sizeof(xfs_attr_leaf_entry_t); in xfs_attr3_leaf_remove()
2153 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_lookup_int() local
2165 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2167 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_lookup_int()
2173 probe = span = ichdr.count / 2; in xfs_attr3_leaf_lookup_int()
2183 ASSERT(probe >= 0 && (!ichdr.count || probe < ichdr.count)); in xfs_attr3_leaf_lookup_int()
2194 while (probe < ichdr.count && in xfs_attr3_leaf_lookup_int()
2199 if (probe == ichdr.count || be32_to_cpu(entry->hashval) != hashval) { in xfs_attr3_leaf_lookup_int()
2207 for (; probe < ichdr.count && (be32_to_cpu(entry->hashval) == hashval); in xfs_attr3_leaf_lookup_int()
2263 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_getvalue() local
2270 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2271 ASSERT(ichdr.count < args->geo->blksize / 8); in xfs_attr3_leaf_getvalue()
2272 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_getvalue()
2469 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr_leaf_lasthash() local
2473 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, bp->b_addr); in xfs_attr_leaf_lasthash()
2476 *count = ichdr.count; in xfs_attr_leaf_lasthash()
2477 if (!ichdr.count) in xfs_attr_leaf_lasthash()
2479 return be32_to_cpu(entries[ichdr.count - 1].hashval); in xfs_attr_leaf_lasthash()
2548 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_clearflag() local
2567 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2568 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_clearflag()
2617 struct xfs_attr3_icleaf_hdr ichdr; in xfs_attr3_leaf_setflag() local
2631 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2632 ASSERT(args->index < ichdr.count); in xfs_attr3_leaf_setflag()