Lines Matching refs:leaf
89 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
743 xfs_attr_leafblock_t *leaf; in xfs_attr_shortform_allfit() local
748 leaf = bp->data; in xfs_attr_shortform_allfit()
749 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_shortform_allfit()
751 entry = &leaf->entries[0]; in xfs_attr_shortform_allfit()
753 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_shortform_allfit()
758 name_loc = xfs_attr_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit()
780 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_to_shortform() local
796 leaf = (xfs_attr_leafblock_t *)tmpbuffer; in xfs_attr_leaf_to_shortform()
797 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_to_shortform()
827 entry = &leaf->entries[0]; in xfs_attr_leaf_to_shortform()
828 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_leaf_to_shortform()
834 name_loc = xfs_attr_leaf_name_local(leaf, i); in xfs_attr_leaf_to_shortform()
856 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_to_node() local
893 leaf = bp2->data; in xfs_attr_leaf_to_node()
894 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_to_node()
897 leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval; in xfs_attr_leaf_to_node()
922 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_create() local
937 leaf = bp->data; in xfs_attr_leaf_create()
938 memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount)); in xfs_attr_leaf_create()
939 hdr = &leaf->hdr; in xfs_attr_leaf_create()
1020 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_add() local
1027 leaf = bp->data; in xfs_attr_leaf_add()
1028 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_add()
1030 && (args->index <= be16_to_cpu(leaf->hdr.count))); in xfs_attr_leaf_add()
1031 hdr = &leaf->hdr; in xfs_attr_leaf_add()
1091 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_add_work() local
1100 leaf = bp->data; in xfs_attr_leaf_add_work()
1101 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_add_work()
1102 hdr = &leaf->hdr; in xfs_attr_leaf_add_work()
1109 entry = &leaf->entries[args->index]; in xfs_attr_leaf_add_work()
1115 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry))); in xfs_attr_leaf_add_work()
1147 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr_leaf_add_work()
1161 name_loc = xfs_attr_leaf_name_local(leaf, args->index); in xfs_attr_leaf_add_work()
1168 name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); in xfs_attr_leaf_add_work()
1179 XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), in xfs_attr_leaf_add_work()
1180 xfs_attr_leaf_entsize(leaf, args->index))); in xfs_attr_leaf_add_work()
1201 be16_add_cpu(&hdr->usedbytes, xfs_attr_leaf_entsize(leaf, args->index)); in xfs_attr_leaf_add_work()
1203 XFS_DA_LOGRANGE(leaf, hdr, sizeof(*hdr))); in xfs_attr_leaf_add_work()
1550 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_toosmall() local
1565 leaf = (xfs_attr_leafblock_t *)info; in xfs_attr_leaf_toosmall()
1566 count = be16_to_cpu(leaf->hdr.count); in xfs_attr_leaf_toosmall()
1569 be16_to_cpu(leaf->hdr.usedbytes); in xfs_attr_leaf_toosmall()
1622 leaf = (xfs_attr_leafblock_t *)info; in xfs_attr_leaf_toosmall()
1623 count = be16_to_cpu(leaf->hdr.count); in xfs_attr_leaf_toosmall()
1625 bytes -= be16_to_cpu(leaf->hdr.usedbytes); in xfs_attr_leaf_toosmall()
1626 leaf = bp->data; in xfs_attr_leaf_toosmall()
1627 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_toosmall()
1628 count += be16_to_cpu(leaf->hdr.count); in xfs_attr_leaf_toosmall()
1629 bytes -= be16_to_cpu(leaf->hdr.usedbytes); in xfs_attr_leaf_toosmall()
1672 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_remove() local
1680 leaf = bp->data; in xfs_attr_leaf_remove()
1681 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_remove()
1682 hdr = &leaf->hdr; in xfs_attr_leaf_remove()
1690 entry = &leaf->entries[args->index]; in xfs_attr_leaf_remove()
1706 entsize = xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr_leaf_remove()
1771 memset(xfs_attr_leaf_name(leaf, args->index), 0, entsize); in xfs_attr_leaf_remove()
1774 XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index), in xfs_attr_leaf_remove()
1782 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry))); in xfs_attr_leaf_remove()
1783 entry = &leaf->entries[be16_to_cpu(hdr->count)]; in xfs_attr_leaf_remove()
1794 entry = &leaf->entries[0]; in xfs_attr_leaf_remove()
1812 XFS_DA_LOGRANGE(leaf, hdr, sizeof(*hdr))); in xfs_attr_leaf_remove()
1819 tmp += be16_to_cpu(leaf->hdr.count) * sizeof(xfs_attr_leaf_entry_t); in xfs_attr_leaf_remove()
1820 tmp += be16_to_cpu(leaf->hdr.usedbytes); in xfs_attr_leaf_remove()
1940 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_lookup_int() local
1949 leaf = bp->data; in xfs_attr_leaf_lookup_int()
1950 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_lookup_int()
1951 ASSERT(be16_to_cpu(leaf->hdr.count) in xfs_attr_leaf_lookup_int()
1958 probe = span = be16_to_cpu(leaf->hdr.count) / 2; in xfs_attr_leaf_lookup_int()
1959 for (entry = &leaf->entries[probe]; span > 4; in xfs_attr_leaf_lookup_int()
1960 entry = &leaf->entries[probe]) { in xfs_attr_leaf_lookup_int()
1970 (!leaf->hdr.count in xfs_attr_leaf_lookup_int()
1971 || (probe < be16_to_cpu(leaf->hdr.count)))); in xfs_attr_leaf_lookup_int()
1982 while ((probe < be16_to_cpu(leaf->hdr.count)) && in xfs_attr_leaf_lookup_int()
1987 if ((probe == be16_to_cpu(leaf->hdr.count)) || in xfs_attr_leaf_lookup_int()
1996 for ( ; (probe < be16_to_cpu(leaf->hdr.count)) && in xfs_attr_leaf_lookup_int()
2011 name_loc = xfs_attr_leaf_name_local(leaf, probe); in xfs_attr_leaf_lookup_int()
2021 name_rmt = xfs_attr_leaf_name_remote(leaf, probe); in xfs_attr_leaf_lookup_int()
2048 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_getvalue() local
2053 leaf = bp->data; in xfs_attr_leaf_getvalue()
2054 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_getvalue()
2055 ASSERT(be16_to_cpu(leaf->hdr.count) in xfs_attr_leaf_getvalue()
2057 ASSERT(args->index < be16_to_cpu(leaf->hdr.count)); in xfs_attr_leaf_getvalue()
2059 entry = &leaf->entries[args->index]; in xfs_attr_leaf_getvalue()
2061 name_loc = xfs_attr_leaf_name_local(leaf, args->index); in xfs_attr_leaf_getvalue()
2076 name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); in xfs_attr_leaf_getvalue()
2278 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_lasthash() local
2280 leaf = bp->data; in xfs_attr_leaf_lasthash()
2281 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_lasthash()
2283 *count = be16_to_cpu(leaf->hdr.count); in xfs_attr_leaf_lasthash()
2284 if (!leaf->hdr.count) in xfs_attr_leaf_lasthash()
2286 return be32_to_cpu(leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashval); in xfs_attr_leaf_lasthash()
2294 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) in xfs_attr_leaf_entsize() argument
2300 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_entsize()
2301 if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { in xfs_attr_leaf_entsize()
2302 name_loc = xfs_attr_leaf_name_local(leaf, index); in xfs_attr_leaf_entsize()
2306 name_rmt = xfs_attr_leaf_name_remote(leaf, index); in xfs_attr_leaf_entsize()
2344 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_list_int() local
2349 leaf = bp->data; in xfs_attr_leaf_list_int()
2359 entry = &leaf->entries[0]; in xfs_attr_leaf_list_int()
2360 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_leaf_list_int()
2373 if (i == be16_to_cpu(leaf->hdr.count)) { in xfs_attr_leaf_list_int()
2378 entry = &leaf->entries[0]; in xfs_attr_leaf_list_int()
2387 for ( ; (i < be16_to_cpu(leaf->hdr.count)); entry++, i++) { in xfs_attr_leaf_list_int()
2398 xfs_attr_leaf_name_local(leaf, i); in xfs_attr_leaf_list_int()
2410 xfs_attr_leaf_name_remote(leaf, i); in xfs_attr_leaf_list_int()
2464 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_clearflag() local
2486 leaf = bp->data; in xfs_attr_leaf_clearflag()
2487 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_clearflag()
2488 ASSERT(args->index < be16_to_cpu(leaf->hdr.count)); in xfs_attr_leaf_clearflag()
2490 entry = &leaf->entries[ args->index ]; in xfs_attr_leaf_clearflag()
2495 name_loc = xfs_attr_leaf_name_local(leaf, args->index); in xfs_attr_leaf_clearflag()
2499 name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); in xfs_attr_leaf_clearflag()
2510 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr_leaf_clearflag()
2514 name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); in xfs_attr_leaf_clearflag()
2518 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr_leaf_clearflag()
2534 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_setflag() local
2552 leaf = bp->data; in xfs_attr_leaf_setflag()
2553 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_setflag()
2554 ASSERT(args->index < be16_to_cpu(leaf->hdr.count)); in xfs_attr_leaf_setflag()
2556 entry = &leaf->entries[ args->index ]; in xfs_attr_leaf_setflag()
2561 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr_leaf_setflag()
2563 name_rmt = xfs_attr_leaf_name_remote(leaf, args->index); in xfs_attr_leaf_setflag()
2567 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr_leaf_setflag()
2869 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_inactive() local
2875 leaf = bp->data; in xfs_attr_leaf_inactive()
2876 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_inactive()
2882 entry = &leaf->entries[0]; in xfs_attr_leaf_inactive()
2883 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_leaf_inactive()
2886 name_rmt = xfs_attr_leaf_name_remote(leaf, i); in xfs_attr_leaf_inactive()
2910 entry = &leaf->entries[0]; in xfs_attr_leaf_inactive()
2911 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_leaf_inactive()
2914 name_rmt = xfs_attr_leaf_name_remote(leaf, i); in xfs_attr_leaf_inactive()