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()
1568 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_get_free_start() local
1569 int i, count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_get_free_start()
1573 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_get_free_start()
1614 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_wipe_namevalue() local
1615 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_wipe_namevalue()
1622 memmove((char *)xh + first_namevalue_offset + namevalue_size, in ocfs2_xa_block_wipe_namevalue()
1623 (char *)xh + first_namevalue_offset, in ocfs2_xa_block_wipe_namevalue()
1625 memset((char *)xh + first_namevalue_offset, 0, namevalue_size); in ocfs2_xa_block_wipe_namevalue()
1629 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_wipe_namevalue()
1631 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, in ocfs2_xa_block_wipe_namevalue()
1796 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_entry() local
1797 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_bucket_add_entry()
1807 tmp_xe = &xh->xh_entries[tmp]; in ocfs2_xa_bucket_add_entry()
1820 memmove(&xh->xh_entries[low + 1], in ocfs2_xa_bucket_add_entry()
1821 &xh->xh_entries[low], in ocfs2_xa_bucket_add_entry()
1824 le16_add_cpu(&xh->xh_count, 1); in ocfs2_xa_bucket_add_entry()
1825 loc->xl_entry = &xh->xh_entries[low]; in ocfs2_xa_bucket_add_entry()
1832 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_namevalue() local
1839 xh->xh_free_start = cpu_to_le16(nameval_offset); in ocfs2_xa_bucket_add_namevalue()
1840 le16_add_cpu(&xh->xh_name_value_len, size); in ocfs2_xa_bucket_add_namevalue()
1918 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_remove_entry() local
1924 le16_add_cpu(&xh->xh_count, -1); in ocfs2_xa_remove_entry()
1925 count = le16_to_cpu(xh->xh_count); in ocfs2_xa_remove_entry()
1933 index = ((char *)entry - (char *)&xh->xh_entries) / in ocfs2_xa_remove_entry()
1935 memmove(&xh->xh_entries[index], &xh->xh_entries[index + 1], in ocfs2_xa_remove_entry()
1937 memset(&xh->xh_entries[count], 0, in ocfs2_xa_remove_entry()
3738 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket() local
3747 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_find_xe_in_bucket()
3748 xe = &xh->xh_entries[i]; in ocfs2_find_xe_in_bucket()
3762 xh, in ocfs2_find_xe_in_bucket()
3803 struct ocfs2_xattr_header *xh = NULL; in ocfs2_xattr_bucket_find() local
3825 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3826 high_bucket = le16_to_cpu(xh->xh_num_buckets) - 1; in ocfs2_xattr_bucket_find()
3838 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3839 xe = &xh->xh_entries[0]; in ocfs2_xattr_bucket_find()
3850 if (xh->xh_count) in ocfs2_xattr_bucket_find()
3851 xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1]; in ocfs2_xattr_bucket_find()
4011 struct ocfs2_xattr_header *xh, in ocfs2_xattr_bucket_get_name_value() argument
4018 if (index < 0 || index >= le16_to_cpu(xh->xh_count)) in ocfs2_xattr_bucket_get_name_value()
4021 name_offset = le16_to_cpu(xh->xh_entries[index].xe_name_offset); in ocfs2_xattr_bucket_get_name_value()
4181 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket() local
4207 xh->xh_count = xb_xh->xh_count; in ocfs2_cp_xattr_block_to_bucket()
4208 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_cp_xattr_block_to_bucket()
4209 xh->xh_name_value_len = cpu_to_le16(size); in ocfs2_cp_xattr_block_to_bucket()
4210 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE - size); in ocfs2_cp_xattr_block_to_bucket()
4222 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); in ocfs2_cp_xattr_block_to_bucket()
4377 struct ocfs2_xattr_header *xh; in ocfs2_defrag_xattr_bucket() local
4407 xh = (struct ocfs2_xattr_header *)bucket_buf; in ocfs2_defrag_xattr_bucket()
4408 entries = (char *)xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4409 xh_free_start = le16_to_cpu(xh->xh_free_start); in ocfs2_defrag_xattr_bucket()
4412 (unsigned long long)blkno, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4413 xh_free_start, le16_to_cpu(xh->xh_name_value_len)); in ocfs2_defrag_xattr_bucket()
4420 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4425 xe = xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4427 for (i = 0; i < le16_to_cpu(xh->xh_count); i++, xe++) { in ocfs2_defrag_xattr_bucket()
4459 xh->xh_free_start = cpu_to_le16(end); in ocfs2_defrag_xattr_bucket()
4462 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4569 static int ocfs2_xattr_find_divide_pos(struct ocfs2_xattr_header *xh) in ocfs2_xattr_find_divide_pos() argument
4571 struct ocfs2_xattr_entry *entries = xh->xh_entries; in ocfs2_xattr_find_divide_pos()
4572 int count = le16_to_cpu(xh->xh_count); in ocfs2_xattr_find_divide_pos()
4621 struct ocfs2_xattr_header *xh; in ocfs2_divide_xattr_bucket() local
4673 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4674 count = le16_to_cpu(xh->xh_count); in ocfs2_divide_xattr_bucket()
4675 start = ocfs2_xattr_find_divide_pos(xh); in ocfs2_divide_xattr_bucket()
4678 xe = &xh->xh_entries[start-1]; in ocfs2_divide_xattr_bucket()
4688 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4689 xh->xh_free_start = cpu_to_le16(blocksize); in ocfs2_divide_xattr_bucket()
4690 xh->xh_entries[0].xe_name_hash = xe->xe_name_hash; in ocfs2_divide_xattr_bucket()
4691 le32_add_cpu(&xh->xh_entries[0].xe_name_hash, 1); in ocfs2_divide_xattr_bucket()
4700 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4709 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4723 xe = &xh->xh_entries[start]; in ocfs2_divide_xattr_bucket()
4726 (int)((char *)xe - (char *)xh), in ocfs2_divide_xattr_bucket()
4727 (int)((char *)xh->xh_entries - (char *)xh)); in ocfs2_divide_xattr_bucket()
4728 memmove((char *)xh->xh_entries, (char *)xe, len); in ocfs2_divide_xattr_bucket()
4729 xe = &xh->xh_entries[count - start]; in ocfs2_divide_xattr_bucket()
4733 le16_add_cpu(&xh->xh_count, -start); in ocfs2_divide_xattr_bucket()
4734 le16_add_cpu(&xh->xh_name_value_len, -name_value_len); in ocfs2_divide_xattr_bucket()
4737 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE); in ocfs2_divide_xattr_bucket()
4738 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_divide_xattr_bucket()
4739 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4741 le16_to_cpu(xh->xh_free_start)) in ocfs2_divide_xattr_bucket()
4742 xh->xh_free_start = xe->xe_name_offset; in ocfs2_divide_xattr_bucket()
4748 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_divide_xattr_bucket()
4750 xh->xh_num_buckets = 0; in ocfs2_divide_xattr_bucket()
4756 *first_hash = le32_to_cpu(xh->xh_entries[0].xe_name_hash); in ocfs2_divide_xattr_bucket()
4766 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4767 memset(&xh->xh_entries[start], 0, in ocfs2_divide_xattr_bucket()
4769 xh->xh_count = cpu_to_le16(start); in ocfs2_divide_xattr_bucket()
4770 xh->xh_free_start = cpu_to_le16(name_offset); in ocfs2_divide_xattr_bucket()
4771 xh->xh_name_value_len = cpu_to_le16(name_value_len); in ocfs2_divide_xattr_bucket()
5349 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate() local
5355 xe = &xh->xh_entries[xe_off]; in ocfs2_xattr_bucket_value_truncate()
5508 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision() local
5511 if (name_hash != le32_to_cpu(xh->xh_entries[0].xe_name_hash)) in ocfs2_check_xattr_bucket_collision()
5514 if (xh->xh_entries[le16_to_cpu(xh->xh_count) - 1].xe_name_hash == in ocfs2_check_xattr_bucket_collision()
5515 xh->xh_entries[0].xe_name_hash) { in ocfs2_check_xattr_bucket_collision()
5519 le32_to_cpu(xh->xh_entries[0].xe_name_hash)); in ocfs2_check_xattr_bucket_collision()
5644 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket() local
5657 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_delete_xattr_in_bucket()
5658 xe = &xh->xh_entries[i]; in ocfs2_delete_xattr_in_bucket()
5993 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root() local
5994 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_tree_value_root()
6030 struct ocfs2_xattr_header *xh = in ocfs2_xattr_bucket_value_refcount() local
6049 le16_to_cpu(xh->xh_count)); in ocfs2_xattr_bucket_value_refcount()
6050 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_xattr_bucket_value_refcount()
6051 xe = &xh->xh_entries[i]; in ocfs2_xattr_bucket_value_refcount()
6189 struct ocfs2_xattr_header *xh,
6202 struct ocfs2_xattr_header *xh, in ocfs2_value_metas_in_xattr_header() argument
6212 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_value_metas_in_xattr_header()
6213 xe = &xh->xh_entries[i]; in ocfs2_value_metas_in_xattr_header()
6217 ret = func(sb, bh, xh, i, &xv, NULL, para); in ocfs2_value_metas_in_xattr_header()
6246 struct ocfs2_xattr_header *xh, in ocfs2_get_xattr_value_root() argument
6252 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_value_root()
6254 *xv = (struct ocfs2_xattr_value_root *)((void *)xh + in ocfs2_get_xattr_value_root()
6269 struct ocfs2_xattr_header *xh, in ocfs2_reflink_lock_xattr_allocators() argument
6280 ret = ocfs2_value_metas_in_xattr_header(osb->sb, NULL, xh, in ocfs2_reflink_lock_xattr_allocators()
6327 struct ocfs2_xattr_header *xh, in ocfs2_reflink_xattr_header() argument
6345 le16_to_cpu(xh->xh_count)); in ocfs2_reflink_xattr_header()
6348 for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { in ocfs2_reflink_xattr_header()
6349 xe = &xh->xh_entries[i]; in ocfs2_reflink_xattr_header()
6373 ret = func(sb, old_bh, xh, i, &xv, NULL, para); in ocfs2_reflink_xattr_header()
6458 struct ocfs2_xattr_header *xh = (struct ocfs2_xattr_header *) in ocfs2_reflink_xattr_inline() local
6470 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_inline()
6497 ret = ocfs2_reflink_xattr_header(handle, args, args->old_bh, xh, in ocfs2_reflink_xattr_inline()
6580 struct ocfs2_xattr_header *xh = &xb->xb_attrs.xb_header; in ocfs2_reflink_xattr_block() local
6590 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_block()
6626 ret = ocfs2_reflink_xattr_header(handle, args, blk_bh, xh, in ocfs2_reflink_xattr_block()
6670 struct ocfs2_xattr_header *xh, in ocfs2_get_reflink_xattr_value_root() argument
6697 struct ocfs2_xattr_header *xh, in ocfs2_value_tree_metas_in_bucket() argument
6716 struct ocfs2_xattr_header *xh = in ocfs2_calc_value_tree_metas() local
6722 xh, &metas->num_metas, in ocfs2_calc_value_tree_metas()