Lines Matching refs:xh
242 struct ocfs2_xattr_header *xh,
956 struct ocfs2_xattr_header *xh; in ocfs2_has_inline_xattr_value_outside() local
959 xh = (struct ocfs2_xattr_header *) in ocfs2_has_inline_xattr_value_outside()
963 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) in ocfs2_has_inline_xattr_value_outside()
964 if (!ocfs2_xattr_is_local(&xh->xh_entries[i])) in ocfs2_has_inline_xattr_value_outside()
1583 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_get_free_start() local
1584 int i, count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_get_free_start()
1588 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_get_free_start()
1629 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_block_wipe_namevalue() local
1630 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_block_wipe_namevalue()
1637 memmove((char *)xh + first_namevalue_offset + namevalue_size, in ocfs2_xa_block_wipe_namevalue()
1638 (char *)xh + first_namevalue_offset, in ocfs2_xa_block_wipe_namevalue()
1640 memset((char *)xh + first_namevalue_offset, 0, namevalue_size); in ocfs2_xa_block_wipe_namevalue()
1644 offset = le16_to_cpu(xh->xh_entries[i].xe_name_offset); in ocfs2_xa_block_wipe_namevalue()
1646 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, in ocfs2_xa_block_wipe_namevalue()
1811 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_entry() local
1812 int count = le16_to_cpu(xh->xh_count); in ocfs2_xa_bucket_add_entry()
1822 tmp_xe = &xh->xh_entries[tmp]; in ocfs2_xa_bucket_add_entry()
1835 memmove(&xh->xh_entries[low + 1], in ocfs2_xa_bucket_add_entry()
1836 &xh->xh_entries[low], in ocfs2_xa_bucket_add_entry()
1839 le16_add_cpu(&xh->xh_count, 1); in ocfs2_xa_bucket_add_entry()
1840 loc->xl_entry = &xh->xh_entries[low]; in ocfs2_xa_bucket_add_entry()
1847 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_bucket_add_namevalue() local
1854 xh->xh_free_start = cpu_to_le16(nameval_offset); in ocfs2_xa_bucket_add_namevalue()
1855 le16_add_cpu(&xh->xh_name_value_len, size); in ocfs2_xa_bucket_add_namevalue()
1933 struct ocfs2_xattr_header *xh = loc->xl_header; in ocfs2_xa_remove_entry() local
1939 le16_add_cpu(&xh->xh_count, -1); in ocfs2_xa_remove_entry()
1940 count = le16_to_cpu(xh->xh_count); in ocfs2_xa_remove_entry()
1948 index = ((char *)entry - (char *)&xh->xh_entries) / in ocfs2_xa_remove_entry()
1950 memmove(&xh->xh_entries[index], &xh->xh_entries[index + 1], in ocfs2_xa_remove_entry()
1952 memset(&xh->xh_entries[count], 0, in ocfs2_xa_remove_entry()
3755 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket() local
3764 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_find_xe_in_bucket()
3765 xe = &xh->xh_entries[i]; in ocfs2_find_xe_in_bucket()
3779 xh, in ocfs2_find_xe_in_bucket()
3820 struct ocfs2_xattr_header *xh = NULL; in ocfs2_xattr_bucket_find() local
3841 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3842 high_bucket = le16_to_cpu(xh->xh_num_buckets) - 1; in ocfs2_xattr_bucket_find()
3854 xh = bucket_xh(search); in ocfs2_xattr_bucket_find()
3855 xe = &xh->xh_entries[0]; in ocfs2_xattr_bucket_find()
3866 if (xh->xh_count) in ocfs2_xattr_bucket_find()
3867 xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1]; in ocfs2_xattr_bucket_find()
4025 struct ocfs2_xattr_header *xh, in ocfs2_xattr_bucket_get_name_value() argument
4032 if (index < 0 || index >= le16_to_cpu(xh->xh_count)) in ocfs2_xattr_bucket_get_name_value()
4035 name_offset = le16_to_cpu(xh->xh_entries[index].xe_name_offset); in ocfs2_xattr_bucket_get_name_value()
4193 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket() local
4219 xh->xh_count = xb_xh->xh_count; in ocfs2_cp_xattr_block_to_bucket()
4220 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_cp_xattr_block_to_bucket()
4221 xh->xh_name_value_len = cpu_to_le16(size); in ocfs2_cp_xattr_block_to_bucket()
4222 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE - size); in ocfs2_cp_xattr_block_to_bucket()
4234 le16_add_cpu(&xh->xh_entries[i].xe_name_offset, off_change); in ocfs2_cp_xattr_block_to_bucket()
4389 struct ocfs2_xattr_header *xh; in ocfs2_defrag_xattr_bucket() local
4419 xh = (struct ocfs2_xattr_header *)bucket_buf; in ocfs2_defrag_xattr_bucket()
4420 entries = (char *)xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4421 xh_free_start = le16_to_cpu(xh->xh_free_start); in ocfs2_defrag_xattr_bucket()
4424 (unsigned long long)blkno, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4425 xh_free_start, le16_to_cpu(xh->xh_name_value_len)); in ocfs2_defrag_xattr_bucket()
4432 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4437 xe = xh->xh_entries; in ocfs2_defrag_xattr_bucket()
4439 for (i = 0; i < le16_to_cpu(xh->xh_count); i++, xe++) { in ocfs2_defrag_xattr_bucket()
4471 xh->xh_free_start = cpu_to_le16(end); in ocfs2_defrag_xattr_bucket()
4474 sort(entries, le16_to_cpu(xh->xh_count), in ocfs2_defrag_xattr_bucket()
4581 static int ocfs2_xattr_find_divide_pos(struct ocfs2_xattr_header *xh) in ocfs2_xattr_find_divide_pos() argument
4583 struct ocfs2_xattr_entry *entries = xh->xh_entries; in ocfs2_xattr_find_divide_pos()
4584 int count = le16_to_cpu(xh->xh_count); in ocfs2_xattr_find_divide_pos()
4633 struct ocfs2_xattr_header *xh; in ocfs2_divide_xattr_bucket() local
4685 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4686 count = le16_to_cpu(xh->xh_count); in ocfs2_divide_xattr_bucket()
4687 start = ocfs2_xattr_find_divide_pos(xh); in ocfs2_divide_xattr_bucket()
4690 xe = &xh->xh_entries[start-1]; in ocfs2_divide_xattr_bucket()
4700 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4701 xh->xh_free_start = cpu_to_le16(blocksize); in ocfs2_divide_xattr_bucket()
4702 xh->xh_entries[0].xe_name_hash = xe->xe_name_hash; in ocfs2_divide_xattr_bucket()
4703 le32_add_cpu(&xh->xh_entries[0].xe_name_hash, 1); in ocfs2_divide_xattr_bucket()
4712 xh = bucket_xh(t_bucket); in ocfs2_divide_xattr_bucket()
4721 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4735 xe = &xh->xh_entries[start]; in ocfs2_divide_xattr_bucket()
4738 (int)((char *)xe - (char *)xh), in ocfs2_divide_xattr_bucket()
4739 (int)((char *)xh->xh_entries - (char *)xh)); in ocfs2_divide_xattr_bucket()
4740 memmove((char *)xh->xh_entries, (char *)xe, len); in ocfs2_divide_xattr_bucket()
4741 xe = &xh->xh_entries[count - start]; in ocfs2_divide_xattr_bucket()
4745 le16_add_cpu(&xh->xh_count, -start); in ocfs2_divide_xattr_bucket()
4746 le16_add_cpu(&xh->xh_name_value_len, -name_value_len); in ocfs2_divide_xattr_bucket()
4749 xh->xh_free_start = cpu_to_le16(OCFS2_XATTR_BUCKET_SIZE); in ocfs2_divide_xattr_bucket()
4750 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_divide_xattr_bucket()
4751 xe = &xh->xh_entries[i]; in ocfs2_divide_xattr_bucket()
4753 le16_to_cpu(xh->xh_free_start)) in ocfs2_divide_xattr_bucket()
4754 xh->xh_free_start = xe->xe_name_offset; in ocfs2_divide_xattr_bucket()
4760 xh->xh_num_buckets = cpu_to_le16(1); in ocfs2_divide_xattr_bucket()
4762 xh->xh_num_buckets = 0; in ocfs2_divide_xattr_bucket()
4768 *first_hash = le32_to_cpu(xh->xh_entries[0].xe_name_hash); in ocfs2_divide_xattr_bucket()
4778 xh = bucket_xh(s_bucket); in ocfs2_divide_xattr_bucket()
4779 memset(&xh->xh_entries[start], 0, in ocfs2_divide_xattr_bucket()
4781 xh->xh_count = cpu_to_le16(start); in ocfs2_divide_xattr_bucket()
4782 xh->xh_free_start = cpu_to_le16(name_offset); in ocfs2_divide_xattr_bucket()
4783 xh->xh_name_value_len = cpu_to_le16(name_value_len); in ocfs2_divide_xattr_bucket()
5361 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate() local
5367 xe = &xh->xh_entries[xe_off]; in ocfs2_xattr_bucket_value_truncate()
5520 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision() local
5523 if (name_hash != le32_to_cpu(xh->xh_entries[0].xe_name_hash)) in ocfs2_check_xattr_bucket_collision()
5526 if (xh->xh_entries[le16_to_cpu(xh->xh_count) - 1].xe_name_hash == in ocfs2_check_xattr_bucket_collision()
5527 xh->xh_entries[0].xe_name_hash) { in ocfs2_check_xattr_bucket_collision()
5531 le32_to_cpu(xh->xh_entries[0].xe_name_hash)); in ocfs2_check_xattr_bucket_collision()
5656 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket() local
5669 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_delete_xattr_in_bucket()
5670 xe = &xh->xh_entries[i]; in ocfs2_delete_xattr_in_bucket()
6005 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root() local
6006 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_tree_value_root()
6042 struct ocfs2_xattr_header *xh = in ocfs2_xattr_bucket_value_refcount() local
6061 le16_to_cpu(xh->xh_count)); in ocfs2_xattr_bucket_value_refcount()
6062 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_xattr_bucket_value_refcount()
6063 xe = &xh->xh_entries[i]; in ocfs2_xattr_bucket_value_refcount()
6201 struct ocfs2_xattr_header *xh,
6214 struct ocfs2_xattr_header *xh, in ocfs2_value_metas_in_xattr_header() argument
6224 for (i = 0; i < le16_to_cpu(xh->xh_count); i++) { in ocfs2_value_metas_in_xattr_header()
6225 xe = &xh->xh_entries[i]; in ocfs2_value_metas_in_xattr_header()
6229 ret = func(sb, bh, xh, i, &xv, NULL, para); in ocfs2_value_metas_in_xattr_header()
6258 struct ocfs2_xattr_header *xh, in ocfs2_get_xattr_value_root() argument
6264 struct ocfs2_xattr_entry *xe = &xh->xh_entries[offset]; in ocfs2_get_xattr_value_root()
6266 *xv = (struct ocfs2_xattr_value_root *)((void *)xh + in ocfs2_get_xattr_value_root()
6281 struct ocfs2_xattr_header *xh, in ocfs2_reflink_lock_xattr_allocators() argument
6292 ret = ocfs2_value_metas_in_xattr_header(osb->sb, NULL, xh, in ocfs2_reflink_lock_xattr_allocators()
6339 struct ocfs2_xattr_header *xh, in ocfs2_reflink_xattr_header() argument
6357 le16_to_cpu(xh->xh_count)); in ocfs2_reflink_xattr_header()
6360 for (i = 0, j = 0; i < le16_to_cpu(xh->xh_count); i++, j++) { in ocfs2_reflink_xattr_header()
6361 xe = &xh->xh_entries[i]; in ocfs2_reflink_xattr_header()
6385 ret = func(sb, old_bh, xh, i, &xv, NULL, para); in ocfs2_reflink_xattr_header()
6470 struct ocfs2_xattr_header *xh = (struct ocfs2_xattr_header *) in ocfs2_reflink_xattr_inline() local
6482 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_inline()
6509 ret = ocfs2_reflink_xattr_header(handle, args, args->old_bh, xh, in ocfs2_reflink_xattr_inline()
6592 struct ocfs2_xattr_header *xh = &xb->xb_attrs.xb_header; in ocfs2_reflink_xattr_block() local
6602 ret = ocfs2_reflink_lock_xattr_allocators(osb, xh, args->ref_root_bh, in ocfs2_reflink_xattr_block()
6638 ret = ocfs2_reflink_xattr_header(handle, args, blk_bh, xh, in ocfs2_reflink_xattr_block()
6682 struct ocfs2_xattr_header *xh, in ocfs2_get_reflink_xattr_value_root() argument
6709 struct ocfs2_xattr_header *xh, in ocfs2_value_tree_metas_in_bucket() argument
6728 struct ocfs2_xattr_header *xh = in ocfs2_calc_value_tree_metas() local
6734 xh, &metas->num_metas, in ocfs2_calc_value_tree_metas()