Lines Matching defs:context

55 	int (*get_clusters)(struct ocfs2_cow_context *context,
3115 struct ocfs2_cow_context *context,
3121 struct ocfs2_caching_info *ci = context->data_et.et_ci;
3129 ret = context->cow_duplicate_clusters(handle, context->inode,
3137 ret = ocfs2_clear_ext_refcount(handle, &context->data_et,
3139 context->meta_ac, &context->dealloc);
3166 static int ocfs2_di_get_clusters(struct ocfs2_cow_context *context,
3171 return ocfs2_get_clusters(context->inode, v_cluster, p_cluster,
3176 struct ocfs2_cow_context *context,
3186 struct ocfs2_caching_info *ref_ci = &context->ref_tree->rf_ci;
3193 &context->data_et,
3195 context->ref_root_bh,
3196 &context->meta_ac,
3197 &context->data_ac, &credits);
3203 if (context->post_refcount)
3204 credits += context->post_refcount->credits;
3206 credits += context->extra_credits;
3217 ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,
3240 &context->data_et,
3243 context->meta_ac,
3244 &context->dealloc);
3253 context->data_ac,
3261 ret = ocfs2_replace_clusters(handle, context,
3272 context->ref_root_bh,
3274 context->meta_ac,
3275 &context->dealloc, delete);
3289 if (context->post_refcount && context->post_refcount->func) {
3290 ret = context->post_refcount->func(context->inode, handle,
3291 context->post_refcount->para);
3302 if (context->get_clusters == ocfs2_di_get_clusters) {
3303 ret = ocfs2_cow_sync_writeback(sb, context->inode, cpos,
3313 if (context->data_ac) {
3314 ocfs2_free_alloc_context(context->data_ac);
3315 context->data_ac = NULL;
3317 if (context->meta_ac) {
3318 ocfs2_free_alloc_context(context->meta_ac);
3319 context->meta_ac = NULL;
3326 static int ocfs2_replace_cow(struct ocfs2_cow_context *context)
3329 struct inode *inode = context->inode;
3330 u32 cow_start = context->cow_start, cow_len = context->cow_len;
3340 ocfs2_init_dealloc_ctxt(&context->dealloc);
3343 ret = context->get_clusters(context, cow_start, &p_cluster,
3355 ret = ocfs2_make_clusters_writable(inode->i_sb, context,
3367 if (ocfs2_dealloc_has_cluster(&context->dealloc)) {
3369 ocfs2_run_deallocs(osb, &context->dealloc);
3390 struct ocfs2_cow_context *context = NULL;
3408 context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS);
3409 if (!context) {
3422 context->inode = inode;
3423 context->cow_start = cow_start;
3424 context->cow_len = cow_len;
3425 context->ref_tree = ref_tree;
3426 context->ref_root_bh = ref_root_bh;
3427 context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_page;
3428 context->get_clusters = ocfs2_di_get_clusters;
3430 ocfs2_init_dinode_extent_tree(&context->data_et,
3433 ret = ocfs2_replace_cow(context);
3447 kfree(context);
3491 static int ocfs2_xattr_value_get_clusters(struct ocfs2_cow_context *context,
3496 struct inode *inode = context->inode;
3497 struct ocfs2_xattr_value_root *xv = context->cow_object;
3602 struct ocfs2_cow_context *context = NULL;
3617 context = kzalloc(sizeof(struct ocfs2_cow_context), GFP_NOFS);
3618 if (!context) {
3624 context->inode = inode;
3625 context->cow_start = cow_start;
3626 context->cow_len = cow_len;
3627 context->ref_tree = ref_tree;
3628 context->ref_root_bh = ref_root_bh;
3629 context->cow_object = xv;
3631 context->cow_duplicate_clusters = ocfs2_duplicate_clusters_by_jbd;
3633 context->extra_credits =
3635 context->get_clusters = ocfs2_xattr_value_get_clusters;
3636 context->post_refcount = post;
3638 ocfs2_init_xattr_value_extent_tree(&context->data_et,
3641 ret = ocfs2_replace_cow(context);
3646 kfree(context);