Lines Matching defs:context
57 int (*get_clusters)(struct ocfs2_cow_context *context,
3114 struct ocfs2_cow_context *context,
3120 struct ocfs2_caching_info *ci = context->data_et.et_ci;
3128 ret = context->cow_duplicate_clusters(handle, context->inode,
3136 ret = ocfs2_clear_ext_refcount(handle, &context->data_et,
3138 context->meta_ac, &context->dealloc);
3195 static int ocfs2_di_get_clusters(struct ocfs2_cow_context *context,
3200 return ocfs2_get_clusters(context->inode, v_cluster, p_cluster,
3205 struct ocfs2_cow_context *context,
3215 struct ocfs2_caching_info *ref_ci = &context->ref_tree->rf_ci;
3222 &context->data_et,
3224 context->ref_root_bh,
3225 &context->meta_ac,
3226 &context->data_ac, &credits);
3232 if (context->post_refcount)
3233 credits += context->post_refcount->credits;
3235 credits += context->extra_credits;
3246 ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,
3269 &context->data_et,
3272 context->meta_ac,
3273 &context->dealloc);
3282 context->data_ac,
3290 ret = ocfs2_replace_clusters(handle, context,
3301 context->ref_root_bh,
3303 context->meta_ac,
3304 &context->dealloc, delete);
3318 if (context->post_refcount && context->post_refcount->func) {
3319 ret = context->post_refcount->func(context->inode, handle,
3320 context->post_refcount->para);
3331 if (context->get_clusters == ocfs2_di_get_clusters) {
3332 ret = ocfs2_cow_sync_writeback(sb, context->inode, cpos,
3342 if (context->data_ac) {
3343 ocfs2_free_alloc_context(context->data_ac);
3344 context->data_ac = NULL;
3346 if (context->meta_ac) {
3347 ocfs2_free_alloc_context(context->meta_ac);
3348 context->meta_ac = NULL;
3355 static int ocfs2_replace_cow(struct ocfs2_cow_context *context)
3358 struct inode *inode = context->inode;
3359 u32 cow_start = context->cow_start, cow_len = context->cow_len;
3369 ocfs2_init_dealloc_ctxt(&context->dealloc);
3372 ret = context->get_clusters(context, cow_start, &p_cluster,
3384 ret = ocfs2_make_clusters_writable(inode->i_sb, context,
3396 if (ocfs2_dealloc_has_cluster(&context->dealloc)) {
3398 ocfs2_run_deallocs(osb, &context->dealloc);
3419 struct ocfs2_cow_context *context = NULL;
3437 context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS);
3438 if (!context) {
3451 context->inode = inode;
3452 context->cow_start = cow_start;
3453 context->cow_len = cow_len;
3454 context->ref_tree = ref_tree;
3455 context->ref_root_bh = ref_root_bh;
3456 context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_page;
3457 context->get_clusters = ocfs2_di_get_clusters;
3459 ocfs2_init_dinode_extent_tree(&context->data_et,
3462 ret = ocfs2_replace_cow(context);
3476 kfree(context);
3520 static int ocfs2_xattr_value_get_clusters(struct ocfs2_cow_context *context,
3525 struct inode *inode = context->inode;
3526 struct ocfs2_xattr_value_root *xv = context->cow_object;
3631 struct ocfs2_cow_context *context = NULL;
3646 context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS);
3647 if (!context) {
3653 context->inode = inode;
3654 context->cow_start = cow_start;
3655 context->cow_len = cow_len;
3656 context->ref_tree = ref_tree;
3657 context->ref_root_bh = ref_root_bh;
3658 context->cow_object = xv;
3660 context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_jbd;
3662 context->extra_credits =
3664 context->get_clusters = ocfs2_xattr_value_get_clusters;
3665 context->post_refcount = post;
3667 ocfs2_init_xattr_value_extent_tree(&context->data_et,
3670 ret = ocfs2_replace_cow(context);
3675 kfree(context);