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()
959 int ocfs2_num_free_extents(struct ocfs2_super *osb, in ocfs2_num_free_extents() argument
1007 struct ocfs2_super *osb = in ocfs2_create_new_meta_bhs() local
1026 bhs[i] = sb_getblk(osb->sb, first_blkno); in ocfs2_create_new_meta_bhs()
1042 memset(bhs[i]->b_data, 0, osb->sb->s_blocksize); in ocfs2_create_new_meta_bhs()
1047 eb->h_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_create_new_meta_bhs()
1053 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb)); in ocfs2_create_new_meta_bhs()
4748 struct ocfs2_super *osb = in ocfs2_add_clusters_in_btree() local
4756 free_extents = ocfs2_num_free_extents(osb, et); in ocfs2_add_clusters_in_btree()
4801 block = ocfs2_clusters_to_blocks(osb->sb, bit_off); in ocfs2_add_clusters_in_btree()
4827 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_add_clusters_in_btree()
4833 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_add_clusters_in_btree()
5623 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_reserve_blocks_for_rec_trunc() local
5627 num_free_extents = ocfs2_num_free_extents(osb, et); in ocfs2_reserve_blocks_for_rec_trunc()
5635 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) in ocfs2_reserve_blocks_for_rec_trunc()
5639 ret = ocfs2_reserve_new_metadata_blocks(osb, extra_blocks, ac); in ocfs2_reserve_blocks_for_rec_trunc()
5666 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_remove_btree_range() local
5667 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_remove_btree_range()
5677 ret = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_remove_btree_range()
5706 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_remove_btree_range()
5707 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_remove_btree_range()
5714 handle = ocfs2_start_trans(osb, in ocfs2_remove_btree_range()
5715 ocfs2_remove_extent_credits(osb->sb) + credits); in ocfs2_remove_btree_range()
5746 ocfs2_blocks_to_clusters(osb->sb, in ocfs2_remove_btree_range()
5751 ret = ocfs2_truncate_log_append(osb, handle, in ocfs2_remove_btree_range()
5759 ocfs2_commit_trans(osb, handle); in ocfs2_remove_btree_range()
5767 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_remove_btree_range()
5772 int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb) in ocfs2_truncate_log_needs_flush() argument
5774 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_needs_flush()
5783 "%u, count = %u\n", osb->slot_num, in ocfs2_truncate_log_needs_flush()
5805 int ocfs2_truncate_log_append(struct ocfs2_super *osb, in ocfs2_truncate_log_append() argument
5812 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_append()
5813 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_truncate_log_append()
5819 start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk); in ocfs2_truncate_log_append()
5830 mlog_bug_on_msg(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) || in ocfs2_truncate_log_append()
5835 ocfs2_truncate_recs_per_inode(osb->sb), in ocfs2_truncate_log_append()
5876 osb->truncated_clusters += num_clusters; in ocfs2_truncate_log_append()
5881 static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, in ocfs2_replay_truncate_records() argument
5893 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_replay_truncate_records()
5894 struct buffer_head *tl_bh = osb->osb_tl_bh; in ocfs2_replay_truncate_records()
5946 osb->truncated_clusters = 0; in ocfs2_replay_truncate_records()
5953 int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) in __ocfs2_flush_truncate_log() argument
5958 struct inode *tl_inode = osb->osb_tl_inode; in __ocfs2_flush_truncate_log()
5960 struct buffer_head *tl_bh = osb->osb_tl_bh; in __ocfs2_flush_truncate_log()
5984 data_alloc_inode = ocfs2_get_system_file_inode(osb, in __ocfs2_flush_truncate_log()
6001 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in __ocfs2_flush_truncate_log()
6008 status = ocfs2_replay_truncate_records(osb, handle, data_alloc_inode, in __ocfs2_flush_truncate_log()
6013 ocfs2_commit_trans(osb, handle); in __ocfs2_flush_truncate_log()
6027 int ocfs2_flush_truncate_log(struct ocfs2_super *osb) in ocfs2_flush_truncate_log() argument
6030 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_flush_truncate_log()
6033 status = __ocfs2_flush_truncate_log(osb); in ocfs2_flush_truncate_log()
6042 struct ocfs2_super *osb = in ocfs2_truncate_log_worker() local
6046 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_worker()
6050 ocfs2_init_steal_slots(osb); in ocfs2_truncate_log_worker()
6054 void ocfs2_schedule_truncate_log_flush(struct ocfs2_super *osb, in ocfs2_schedule_truncate_log_flush() argument
6057 if (osb->osb_tl_inode && in ocfs2_schedule_truncate_log_flush()
6058 atomic_read(&osb->osb_tl_disable) == 0) { in ocfs2_schedule_truncate_log_flush()
6062 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_schedule_truncate_log_flush()
6064 queue_delayed_work(ocfs2_wq, &osb->osb_truncate_log_wq, in ocfs2_schedule_truncate_log_flush()
6069 static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb, in ocfs2_get_truncate_log_info() argument
6078 inode = ocfs2_get_system_file_inode(osb, in ocfs2_get_truncate_log_info()
6104 int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_begin_truncate_log_recovery() argument
6118 status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh); in ocfs2_begin_truncate_log_recovery()
6150 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check); in ocfs2_begin_truncate_log_recovery()
6151 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode)); in ocfs2_begin_truncate_log_recovery()
6172 int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, in ocfs2_complete_truncate_log_recovery() argument
6180 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_complete_truncate_log_recovery()
6196 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_complete_truncate_log_recovery()
6197 status = __ocfs2_flush_truncate_log(osb); in ocfs2_complete_truncate_log_recovery()
6204 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_complete_truncate_log_recovery()
6213 start_blk = ocfs2_clusters_to_blocks(osb->sb, start_cluster); in ocfs2_complete_truncate_log_recovery()
6215 status = ocfs2_truncate_log_append(osb, handle, in ocfs2_complete_truncate_log_recovery()
6217 ocfs2_commit_trans(osb, handle); in ocfs2_complete_truncate_log_recovery()
6230 void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb) in ocfs2_truncate_log_shutdown() argument
6233 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_truncate_log_shutdown()
6235 atomic_set(&osb->osb_tl_disable, 1); in ocfs2_truncate_log_shutdown()
6238 cancel_delayed_work(&osb->osb_truncate_log_wq); in ocfs2_truncate_log_shutdown()
6241 status = ocfs2_flush_truncate_log(osb); in ocfs2_truncate_log_shutdown()
6245 brelse(osb->osb_tl_bh); in ocfs2_truncate_log_shutdown()
6246 iput(osb->osb_tl_inode); in ocfs2_truncate_log_shutdown()
6250 int ocfs2_truncate_log_init(struct ocfs2_super *osb) in ocfs2_truncate_log_init() argument
6256 status = ocfs2_get_truncate_log_info(osb, in ocfs2_truncate_log_init()
6257 osb->slot_num, in ocfs2_truncate_log_init()
6266 INIT_DELAYED_WORK(&osb->osb_truncate_log_wq, in ocfs2_truncate_log_init()
6268 atomic_set(&osb->osb_tl_disable, 0); in ocfs2_truncate_log_init()
6269 osb->osb_tl_bh = tl_bh; in ocfs2_truncate_log_init()
6270 osb->osb_tl_inode = tl_inode; in ocfs2_truncate_log_init()
6313 static int ocfs2_free_cached_blocks(struct ocfs2_super *osb, in ocfs2_free_cached_blocks() argument
6325 inode = ocfs2_get_system_file_inode(osb, sysfile_type, slot); in ocfs2_free_cached_blocks()
6340 handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE); in ocfs2_free_cached_blocks()
6375 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_blocks()
6417 static int ocfs2_free_cached_clusters(struct ocfs2_super *osb, in ocfs2_free_cached_clusters() argument
6421 struct inode *tl_inode = osb->osb_tl_inode; in ocfs2_free_cached_clusters()
6428 if (ocfs2_truncate_log_needs_flush(osb)) { in ocfs2_free_cached_clusters()
6429 ret = __ocfs2_flush_truncate_log(osb); in ocfs2_free_cached_clusters()
6436 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE); in ocfs2_free_cached_clusters()
6443 ret = ocfs2_truncate_log_append(osb, handle, head->free_blk, in ocfs2_free_cached_clusters()
6446 ocfs2_commit_trans(osb, handle); in ocfs2_free_cached_clusters()
6469 int ocfs2_run_deallocs(struct ocfs2_super *osb, in ocfs2_run_deallocs() argument
6484 ret2 = ocfs2_free_cached_blocks(osb, in ocfs2_run_deallocs()
6499 ret2 = ocfs2_free_cached_clusters(osb, in ocfs2_run_deallocs()
6842 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_convert_inline_data_to_extents() local
6846 loff_t end = osb->s_clustersize; in ocfs2_convert_inline_data_to_extents()
6853 pages = kcalloc(ocfs2_pages_per_cluster(osb->sb), in ocfs2_convert_inline_data_to_extents()
6861 ret = ocfs2_reserve_clusters(osb, 1, &data_ac); in ocfs2_convert_inline_data_to_extents()
6868 handle = ocfs2_start_trans(osb, in ocfs2_convert_inline_data_to_extents()
6869 ocfs2_inline_to_extents_credits(osb->sb)); in ocfs2_convert_inline_data_to_extents()
6888 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
6912 if (!ocfs2_sparse_alloc(osb) && in ocfs2_convert_inline_data_to_extents()
6913 PAGE_CACHE_SIZE < osb->s_clustersize) in ocfs2_convert_inline_data_to_extents()
6935 if (PAGE_CACHE_SIZE > osb->s_clustersize) in ocfs2_convert_inline_data_to_extents()
6936 page_end = osb->s_clustersize; in ocfs2_convert_inline_data_to_extents()
6977 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_convert_inline_data_to_extents()
6981 ocfs2_free_local_alloc_bits(osb, handle, data_ac, in ocfs2_convert_inline_data_to_extents()
6987 ocfs2_clusters_to_blocks(osb->sb, bit_off), in ocfs2_convert_inline_data_to_extents()
6991 ocfs2_commit_trans(osb, handle); in ocfs2_convert_inline_data_to_extents()
7007 int ocfs2_commit_truncate(struct ocfs2_super *osb, in ocfs2_commit_truncate() argument
7027 new_highest_cpos = ocfs2_clusters_for_bytes(osb->sb, in ocfs2_commit_truncate()
7133 status = ocfs2_lock_refcount_tree(osb, refcount_loc, 1, in ocfs2_commit_truncate()
7159 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); in ocfs2_commit_truncate()
7161 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_commit_truncate()
7163 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_commit_truncate()
7179 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); in ocfs2_truncate_inline() local
7190 !ocfs2_supports_inline_data(osb)) { in ocfs2_truncate_inline()
7197 osb->s_feature_incompat); in ocfs2_truncate_inline()
7202 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); in ocfs2_truncate_inline()
7240 ocfs2_commit_trans(osb, handle); in ocfs2_truncate_inline()
7308 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_trim_fs() local
7318 start = range->start >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7319 len = range->len >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7320 minlen = range->minlen >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7322 if (minlen >= osb->bitmap_cpg || range->len < sb->s_blocksize) in ocfs2_trim_fs()
7325 main_bm_inode = ocfs2_get_system_file_inode(osb, in ocfs2_trim_fs()
7348 len = range->len >> osb->s_clustersize_bits; in ocfs2_trim_fs()
7356 if (first_group == osb->first_cluster_group_blkno) in ocfs2_trim_fs()
7361 last_bit = osb->bitmap_cpg; in ocfs2_trim_fs()
7365 if (first_bit + len >= osb->bitmap_cpg) in ocfs2_trim_fs()
7366 last_bit = osb->bitmap_cpg; in ocfs2_trim_fs()
7389 len -= osb->bitmap_cpg - first_bit; in ocfs2_trim_fs()
7391 if (group == osb->first_cluster_group_blkno) in ocfs2_trim_fs()
7392 group = ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_fs()
7394 group += ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg); in ocfs2_trim_fs()