Lines Matching refs:ctxt
274 struct ocfs2_xattr_set_ctxt *ctxt);
279 struct ocfs2_xattr_set_ctxt *ctxt);
712 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_extend_allocation() argument
715 handle_t *handle = ctxt->handle; in ocfs2_xattr_extend_allocation()
738 ctxt->data_ac, in ocfs2_xattr_extend_allocation()
739 ctxt->meta_ac, in ocfs2_xattr_extend_allocation()
777 struct ocfs2_xattr_set_ctxt *ctxt) in __ocfs2_remove_xattr_range() argument
781 handle_t *handle = ctxt->handle; in __ocfs2_remove_xattr_range()
793 ret = ocfs2_remove_extent(handle, &et, cpos, len, ctxt->meta_ac, in __ocfs2_remove_xattr_range()
794 &ctxt->dealloc); in __ocfs2_remove_xattr_range()
807 len, ctxt->meta_ac, &ctxt->dealloc, 1); in __ocfs2_remove_xattr_range()
809 ret = ocfs2_cache_cluster_dealloc(&ctxt->dealloc, in __ocfs2_remove_xattr_range()
822 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_shrink_size() argument
848 ext_flags, ctxt); in ocfs2_xattr_shrink_size()
868 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_value_truncate() argument
880 vb, ctxt); in ocfs2_xattr_value_truncate()
884 vb, ctxt); in ocfs2_xattr_value_truncate()
1914 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_value_truncate() argument
1921 ctxt); in ocfs2_xa_value_truncate()
1933 access_rc = ocfs2_xa_journal_access(ctxt->handle, loc, in ocfs2_xa_value_truncate()
2024 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_remove() argument
2031 rc = ocfs2_xa_value_truncate(loc, 0, ctxt); in ocfs2_xa_remove()
2072 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_reuse_entry() argument
2094 rc = ocfs2_xa_value_truncate(loc, 0, ctxt); in ocfs2_xa_reuse_entry()
2104 ctxt); in ocfs2_xa_reuse_entry()
2134 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_prepare_entry() argument
2147 rc = ocfs2_xa_reuse_entry(loc, xi, ctxt); in ocfs2_xa_prepare_entry()
2155 rc = ocfs2_xa_value_truncate(loc, 0, ctxt); in ocfs2_xa_prepare_entry()
2179 rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); in ocfs2_xa_prepare_entry()
2181 ctxt->set_abort = 1; in ocfs2_xa_prepare_entry()
2209 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_store_value() argument
2221 ctxt->handle, &vb, in ocfs2_xa_store_value()
2232 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xa_set() argument
2238 ret = ocfs2_xa_journal_access(ctxt->handle, loc, in ocfs2_xa_set()
2253 ret = ocfs2_xa_remove(loc, ctxt); in ocfs2_xa_set()
2257 ret = ocfs2_xa_prepare_entry(loc, xi, name_hash, ctxt); in ocfs2_xa_set()
2264 ret = ocfs2_xa_store_value(loc, xi, ctxt); in ocfs2_xa_set()
2269 ocfs2_xa_journal_dirty(ctxt->handle, loc); in ocfs2_xa_set()
2378 struct ocfs2_xattr_set_ctxt ctxt = { NULL, NULL, }; in ocfs2_remove_value_outside() local
2381 ocfs2_init_dealloc_ctxt(&ctxt.dealloc); in ocfs2_remove_value_outside()
2396 &ctxt.meta_ac, in ocfs2_remove_value_outside()
2399 ctxt.handle = ocfs2_start_trans(osb, ref_credits + in ocfs2_remove_value_outside()
2401 if (IS_ERR(ctxt.handle)) { in ocfs2_remove_value_outside()
2402 ret = PTR_ERR(ctxt.handle); in ocfs2_remove_value_outside()
2407 ret = ocfs2_xattr_value_truncate(inode, vb, 0, &ctxt); in ocfs2_remove_value_outside()
2409 ocfs2_commit_trans(osb, ctxt.handle); in ocfs2_remove_value_outside()
2410 if (ctxt.meta_ac) { in ocfs2_remove_value_outside()
2411 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_remove_value_outside()
2412 ctxt.meta_ac = NULL; in ocfs2_remove_value_outside()
2422 if (ctxt.meta_ac) in ocfs2_remove_value_outside()
2423 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_remove_value_outside()
2425 ocfs2_run_deallocs(osb, &ctxt.dealloc); in ocfs2_remove_value_outside()
2726 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_ibody_init() argument
2739 ret = ocfs2_journal_access_di(ctxt->handle, INODE_CACHE(inode), di_bh, in ocfs2_xattr_ibody_init()
2765 ocfs2_journal_dirty(ctxt->handle, di_bh); in ocfs2_xattr_ibody_init()
2780 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_ibody_set() argument
2791 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); in ocfs2_xattr_ibody_set()
2801 ret = ocfs2_xa_set(&loc, xi, ctxt); in ocfs2_xattr_ibody_set()
2870 struct ocfs2_xattr_set_ctxt *ctxt, in ocfs2_create_xattr_block() argument
2882 ret = ocfs2_journal_access_di(ctxt->handle, INODE_CACHE(inode), in ocfs2_create_xattr_block()
2889 ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1, in ocfs2_create_xattr_block()
2906 ret = ocfs2_journal_access_xb(ctxt->handle, INODE_CACHE(inode), in ocfs2_create_xattr_block()
2918 xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); in ocfs2_create_xattr_block()
2934 ocfs2_journal_dirty(ctxt->handle, new_bh); in ocfs2_create_xattr_block()
2944 ocfs2_journal_dirty(ctxt->handle, inode_bh); in ocfs2_create_xattr_block()
2963 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_block_set() argument
2971 ret = ocfs2_create_xattr_block(inode, xs->inode_bh, ctxt, in ocfs2_xattr_block_set()
2991 ret = ocfs2_xa_set(&loc, xi, ctxt); in ocfs2_xattr_block_set()
2994 else if ((ret != -ENOSPC) || ctxt->set_abort) in ocfs2_xattr_block_set()
2997 ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); in ocfs2_xattr_block_set()
3004 ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs, ctxt); in ocfs2_xattr_block_set()
3260 struct ocfs2_xattr_set_ctxt *ctxt, in ocfs2_init_xattr_set_ctxt() argument
3267 memset(ctxt, 0, sizeof(struct ocfs2_xattr_set_ctxt)); in ocfs2_init_xattr_set_ctxt()
3269 ocfs2_init_dealloc_ctxt(&ctxt->dealloc); in ocfs2_init_xattr_set_ctxt()
3284 &ctxt->meta_ac); in ocfs2_init_xattr_set_ctxt()
3292 ret = ocfs2_reserve_clusters(osb, clusters_add, &ctxt->data_ac); in ocfs2_init_xattr_set_ctxt()
3298 if (ctxt->meta_ac) { in ocfs2_init_xattr_set_ctxt()
3299 ocfs2_free_alloc_context(ctxt->meta_ac); in ocfs2_init_xattr_set_ctxt()
3300 ctxt->meta_ac = NULL; in ocfs2_init_xattr_set_ctxt()
3316 struct ocfs2_xattr_set_ctxt *ctxt) in __ocfs2_xattr_set_handle() argument
3323 ret = ocfs2_xattr_ibody_set(inode, xi, xis, ctxt); in __ocfs2_xattr_set_handle()
3325 ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); in __ocfs2_xattr_set_handle()
3328 ret = ocfs2_xattr_ibody_set(inode, xi, xis, ctxt); in __ocfs2_xattr_set_handle()
3353 ret = ocfs2_extend_trans(ctxt->handle, credits); in __ocfs2_xattr_set_handle()
3358 ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); in __ocfs2_xattr_set_handle()
3359 } else if ((ret == -ENOSPC) && !ctxt->set_abort) { in __ocfs2_xattr_set_handle()
3383 ret = ocfs2_extend_trans(ctxt->handle, credits); in __ocfs2_xattr_set_handle()
3393 ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); in __ocfs2_xattr_set_handle()
3417 ret = ocfs2_extend_trans(ctxt->handle, credits); in __ocfs2_xattr_set_handle()
3423 xis, ctxt); in __ocfs2_xattr_set_handle()
3430 ret = ocfs2_journal_access_di(ctxt->handle, INODE_CACHE(inode), in __ocfs2_xattr_set_handle()
3441 ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); in __ocfs2_xattr_set_handle()
3482 struct ocfs2_xattr_set_ctxt ctxt = { in ocfs2_xattr_set_handle() local
3518 ret = __ocfs2_xattr_set_handle(inode, di, &xi, &xis, &xbs, &ctxt); in ocfs2_xattr_set_handle()
3547 struct ocfs2_xattr_set_ctxt ctxt = { NULL, NULL, NULL, }; in ocfs2_xattr_set() local
3641 &xbs, &ctxt, ref_meta, &credits); in ocfs2_xattr_set()
3649 ctxt.handle = ocfs2_start_trans(osb, credits + ref_credits); in ocfs2_xattr_set()
3650 if (IS_ERR(ctxt.handle)) { in ocfs2_xattr_set()
3651 ret = PTR_ERR(ctxt.handle); in ocfs2_xattr_set()
3656 ret = __ocfs2_xattr_set_handle(inode, di, &xi, &xis, &xbs, &ctxt); in ocfs2_xattr_set()
3657 ocfs2_update_inode_fsync_trans(ctxt.handle, inode, 0); in ocfs2_xattr_set()
3659 ocfs2_commit_trans(osb, ctxt.handle); in ocfs2_xattr_set()
3662 if (ctxt.data_ac) in ocfs2_xattr_set()
3663 ocfs2_free_alloc_context(ctxt.data_ac); in ocfs2_xattr_set()
3664 if (ctxt.meta_ac) in ocfs2_xattr_set()
3665 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_xattr_set()
3666 if (ocfs2_dealloc_has_cluster(&ctxt.dealloc)) in ocfs2_xattr_set()
3668 ocfs2_run_deallocs(osb, &ctxt.dealloc); in ocfs2_xattr_set()
4285 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_create_index_block() argument
4290 handle_t *handle = ctxt->handle; in ocfs2_xattr_create_index_block()
4318 ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, in ocfs2_xattr_create_index_block()
5113 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_add_new_xattr_cluster() argument
5120 handle_t *handle = ctxt->handle; in ocfs2_add_new_xattr_cluster()
5138 ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, 1, in ocfs2_add_new_xattr_cluster()
5183 num_bits, 0, ctxt->meta_ac); in ocfs2_add_new_xattr_cluster()
5283 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_add_new_xattr_bucket() argument
5335 ctxt); in ocfs2_add_new_xattr_bucket()
5344 ctxt->handle, in ocfs2_add_new_xattr_bucket()
5369 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_bucket_value_truncate() argument
5407 ret = ocfs2_xattr_value_truncate(inode, &vb, len, ctxt); in ocfs2_xattr_bucket_value_truncate()
5413 ret = ocfs2_xattr_bucket_journal_access(ctxt->handle, bucket, in ocfs2_xattr_bucket_value_truncate()
5422 ocfs2_xattr_bucket_journal_dirty(ctxt->handle, bucket); in ocfs2_xattr_bucket_value_truncate()
5558 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_set_entry_bucket() argument
5567 ret = ocfs2_xa_set(&loc, xi, ctxt); in ocfs2_xattr_set_entry_bucket()
5578 ret = ocfs2_defrag_xattr_bucket(inode, ctxt->handle, in ocfs2_xattr_set_entry_bucket()
5585 ret = ocfs2_xa_set(&loc, xi, ctxt); in ocfs2_xattr_set_entry_bucket()
5601 struct ocfs2_xattr_set_ctxt *ctxt) in ocfs2_xattr_set_entry_index_block() argument
5607 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5634 ctxt); in ocfs2_xattr_set_entry_index_block()
5656 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5673 struct ocfs2_xattr_set_ctxt ctxt = {NULL, NULL,}; in ocfs2_delete_xattr_in_bucket() local
5680 ocfs2_init_dealloc_ctxt(&ctxt.dealloc); in ocfs2_delete_xattr_in_bucket()
5697 &ctxt.meta_ac, in ocfs2_delete_xattr_in_bucket()
5700 ctxt.handle = ocfs2_start_trans(osb, credits + ref_credits); in ocfs2_delete_xattr_in_bucket()
5701 if (IS_ERR(ctxt.handle)) { in ocfs2_delete_xattr_in_bucket()
5702 ret = PTR_ERR(ctxt.handle); in ocfs2_delete_xattr_in_bucket()
5708 i, 0, &ctxt); in ocfs2_delete_xattr_in_bucket()
5710 ocfs2_commit_trans(osb, ctxt.handle); in ocfs2_delete_xattr_in_bucket()
5711 if (ctxt.meta_ac) { in ocfs2_delete_xattr_in_bucket()
5712 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_delete_xattr_in_bucket()
5713 ctxt.meta_ac = NULL; in ocfs2_delete_xattr_in_bucket()
5721 if (ctxt.meta_ac) in ocfs2_delete_xattr_in_bucket()
5722 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_delete_xattr_in_bucket()
5724 ocfs2_run_deallocs(osb, &ctxt.dealloc); in ocfs2_delete_xattr_in_bucket()
6564 struct ocfs2_xattr_set_ctxt ctxt; in ocfs2_create_empty_xattr_block() local
6566 memset(&ctxt, 0, sizeof(ctxt)); in ocfs2_create_empty_xattr_block()
6567 ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &ctxt.meta_ac); in ocfs2_create_empty_xattr_block()
6573 ctxt.handle = ocfs2_start_trans(osb, OCFS2_XATTR_BLOCK_CREATE_CREDITS); in ocfs2_create_empty_xattr_block()
6574 if (IS_ERR(ctxt.handle)) { in ocfs2_create_empty_xattr_block()
6575 ret = PTR_ERR(ctxt.handle); in ocfs2_create_empty_xattr_block()
6582 ret = ocfs2_create_xattr_block(inode, fe_bh, &ctxt, indexed, in ocfs2_create_empty_xattr_block()
6587 ocfs2_commit_trans(osb, ctxt.handle); in ocfs2_create_empty_xattr_block()
6589 ocfs2_free_alloc_context(ctxt.meta_ac); in ocfs2_create_empty_xattr_block()