Lines Matching refs:xh
252 struct ocfs2_xattr_header *xh,
942 struct ocfs2_xattr_header *xh; in ocfs2_has_inline_xattr_value_outside() local
945 xh = (struct ocfs2_xattr_header *) in ocfs2_has_inline_xattr_value_outside()
949 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) in ocfs2_has_inline_xattr_value_outside()
950 if (!ocfs2_xattr_is_local(&xh->xh_entries[i])) in ocfs2_has_inline_xattr_value_outside()
1564 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_get_free_start() local
1565 int i, count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_get_free_start()
1569 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_get_free_start()
1610 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_wipe_namevalue() local
1611 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_wipe_namevalue()
1618 memmove((char *)xh + first_namevalue_offset + namevalue_size, in ocfs2_xa_block_wipe_namevalue()
1619 (char *)xh + first_namevalue_offset, in ocfs2_xa_block_wipe_namevalue()
1621 memset((char *)xh + first_namevalue_offset, 0, namevalue_size); in ocfs2_xa_block_wipe_namevalue()
1625 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_wipe_namevalue()
1627 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, in ocfs2_xa_block_wipe_namevalue()
1792 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_entry() local
1793 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_bucket_add_entry()
1803 tmp_xe = &xh->xh_entries[tmp]; in ocfs2_xa_bucket_add_entry()
1816 memmove(&xh->xh_entries[low + 1], in ocfs2_xa_bucket_add_entry()
1817 &xh->xh_entries[low], in ocfs2_xa_bucket_add_entry()
1820 le16_add_cpu(&xh->xh_count, 1); in ocfs2_xa_bucket_add_entry()
1821 loc->xl_entry = &xh->xh_entries[low]; in ocfs2_xa_bucket_add_entry()
1828 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_namevalue() local
1835 xh->xh_free_start = cpu_to_le16(nameval_offset); in ocfs2_xa_bucket_add_namevalue()
1836 le16_add_cpu(&xh->xh_name_value_len, size); in ocfs2_xa_bucket_add_namevalue()
1914 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_remove_entry() local
1920 le16_add_cpu(&xh->xh_count, -1); in ocfs2_xa_remove_entry()
1921 count = le16_to_cpu(xh->xh_count); in ocfs2_xa_remove_entry()
1929 index = ((char *)entry - (char *)&xh->xh_entries) / in ocfs2_xa_remove_entry()
1931 memmove(&xh->xh_entries[index], &xh->xh_entries[index + 1], in ocfs2_xa_remove_entry()
1933 memset(&xh->xh_entries[count], 0, in ocfs2_xa_remove_entry()
3732 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket() local
3741 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_find_xe_in_bucket()
3742 xe = &xh->xh_entries[i]; in ocfs2_find_xe_in_bucket()
3756 xh, in ocfs2_find_xe_in_bucket()
3797 struct ocfs2_xattr_header *xh = NULL; in ocfs2_xattr_bucket_find() local
3819 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3820 high_bucket = le16_to_cpu(xh->xh_num_buckets) - 1; in ocfs2_xattr_bucket_find()
3832 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3833 xe = &xh->xh_entries[0]; in ocfs2_xattr_bucket_find()
3844 if (xh->xh_count) in ocfs2_xattr_bucket_find()
3845 xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1]; in ocfs2_xattr_bucket_find()
4005 struct ocfs2_xattr_header *xh, in ocfs2_xattr_bucket_get_name_value() argument
4012 if (index < 0 || index >= le16_to_cpu(xh->xh_count)) in ocfs2_xattr_bucket_get_name_value()
4015 name_offset = le16_to_cpu(xh->xh_entries[index].xe_name_offset); in ocfs2_xattr_bucket_get_name_value()
4175 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket() local
4201 xh->xh_count = xb_xh->xh_count; in ocfs2_cp_xattr_block_to_bucket()
4202 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_cp_xattr_block_to_bucket()
4203 xh->xh_name_value_len = cpu_to_le16(size); in ocfs2_cp_xattr_block_to_bucket()
4204 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE - size); in ocfs2_cp_xattr_block_to_bucket()
4216 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); in ocfs2_cp_xattr_block_to_bucket()
4371 struct ocfs2_xattr_header *xh; in ocfs2_defrag_xattr_bucket() local
4401 xh = (struct ocfs2_xattr_header *)bucket_buf; in ocfs2_defrag_xattr_bucket()
4402 entries = (char *)xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4403 xh_free_start = le16_to_cpu(xh->xh_free_start); in ocfs2_defrag_xattr_bucket()
4406 (unsigned long long)blkno, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4407 xh_free_start, le16_to_cpu(xh->xh_name_value_len)); in ocfs2_defrag_xattr_bucket()
4414 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4419 xe = xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4421 for (i = 0; i < le16_to_cpu(xh->xh_count); i++, xe++) { in ocfs2_defrag_xattr_bucket()
4453 xh->xh_free_start = cpu_to_le16(end); in ocfs2_defrag_xattr_bucket()
4456 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4563 static int ocfs2_xattr_find_divide_pos(struct ocfs2_xattr_header *xh) in ocfs2_xattr_find_divide_pos() argument
4565 struct ocfs2_xattr_entry *entries = xh->xh_entries; in ocfs2_xattr_find_divide_pos()
4566 int count = le16_to_cpu(xh->xh_count); in ocfs2_xattr_find_divide_pos()
4615 struct ocfs2_xattr_header *xh; in ocfs2_divide_xattr_bucket() local
4667 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4668 count = le16_to_cpu(xh->xh_count); in ocfs2_divide_xattr_bucket()
4669 start = ocfs2_xattr_find_divide_pos(xh); in ocfs2_divide_xattr_bucket()
4672 xe = &xh->xh_entries[start-1]; in ocfs2_divide_xattr_bucket()
4682 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4683 xh->xh_free_start = cpu_to_le16(blocksize); in ocfs2_divide_xattr_bucket()
4684 xh->xh_entries[0].xe_name_hash = xe->xe_name_hash; in ocfs2_divide_xattr_bucket()
4685 le32_add_cpu(&xh->xh_entries[0].xe_name_hash, 1); in ocfs2_divide_xattr_bucket()
4694 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4703 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4717 xe = &xh->xh_entries[start]; in ocfs2_divide_xattr_bucket()
4720 (int)((char *)xe - (char *)xh), in ocfs2_divide_xattr_bucket()
4721 (int)((char *)xh->xh_entries - (char *)xh)); in ocfs2_divide_xattr_bucket()
4722 memmove((char *)xh->xh_entries, (char *)xe, len); in ocfs2_divide_xattr_bucket()
4723 xe = &xh->xh_entries[count - start]; in ocfs2_divide_xattr_bucket()
4727 le16_add_cpu(&xh->xh_count, -start); in ocfs2_divide_xattr_bucket()
4728 le16_add_cpu(&xh->xh_name_value_len, -name_value_len); in ocfs2_divide_xattr_bucket()
4731 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE); in ocfs2_divide_xattr_bucket()
4732 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_divide_xattr_bucket()
4733 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4735 le16_to_cpu(xh->xh_free_start)) in ocfs2_divide_xattr_bucket()
4736 xh->xh_free_start = xe->xe_name_offset; in ocfs2_divide_xattr_bucket()
4742 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_divide_xattr_bucket()
4744 xh->xh_num_buckets = 0; in ocfs2_divide_xattr_bucket()
4750 *first_hash = le32_to_cpu(xh->xh_entries[0].xe_name_hash); in ocfs2_divide_xattr_bucket()
4760 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4761 memset(&xh->xh_entries[start], 0, in ocfs2_divide_xattr_bucket()
4763 xh->xh_count = cpu_to_le16(start); in ocfs2_divide_xattr_bucket()
4764 xh->xh_free_start = cpu_to_le16(name_offset); in ocfs2_divide_xattr_bucket()
4765 xh->xh_name_value_len = cpu_to_le16(name_value_len); in ocfs2_divide_xattr_bucket()
5353 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate() local
5359 xe = &xh->xh_entries[xe_off]; in ocfs2_xattr_bucket_value_truncate()
5511 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision() local
5514 if (name_hash != le32_to_cpu(xh->xh_entries[0].xe_name_hash)) in ocfs2_check_xattr_bucket_collision()
5517 if (xh->xh_entries[le16_to_cpu(xh->xh_count) - 1].xe_name_hash == in ocfs2_check_xattr_bucket_collision()
5518 xh->xh_entries[0].xe_name_hash) { in ocfs2_check_xattr_bucket_collision()
5522 le32_to_cpu(xh->xh_entries[0].xe_name_hash)); in ocfs2_check_xattr_bucket_collision()
5647 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket() local
5660 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_delete_xattr_in_bucket()
5661 xe = &xh->xh_entries[i]; in ocfs2_delete_xattr_in_bucket()
5988 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root() local
5989 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_tree_value_root()
6025 struct ocfs2_xattr_header *xh = in ocfs2_xattr_bucket_value_refcount() local
6044 le16_to_cpu(xh->xh_count)); in ocfs2_xattr_bucket_value_refcount()
6045 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_xattr_bucket_value_refcount()
6046 xe = &xh->xh_entries[i]; in ocfs2_xattr_bucket_value_refcount()
6184 struct ocfs2_xattr_header *xh,
6197 struct ocfs2_xattr_header *xh, in ocfs2_value_metas_in_xattr_header() argument
6207 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_value_metas_in_xattr_header()
6208 xe = &xh->xh_entries[i]; in ocfs2_value_metas_in_xattr_header()
6212 ret = func(sb, bh, xh, i, &xv, NULL, para); in ocfs2_value_metas_in_xattr_header()
6242 struct ocfs2_xattr_header *xh, in ocfs2_get_xattr_value_root() argument
6248 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_value_root()
6250 *xv = (struct ocfs2_xattr_value_root *)((void *)xh + in ocfs2_get_xattr_value_root()
6265 struct ocfs2_xattr_header *xh, in ocfs2_reflink_lock_xattr_allocators() argument
6276 ret = ocfs2_value_metas_in_xattr_header(osb->sb, NULL, xh, in ocfs2_reflink_lock_xattr_allocators()
6323 struct ocfs2_xattr_header *xh, in ocfs2_reflink_xattr_header() argument
6341 le16_to_cpu(xh->xh_count)); in ocfs2_reflink_xattr_header()
6344 for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { in ocfs2_reflink_xattr_header()
6345 xe = &xh->xh_entries[i]; in ocfs2_reflink_xattr_header()
6369 ret = func(sb, old_bh, xh, i, &xv, NULL, para); in ocfs2_reflink_xattr_header()
6454 struct ocfs2_xattr_header *xh = (struct ocfs2_xattr_header *) in ocfs2_reflink_xattr_inline() local
6466 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_inline()
6493 ret = ocfs2_reflink_xattr_header(handle, args, args->old_bh, xh, in ocfs2_reflink_xattr_inline()
6576 struct ocfs2_xattr_header *xh = &xb->xb_attrs.xb_header; in ocfs2_reflink_xattr_block() local
6586 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_block()
6622 ret = ocfs2_reflink_xattr_header(handle, args, blk_bh, xh, in ocfs2_reflink_xattr_block()
6666 struct ocfs2_xattr_header *xh, in ocfs2_get_reflink_xattr_value_root() argument
6693 struct ocfs2_xattr_header *xh, in ocfs2_value_tree_metas_in_bucket() argument
6712 struct ocfs2_xattr_header *xh = in ocfs2_calc_value_tree_metas() local
6718 xh, &metas->num_metas, in ocfs2_calc_value_tree_metas()