Lines Matching refs:osb

194 ocfs2_find_refcount_tree(struct ocfs2_super *osb, u64 blkno)  in ocfs2_find_refcount_tree()  argument
196 struct rb_node *n = osb->osb_rf_lock_tree.rb_node; in ocfs2_find_refcount_tree()
214 static void ocfs2_insert_refcount_tree(struct ocfs2_super *osb, in ocfs2_insert_refcount_tree() argument
219 struct rb_node **p = &osb->osb_rf_lock_tree.rb_node; in ocfs2_insert_refcount_tree()
241 rb_insert_color(&new->rf_node, &osb->osb_rf_lock_tree); in ocfs2_insert_refcount_tree()
253 ocfs2_erase_refcount_tree_from_list_no_lock(struct ocfs2_super *osb, in ocfs2_erase_refcount_tree_from_list_no_lock() argument
256 rb_erase(&tree->rf_node, &osb->osb_rf_lock_tree); in ocfs2_erase_refcount_tree_from_list_no_lock()
257 if (osb->osb_ref_tree_lru && osb->osb_ref_tree_lru == tree) in ocfs2_erase_refcount_tree_from_list_no_lock()
258 osb->osb_ref_tree_lru = NULL; in ocfs2_erase_refcount_tree_from_list_no_lock()
261 static void ocfs2_erase_refcount_tree_from_list(struct ocfs2_super *osb, in ocfs2_erase_refcount_tree_from_list() argument
264 spin_lock(&osb->osb_lock); in ocfs2_erase_refcount_tree_from_list()
265 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree); in ocfs2_erase_refcount_tree_from_list()
266 spin_unlock(&osb->osb_lock); in ocfs2_erase_refcount_tree_from_list()
298 static inline void ocfs2_init_refcount_tree_lock(struct ocfs2_super *osb, in ocfs2_init_refcount_tree_lock() argument
303 ocfs2_refcount_lock_res_init(&new->rf_lockres, osb, in ocfs2_init_refcount_tree_lock()
308 ocfs2_allocate_refcount_tree(struct ocfs2_super *osb, u64 rf_blkno) in ocfs2_allocate_refcount_tree() argument
318 ocfs2_init_refcount_tree_ci(new, osb->sb); in ocfs2_allocate_refcount_tree()
323 static int ocfs2_get_refcount_tree(struct ocfs2_super *osb, u64 rf_blkno, in ocfs2_get_refcount_tree() argument
331 spin_lock(&osb->osb_lock); in ocfs2_get_refcount_tree()
332 if (osb->osb_ref_tree_lru && in ocfs2_get_refcount_tree()
333 osb->osb_ref_tree_lru->rf_blkno == rf_blkno) in ocfs2_get_refcount_tree()
334 tree = osb->osb_ref_tree_lru; in ocfs2_get_refcount_tree()
336 tree = ocfs2_find_refcount_tree(osb, rf_blkno); in ocfs2_get_refcount_tree()
340 spin_unlock(&osb->osb_lock); in ocfs2_get_refcount_tree()
342 new = ocfs2_allocate_refcount_tree(osb, rf_blkno); in ocfs2_get_refcount_tree()
366 ocfs2_init_refcount_tree_lock(osb, new, rf_blkno, in ocfs2_get_refcount_tree()
370 spin_lock(&osb->osb_lock); in ocfs2_get_refcount_tree()
371 tree = ocfs2_find_refcount_tree(osb, rf_blkno); in ocfs2_get_refcount_tree()
375 ocfs2_insert_refcount_tree(osb, new); in ocfs2_get_refcount_tree()
383 osb->osb_ref_tree_lru = tree; in ocfs2_get_refcount_tree()
385 spin_unlock(&osb->osb_lock); in ocfs2_get_refcount_tree()
415 static int __ocfs2_lock_refcount_tree(struct ocfs2_super *osb, in __ocfs2_lock_refcount_tree() argument
443 int ocfs2_lock_refcount_tree(struct ocfs2_super *osb, in ocfs2_lock_refcount_tree() argument
454 ret = ocfs2_get_refcount_tree(osb, ref_blkno, &tree); in ocfs2_lock_refcount_tree()
462 ret = __ocfs2_lock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
473 ocfs2_unlock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
489 ocfs2_erase_refcount_tree_from_list(osb, tree); in ocfs2_lock_refcount_tree()
494 ocfs2_unlock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
516 void ocfs2_unlock_refcount_tree(struct ocfs2_super *osb, in ocfs2_unlock_refcount_tree() argument
528 void ocfs2_purge_refcount_trees(struct ocfs2_super *osb) in ocfs2_purge_refcount_trees() argument
532 struct rb_root *root = &osb->osb_rf_lock_tree; in ocfs2_purge_refcount_trees()
557 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_create_refcount_tree() local
570 ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &meta_ac); in ocfs2_create_refcount_tree()
576 handle = ocfs2_start_trans(osb, OCFS2_REFCOUNT_TREE_CREATE_CREDITS); in ocfs2_create_refcount_tree()
598 new_tree = ocfs2_allocate_refcount_tree(osb, first_blkno); in ocfs2_create_refcount_tree()
627 rb->rf_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_create_refcount_tree()
631 cpu_to_le16(ocfs2_refcount_recs_per_rb(osb->sb)); in ocfs2_create_refcount_tree()
632 spin_lock(&osb->osb_lock); in ocfs2_create_refcount_tree()
633 rb->rf_generation = osb->s_next_generation++; in ocfs2_create_refcount_tree()
634 spin_unlock(&osb->osb_lock); in ocfs2_create_refcount_tree()
653 ocfs2_init_refcount_tree_lock(osb, new_tree, first_blkno, in ocfs2_create_refcount_tree()
656 spin_lock(&osb->osb_lock); in ocfs2_create_refcount_tree()
657 tree = ocfs2_find_refcount_tree(osb, first_blkno); in ocfs2_create_refcount_tree()
667 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree); in ocfs2_create_refcount_tree()
668 ocfs2_insert_refcount_tree(osb, new_tree); in ocfs2_create_refcount_tree()
669 spin_unlock(&osb->osb_lock); in ocfs2_create_refcount_tree()
675 ocfs2_commit_trans(osb, handle); in ocfs2_create_refcount_tree()
698 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_set_refcount_tree() local
705 ret = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_set_refcount_tree()
712 handle = ocfs2_start_trans(osb, OCFS2_REFCOUNT_TREE_SET_CREDITS); in ocfs2_set_refcount_tree()
746 ocfs2_commit_trans(osb, handle); in ocfs2_set_refcount_tree()
748 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_set_refcount_tree()
760 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_remove_refcount_tree() local
774 ret = ocfs2_lock_refcount_tree(osb, ref_blkno, 1, &ref_tree, &blk_bh); in ocfs2_remove_refcount_tree()
794 alloc_inode = ocfs2_get_system_file_inode(osb, in ocfs2_remove_refcount_tree()
813 handle = ocfs2_start_trans(osb, credits); in ocfs2_remove_refcount_tree()
846 ocfs2_erase_refcount_tree_from_list(osb, ref_tree); in ocfs2_remove_refcount_tree()
854 ocfs2_commit_trans(osb, handle); in ocfs2_remove_refcount_tree()
866 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_remove_refcount_tree()
3012 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_duplicate_clusters_by_jbd() local
3020 new_bh = sb_getblk(osb->sb, new_block); in ocfs2_duplicate_clusters_by_jbd()
3183 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_make_clusters_writable() local
3207 handle = ocfs2_start_trans(osb, credits); in ocfs2_make_clusters_writable()
3310 ocfs2_commit_trans(osb, handle); in ocfs2_make_clusters_writable()
3333 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_replace_cow() local
3335 if (!ocfs2_refcount_tree(osb)) { in ocfs2_replace_cow()
3368 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_replace_cow()
3369 ocfs2_run_deallocs(osb, &context->dealloc); in ocfs2_replace_cow()
3386 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_refcount_cow_hunk() local
3415 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc), in ocfs2_refcount_cow_hunk()
3444 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_refcount_cow_hunk()
3665 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_add_refcount_flag() local
3683 ret = ocfs2_reserve_new_metadata_blocks(osb, in ocfs2_add_refcount_flag()
3694 handle = ocfs2_start_trans(osb, credits); in ocfs2_add_refcount_flag()
3724 ocfs2_commit_trans(osb, handle); in ocfs2_add_refcount_flag()
3772 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_attach_refcount_tree() local
3791 ret = ocfs2_lock_refcount_tree(osb, in ocfs2_attach_refcount_tree()
3850 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_attach_refcount_tree()
3854 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_attach_refcount_tree()
3855 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_attach_refcount_tree()
3878 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_add_refcounted_extent() local
3891 handle = ocfs2_start_trans(osb, credits); in ocfs2_add_refcounted_extent()
3915 ocfs2_clusters_to_bytes(osb->sb, num_clusters)); in ocfs2_add_refcounted_extent()
3920 ocfs2_commit_trans(osb, handle); in ocfs2_add_refcounted_extent()
3934 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb); in ocfs2_duplicate_inline_data() local
3940 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); in ocfs2_duplicate_inline_data()
3965 ocfs2_commit_trans(osb, handle); in ocfs2_duplicate_inline_data()
4102 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb); in ocfs2_create_reflink_node() local
4123 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc), in ocfs2_create_reflink_node()
4139 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_create_reflink_node()
4143 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_create_reflink_node()
4144 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_create_reflink_node()
4487 struct ocfs2_super *osb; in ocfs2_reflink_remap_extent() local
4494 osb = OCFS2_SB(s_inode->i_sb); in ocfs2_reflink_remap_extent()
4532 ret = ocfs2_lock_refcount_tree(osb, in ocfs2_reflink_remap_extent()
4567 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_reflink_remap_extent()
4577 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_reflink_remap_extent()
4596 struct ocfs2_super *osb; in ocfs2_reflink_remap_blocks() local
4601 osb = OCFS2_SB(s_inode->i_sb); in ocfs2_reflink_remap_blocks()
4678 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_reflink_remap_blocks()
4679 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_reflink_remap_blocks()