• Home
  • Raw
  • Download

Lines Matching refs:context

50 			       struct ocfs2_move_extents_context *context,  in __ocfs2_move_extent()  argument
55 struct inode *inode = context->inode; in __ocfs2_move_extent()
60 u64 ino = ocfs2_metadata_cache_owner(context->et.et_ci); in __ocfs2_move_extent()
76 path = ocfs2_new_path_from_et(&context->et); in __ocfs2_move_extent()
108 ret = ocfs2_split_extent(handle, &context->et, path, index, in __ocfs2_move_extent()
109 &replace_rec, context->meta_ac, in __ocfs2_move_extent()
110 &context->dealloc); in __ocfs2_move_extent()
116 context->new_phys_cpos = new_p_cpos; in __ocfs2_move_extent()
126 len, context->meta_ac, in __ocfs2_move_extent()
127 &context->dealloc, 1); in __ocfs2_move_extent()
195 static int ocfs2_defrag_extent(struct ocfs2_move_extents_context *context, in ocfs2_defrag_extent() argument
198 int ret, credits = 0, extra_blocks = 0, partial = context->partial; in ocfs2_defrag_extent()
200 struct inode *inode = context->inode; in ocfs2_defrag_extent()
210 BUG_ON(!context->refcount_loc); in ocfs2_defrag_extent()
212 ret = ocfs2_lock_refcount_tree(osb, context->refcount_loc, 1, in ocfs2_defrag_extent()
220 context->refcount_loc, in ocfs2_defrag_extent()
231 ret = ocfs2_lock_meta_allocator_move_extents(inode, &context->et, in ocfs2_defrag_extent()
233 &context->meta_ac, in ocfs2_defrag_extent()
266 ret = ocfs2_reserve_clusters(osb, *len, &context->data_ac); in ocfs2_defrag_extent()
279 ret = __ocfs2_claim_clusters(handle, context->data_ac, 1, *len, in ocfs2_defrag_extent()
295 context->range->me_flags &= ~OCFS2_MOVE_EXT_FL_COMPLETE; in ocfs2_defrag_extent()
305 ret = __ocfs2_move_extent(handle, context, cpos, new_len, phys_cpos, in ocfs2_defrag_extent()
317 ret = ocfs2_cow_sync_writeback(inode->i_sb, context->inode, cpos, *len); in ocfs2_defrag_extent()
322 if (need_free && context->data_ac) { in ocfs2_defrag_extent()
323 struct ocfs2_alloc_context *data_ac = context->data_ac; in ocfs2_defrag_extent()
325 if (context->data_ac->ac_which == OCFS2_AC_USE_LOCAL) in ocfs2_defrag_extent()
341 if (context->data_ac) { in ocfs2_defrag_extent()
342 ocfs2_free_alloc_context(context->data_ac); in ocfs2_defrag_extent()
343 context->data_ac = NULL; in ocfs2_defrag_extent()
346 if (context->meta_ac) { in ocfs2_defrag_extent()
347 ocfs2_free_alloc_context(context->meta_ac); in ocfs2_defrag_extent()
348 context->meta_ac = NULL; in ocfs2_defrag_extent()
562 static int ocfs2_move_extent(struct ocfs2_move_extents_context *context, in ocfs2_move_extent() argument
568 struct inode *inode = context->inode; in ocfs2_move_extent()
577 context->range->me_threshold); in ocfs2_move_extent()
584 BUG_ON(!context->refcount_loc); in ocfs2_move_extent()
586 ret = ocfs2_lock_refcount_tree(osb, context->refcount_loc, 1, in ocfs2_move_extent()
594 context->refcount_loc, in ocfs2_move_extent()
605 ret = ocfs2_lock_meta_allocator_move_extents(inode, &context->et, in ocfs2_move_extent()
607 &context->meta_ac, in ocfs2_move_extent()
672 ret = __ocfs2_move_extent(handle, context, cpos, len, phys_cpos, in ocfs2_move_extent()
699 ret = ocfs2_cow_sync_writeback(inode->i_sb, context->inode, cpos, len); in ocfs2_move_extent()
717 if (context->meta_ac) { in ocfs2_move_extent()
718 ocfs2_free_alloc_context(context->meta_ac); in ocfs2_move_extent()
719 context->meta_ac = NULL; in ocfs2_move_extent()
759 struct ocfs2_move_extents_context *context) in __ocfs2_move_extents_range() argument
765 struct inode *inode = context->inode; in __ocfs2_move_extents_range()
767 struct ocfs2_move_extents *range = context->range; in __ocfs2_move_extents_range()
776 context->refcount_loc = le64_to_cpu(di->i_refcount_loc); in __ocfs2_move_extents_range()
778 ocfs2_init_dinode_extent_tree(&context->et, INODE_CACHE(inode), di_bh); in __ocfs2_move_extents_range()
779 ocfs2_init_dealloc_ctxt(&context->dealloc); in __ocfs2_move_extents_range()
787 do_defrag = context->auto_defrag; in __ocfs2_move_extents_range()
857 ret = ocfs2_defrag_extent(context, cpos, phys_cpos, in __ocfs2_move_extents_range()
860 ret = ocfs2_move_extent(context, cpos, phys_cpos, in __ocfs2_move_extents_range()
872 context->clusters_moved += alloc_size; in __ocfs2_move_extents_range()
883 context->clusters_moved); in __ocfs2_move_extents_range()
885 context->new_phys_cpos); in __ocfs2_move_extents_range()
888 ocfs2_run_deallocs(osb, &context->dealloc); in __ocfs2_move_extents_range()
893 static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) in ocfs2_move_extents() argument
897 struct inode *inode = context->inode; in ocfs2_move_extents()
927 status = __ocfs2_move_extents_range(di_bh, context); in ocfs2_move_extents()
980 struct ocfs2_move_extents_context *context; in ocfs2_ioctl_move_extents() local
999 context = kzalloc(sizeof(struct ocfs2_move_extents_context), GFP_NOFS); in ocfs2_ioctl_move_extents()
1000 if (!context) { in ocfs2_ioctl_move_extents()
1006 context->inode = inode; in ocfs2_ioctl_move_extents()
1007 context->file = filp; in ocfs2_ioctl_move_extents()
1022 context->range = ⦥ in ocfs2_ioctl_move_extents()
1036 context->auto_defrag = 1; in ocfs2_ioctl_move_extents()
1039 context->partial = 1; in ocfs2_ioctl_move_extents()
1053 status = ocfs2_move_extents(context); in ocfs2_ioctl_move_extents()
1066 kfree(context); in ocfs2_ioctl_move_extents()