Lines Matching refs:xh
244 struct ocfs2_xattr_header *xh,
958 struct ocfs2_xattr_header *xh; in ocfs2_has_inline_xattr_value_outside() local
961 xh = (struct ocfs2_xattr_header *) in ocfs2_has_inline_xattr_value_outside()
965 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) in ocfs2_has_inline_xattr_value_outside()
966 if (!ocfs2_xattr_is_local(&xh->xh_entries[i])) in ocfs2_has_inline_xattr_value_outside()
1585 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_get_free_start() local
1586 int i, count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_get_free_start()
1590 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_get_free_start()
1631 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_wipe_namevalue() local
1632 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_wipe_namevalue()
1639 memmove((char *)xh + first_namevalue_offset + namevalue_size, in ocfs2_xa_block_wipe_namevalue()
1640 (char *)xh + first_namevalue_offset, in ocfs2_xa_block_wipe_namevalue()
1642 memset((char *)xh + first_namevalue_offset, 0, namevalue_size); in ocfs2_xa_block_wipe_namevalue()
1646 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_wipe_namevalue()
1648 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, in ocfs2_xa_block_wipe_namevalue()
1813 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_entry() local
1814 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_bucket_add_entry()
1824 tmp_xe = &xh->xh_entries[tmp]; in ocfs2_xa_bucket_add_entry()
1837 memmove(&xh->xh_entries[low + 1], in ocfs2_xa_bucket_add_entry()
1838 &xh->xh_entries[low], in ocfs2_xa_bucket_add_entry()
1841 le16_add_cpu(&xh->xh_count, 1); in ocfs2_xa_bucket_add_entry()
1842 loc->xl_entry = &xh->xh_entries[low]; in ocfs2_xa_bucket_add_entry()
1849 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_namevalue() local
1856 xh->xh_free_start = cpu_to_le16(nameval_offset); in ocfs2_xa_bucket_add_namevalue()
1857 le16_add_cpu(&xh->xh_name_value_len, size); in ocfs2_xa_bucket_add_namevalue()
1935 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_remove_entry() local
1941 le16_add_cpu(&xh->xh_count, -1); in ocfs2_xa_remove_entry()
1942 count = le16_to_cpu(xh->xh_count); in ocfs2_xa_remove_entry()
1950 index = ((char *)entry - (char *)&xh->xh_entries) / in ocfs2_xa_remove_entry()
1952 memmove(&xh->xh_entries[index], &xh->xh_entries[index + 1], in ocfs2_xa_remove_entry()
1954 memset(&xh->xh_entries[count], 0, in ocfs2_xa_remove_entry()
3757 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket() local
3766 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_find_xe_in_bucket()
3767 xe = &xh->xh_entries[i]; in ocfs2_find_xe_in_bucket()
3781 xh, in ocfs2_find_xe_in_bucket()
3822 struct ocfs2_xattr_header *xh = NULL; in ocfs2_xattr_bucket_find() local
3843 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3844 high_bucket = le16_to_cpu(xh->xh_num_buckets) - 1; in ocfs2_xattr_bucket_find()
3856 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3857 xe = &xh->xh_entries[0]; in ocfs2_xattr_bucket_find()
3868 if (xh->xh_count) in ocfs2_xattr_bucket_find()
3869 xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1]; in ocfs2_xattr_bucket_find()
4027 struct ocfs2_xattr_header *xh, in ocfs2_xattr_bucket_get_name_value() argument
4034 if (index < 0 || index >= le16_to_cpu(xh->xh_count)) in ocfs2_xattr_bucket_get_name_value()
4037 name_offset = le16_to_cpu(xh->xh_entries[index].xe_name_offset); in ocfs2_xattr_bucket_get_name_value()
4195 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket() local
4221 xh->xh_count = xb_xh->xh_count; in ocfs2_cp_xattr_block_to_bucket()
4222 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_cp_xattr_block_to_bucket()
4223 xh->xh_name_value_len = cpu_to_le16(size); in ocfs2_cp_xattr_block_to_bucket()
4224 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE - size); in ocfs2_cp_xattr_block_to_bucket()
4236 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); in ocfs2_cp_xattr_block_to_bucket()
4391 struct ocfs2_xattr_header *xh; in ocfs2_defrag_xattr_bucket() local
4421 xh = (struct ocfs2_xattr_header *)bucket_buf; in ocfs2_defrag_xattr_bucket()
4422 entries = (char *)xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4423 xh_free_start = le16_to_cpu(xh->xh_free_start); in ocfs2_defrag_xattr_bucket()
4426 (unsigned long long)blkno, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4427 xh_free_start, le16_to_cpu(xh->xh_name_value_len)); in ocfs2_defrag_xattr_bucket()
4434 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4439 xe = xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4441 for (i = 0; i < le16_to_cpu(xh->xh_count); i++, xe++) { in ocfs2_defrag_xattr_bucket()
4473 xh->xh_free_start = cpu_to_le16(end); in ocfs2_defrag_xattr_bucket()
4476 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4583 static int ocfs2_xattr_find_divide_pos(struct ocfs2_xattr_header *xh) in ocfs2_xattr_find_divide_pos() argument
4585 struct ocfs2_xattr_entry *entries = xh->xh_entries; in ocfs2_xattr_find_divide_pos()
4586 int count = le16_to_cpu(xh->xh_count); in ocfs2_xattr_find_divide_pos()
4635 struct ocfs2_xattr_header *xh; in ocfs2_divide_xattr_bucket() local
4687 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4688 count = le16_to_cpu(xh->xh_count); in ocfs2_divide_xattr_bucket()
4689 start = ocfs2_xattr_find_divide_pos(xh); in ocfs2_divide_xattr_bucket()
4692 xe = &xh->xh_entries[start-1]; in ocfs2_divide_xattr_bucket()
4702 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4703 xh->xh_free_start = cpu_to_le16(blocksize); in ocfs2_divide_xattr_bucket()
4704 xh->xh_entries[0].xe_name_hash = xe->xe_name_hash; in ocfs2_divide_xattr_bucket()
4705 le32_add_cpu(&xh->xh_entries[0].xe_name_hash, 1); in ocfs2_divide_xattr_bucket()
4714 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4723 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4737 xe = &xh->xh_entries[start]; in ocfs2_divide_xattr_bucket()
4740 (int)((char *)xe - (char *)xh), in ocfs2_divide_xattr_bucket()
4741 (int)((char *)xh->xh_entries - (char *)xh)); in ocfs2_divide_xattr_bucket()
4742 memmove((char *)xh->xh_entries, (char *)xe, len); in ocfs2_divide_xattr_bucket()
4743 xe = &xh->xh_entries[count - start]; in ocfs2_divide_xattr_bucket()
4747 le16_add_cpu(&xh->xh_count, -start); in ocfs2_divide_xattr_bucket()
4748 le16_add_cpu(&xh->xh_name_value_len, -name_value_len); in ocfs2_divide_xattr_bucket()
4751 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE); in ocfs2_divide_xattr_bucket()
4752 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_divide_xattr_bucket()
4753 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4755 le16_to_cpu(xh->xh_free_start)) in ocfs2_divide_xattr_bucket()
4756 xh->xh_free_start = xe->xe_name_offset; in ocfs2_divide_xattr_bucket()
4762 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_divide_xattr_bucket()
4764 xh->xh_num_buckets = 0; in ocfs2_divide_xattr_bucket()
4770 *first_hash = le32_to_cpu(xh->xh_entries[0].xe_name_hash); in ocfs2_divide_xattr_bucket()
4780 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4781 memset(&xh->xh_entries[start], 0, in ocfs2_divide_xattr_bucket()
4783 xh->xh_count = cpu_to_le16(start); in ocfs2_divide_xattr_bucket()
4784 xh->xh_free_start = cpu_to_le16(name_offset); in ocfs2_divide_xattr_bucket()
4785 xh->xh_name_value_len = cpu_to_le16(name_value_len); in ocfs2_divide_xattr_bucket()
5363 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate() local
5369 xe = &xh->xh_entries[xe_off]; in ocfs2_xattr_bucket_value_truncate()
5522 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision() local
5525 if (name_hash != le32_to_cpu(xh->xh_entries[0].xe_name_hash)) in ocfs2_check_xattr_bucket_collision()
5528 if (xh->xh_entries[le16_to_cpu(xh->xh_count) - 1].xe_name_hash == in ocfs2_check_xattr_bucket_collision()
5529 xh->xh_entries[0].xe_name_hash) { in ocfs2_check_xattr_bucket_collision()
5533 le32_to_cpu(xh->xh_entries[0].xe_name_hash)); in ocfs2_check_xattr_bucket_collision()
5658 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket() local
5671 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_delete_xattr_in_bucket()
5672 xe = &xh->xh_entries[i]; in ocfs2_delete_xattr_in_bucket()
6007 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root() local
6008 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_tree_value_root()
6044 struct ocfs2_xattr_header *xh = in ocfs2_xattr_bucket_value_refcount() local
6063 le16_to_cpu(xh->xh_count)); in ocfs2_xattr_bucket_value_refcount()
6064 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_xattr_bucket_value_refcount()
6065 xe = &xh->xh_entries[i]; in ocfs2_xattr_bucket_value_refcount()
6203 struct ocfs2_xattr_header *xh,
6216 struct ocfs2_xattr_header *xh, in ocfs2_value_metas_in_xattr_header() argument
6226 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_value_metas_in_xattr_header()
6227 xe = &xh->xh_entries[i]; in ocfs2_value_metas_in_xattr_header()
6231 ret = func(sb, bh, xh, i, &xv, NULL, para); in ocfs2_value_metas_in_xattr_header()
6260 struct ocfs2_xattr_header *xh, in ocfs2_get_xattr_value_root() argument
6266 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_value_root()
6268 *xv = (struct ocfs2_xattr_value_root *)((void *)xh + in ocfs2_get_xattr_value_root()
6283 struct ocfs2_xattr_header *xh, in ocfs2_reflink_lock_xattr_allocators() argument
6294 ret = ocfs2_value_metas_in_xattr_header(osb->sb, NULL, xh, in ocfs2_reflink_lock_xattr_allocators()
6341 struct ocfs2_xattr_header *xh, in ocfs2_reflink_xattr_header() argument
6359 le16_to_cpu(xh->xh_count)); in ocfs2_reflink_xattr_header()
6362 for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { in ocfs2_reflink_xattr_header()
6363 xe = &xh->xh_entries[i]; in ocfs2_reflink_xattr_header()
6387 ret = func(sb, old_bh, xh, i, &xv, NULL, para); in ocfs2_reflink_xattr_header()
6472 struct ocfs2_xattr_header *xh = (struct ocfs2_xattr_header *) in ocfs2_reflink_xattr_inline() local
6484 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_inline()
6511 ret = ocfs2_reflink_xattr_header(handle, args, args->old_bh, xh, in ocfs2_reflink_xattr_inline()
6594 struct ocfs2_xattr_header *xh = &xb->xb_attrs.xb_header; in ocfs2_reflink_xattr_block() local
6604 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_block()
6640 ret = ocfs2_reflink_xattr_header(handle, args, blk_bh, xh, in ocfs2_reflink_xattr_block()
6684 struct ocfs2_xattr_header *xh, in ocfs2_get_reflink_xattr_value_root() argument
6711 struct ocfs2_xattr_header *xh, in ocfs2_value_tree_metas_in_bucket() argument
6730 struct ocfs2_xattr_header *xh = in ocfs2_calc_value_tree_metas() local
6736 xh, &metas->num_metas, in ocfs2_calc_value_tree_metas()