Lines Matching refs:osb
219 struct ocfs2_super *osb = OCFS2_SB(oi->vfs_inode.i_sb); in ocfs2_dinode_insert_check() local
222 mlog_bug_on_msg(!ocfs2_sparse_alloc(osb) && in ocfs2_dinode_insert_check()
226 osb->dev_str, in ocfs2_dinode_insert_check()
1002 struct ocfs2_super *osb = in ocfs2_create_new_meta_bhs() local
1021 bhs[i] = sb_getblk(osb->sb, first_blkno); in ocfs2_create_new_meta_bhs()
1037 memset(bhs[i]->b_data, 0, osb->sb->s_blocksize); in ocfs2_create_new_meta_bhs()
1042 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_create_new_meta_bhs()
1048 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb)); in ocfs2_create_new_meta_bhs()
3110 static int ocfs2_remove_rightmost_empty_extent(struct ocfs2_super *osb, in ocfs2_remove_rightmost_empty_extent() argument
3119 handle = ocfs2_start_trans(osb, credits); in ocfs2_remove_rightmost_empty_extent()
3130 ocfs2_commit_trans(osb, handle); in ocfs2_remove_rightmost_empty_extent()
4792 struct ocfs2_super *osb = in ocfs2_add_clusters_in_btree() local
4845 block = ocfs2_clusters_to_blocks(osb->sb, bit_off); in ocfs2_add_clusters_in_btree()
4871 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_add_clusters_in_btree()
4877 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_add_clusters_in_btree()
5663 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_reserve_blocks_for_rec_trunc() local
5675 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) in ocfs2_reserve_blocks_for_rec_trunc()
5679 ret = ocfs2_reserve_new_metadata_blocks(osb, extra_blocks, ac); in ocfs2_reserve_blocks_for_rec_trunc()
5705 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_remove_btree_range() local
5706 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_remove_btree_range()
5715 ret = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_remove_btree_range()
5744 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_remove_btree_range()
5745 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_remove_btree_range()
5752 handle = ocfs2_start_trans(osb, in ocfs2_remove_btree_range()
5753 ocfs2_remove_extent_credits(osb->sb) + credits); in ocfs2_remove_btree_range()
5784 ocfs2_blocks_to_clusters(osb->sb, in ocfs2_remove_btree_range()
5789 ret = ocfs2_truncate_log_append(osb, handle, in ocfs2_remove_btree_range()
5797 ocfs2_commit_trans(osb, handle); in ocfs2_remove_btree_range()
5805 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_remove_btree_range()
5810 int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb) in ocfs2_truncate_log_needs_flush() argument
5812 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_needs_flush()
5821 "%u, count = %u\n", osb->slot_num, in ocfs2_truncate_log_needs_flush()
5843 int ocfs2_truncate_log_append(struct ocfs2_super *osb, in ocfs2_truncate_log_append() argument
5850 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_append()
5851 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_append()
5857 start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk); in ocfs2_truncate_log_append()
5868 mlog_bug_on_msg(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) || in ocfs2_truncate_log_append()
5873 ocfs2_truncate_recs_per_inode(osb->sb), in ocfs2_truncate_log_append()
5914 osb->truncated_clusters += num_clusters; in ocfs2_truncate_log_append()
5919 static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, in ocfs2_replay_truncate_records() argument
5930 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_replay_truncate_records()
5931 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_replay_truncate_records()
5938 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC); in ocfs2_replay_truncate_records()
5950 ocfs2_commit_trans(osb, handle); in ocfs2_replay_truncate_records()
5975 ocfs2_commit_trans(osb, handle); in ocfs2_replay_truncate_records()
5981 ocfs2_commit_trans(osb, handle); in ocfs2_replay_truncate_records()
5985 osb->truncated_clusters = 0; in ocfs2_replay_truncate_records()
5992 int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) in __ocfs2_flush_truncate_log() argument
5996 struct inode *tl_inode = osb->osb_tl_inode; in __ocfs2_flush_truncate_log()
5998 struct buffer_head *tl_bh = osb->osb_tl_bh; in __ocfs2_flush_truncate_log()
6002 struct ocfs2_journal *journal = osb->journal; in __ocfs2_flush_truncate_log()
6037 data_alloc_inode = ocfs2_get_system_file_inode(osb, in __ocfs2_flush_truncate_log()
6054 status = ocfs2_replay_truncate_records(osb, data_alloc_inode, in __ocfs2_flush_truncate_log()
6070 int ocfs2_flush_truncate_log(struct ocfs2_super *osb) in ocfs2_flush_truncate_log() argument
6073 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_flush_truncate_log()
6076 status = __ocfs2_flush_truncate_log(osb); in ocfs2_flush_truncate_log()
6085 struct ocfs2_super *osb = in ocfs2_truncate_log_worker() local
6089 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_worker()
6093 ocfs2_init_steal_slots(osb); in ocfs2_truncate_log_worker()
6097 void ocfs2_schedule_truncate_log_flush(struct ocfs2_super *osb, in ocfs2_schedule_truncate_log_flush() argument
6100 if (osb->osb_tl_inode && in ocfs2_schedule_truncate_log_flush()
6101 atomic_read(&osb->osb_tl_disable) == 0) { in ocfs2_schedule_truncate_log_flush()
6105 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_schedule_truncate_log_flush()
6107 queue_delayed_work(osb->ocfs2_wq, &osb->osb_truncate_log_wq, in ocfs2_schedule_truncate_log_flush()
6117 int ocfs2_try_to_free_truncate_log(struct ocfs2_super *osb, in ocfs2_try_to_free_truncate_log() argument
6124 inode_lock(osb->osb_tl_inode); in ocfs2_try_to_free_truncate_log()
6125 truncated_clusters = osb->truncated_clusters; in ocfs2_try_to_free_truncate_log()
6126 inode_unlock(osb->osb_tl_inode); in ocfs2_try_to_free_truncate_log()
6135 ret = ocfs2_flush_truncate_log(osb); in ocfs2_try_to_free_truncate_log()
6141 if (jbd2_journal_start_commit(osb->journal->j_journal, &target)) { in ocfs2_try_to_free_truncate_log()
6142 jbd2_log_wait_commit(osb->journal->j_journal, target); in ocfs2_try_to_free_truncate_log()
6149 static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb, in ocfs2_get_truncate_log_info() argument
6158 inode = ocfs2_get_system_file_inode(osb, in ocfs2_get_truncate_log_info()
6184 int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_begin_truncate_log_recovery() argument
6198 status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh); in ocfs2_begin_truncate_log_recovery()
6230 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check); in ocfs2_begin_truncate_log_recovery()
6231 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode)); in ocfs2_begin_truncate_log_recovery()
6251 int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_complete_truncate_log_recovery() argument
6259 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_complete_truncate_log_recovery()
6275 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_complete_truncate_log_recovery()
6276 status = __ocfs2_flush_truncate_log(osb); in ocfs2_complete_truncate_log_recovery()
6283 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_complete_truncate_log_recovery()
6292 start_blk = ocfs2_clusters_to_blocks(osb->sb, start_cluster); in ocfs2_complete_truncate_log_recovery()
6294 status = ocfs2_truncate_log_append(osb, handle, in ocfs2_complete_truncate_log_recovery()
6296 ocfs2_commit_trans(osb, handle); in ocfs2_complete_truncate_log_recovery()
6309 void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb) in ocfs2_truncate_log_shutdown() argument
6312 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_shutdown()
6314 atomic_set(&osb->osb_tl_disable, 1); in ocfs2_truncate_log_shutdown()
6317 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_truncate_log_shutdown()
6318 flush_workqueue(osb->ocfs2_wq); in ocfs2_truncate_log_shutdown()
6320 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_shutdown()
6324 brelse(osb->osb_tl_bh); in ocfs2_truncate_log_shutdown()
6325 iput(osb->osb_tl_inode); in ocfs2_truncate_log_shutdown()
6329 int ocfs2_truncate_log_init(struct ocfs2_super *osb) in ocfs2_truncate_log_init() argument
6335 status = ocfs2_get_truncate_log_info(osb, in ocfs2_truncate_log_init()
6336 osb->slot_num, in ocfs2_truncate_log_init()
6345 INIT_DELAYED_WORK(&osb->osb_truncate_log_wq, in ocfs2_truncate_log_init()
6347 atomic_set(&osb->osb_tl_disable, 0); in ocfs2_truncate_log_init()
6348 osb->osb_tl_bh = tl_bh; in ocfs2_truncate_log_init()
6349 osb->osb_tl_inode = tl_inode; in ocfs2_truncate_log_init()
6392 static int ocfs2_free_cached_blocks(struct ocfs2_super *osb, in ocfs2_free_cached_blocks() argument
6404 inode = ocfs2_get_system_file_inode(osb, sysfile_type, slot); in ocfs2_free_cached_blocks()
6425 handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE); in ocfs2_free_cached_blocks()
6440 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_blocks()
6487 static int ocfs2_free_cached_clusters(struct ocfs2_super *osb, in ocfs2_free_cached_clusters() argument
6491 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_free_cached_clusters()
6498 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_free_cached_clusters()
6499 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_free_cached_clusters()
6506 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_free_cached_clusters()
6513 ret = ocfs2_truncate_log_append(osb, handle, head->free_blk, in ocfs2_free_cached_clusters()
6516 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_clusters()
6539 int ocfs2_run_deallocs(struct ocfs2_super *osb, in ocfs2_run_deallocs() argument
6554 ret2 = ocfs2_free_cached_blocks(osb, in ocfs2_run_deallocs()
6569 ret2 = ocfs2_free_cached_clusters(osb, in ocfs2_run_deallocs()
6668 struct ocfs2_super *osb = in ocfs2_reuse_blk_from_dealloc() local
6684 osb->slot_num, &real_slot, in ocfs2_reuse_blk_from_dealloc()
6697 new_eb_bh[i] = sb_getblk(osb->sb, bf->free_blk); in ocfs2_reuse_blk_from_dealloc()
6706 bf->free_blk, osb->slot_num, real_slot); in ocfs2_reuse_blk_from_dealloc()
6718 memset(new_eb_bh[i]->b_data, 0, osb->sb->s_blocksize); in ocfs2_reuse_blk_from_dealloc()
6726 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_reuse_blk_from_dealloc()
6731 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb)); in ocfs2_reuse_blk_from_dealloc()
7068 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_convert_inline_data_to_extents() local
7078 ret = ocfs2_reserve_clusters(osb, 1, &data_ac); in ocfs2_convert_inline_data_to_extents()
7085 handle = ocfs2_start_trans(osb, in ocfs2_convert_inline_data_to_extents()
7086 ocfs2_inline_to_extents_credits(osb->sb)); in ocfs2_convert_inline_data_to_extents()
7102 osb->s_clustersize); in ocfs2_convert_inline_data_to_extents()
7106 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
7183 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
7187 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_convert_inline_data_to_extents()
7193 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_convert_inline_data_to_extents()
7197 ocfs2_commit_trans(osb, handle); in ocfs2_convert_inline_data_to_extents()
7211 int ocfs2_commit_truncate(struct ocfs2_super *osb, in ocfs2_commit_truncate() argument
7231 new_highest_cpos = ocfs2_clusters_for_bytes(osb->sb, in ocfs2_commit_truncate()
7303 status = ocfs2_remove_rightmost_empty_extent(osb, in ocfs2_commit_truncate()
7345 status = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_commit_truncate()
7371 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_commit_truncate()
7373 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_commit_truncate()
7375 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_commit_truncate()
7391 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_truncate_inline() local
7406 !ocfs2_supports_inline_data(osb)) { in ocfs2_truncate_inline()
7412 osb->s_feature_incompat); in ocfs2_truncate_inline()
7417 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); in ocfs2_truncate_inline()
7455 ocfs2_commit_trans(osb, handle); in ocfs2_truncate_inline()
7466 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_trim_extent() local
7479 if (group != osb->first_cluster_group_blkno) in ocfs2_trim_extent()
7535 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_trim_mainbm() local
7545 start = range->start >> osb->s_clustersize_bits; in ocfs2_trim_mainbm()
7546 len = range->len >> osb->s_clustersize_bits; in ocfs2_trim_mainbm()
7547 minlen = range->minlen >> osb->s_clustersize_bits; in ocfs2_trim_mainbm()
7549 if (minlen >= osb->bitmap_cpg || range->len < sb->s_blocksize) in ocfs2_trim_mainbm()
7555 main_bm_inode = ocfs2_get_system_file_inode(osb, in ocfs2_trim_mainbm()
7590 if (first_group == osb->first_cluster_group_blkno) in ocfs2_trim_mainbm()
7601 if (first_bit + len >= osb->bitmap_cpg) in ocfs2_trim_mainbm()
7602 last_bit = osb->bitmap_cpg; in ocfs2_trim_mainbm()
7626 len -= osb->bitmap_cpg - first_bit; in ocfs2_trim_mainbm()
7628 if (group == osb->first_cluster_group_blkno) in ocfs2_trim_mainbm()
7629 group = ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_mainbm()
7631 group += ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_mainbm()
7652 range->len = trimmed * osb->s_clustersize; in ocfs2_trim_mainbm()
7659 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_trim_fs() local
7662 ocfs2_trim_fs_lock_res_init(osb); in ocfs2_trim_fs()
7666 ret = ocfs2_trim_fs_lock(osb, NULL, 1); in ocfs2_trim_fs()
7670 ocfs2_trim_fs_lock_res_uninit(osb); in ocfs2_trim_fs()
7676 osb->dev_str); in ocfs2_trim_fs()
7677 ret = ocfs2_trim_fs_lock(osb, &info, 0); in ocfs2_trim_fs()
7680 ocfs2_trim_fs_lock_res_uninit(osb); in ocfs2_trim_fs()
7691 osb->dev_str, info.tf_nodenum); in ocfs2_trim_fs()
7697 info.tf_nodenum = osb->node_num; in ocfs2_trim_fs()
7708 ocfs2_trim_fs_unlock(osb, pinfo); in ocfs2_trim_fs()
7709 ocfs2_trim_fs_lock_res_uninit(osb); in ocfs2_trim_fs()