Lines Matching refs:bucket
135 struct ocfs2_xattr_bucket *bucket; member
289 struct ocfs2_xattr_bucket *bucket,
311 struct ocfs2_xattr_bucket *bucket,
332 struct ocfs2_xattr_bucket *bucket; in ocfs2_xattr_bucket_new() local
337 bucket = kzalloc(sizeof(struct ocfs2_xattr_bucket), GFP_NOFS); in ocfs2_xattr_bucket_new()
338 if (bucket) { in ocfs2_xattr_bucket_new()
339 bucket->bu_inode = inode; in ocfs2_xattr_bucket_new()
340 bucket->bu_blocks = blks; in ocfs2_xattr_bucket_new()
343 return bucket; in ocfs2_xattr_bucket_new()
346 static void ocfs2_xattr_bucket_relse(struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_relse() argument
350 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_xattr_bucket_relse()
351 brelse(bucket->bu_bhs[i]); in ocfs2_xattr_bucket_relse()
352 bucket->bu_bhs[i] = NULL; in ocfs2_xattr_bucket_relse()
356 static void ocfs2_xattr_bucket_free(struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_free() argument
358 if (bucket) { in ocfs2_xattr_bucket_free()
359 ocfs2_xattr_bucket_relse(bucket); in ocfs2_xattr_bucket_free()
360 bucket->bu_inode = NULL; in ocfs2_xattr_bucket_free()
361 kfree(bucket); in ocfs2_xattr_bucket_free()
371 static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket, in ocfs2_init_xattr_bucket() argument
376 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_init_xattr_bucket()
377 bucket->bu_bhs[i] = sb_getblk(bucket->bu_inode->i_sb, in ocfs2_init_xattr_bucket()
379 if (!bucket->bu_bhs[i]) { in ocfs2_init_xattr_bucket()
385 if (!ocfs2_buffer_uptodate(INODE_CACHE(bucket->bu_inode), in ocfs2_init_xattr_bucket()
386 bucket->bu_bhs[i])) in ocfs2_init_xattr_bucket()
387 ocfs2_set_new_buffer_uptodate(INODE_CACHE(bucket->bu_inode), in ocfs2_init_xattr_bucket()
388 bucket->bu_bhs[i]); in ocfs2_init_xattr_bucket()
392 ocfs2_xattr_bucket_relse(bucket); in ocfs2_init_xattr_bucket()
397 static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket, in ocfs2_read_xattr_bucket() argument
402 rc = ocfs2_read_blocks(INODE_CACHE(bucket->bu_inode), xb_blkno, in ocfs2_read_xattr_bucket()
403 bucket->bu_blocks, bucket->bu_bhs, 0, in ocfs2_read_xattr_bucket()
406 spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_read_xattr_bucket()
407 rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb, in ocfs2_read_xattr_bucket()
408 bucket->bu_bhs, in ocfs2_read_xattr_bucket()
409 bucket->bu_blocks, in ocfs2_read_xattr_bucket()
410 &bucket_xh(bucket)->xh_check); in ocfs2_read_xattr_bucket()
411 spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_read_xattr_bucket()
417 ocfs2_xattr_bucket_relse(bucket); in ocfs2_read_xattr_bucket()
422 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_journal_access() argument
427 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_xattr_bucket_journal_access()
429 INODE_CACHE(bucket->bu_inode), in ocfs2_xattr_bucket_journal_access()
430 bucket->bu_bhs[i], type); in ocfs2_xattr_bucket_journal_access()
441 struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_journal_dirty() argument
445 spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_xattr_bucket_journal_dirty()
446 ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb, in ocfs2_xattr_bucket_journal_dirty()
447 bucket->bu_bhs, bucket->bu_blocks, in ocfs2_xattr_bucket_journal_dirty()
448 &bucket_xh(bucket)->xh_check); in ocfs2_xattr_bucket_journal_dirty()
449 spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_xattr_bucket_journal_dirty()
451 for (i = 0; i < bucket->bu_blocks; i++) in ocfs2_xattr_bucket_journal_dirty()
452 ocfs2_journal_dirty(handle, bucket->bu_bhs[i]); in ocfs2_xattr_bucket_journal_dirty()
1200 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1201 if (!xs->bucket) { in ocfs2_xattr_block_get()
1231 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1235 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1253 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1686 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_journal_access() local
1688 return ocfs2_xattr_bucket_journal_access(handle, bucket, type); in ocfs2_xa_bucket_journal_access()
1694 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_journal_dirty() local
1696 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_xa_bucket_journal_dirty()
1702 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_offset_pointer() local
1709 return bucket_block(bucket, block) + block_offset; in ocfs2_xa_bucket_offset_pointer()
1721 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_get_free_start() local
1722 return le16_to_cpu(bucket_xh(bucket)->xh_free_start); in ocfs2_xa_bucket_get_free_start()
1843 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_fill_value_buf() local
1853 BUG_ON(!bucket->bu_bhs[block_offset]); in ocfs2_xa_bucket_fill_value_buf()
1856 vb->vb_bh = bucket->bu_bhs[block_offset]; in ocfs2_xa_bucket_fill_value_buf()
2285 struct ocfs2_xattr_bucket *bucket, in ocfs2_init_xattr_bucket_xa_loc() argument
2288 loc->xl_inode = bucket->bu_inode; in ocfs2_init_xattr_bucket_xa_loc()
2290 loc->xl_storage = bucket; in ocfs2_init_xattr_bucket_xa_loc()
2291 loc->xl_header = bucket_xh(bucket); in ocfs2_init_xattr_bucket_xa_loc()
3075 bucket_xh(xbs->bucket), in ocfs2_calc_xattr_set_need()
3078 base = bucket_block(xbs->bucket, block_off); in ocfs2_calc_xattr_set_need()
3466 xbs.bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_set_handle()
3467 if (!xbs.bucket) { in ocfs2_xattr_set_handle()
3492 ocfs2_xattr_bucket_free(xbs.bucket); in ocfs2_xattr_set_handle()
3542 xbs.bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_set()
3543 if (!xbs.bucket) { in ocfs2_xattr_set()
3648 ocfs2_xattr_bucket_free(xbs.bucket); in ocfs2_xattr_set()
3720 struct ocfs2_xattr_bucket *bucket,
3724 struct ocfs2_xattr_bucket *bucket, in ocfs2_find_xe_in_bucket() argument
3732 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket()
3766 xe_name = bucket_block(bucket, block_off) + new_offset; in ocfs2_find_xe_in_bucket()
3801 int low_bucket = 0, bucket, high_bucket; in ocfs2_xattr_bucket_find() local
3824 bucket = (low_bucket + high_bucket) / 2; in ocfs2_xattr_bucket_find()
3825 blkno = p_blkno + bucket * blk_per_bucket; in ocfs2_xattr_bucket_find()
3835 high_bucket = bucket - 1; in ocfs2_xattr_bucket_find()
3853 low_bucket = bucket + 1; in ocfs2_xattr_bucket_find()
3877 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3883 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3884 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3891 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3954 struct ocfs2_xattr_bucket *bucket; in ocfs2_iterate_xattr_buckets() local
3956 bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_iterate_xattr_buckets()
3957 if (!bucket) { in ocfs2_iterate_xattr_buckets()
3966 for (i = 0; i < num_buckets; i++, blkno += bucket->bu_blocks) { in ocfs2_iterate_xattr_buckets()
3967 ret = ocfs2_read_xattr_bucket(bucket, blkno); in ocfs2_iterate_xattr_buckets()
3978 num_buckets = le16_to_cpu(bucket_xh(bucket)->xh_num_buckets); in ocfs2_iterate_xattr_buckets()
3981 le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash)); in ocfs2_iterate_xattr_buckets()
3983 ret = func(inode, bucket, para); in ocfs2_iterate_xattr_buckets()
3989 ocfs2_xattr_bucket_relse(bucket); in ocfs2_iterate_xattr_buckets()
3994 ocfs2_xattr_bucket_free(bucket); in ocfs2_iterate_xattr_buckets()
4024 struct ocfs2_xattr_bucket *bucket, in ocfs2_list_xattr_bucket() argument
4032 for (i = 0 ; i < le16_to_cpu(bucket_xh(bucket)->xh_count); i++) { in ocfs2_list_xattr_bucket()
4033 struct ocfs2_xattr_entry *entry = &bucket_xh(bucket)->xh_entries[i]; in ocfs2_list_xattr_bucket()
4039 bucket_xh(bucket), in ocfs2_list_xattr_bucket()
4046 name = (const char *)bucket_block(bucket, block_off) + in ocfs2_list_xattr_bucket()
4166 struct ocfs2_xattr_bucket *bucket) in ocfs2_cp_xattr_block_to_bucket() argument
4175 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket()
4178 char *target = bucket_block(bucket, blks - 1); in ocfs2_cp_xattr_block_to_bucket()
4182 (unsigned long long)bucket_blkno(bucket)); in ocfs2_cp_xattr_block_to_bucket()
4185 memset(bucket_block(bucket, i), 0, blocksize); in ocfs2_cp_xattr_block_to_bucket()
4207 target = bucket_block(bucket, 0); in ocfs2_cp_xattr_block_to_bucket()
4241 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4242 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4271 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4303 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno); in ocfs2_xattr_create_index_block()
4309 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4316 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4317 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4367 struct ocfs2_xattr_bucket *bucket) in ocfs2_defrag_xattr_bucket() argument
4373 u64 blkno = bucket_blkno(bucket); in ocfs2_defrag_xattr_bucket()
4391 for (i = 0; i < bucket->bu_blocks; i++, buf += blocksize) in ocfs2_defrag_xattr_bucket()
4392 memcpy(buf, bucket_block(bucket, i), blocksize); in ocfs2_defrag_xattr_bucket()
4394 ret = ocfs2_xattr_bucket_journal_access(handle, bucket, in ocfs2_defrag_xattr_bucket()
4461 for (i = 0; i < bucket->bu_blocks; i++, buf += blocksize) in ocfs2_defrag_xattr_bucket()
4462 memcpy(bucket_block(bucket, i), buf, blocksize); in ocfs2_defrag_xattr_bucket()
4463 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_defrag_xattr_bucket()
5328 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_get_val() argument
5334 return bucket_block(bucket, block_off) + offs; in ocfs2_xattr_bucket_get_val()
5345 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_value_truncate() argument
5353 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate()
5371 vb.vb_bh = bucket->bu_bhs[value_blk]; in ocfs2_xattr_bucket_value_truncate()
5385 (unsigned long long)bucket_blkno(bucket), xe_off, len); in ocfs2_xattr_bucket_value_truncate()
5392 ret = ocfs2_xattr_bucket_journal_access(ctxt->handle, bucket, in ocfs2_xattr_bucket_value_truncate()
5401 ocfs2_xattr_bucket_journal_dirty(ctxt->handle, bucket); in ocfs2_xattr_bucket_value_truncate()
5508 struct ocfs2_xattr_bucket *bucket, in ocfs2_check_xattr_bucket_collision() argument
5511 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision()
5521 (unsigned long long)bucket_blkno(bucket), in ocfs2_check_xattr_bucket_collision()
5543 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5557 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5602 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5611 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5625 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5643 struct ocfs2_xattr_bucket *bucket, in ocfs2_delete_xattr_in_bucket() argument
5647 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket()
5665 ret = ocfs2_get_xattr_tree_value_root(inode->i_sb, bucket, in ocfs2_delete_xattr_in_bucket()
5681 ret = ocfs2_xattr_bucket_value_truncate(inode, bucket, in ocfs2_delete_xattr_in_bucket()
5715 struct ocfs2_xattr_bucket *bucket = in ocfs2_xattr_bucket_post_refcount() local
5718 ret = ocfs2_xattr_bucket_journal_access(handle, bucket, in ocfs2_xattr_bucket_post_refcount()
5725 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_xattr_bucket_post_refcount()
5761 struct ocfs2_xattr_bucket *bucket = NULL; in ocfs2_prepare_refcount_xattr() local
5784 bucket_xh(xbs->bucket), in ocfs2_prepare_refcount_xattr()
5791 base = bucket_block(xbs->bucket, block_off); in ocfs2_prepare_refcount_xattr()
5792 vb.vb_bh = xbs->bucket->bu_bhs[block_off]; in ocfs2_prepare_refcount_xattr()
5797 bucket = xbs->bucket; in ocfs2_prepare_refcount_xattr()
5798 refcount.credits = bucket->bu_blocks; in ocfs2_prepare_refcount_xattr()
5799 refcount.para = bucket; in ocfs2_prepare_refcount_xattr()
5982 struct ocfs2_xattr_bucket *bucket, in ocfs2_get_xattr_tree_value_root() argument
5988 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root()
5993 bucket_xh(bucket), in ocfs2_get_xattr_tree_value_root()
6002 base = bucket_block(bucket, block_off); in ocfs2_get_xattr_tree_value_root()
6008 *bh = bucket->bu_bhs[block_off]; in ocfs2_get_xattr_tree_value_root()
6018 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_value_refcount() argument
6026 (struct ocfs2_xattr_header *)bucket->bu_bhs[0]->b_data; in ocfs2_xattr_bucket_value_refcount()
6032 .credits = bucket->bu_blocks, in ocfs2_xattr_bucket_value_refcount()
6033 .para = bucket, in ocfs2_xattr_bucket_value_refcount()
6043 (unsigned long long)bucket_blkno(bucket), in ocfs2_xattr_bucket_value_refcount()
6051 ret = ocfs2_get_xattr_tree_value_root(inode->i_sb, bucket, i, in ocfs2_xattr_bucket_value_refcount()
6674 struct ocfs2_xattr_bucket *bucket; in ocfs2_get_reflink_xattr_value_root() local
6677 bucket = args->old_bucket; in ocfs2_get_reflink_xattr_value_root()
6679 bucket = args->new_bucket; in ocfs2_get_reflink_xattr_value_root()
6681 return ocfs2_get_xattr_tree_value_root(sb, bucket, offset, in ocfs2_get_reflink_xattr_value_root()
6699 struct ocfs2_xattr_bucket *bucket = in ocfs2_value_tree_metas_in_bucket() local
6702 return ocfs2_get_xattr_tree_value_root(sb, bucket, offset, in ocfs2_value_tree_metas_in_bucket()
6707 struct ocfs2_xattr_bucket *bucket, in ocfs2_calc_value_tree_metas() argument
6713 (struct ocfs2_xattr_header *)bucket->bu_bhs[0]->b_data; in ocfs2_calc_value_tree_metas()
6716 metas->credits += bucket->bu_blocks; in ocfs2_calc_value_tree_metas()
6717 return ocfs2_value_metas_in_xattr_header(inode->i_sb, bucket->bu_bhs[0], in ocfs2_calc_value_tree_metas()
6721 bucket); in ocfs2_calc_value_tree_metas()