Lines Matching refs:osb
219 struct ocfs2_super *osb = OCFS2_SB(oi->vfs_inode.i_sb);
222 mlog_bug_on_msg(!ocfs2_sparse_alloc(osb) &&
226 osb->dev_str,
1002 struct ocfs2_super *osb =
1021 bhs[i] = sb_getblk(osb->sb, first_blkno);
1037 memset(bhs[i]->b_data, 0, osb->sb->s_blocksize);
1042 eb->h_fs_generation = cpu_to_le32(osb->fs_generation);
1048 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb));
3110 static int ocfs2_remove_rightmost_empty_extent(struct ocfs2_super *osb,
3119 handle = ocfs2_start_trans(osb, credits);
3130 ocfs2_commit_trans(osb, handle);
4792 struct ocfs2_super *osb =
4845 block = ocfs2_clusters_to_blocks(osb->sb, bit_off);
4871 ocfs2_free_local_alloc_bits(osb, handle, data_ac,
4877 ocfs2_clusters_to_blocks(osb->sb, bit_off),
5663 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
5675 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed))
5679 ret = ocfs2_reserve_new_metadata_blocks(osb, extra_blocks, ac);
5705 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
5706 struct inode *tl_inode = osb->osb_tl_inode;
5715 ret = ocfs2_lock_refcount_tree(osb, refcount_loc, 1,
5744 if (ocfs2_truncate_log_needs_flush(osb)) {
5745 ret = __ocfs2_flush_truncate_log(osb);
5752 handle = ocfs2_start_trans(osb,
5753 ocfs2_remove_extent_credits(osb->sb) + credits);
5784 ocfs2_blocks_to_clusters(osb->sb,
5789 ret = ocfs2_truncate_log_append(osb, handle,
5797 ocfs2_commit_trans(osb, handle);
5805 ocfs2_unlock_refcount_tree(osb, ref_tree, 1);
5810 int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb)
5812 struct buffer_head *tl_bh = osb->osb_tl_bh;
5821 "%u, count = %u\n", osb->slot_num,
5843 int ocfs2_truncate_log_append(struct ocfs2_super *osb,
5850 struct inode *tl_inode = osb->osb_tl_inode;
5851 struct buffer_head *tl_bh = osb->osb_tl_bh;
5857 start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk);
5868 mlog_bug_on_msg(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) ||
5873 ocfs2_truncate_recs_per_inode(osb->sb),
5914 osb->truncated_clusters += num_clusters;
5919 static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
5930 struct inode *tl_inode = osb->osb_tl_inode;
5931 struct buffer_head *tl_bh = osb->osb_tl_bh;
5938 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
5950 ocfs2_commit_trans(osb, handle);
5975 ocfs2_commit_trans(osb, handle);
5981 ocfs2_commit_trans(osb, handle);
5985 osb->truncated_clusters = 0;
5992 int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
5996 struct inode *tl_inode = osb->osb_tl_inode;
5998 struct buffer_head *tl_bh = osb->osb_tl_bh;
6002 struct ocfs2_journal *journal = osb->journal;
6037 data_alloc_inode = ocfs2_get_system_file_inode(osb,
6054 status = ocfs2_replay_truncate_records(osb, data_alloc_inode,
6070 int ocfs2_flush_truncate_log(struct ocfs2_super *osb)
6073 struct inode *tl_inode = osb->osb_tl_inode;
6076 status = __ocfs2_flush_truncate_log(osb);
6085 struct ocfs2_super *osb =
6089 status = ocfs2_flush_truncate_log(osb);
6093 ocfs2_init_steal_slots(osb);
6097 void ocfs2_schedule_truncate_log_flush(struct ocfs2_super *osb,
6100 if (osb->osb_tl_inode &&
6101 atomic_read(&osb->osb_tl_disable) == 0) {
6105 cancel_delayed_work(&osb->osb_truncate_log_wq);
6107 queue_delayed_work(osb->ocfs2_wq, &osb->osb_truncate_log_wq,
6117 int ocfs2_try_to_free_truncate_log(struct ocfs2_super *osb,
6124 inode_lock(osb->osb_tl_inode);
6125 truncated_clusters = osb->truncated_clusters;
6126 inode_unlock(osb->osb_tl_inode);
6135 ret = ocfs2_flush_truncate_log(osb);
6141 if (jbd2_journal_start_commit(osb->journal->j_journal, &target)) {
6142 jbd2_log_wait_commit(osb->journal->j_journal, target);
6149 static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
6161 inode = ocfs2_get_system_file_inode(osb,
6180 if (unlikely(tl_count > ocfs2_truncate_recs_per_inode(osb->sb) ||
6199 int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
6213 status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh);
6245 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check);
6246 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode));
6266 int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
6274 struct inode *tl_inode = osb->osb_tl_inode;
6290 if (ocfs2_truncate_log_needs_flush(osb)) {
6291 status = __ocfs2_flush_truncate_log(osb);
6298 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
6307 start_blk = ocfs2_clusters_to_blocks(osb->sb, start_cluster);
6309 status = ocfs2_truncate_log_append(osb, handle,
6311 ocfs2_commit_trans(osb, handle);
6324 void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb)
6327 struct inode *tl_inode = osb->osb_tl_inode;
6329 atomic_set(&osb->osb_tl_disable, 1);
6332 cancel_delayed_work(&osb->osb_truncate_log_wq);
6333 flush_workqueue(osb->ocfs2_wq);
6335 status = ocfs2_flush_truncate_log(osb);
6339 brelse(osb->osb_tl_bh);
6340 iput(osb->osb_tl_inode);
6344 int ocfs2_truncate_log_init(struct ocfs2_super *osb)
6350 status = ocfs2_get_truncate_log_info(osb,
6351 osb->slot_num,
6358 * osb->osb_tl_inode so we don't set any of the osb variables
6360 INIT_DELAYED_WORK(&osb->osb_truncate_log_wq,
6362 atomic_set(&osb->osb_tl_disable, 0);
6363 osb->osb_tl_bh = tl_bh;
6364 osb->osb_tl_inode = tl_inode;
6407 static int ocfs2_free_cached_blocks(struct ocfs2_super *osb,
6419 inode = ocfs2_get_system_file_inode(osb, sysfile_type, slot);
6440 handle = ocfs2_start_trans(osb, OCFS2_SUBALLOC_FREE);
6455 ocfs2_commit_trans(osb, handle);
6502 static int ocfs2_free_cached_clusters(struct ocfs2_super *osb,
6506 struct inode *tl_inode = osb->osb_tl_inode;
6513 if (ocfs2_truncate_log_needs_flush(osb)) {
6514 ret = __ocfs2_flush_truncate_log(osb);
6521 handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
6528 ret = ocfs2_truncate_log_append(osb, handle, head->free_blk,
6531 ocfs2_commit_trans(osb, handle);
6554 int ocfs2_run_deallocs(struct ocfs2_super *osb,
6569 ret2 = ocfs2_free_cached_blocks(osb,
6584 ret2 = ocfs2_free_cached_clusters(osb,
6683 struct ocfs2_super *osb =
6699 osb->slot_num, &real_slot,
6712 new_eb_bh[i] = sb_getblk(osb->sb, bf->free_blk);
6721 bf->free_blk, osb->slot_num, real_slot);
6733 memset(new_eb_bh[i]->b_data, 0, osb->sb->s_blocksize);
6741 eb->h_fs_generation = cpu_to_le32(osb->fs_generation);
6746 cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb));
7079 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
7089 ret = ocfs2_reserve_clusters(osb, 1, &data_ac);
7096 handle = ocfs2_start_trans(osb,
7097 ocfs2_inline_to_extents_credits(osb->sb));
7113 osb->s_clustersize);
7117 ocfs2_clusters_to_bytes(osb->sb, 1));
7194 ocfs2_clusters_to_bytes(osb->sb, 1));
7198 ocfs2_free_local_alloc_bits(osb, handle, data_ac,
7204 ocfs2_clusters_to_blocks(osb->sb, bit_off),
7208 ocfs2_commit_trans(osb, handle);
7222 int ocfs2_commit_truncate(struct ocfs2_super *osb,
7242 new_highest_cpos = ocfs2_clusters_for_bytes(osb->sb,
7314 status = ocfs2_remove_rightmost_empty_extent(osb,
7356 status = ocfs2_lock_refcount_tree(osb, refcount_loc, 1,
7382 ocfs2_unlock_refcount_tree(osb, ref_tree, 1);
7384 ocfs2_schedule_truncate_log_flush(osb, 1);
7386 ocfs2_run_deallocs(osb, &dealloc);
7402 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
7417 !ocfs2_supports_inline_data(osb)) {
7423 osb->s_feature_incompat);
7428 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
7466 ocfs2_commit_trans(osb, handle);
7477 struct ocfs2_super *osb = OCFS2_SB(sb);
7490 if (group != osb->first_cluster_group_blkno)
7546 struct ocfs2_super *osb = OCFS2_SB(sb);
7556 start = range->start >> osb->s_clustersize_bits;
7557 len = range->len >> osb->s_clustersize_bits;
7558 minlen = range->minlen >> osb->s_clustersize_bits;
7560 if (minlen >= osb->bitmap_cpg || range->len < sb->s_blocksize)
7566 main_bm_inode = ocfs2_get_system_file_inode(osb,
7601 if (first_group == osb->first_cluster_group_blkno)
7612 if (first_bit + len >= osb->bitmap_cpg)
7613 last_bit = osb->bitmap_cpg;
7637 len -= osb->bitmap_cpg - first_bit;
7639 if (group == osb->first_cluster_group_blkno)
7640 group = ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg);
7642 group += ocfs2_clusters_to_blocks(sb, osb->bitmap_cpg);
7663 range->len = trimmed * osb->s_clustersize;
7670 struct ocfs2_super *osb = OCFS2_SB(sb);
7673 ocfs2_trim_fs_lock_res_init(osb);
7677 ret = ocfs2_trim_fs_lock(osb, NULL, 1);
7681 ocfs2_trim_fs_lock_res_uninit(osb);
7687 osb->dev_str);
7688 ret = ocfs2_trim_fs_lock(osb, &info, 0);
7691 ocfs2_trim_fs_lock_res_uninit(osb);
7702 osb->dev_str, info.tf_nodenum);
7708 info.tf_nodenum = osb->node_num;
7719 ocfs2_trim_fs_unlock(osb, pinfo);
7720 ocfs2_trim_fs_lock_res_uninit(osb);