Lines Matching refs:bucket
125 struct ocfs2_xattr_bucket *bucket; member
279 struct ocfs2_xattr_bucket *bucket,
301 struct ocfs2_xattr_bucket *bucket,
322 struct ocfs2_xattr_bucket *bucket; in ocfs2_xattr_bucket_new() local
327 bucket = kzalloc(sizeof(struct ocfs2_xattr_bucket), GFP_NOFS); in ocfs2_xattr_bucket_new()
328 if (bucket) { in ocfs2_xattr_bucket_new()
329 bucket->bu_inode = inode; in ocfs2_xattr_bucket_new()
330 bucket->bu_blocks = blks; in ocfs2_xattr_bucket_new()
333 return bucket; in ocfs2_xattr_bucket_new()
336 static void ocfs2_xattr_bucket_relse(struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_relse() argument
340 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_xattr_bucket_relse()
341 brelse(bucket->bu_bhs[i]); in ocfs2_xattr_bucket_relse()
342 bucket->bu_bhs[i] = NULL; in ocfs2_xattr_bucket_relse()
346 static void ocfs2_xattr_bucket_free(struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_free() argument
348 if (bucket) { in ocfs2_xattr_bucket_free()
349 ocfs2_xattr_bucket_relse(bucket); in ocfs2_xattr_bucket_free()
350 bucket->bu_inode = NULL; in ocfs2_xattr_bucket_free()
351 kfree(bucket); in ocfs2_xattr_bucket_free()
361 static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket, in ocfs2_init_xattr_bucket() argument
366 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_init_xattr_bucket()
367 bucket->bu_bhs[i] = sb_getblk(bucket->bu_inode->i_sb, in ocfs2_init_xattr_bucket()
369 if (!bucket->bu_bhs[i]) { in ocfs2_init_xattr_bucket()
375 if (!ocfs2_buffer_uptodate(INODE_CACHE(bucket->bu_inode), in ocfs2_init_xattr_bucket()
376 bucket->bu_bhs[i])) { in ocfs2_init_xattr_bucket()
378 ocfs2_set_new_buffer_uptodate(INODE_CACHE(bucket->bu_inode), in ocfs2_init_xattr_bucket()
379 bucket->bu_bhs[i]); in ocfs2_init_xattr_bucket()
381 set_buffer_uptodate(bucket->bu_bhs[i]); in ocfs2_init_xattr_bucket()
382 ocfs2_set_buffer_uptodate(INODE_CACHE(bucket->bu_inode), in ocfs2_init_xattr_bucket()
383 bucket->bu_bhs[i]); in ocfs2_init_xattr_bucket()
389 ocfs2_xattr_bucket_relse(bucket); in ocfs2_init_xattr_bucket()
394 static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket, in ocfs2_read_xattr_bucket() argument
399 rc = ocfs2_read_blocks(INODE_CACHE(bucket->bu_inode), xb_blkno, in ocfs2_read_xattr_bucket()
400 bucket->bu_blocks, bucket->bu_bhs, 0, in ocfs2_read_xattr_bucket()
403 spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_read_xattr_bucket()
404 rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb, in ocfs2_read_xattr_bucket()
405 bucket->bu_bhs, in ocfs2_read_xattr_bucket()
406 bucket->bu_blocks, in ocfs2_read_xattr_bucket()
407 &bucket_xh(bucket)->xh_check); in ocfs2_read_xattr_bucket()
408 spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_read_xattr_bucket()
414 ocfs2_xattr_bucket_relse(bucket); in ocfs2_read_xattr_bucket()
419 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_journal_access() argument
424 for (i = 0; i < bucket->bu_blocks; i++) { in ocfs2_xattr_bucket_journal_access()
426 INODE_CACHE(bucket->bu_inode), in ocfs2_xattr_bucket_journal_access()
427 bucket->bu_bhs[i], type); in ocfs2_xattr_bucket_journal_access()
438 struct ocfs2_xattr_bucket *bucket) in ocfs2_xattr_bucket_journal_dirty() argument
442 spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_xattr_bucket_journal_dirty()
443 ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb, in ocfs2_xattr_bucket_journal_dirty()
444 bucket->bu_bhs, bucket->bu_blocks, in ocfs2_xattr_bucket_journal_dirty()
445 &bucket_xh(bucket)->xh_check); in ocfs2_xattr_bucket_journal_dirty()
446 spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); in ocfs2_xattr_bucket_journal_dirty()
448 for (i = 0; i < bucket->bu_blocks; i++) in ocfs2_xattr_bucket_journal_dirty()
449 ocfs2_journal_dirty(handle, bucket->bu_bhs[i]); in ocfs2_xattr_bucket_journal_dirty()
1214 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1215 if (!xs->bucket) { in ocfs2_xattr_block_get()
1245 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1253 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1271 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1705 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_journal_access() local
1707 return ocfs2_xattr_bucket_journal_access(handle, bucket, type); in ocfs2_xa_bucket_journal_access()
1713 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_journal_dirty() local
1715 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_xa_bucket_journal_dirty()
1721 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_offset_pointer() local
1728 return bucket_block(bucket, block) + block_offset; in ocfs2_xa_bucket_offset_pointer()
1740 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_get_free_start() local
1741 return le16_to_cpu(bucket_xh(bucket)->xh_free_start); in ocfs2_xa_bucket_get_free_start()
1862 struct ocfs2_xattr_bucket *bucket = loc->xl_storage; in ocfs2_xa_bucket_fill_value_buf() local
1872 BUG_ON(!bucket->bu_bhs[block_offset]); in ocfs2_xa_bucket_fill_value_buf()
1875 vb->vb_bh = bucket->bu_bhs[block_offset]; in ocfs2_xa_bucket_fill_value_buf()
2304 struct ocfs2_xattr_bucket *bucket, in ocfs2_init_xattr_bucket_xa_loc() argument
2307 loc->xl_inode = bucket->bu_inode; in ocfs2_init_xattr_bucket_xa_loc()
2309 loc->xl_storage = bucket; in ocfs2_init_xattr_bucket_xa_loc()
2310 loc->xl_header = bucket_xh(bucket); in ocfs2_init_xattr_bucket_xa_loc()
3092 bucket_xh(xbs->bucket), in ocfs2_calc_xattr_set_need()
3095 base = bucket_block(xbs->bucket, block_off); in ocfs2_calc_xattr_set_need()
3487 xbs.bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_set_handle()
3488 if (!xbs.bucket) { in ocfs2_xattr_set_handle()
3513 ocfs2_xattr_bucket_free(xbs.bucket); in ocfs2_xattr_set_handle()
3564 xbs.bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_set()
3565 if (!xbs.bucket) { in ocfs2_xattr_set()
3673 ocfs2_xattr_bucket_free(xbs.bucket); in ocfs2_xattr_set()
3743 struct ocfs2_xattr_bucket *bucket,
3747 struct ocfs2_xattr_bucket *bucket, in ocfs2_find_xe_in_bucket() argument
3755 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_find_xe_in_bucket()
3789 xe_name = bucket_block(bucket, block_off) + new_offset; in ocfs2_find_xe_in_bucket()
3824 int low_bucket = 0, bucket, high_bucket; in ocfs2_xattr_bucket_find() local
3846 bucket = (low_bucket + high_bucket) / 2; in ocfs2_xattr_bucket_find()
3847 blkno = p_blkno + bucket * blk_per_bucket; in ocfs2_xattr_bucket_find()
3857 high_bucket = bucket - 1; in ocfs2_xattr_bucket_find()
3873 low_bucket = bucket + 1; in ocfs2_xattr_bucket_find()
3897 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3903 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3904 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3911 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3974 struct ocfs2_xattr_bucket *bucket; in ocfs2_iterate_xattr_buckets() local
3976 bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_iterate_xattr_buckets()
3977 if (!bucket) { in ocfs2_iterate_xattr_buckets()
3986 for (i = 0; i < num_buckets; i++, blkno += bucket->bu_blocks) { in ocfs2_iterate_xattr_buckets()
3987 ret = ocfs2_read_xattr_bucket(bucket, blkno); in ocfs2_iterate_xattr_buckets()
3998 num_buckets = le16_to_cpu(bucket_xh(bucket)->xh_num_buckets); in ocfs2_iterate_xattr_buckets()
4001 le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash)); in ocfs2_iterate_xattr_buckets()
4003 ret = func(inode, bucket, para); in ocfs2_iterate_xattr_buckets()
4009 ocfs2_xattr_bucket_relse(bucket); in ocfs2_iterate_xattr_buckets()
4014 ocfs2_xattr_bucket_free(bucket); in ocfs2_iterate_xattr_buckets()
4044 struct ocfs2_xattr_bucket *bucket, in ocfs2_list_xattr_bucket() argument
4052 for (i = 0 ; i < le16_to_cpu(bucket_xh(bucket)->xh_count); i++) { in ocfs2_list_xattr_bucket()
4053 struct ocfs2_xattr_entry *entry = &bucket_xh(bucket)->xh_entries[i]; in ocfs2_list_xattr_bucket()
4057 bucket_xh(bucket), in ocfs2_list_xattr_bucket()
4064 name = (const char *)bucket_block(bucket, block_off) + in ocfs2_list_xattr_bucket()
4184 struct ocfs2_xattr_bucket *bucket) in ocfs2_cp_xattr_block_to_bucket() argument
4193 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_cp_xattr_block_to_bucket()
4196 char *target = bucket_block(bucket, blks - 1); in ocfs2_cp_xattr_block_to_bucket()
4200 (unsigned long long)bucket_blkno(bucket)); in ocfs2_cp_xattr_block_to_bucket()
4203 memset(bucket_block(bucket, i), 0, blocksize); in ocfs2_cp_xattr_block_to_bucket()
4225 target = bucket_block(bucket, 0); in ocfs2_cp_xattr_block_to_bucket()
4259 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4260 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4289 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4321 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1); in ocfs2_xattr_create_index_block()
4327 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4334 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4335 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4385 struct ocfs2_xattr_bucket *bucket) in ocfs2_defrag_xattr_bucket() argument
4391 u64 blkno = bucket_blkno(bucket); in ocfs2_defrag_xattr_bucket()
4409 for (i = 0; i < bucket->bu_blocks; i++, buf += blocksize) in ocfs2_defrag_xattr_bucket()
4410 memcpy(buf, bucket_block(bucket, i), blocksize); in ocfs2_defrag_xattr_bucket()
4412 ret = ocfs2_xattr_bucket_journal_access(handle, bucket, in ocfs2_defrag_xattr_bucket()
4479 for (i = 0; i < bucket->bu_blocks; i++, buf += blocksize) in ocfs2_defrag_xattr_bucket()
4480 memcpy(bucket_block(bucket, i), buf, blocksize); in ocfs2_defrag_xattr_bucket()
4481 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_defrag_xattr_bucket()
5353 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_value_truncate() argument
5361 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_xattr_bucket_value_truncate()
5379 vb.vb_bh = bucket->bu_bhs[value_blk]; in ocfs2_xattr_bucket_value_truncate()
5393 (unsigned long long)bucket_blkno(bucket), xe_off, len); in ocfs2_xattr_bucket_value_truncate()
5400 ret = ocfs2_xattr_bucket_journal_access(ctxt->handle, bucket, in ocfs2_xattr_bucket_value_truncate()
5409 ocfs2_xattr_bucket_journal_dirty(ctxt->handle, bucket); in ocfs2_xattr_bucket_value_truncate()
5517 struct ocfs2_xattr_bucket *bucket, in ocfs2_check_xattr_bucket_collision() argument
5520 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_check_xattr_bucket_collision()
5530 (unsigned long long)bucket_blkno(bucket), in ocfs2_check_xattr_bucket_collision()
5552 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5566 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5611 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5620 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5634 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5652 struct ocfs2_xattr_bucket *bucket, in ocfs2_delete_xattr_in_bucket() argument
5656 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_delete_xattr_in_bucket()
5674 ret = ocfs2_get_xattr_tree_value_root(inode->i_sb, bucket, in ocfs2_delete_xattr_in_bucket()
5694 ret = ocfs2_xattr_bucket_value_truncate(inode, bucket, in ocfs2_delete_xattr_in_bucket()
5728 struct ocfs2_xattr_bucket *bucket = in ocfs2_xattr_bucket_post_refcount() local
5731 ret = ocfs2_xattr_bucket_journal_access(handle, bucket, in ocfs2_xattr_bucket_post_refcount()
5738 ocfs2_xattr_bucket_journal_dirty(handle, bucket); in ocfs2_xattr_bucket_post_refcount()
5774 struct ocfs2_xattr_bucket *bucket = NULL; in ocfs2_prepare_refcount_xattr() local
5797 bucket_xh(xbs->bucket), in ocfs2_prepare_refcount_xattr()
5804 base = bucket_block(xbs->bucket, block_off); in ocfs2_prepare_refcount_xattr()
5805 vb.vb_bh = xbs->bucket->bu_bhs[block_off]; in ocfs2_prepare_refcount_xattr()
5810 bucket = xbs->bucket; in ocfs2_prepare_refcount_xattr()
5811 refcount.credits = bucket->bu_blocks; in ocfs2_prepare_refcount_xattr()
5812 refcount.para = bucket; in ocfs2_prepare_refcount_xattr()
5999 struct ocfs2_xattr_bucket *bucket, in ocfs2_get_xattr_tree_value_root() argument
6005 struct ocfs2_xattr_header *xh = bucket_xh(bucket); in ocfs2_get_xattr_tree_value_root()
6010 bucket_xh(bucket), in ocfs2_get_xattr_tree_value_root()
6019 base = bucket_block(bucket, block_off); in ocfs2_get_xattr_tree_value_root()
6025 *bh = bucket->bu_bhs[block_off]; in ocfs2_get_xattr_tree_value_root()
6035 struct ocfs2_xattr_bucket *bucket, in ocfs2_xattr_bucket_value_refcount() argument
6043 (struct ocfs2_xattr_header *)bucket->bu_bhs[0]->b_data; in ocfs2_xattr_bucket_value_refcount()
6049 .credits = bucket->bu_blocks, in ocfs2_xattr_bucket_value_refcount()
6050 .para = bucket, in ocfs2_xattr_bucket_value_refcount()
6060 (unsigned long long)bucket_blkno(bucket), in ocfs2_xattr_bucket_value_refcount()
6068 ret = ocfs2_get_xattr_tree_value_root(inode->i_sb, bucket, i, in ocfs2_xattr_bucket_value_refcount()
6690 struct ocfs2_xattr_bucket *bucket; in ocfs2_get_reflink_xattr_value_root() local
6693 bucket = args->old_bucket; in ocfs2_get_reflink_xattr_value_root()
6695 bucket = args->new_bucket; in ocfs2_get_reflink_xattr_value_root()
6697 return ocfs2_get_xattr_tree_value_root(sb, bucket, offset, in ocfs2_get_reflink_xattr_value_root()
6715 struct ocfs2_xattr_bucket *bucket = in ocfs2_value_tree_metas_in_bucket() local
6718 return ocfs2_get_xattr_tree_value_root(sb, bucket, offset, in ocfs2_value_tree_metas_in_bucket()
6723 struct ocfs2_xattr_bucket *bucket, in ocfs2_calc_value_tree_metas() argument
6729 (struct ocfs2_xattr_header *)bucket->bu_bhs[0]->b_data; in ocfs2_calc_value_tree_metas()
6732 metas->credits += bucket->bu_blocks; in ocfs2_calc_value_tree_metas()
6733 return ocfs2_value_metas_in_xattr_header(inode->i_sb, bucket->bu_bhs[0], in ocfs2_calc_value_tree_metas()
6737 bucket); in ocfs2_calc_value_tree_metas()