Lines Matching refs:osb

227 	struct ocfs2_super *osb = OCFS2_SB(oi->vfs_inode.i_sb);  in ocfs2_dinode_insert_check()  local
230 mlog_bug_on_msg(!ocfs2_sparse_alloc(osb) && in ocfs2_dinode_insert_check()
234 osb->dev_str, in ocfs2_dinode_insert_check()
957 int ocfs2_num_free_extents(struct ocfs2_super *osb, in ocfs2_num_free_extents() argument
1005 struct ocfs2_super *osb = in ocfs2_create_new_meta_bhs() local
1024 bhs[i] = sb_getblk(osb->sb, first_blkno); in ocfs2_create_new_meta_bhs()
1040 memset(bhs[i]->b_data, 0, osb->sb->s_blocksize); in ocfs2_create_new_meta_bhs()
1045 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_create_new_meta_bhs()
1051 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb)); in ocfs2_create_new_meta_bhs()
3123 static int ocfs2_remove_rightmost_empty_extent(struct ocfs2_super *osb, in ocfs2_remove_rightmost_empty_extent() argument
3132 handle = ocfs2_start_trans(osb, credits); in ocfs2_remove_rightmost_empty_extent()
3143 ocfs2_commit_trans(osb, handle); in ocfs2_remove_rightmost_empty_extent()
4767 struct ocfs2_super *osb = in ocfs2_add_clusters_in_btree() local
4775 free_extents = ocfs2_num_free_extents(osb, et); in ocfs2_add_clusters_in_btree()
4820 block = ocfs2_clusters_to_blocks(osb->sb, bit_off); in ocfs2_add_clusters_in_btree()
4846 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_add_clusters_in_btree()
4852 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_add_clusters_in_btree()
5641 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_reserve_blocks_for_rec_trunc() local
5645 num_free_extents = ocfs2_num_free_extents(osb, et); in ocfs2_reserve_blocks_for_rec_trunc()
5653 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) in ocfs2_reserve_blocks_for_rec_trunc()
5657 ret = ocfs2_reserve_new_metadata_blocks(osb, extra_blocks, ac); in ocfs2_reserve_blocks_for_rec_trunc()
5684 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_remove_btree_range() local
5685 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_remove_btree_range()
5695 ret = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_remove_btree_range()
5724 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_remove_btree_range()
5725 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_remove_btree_range()
5732 handle = ocfs2_start_trans(osb, in ocfs2_remove_btree_range()
5733 ocfs2_remove_extent_credits(osb->sb) + credits); in ocfs2_remove_btree_range()
5764 ocfs2_blocks_to_clusters(osb->sb, in ocfs2_remove_btree_range()
5769 ret = ocfs2_truncate_log_append(osb, handle, in ocfs2_remove_btree_range()
5777 ocfs2_commit_trans(osb, handle); in ocfs2_remove_btree_range()
5785 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_remove_btree_range()
5790 int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb) in ocfs2_truncate_log_needs_flush() argument
5792 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_needs_flush()
5801 "%u, count = %u\n", osb->slot_num, in ocfs2_truncate_log_needs_flush()
5823 int ocfs2_truncate_log_append(struct ocfs2_super *osb, in ocfs2_truncate_log_append() argument
5830 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_append()
5831 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_append()
5837 start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk); in ocfs2_truncate_log_append()
5848 mlog_bug_on_msg(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) || in ocfs2_truncate_log_append()
5853 ocfs2_truncate_recs_per_inode(osb->sb), in ocfs2_truncate_log_append()
5894 osb->truncated_clusters += num_clusters; in ocfs2_truncate_log_append()
5899 static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, in ocfs2_replay_truncate_records() argument
5911 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_replay_truncate_records()
5912 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_replay_truncate_records()
5964 osb->truncated_clusters = 0; in ocfs2_replay_truncate_records()
5971 int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) in __ocfs2_flush_truncate_log() argument
5976 struct inode *tl_inode = osb->osb_tl_inode; in __ocfs2_flush_truncate_log()
5978 struct buffer_head *tl_bh = osb->osb_tl_bh; in __ocfs2_flush_truncate_log()
6002 data_alloc_inode = ocfs2_get_system_file_inode(osb, in __ocfs2_flush_truncate_log()
6019 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in __ocfs2_flush_truncate_log()
6026 status = ocfs2_replay_truncate_records(osb, handle, data_alloc_inode, in __ocfs2_flush_truncate_log()
6031 ocfs2_commit_trans(osb, handle); in __ocfs2_flush_truncate_log()
6045 int ocfs2_flush_truncate_log(struct ocfs2_super *osb) in ocfs2_flush_truncate_log() argument
6048 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_flush_truncate_log()
6051 status = __ocfs2_flush_truncate_log(osb); in ocfs2_flush_truncate_log()
6060 struct ocfs2_super *osb = in ocfs2_truncate_log_worker() local
6064 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_worker()
6068 ocfs2_init_steal_slots(osb); in ocfs2_truncate_log_worker()
6072 void ocfs2_schedule_truncate_log_flush(struct ocfs2_super *osb, in ocfs2_schedule_truncate_log_flush() argument
6075 if (osb->osb_tl_inode && in ocfs2_schedule_truncate_log_flush()
6076 atomic_read(&osb->osb_tl_disable) == 0) { in ocfs2_schedule_truncate_log_flush()
6080 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_schedule_truncate_log_flush()
6082 queue_delayed_work(ocfs2_wq, &osb->osb_truncate_log_wq, in ocfs2_schedule_truncate_log_flush()
6087 static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb, in ocfs2_get_truncate_log_info() argument
6096 inode = ocfs2_get_system_file_inode(osb, in ocfs2_get_truncate_log_info()
6122 int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_begin_truncate_log_recovery() argument
6136 status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh); in ocfs2_begin_truncate_log_recovery()
6168 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check); in ocfs2_begin_truncate_log_recovery()
6169 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode)); in ocfs2_begin_truncate_log_recovery()
6190 int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_complete_truncate_log_recovery() argument
6198 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_complete_truncate_log_recovery()
6214 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_complete_truncate_log_recovery()
6215 status = __ocfs2_flush_truncate_log(osb); in ocfs2_complete_truncate_log_recovery()
6222 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_complete_truncate_log_recovery()
6231 start_blk = ocfs2_clusters_to_blocks(osb->sb, start_cluster); in ocfs2_complete_truncate_log_recovery()
6233 status = ocfs2_truncate_log_append(osb, handle, in ocfs2_complete_truncate_log_recovery()
6235 ocfs2_commit_trans(osb, handle); in ocfs2_complete_truncate_log_recovery()
6248 void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb) in ocfs2_truncate_log_shutdown() argument
6251 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_shutdown()
6253 atomic_set(&osb->osb_tl_disable, 1); in ocfs2_truncate_log_shutdown()
6256 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_truncate_log_shutdown()
6259 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_shutdown()
6263 brelse(osb->osb_tl_bh); in ocfs2_truncate_log_shutdown()
6264 iput(osb->osb_tl_inode); in ocfs2_truncate_log_shutdown()
6268 int ocfs2_truncate_log_init(struct ocfs2_super *osb) in ocfs2_truncate_log_init() argument
6274 status = ocfs2_get_truncate_log_info(osb, in ocfs2_truncate_log_init()
6275 osb->slot_num, in ocfs2_truncate_log_init()
6284 INIT_DELAYED_WORK(&osb->osb_truncate_log_wq, in ocfs2_truncate_log_init()
6286 atomic_set(&osb->osb_tl_disable, 0); in ocfs2_truncate_log_init()
6287 osb->osb_tl_bh = tl_bh; in ocfs2_truncate_log_init()
6288 osb->osb_tl_inode = tl_inode; in ocfs2_truncate_log_init()
6331 static int ocfs2_free_cached_blocks(struct ocfs2_super *osb, in ocfs2_free_cached_blocks() argument
6343 inode = ocfs2_get_system_file_inode(osb, sysfile_type, slot); in ocfs2_free_cached_blocks()
6358 handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE); in ocfs2_free_cached_blocks()
6393 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_blocks()
6435 static int ocfs2_free_cached_clusters(struct ocfs2_super *osb, in ocfs2_free_cached_clusters() argument
6439 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_free_cached_clusters()
6446 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_free_cached_clusters()
6447 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_free_cached_clusters()
6454 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_free_cached_clusters()
6461 ret = ocfs2_truncate_log_append(osb, handle, head->free_blk, in ocfs2_free_cached_clusters()
6464 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_clusters()
6487 int ocfs2_run_deallocs(struct ocfs2_super *osb, in ocfs2_run_deallocs() argument
6502 ret2 = ocfs2_free_cached_blocks(osb, in ocfs2_run_deallocs()
6517 ret2 = ocfs2_free_cached_clusters(osb, in ocfs2_run_deallocs()
6860 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_convert_inline_data_to_extents() local
6864 loff_t end = osb->s_clustersize; in ocfs2_convert_inline_data_to_extents()
6871 pages = kcalloc(ocfs2_pages_per_cluster(osb->sb), in ocfs2_convert_inline_data_to_extents()
6879 ret = ocfs2_reserve_clusters(osb, 1, &data_ac); in ocfs2_convert_inline_data_to_extents()
6886 handle = ocfs2_start_trans(osb, in ocfs2_convert_inline_data_to_extents()
6887 ocfs2_inline_to_extents_credits(osb->sb)); in ocfs2_convert_inline_data_to_extents()
6906 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
6930 if (!ocfs2_sparse_alloc(osb) && in ocfs2_convert_inline_data_to_extents()
6931 PAGE_CACHE_SIZE < osb->s_clustersize) in ocfs2_convert_inline_data_to_extents()
6953 if (PAGE_CACHE_SIZE > osb->s_clustersize) in ocfs2_convert_inline_data_to_extents()
6954 page_end = osb->s_clustersize; in ocfs2_convert_inline_data_to_extents()
6995 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
6999 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_convert_inline_data_to_extents()
7005 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_convert_inline_data_to_extents()
7009 ocfs2_commit_trans(osb, handle); in ocfs2_convert_inline_data_to_extents()
7025 int ocfs2_commit_truncate(struct ocfs2_super *osb, in ocfs2_commit_truncate() argument
7045 new_highest_cpos = ocfs2_clusters_for_bytes(osb->sb, in ocfs2_commit_truncate()
7117 status = ocfs2_remove_rightmost_empty_extent(osb, in ocfs2_commit_truncate()
7159 status = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_commit_truncate()
7185 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_commit_truncate()
7187 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_commit_truncate()
7189 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_commit_truncate()
7205 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_truncate_inline() local
7216 !ocfs2_supports_inline_data(osb)) { in ocfs2_truncate_inline()
7222 osb->s_feature_incompat); in ocfs2_truncate_inline()
7227 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); in ocfs2_truncate_inline()
7265 ocfs2_commit_trans(osb, handle); in ocfs2_truncate_inline()
7333 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_trim_fs() local
7343 start = range->start >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7344 len = range->len >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7345 minlen = range->minlen >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7347 if (minlen >= osb->bitmap_cpg || range->len < sb->s_blocksize) in ocfs2_trim_fs()
7350 main_bm_inode = ocfs2_get_system_file_inode(osb, in ocfs2_trim_fs()
7373 len = range->len >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7381 if (first_group == osb->first_cluster_group_blkno) in ocfs2_trim_fs()
7386 last_bit = osb->bitmap_cpg; in ocfs2_trim_fs()
7390 if (first_bit + len >= osb->bitmap_cpg) in ocfs2_trim_fs()
7391 last_bit = osb->bitmap_cpg; in ocfs2_trim_fs()
7414 len -= osb->bitmap_cpg - first_bit; in ocfs2_trim_fs()
7416 if (group == osb->first_cluster_group_blkno) in ocfs2_trim_fs()
7417 group = ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_fs()
7419 group += ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_fs()