diff options
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 165 |
1 files changed, 88 insertions, 77 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 80ffbe3dd32f..f0e26c4adc94 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "uptodate.h" | 50 | #include "uptodate.h" |
51 | #include "xattr.h" | 51 | #include "xattr.h" |
52 | #include "refcounttree.h" | 52 | #include "refcounttree.h" |
53 | #include "ocfs2_trace.h" | ||
53 | 54 | ||
54 | #include "buffer_head_io.h" | 55 | #include "buffer_head_io.h" |
55 | 56 | ||
@@ -886,8 +887,7 @@ static int ocfs2_validate_extent_block(struct super_block *sb, | |||
886 | struct ocfs2_extent_block *eb = | 887 | struct ocfs2_extent_block *eb = |
887 | (struct ocfs2_extent_block *)bh->b_data; | 888 | (struct ocfs2_extent_block *)bh->b_data; |
888 | 889 | ||
889 | mlog(0, "Validating extent block %llu\n", | 890 | trace_ocfs2_validate_extent_block((unsigned long long)bh->b_blocknr); |
890 | (unsigned long long)bh->b_blocknr); | ||
891 | 891 | ||
892 | BUG_ON(!buffer_uptodate(bh)); | 892 | BUG_ON(!buffer_uptodate(bh)); |
893 | 893 | ||
@@ -985,7 +985,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb, | |||
985 | bail: | 985 | bail: |
986 | brelse(eb_bh); | 986 | brelse(eb_bh); |
987 | 987 | ||
988 | mlog(0, "retval = %d\n", retval); | 988 | trace_ocfs2_num_free_extents(retval); |
989 | return retval; | 989 | return retval; |
990 | } | 990 | } |
991 | 991 | ||
@@ -1194,8 +1194,11 @@ static int ocfs2_add_branch(handle_t *handle, | |||
1194 | * from new_cpos). | 1194 | * from new_cpos). |
1195 | */ | 1195 | */ |
1196 | if (root_end > new_cpos) { | 1196 | if (root_end > new_cpos) { |
1197 | mlog(0, "adjust the cluster end from %u to %u\n", | 1197 | trace_ocfs2_adjust_rightmost_branch( |
1198 | root_end, new_cpos); | 1198 | (unsigned long long) |
1199 | ocfs2_metadata_cache_owner(et->et_ci), | ||
1200 | root_end, new_cpos); | ||
1201 | |||
1199 | status = ocfs2_adjust_rightmost_branch(handle, et); | 1202 | status = ocfs2_adjust_rightmost_branch(handle, et); |
1200 | if (status) { | 1203 | if (status) { |
1201 | mlog_errno(status); | 1204 | mlog_errno(status); |
@@ -1527,7 +1530,10 @@ static int ocfs2_grow_tree(handle_t *handle, struct ocfs2_extent_tree *et, | |||
1527 | * another tree level */ | 1530 | * another tree level */ |
1528 | if (shift) { | 1531 | if (shift) { |
1529 | BUG_ON(bh); | 1532 | BUG_ON(bh); |
1530 | mlog(0, "need to shift tree depth (current = %d)\n", depth); | 1533 | trace_ocfs2_grow_tree( |
1534 | (unsigned long long) | ||
1535 | ocfs2_metadata_cache_owner(et->et_ci), | ||
1536 | depth); | ||
1531 | 1537 | ||
1532 | /* ocfs2_shift_tree_depth will return us a buffer with | 1538 | /* ocfs2_shift_tree_depth will return us a buffer with |
1533 | * the new extent block (so we can pass that to | 1539 | * the new extent block (so we can pass that to |
@@ -1557,7 +1563,6 @@ static int ocfs2_grow_tree(handle_t *handle, struct ocfs2_extent_tree *et, | |||
1557 | 1563 | ||
1558 | /* call ocfs2_add_branch to add the final part of the tree with | 1564 | /* call ocfs2_add_branch to add the final part of the tree with |
1559 | * the new data. */ | 1565 | * the new data. */ |
1560 | mlog(0, "add branch. bh = %p\n", bh); | ||
1561 | ret = ocfs2_add_branch(handle, et, bh, last_eb_bh, | 1566 | ret = ocfs2_add_branch(handle, et, bh, last_eb_bh, |
1562 | meta_ac); | 1567 | meta_ac); |
1563 | if (ret < 0) { | 1568 | if (ret < 0) { |
@@ -1632,8 +1637,9 @@ static void ocfs2_rotate_leaf(struct ocfs2_extent_list *el, | |||
1632 | } | 1637 | } |
1633 | insert_index = i; | 1638 | insert_index = i; |
1634 | 1639 | ||
1635 | mlog(0, "ins %u: index %d, has_empty %d, next_free %d, count %d\n", | 1640 | trace_ocfs2_rotate_leaf(insert_cpos, insert_index, |
1636 | insert_cpos, insert_index, has_empty, next_free, le16_to_cpu(el->l_count)); | 1641 | has_empty, next_free, |
1642 | le16_to_cpu(el->l_count)); | ||
1637 | 1643 | ||
1638 | BUG_ON(insert_index < 0); | 1644 | BUG_ON(insert_index < 0); |
1639 | BUG_ON(insert_index >= le16_to_cpu(el->l_count)); | 1645 | BUG_ON(insert_index >= le16_to_cpu(el->l_count)); |
@@ -2046,7 +2052,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle, | |||
2046 | left_el = path_leaf_el(left_path); | 2052 | left_el = path_leaf_el(left_path); |
2047 | right_el = path_leaf_el(right_path); | 2053 | right_el = path_leaf_el(right_path); |
2048 | for(i = left_path->p_tree_depth - 1; i > subtree_index; i--) { | 2054 | for(i = left_path->p_tree_depth - 1; i > subtree_index; i--) { |
2049 | mlog(0, "Adjust records at index %u\n", i); | 2055 | trace_ocfs2_complete_edge_insert(i); |
2050 | 2056 | ||
2051 | /* | 2057 | /* |
2052 | * One nice property of knowing that all of these | 2058 | * One nice property of knowing that all of these |
@@ -2376,7 +2382,9 @@ static int ocfs2_rotate_tree_right(handle_t *handle, | |||
2376 | goto out; | 2382 | goto out; |
2377 | } | 2383 | } |
2378 | 2384 | ||
2379 | mlog(0, "Insert: %u, first left path cpos: %u\n", insert_cpos, cpos); | 2385 | trace_ocfs2_rotate_tree_right( |
2386 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), | ||
2387 | insert_cpos, cpos); | ||
2380 | 2388 | ||
2381 | /* | 2389 | /* |
2382 | * What we want to do here is: | 2390 | * What we want to do here is: |
@@ -2405,8 +2413,10 @@ static int ocfs2_rotate_tree_right(handle_t *handle, | |||
2405 | * rotating subtrees. | 2413 | * rotating subtrees. |
2406 | */ | 2414 | */ |
2407 | while (cpos && insert_cpos <= cpos) { | 2415 | while (cpos && insert_cpos <= cpos) { |
2408 | mlog(0, "Rotating a tree: ins. cpos: %u, left path cpos: %u\n", | 2416 | trace_ocfs2_rotate_tree_right( |
2409 | insert_cpos, cpos); | 2417 | (unsigned long long) |
2418 | ocfs2_metadata_cache_owner(et->et_ci), | ||
2419 | insert_cpos, cpos); | ||
2410 | 2420 | ||
2411 | ret = ocfs2_find_path(et->et_ci, left_path, cpos); | 2421 | ret = ocfs2_find_path(et->et_ci, left_path, cpos); |
2412 | if (ret) { | 2422 | if (ret) { |
@@ -2448,10 +2458,10 @@ static int ocfs2_rotate_tree_right(handle_t *handle, | |||
2448 | 2458 | ||
2449 | start = ocfs2_find_subtree_root(et, left_path, right_path); | 2459 | start = ocfs2_find_subtree_root(et, left_path, right_path); |
2450 | 2460 | ||
2451 | mlog(0, "Subtree root at index %d (blk %llu, depth %d)\n", | 2461 | trace_ocfs2_rotate_subtree(start, |
2452 | start, | 2462 | (unsigned long long) |
2453 | (unsigned long long) right_path->p_node[start].bh->b_blocknr, | 2463 | right_path->p_node[start].bh->b_blocknr, |
2454 | right_path->p_tree_depth); | 2464 | right_path->p_tree_depth); |
2455 | 2465 | ||
2456 | ret = ocfs2_extend_rotate_transaction(handle, start, | 2466 | ret = ocfs2_extend_rotate_transaction(handle, start, |
2457 | orig_credits, right_path); | 2467 | orig_credits, right_path); |
@@ -2951,8 +2961,7 @@ static int __ocfs2_rotate_tree_left(handle_t *handle, | |||
2951 | subtree_root = ocfs2_find_subtree_root(et, left_path, | 2961 | subtree_root = ocfs2_find_subtree_root(et, left_path, |
2952 | right_path); | 2962 | right_path); |
2953 | 2963 | ||
2954 | mlog(0, "Subtree root at index %d (blk %llu, depth %d)\n", | 2964 | trace_ocfs2_rotate_subtree(subtree_root, |
2955 | subtree_root, | ||
2956 | (unsigned long long) | 2965 | (unsigned long long) |
2957 | right_path->p_node[subtree_root].bh->b_blocknr, | 2966 | right_path->p_node[subtree_root].bh->b_blocknr, |
2958 | right_path->p_tree_depth); | 2967 | right_path->p_tree_depth); |
@@ -3976,9 +3985,11 @@ static int ocfs2_append_rec_to_path(handle_t *handle, | |||
3976 | goto out; | 3985 | goto out; |
3977 | } | 3986 | } |
3978 | 3987 | ||
3979 | mlog(0, "Append may need a left path update. cpos: %u, " | 3988 | trace_ocfs2_append_rec_to_path( |
3980 | "left_cpos: %u\n", le32_to_cpu(insert_rec->e_cpos), | 3989 | (unsigned long long) |
3981 | left_cpos); | 3990 | ocfs2_metadata_cache_owner(et->et_ci), |
3991 | le32_to_cpu(insert_rec->e_cpos), | ||
3992 | left_cpos); | ||
3982 | 3993 | ||
3983 | /* | 3994 | /* |
3984 | * No need to worry if the append is already in the | 3995 | * No need to worry if the append is already in the |
@@ -4665,9 +4676,9 @@ int ocfs2_insert_extent(handle_t *handle, | |||
4665 | struct ocfs2_insert_type insert = {0, }; | 4676 | struct ocfs2_insert_type insert = {0, }; |
4666 | struct ocfs2_extent_rec rec; | 4677 | struct ocfs2_extent_rec rec; |
4667 | 4678 | ||
4668 | mlog(0, "add %u clusters at position %u to owner %llu\n", | 4679 | trace_ocfs2_insert_extent_start( |
4669 | new_clusters, cpos, | 4680 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), |
4670 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); | 4681 | cpos, new_clusters); |
4671 | 4682 | ||
4672 | memset(&rec, 0, sizeof(rec)); | 4683 | memset(&rec, 0, sizeof(rec)); |
4673 | rec.e_cpos = cpu_to_le32(cpos); | 4684 | rec.e_cpos = cpu_to_le32(cpos); |
@@ -4687,11 +4698,9 @@ int ocfs2_insert_extent(handle_t *handle, | |||
4687 | goto bail; | 4698 | goto bail; |
4688 | } | 4699 | } |
4689 | 4700 | ||
4690 | mlog(0, "Insert.appending: %u, Insert.Contig: %u, " | 4701 | trace_ocfs2_insert_extent(insert.ins_appending, insert.ins_contig, |
4691 | "Insert.contig_index: %d, Insert.free_records: %d, " | 4702 | insert.ins_contig_index, free_records, |
4692 | "Insert.tree_depth: %d\n", | 4703 | insert.ins_tree_depth); |
4693 | insert.ins_appending, insert.ins_contig, insert.ins_contig_index, | ||
4694 | free_records, insert.ins_tree_depth); | ||
4695 | 4704 | ||
4696 | if (insert.ins_contig == CONTIG_NONE && free_records == 0) { | 4705 | if (insert.ins_contig == CONTIG_NONE && free_records == 0) { |
4697 | status = ocfs2_grow_tree(handle, et, | 4706 | status = ocfs2_grow_tree(handle, et, |
@@ -4732,7 +4741,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4732 | struct ocfs2_alloc_context *meta_ac, | 4741 | struct ocfs2_alloc_context *meta_ac, |
4733 | enum ocfs2_alloc_restarted *reason_ret) | 4742 | enum ocfs2_alloc_restarted *reason_ret) |
4734 | { | 4743 | { |
4735 | int status = 0; | 4744 | int status = 0, err = 0; |
4736 | int free_extents; | 4745 | int free_extents; |
4737 | enum ocfs2_alloc_restarted reason = RESTART_NONE; | 4746 | enum ocfs2_alloc_restarted reason = RESTART_NONE; |
4738 | u32 bit_off, num_bits; | 4747 | u32 bit_off, num_bits; |
@@ -4759,14 +4768,14 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4759 | * 2) we are so fragmented, we've needed to add metadata too | 4768 | * 2) we are so fragmented, we've needed to add metadata too |
4760 | * many times. */ | 4769 | * many times. */ |
4761 | if (!free_extents && !meta_ac) { | 4770 | if (!free_extents && !meta_ac) { |
4762 | mlog(0, "we haven't reserved any metadata!\n"); | 4771 | err = -1; |
4763 | status = -EAGAIN; | 4772 | status = -EAGAIN; |
4764 | reason = RESTART_META; | 4773 | reason = RESTART_META; |
4765 | goto leave; | 4774 | goto leave; |
4766 | } else if ((!free_extents) | 4775 | } else if ((!free_extents) |
4767 | && (ocfs2_alloc_context_bits_left(meta_ac) | 4776 | && (ocfs2_alloc_context_bits_left(meta_ac) |
4768 | < ocfs2_extend_meta_needed(et->et_root_el))) { | 4777 | < ocfs2_extend_meta_needed(et->et_root_el))) { |
4769 | mlog(0, "filesystem is really fragmented...\n"); | 4778 | err = -2; |
4770 | status = -EAGAIN; | 4779 | status = -EAGAIN; |
4771 | reason = RESTART_META; | 4780 | reason = RESTART_META; |
4772 | goto leave; | 4781 | goto leave; |
@@ -4791,9 +4800,9 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4791 | } | 4800 | } |
4792 | 4801 | ||
4793 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); | 4802 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); |
4794 | mlog(0, "Allocating %u clusters at block %u for owner %llu\n", | 4803 | trace_ocfs2_add_clusters_in_btree( |
4795 | num_bits, bit_off, | 4804 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), |
4796 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); | 4805 | bit_off, num_bits); |
4797 | status = ocfs2_insert_extent(handle, et, *logical_offset, block, | 4806 | status = ocfs2_insert_extent(handle, et, *logical_offset, block, |
4798 | num_bits, flags, meta_ac); | 4807 | num_bits, flags, meta_ac); |
4799 | if (status < 0) { | 4808 | if (status < 0) { |
@@ -4807,8 +4816,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4807 | *logical_offset += num_bits; | 4816 | *logical_offset += num_bits; |
4808 | 4817 | ||
4809 | if (clusters_to_add) { | 4818 | if (clusters_to_add) { |
4810 | mlog(0, "need to alloc once more, wanted = %u\n", | 4819 | err = clusters_to_add; |
4811 | clusters_to_add); | ||
4812 | status = -EAGAIN; | 4820 | status = -EAGAIN; |
4813 | reason = RESTART_TRANS; | 4821 | reason = RESTART_TRANS; |
4814 | } | 4822 | } |
@@ -4816,6 +4824,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4816 | leave: | 4824 | leave: |
4817 | if (reason_ret) | 4825 | if (reason_ret) |
4818 | *reason_ret = reason; | 4826 | *reason_ret = reason; |
4827 | trace_ocfs2_add_clusters_in_btree_ret(status, reason, err); | ||
4819 | return status; | 4828 | return status; |
4820 | } | 4829 | } |
4821 | 4830 | ||
@@ -5041,9 +5050,9 @@ int ocfs2_split_extent(handle_t *handle, | |||
5041 | 5050 | ||
5042 | ctxt.c_has_empty_extent = ocfs2_is_empty_extent(&el->l_recs[0]); | 5051 | ctxt.c_has_empty_extent = ocfs2_is_empty_extent(&el->l_recs[0]); |
5043 | 5052 | ||
5044 | mlog(0, "index: %d, contig: %u, has_empty: %u, split_covers: %u\n", | 5053 | trace_ocfs2_split_extent(split_index, ctxt.c_contig_type, |
5045 | split_index, ctxt.c_contig_type, ctxt.c_has_empty_extent, | 5054 | ctxt.c_has_empty_extent, |
5046 | ctxt.c_split_covers_rec); | 5055 | ctxt.c_split_covers_rec); |
5047 | 5056 | ||
5048 | if (ctxt.c_contig_type == CONTIG_NONE) { | 5057 | if (ctxt.c_contig_type == CONTIG_NONE) { |
5049 | if (ctxt.c_split_covers_rec) | 5058 | if (ctxt.c_split_covers_rec) |
@@ -5177,8 +5186,9 @@ int ocfs2_mark_extent_written(struct inode *inode, | |||
5177 | { | 5186 | { |
5178 | int ret; | 5187 | int ret; |
5179 | 5188 | ||
5180 | mlog(0, "Inode %lu cpos %u, len %u, phys clusters %u\n", | 5189 | trace_ocfs2_mark_extent_written( |
5181 | inode->i_ino, cpos, len, phys); | 5190 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
5191 | cpos, len, phys); | ||
5182 | 5192 | ||
5183 | if (!ocfs2_writes_unwritten_extents(OCFS2_SB(inode->i_sb))) { | 5193 | if (!ocfs2_writes_unwritten_extents(OCFS2_SB(inode->i_sb))) { |
5184 | ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents " | 5194 | ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents " |
@@ -5497,11 +5507,10 @@ int ocfs2_remove_extent(handle_t *handle, | |||
5497 | 5507 | ||
5498 | BUG_ON(cpos < le32_to_cpu(rec->e_cpos) || trunc_range > rec_range); | 5508 | BUG_ON(cpos < le32_to_cpu(rec->e_cpos) || trunc_range > rec_range); |
5499 | 5509 | ||
5500 | mlog(0, "Owner %llu, remove (cpos %u, len %u). Existing index %d " | 5510 | trace_ocfs2_remove_extent( |
5501 | "(cpos %u, len %u)\n", | 5511 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), |
5502 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), | 5512 | cpos, len, index, le32_to_cpu(rec->e_cpos), |
5503 | cpos, len, index, | 5513 | ocfs2_rec_clusters(el, rec)); |
5504 | le32_to_cpu(rec->e_cpos), ocfs2_rec_clusters(el, rec)); | ||
5505 | 5514 | ||
5506 | if (le32_to_cpu(rec->e_cpos) == cpos || rec_range == trunc_range) { | 5515 | if (le32_to_cpu(rec->e_cpos) == cpos || rec_range == trunc_range) { |
5507 | ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, | 5516 | ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, |
@@ -5780,9 +5789,6 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb, | |||
5780 | struct ocfs2_dinode *di; | 5789 | struct ocfs2_dinode *di; |
5781 | struct ocfs2_truncate_log *tl; | 5790 | struct ocfs2_truncate_log *tl; |
5782 | 5791 | ||
5783 | mlog(0, "start_blk = %llu, num_clusters = %u\n", | ||
5784 | (unsigned long long)start_blk, num_clusters); | ||
5785 | |||
5786 | BUG_ON(mutex_trylock(&tl_inode->i_mutex)); | 5792 | BUG_ON(mutex_trylock(&tl_inode->i_mutex)); |
5787 | 5793 | ||
5788 | start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk); | 5794 | start_cluster = ocfs2_blocks_to_clusters(osb->sb, start_blk); |
@@ -5819,10 +5825,9 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb, | |||
5819 | goto bail; | 5825 | goto bail; |
5820 | } | 5826 | } |
5821 | 5827 | ||
5822 | mlog(0, "Log truncate of %u clusters starting at cluster %u to " | 5828 | trace_ocfs2_truncate_log_append( |
5823 | "%llu (index = %d)\n", num_clusters, start_cluster, | 5829 | (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, index, |
5824 | (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, index); | 5830 | start_cluster, num_clusters); |
5825 | |||
5826 | if (ocfs2_truncate_log_can_coalesce(tl, start_cluster)) { | 5831 | if (ocfs2_truncate_log_can_coalesce(tl, start_cluster)) { |
5827 | /* | 5832 | /* |
5828 | * Move index back to the record we are coalescing with. | 5833 | * Move index back to the record we are coalescing with. |
@@ -5831,9 +5836,10 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb, | |||
5831 | index--; | 5836 | index--; |
5832 | 5837 | ||
5833 | num_clusters += le32_to_cpu(tl->tl_recs[index].t_clusters); | 5838 | num_clusters += le32_to_cpu(tl->tl_recs[index].t_clusters); |
5834 | mlog(0, "Coalesce with index %u (start = %u, clusters = %u)\n", | 5839 | trace_ocfs2_truncate_log_append( |
5835 | index, le32_to_cpu(tl->tl_recs[index].t_start), | 5840 | (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, |
5836 | num_clusters); | 5841 | index, le32_to_cpu(tl->tl_recs[index].t_start), |
5842 | num_clusters); | ||
5837 | } else { | 5843 | } else { |
5838 | tl->tl_recs[index].t_start = cpu_to_le32(start_cluster); | 5844 | tl->tl_recs[index].t_start = cpu_to_le32(start_cluster); |
5839 | tl->tl_used = cpu_to_le16(index + 1); | 5845 | tl->tl_used = cpu_to_le16(index + 1); |
@@ -5897,8 +5903,9 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, | |||
5897 | /* if start_blk is not set, we ignore the record as | 5903 | /* if start_blk is not set, we ignore the record as |
5898 | * invalid. */ | 5904 | * invalid. */ |
5899 | if (start_blk) { | 5905 | if (start_blk) { |
5900 | mlog(0, "free record %d, start = %u, clusters = %u\n", | 5906 | trace_ocfs2_replay_truncate_records( |
5901 | i, le32_to_cpu(rec.t_start), num_clusters); | 5907 | (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, |
5908 | i, le32_to_cpu(rec.t_start), num_clusters); | ||
5902 | 5909 | ||
5903 | status = ocfs2_free_clusters(handle, data_alloc_inode, | 5910 | status = ocfs2_free_clusters(handle, data_alloc_inode, |
5904 | data_alloc_bh, start_blk, | 5911 | data_alloc_bh, start_blk, |
@@ -5941,8 +5948,9 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb) | |||
5941 | 5948 | ||
5942 | tl = &di->id2.i_dealloc; | 5949 | tl = &di->id2.i_dealloc; |
5943 | num_to_flush = le16_to_cpu(tl->tl_used); | 5950 | num_to_flush = le16_to_cpu(tl->tl_used); |
5944 | mlog(0, "Flush %u records from truncate log #%llu\n", | 5951 | trace_ocfs2_flush_truncate_log( |
5945 | num_to_flush, (unsigned long long)OCFS2_I(tl_inode)->ip_blkno); | 5952 | (unsigned long long)OCFS2_I(tl_inode)->ip_blkno, |
5953 | num_to_flush); | ||
5946 | if (!num_to_flush) { | 5954 | if (!num_to_flush) { |
5947 | status = 0; | 5955 | status = 0; |
5948 | goto out; | 5956 | goto out; |
@@ -6079,7 +6087,7 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, | |||
6079 | 6087 | ||
6080 | *tl_copy = NULL; | 6088 | *tl_copy = NULL; |
6081 | 6089 | ||
6082 | mlog(0, "recover truncate log from slot %d\n", slot_num); | 6090 | trace_ocfs2_begin_truncate_log_recovery(slot_num); |
6083 | 6091 | ||
6084 | status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh); | 6092 | status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh); |
6085 | if (status < 0) { | 6093 | if (status < 0) { |
@@ -6096,8 +6104,7 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, | |||
6096 | 6104 | ||
6097 | tl = &di->id2.i_dealloc; | 6105 | tl = &di->id2.i_dealloc; |
6098 | if (le16_to_cpu(tl->tl_used)) { | 6106 | if (le16_to_cpu(tl->tl_used)) { |
6099 | mlog(0, "We'll have %u logs to recover\n", | 6107 | trace_ocfs2_truncate_log_recovery_num(le16_to_cpu(tl->tl_used)); |
6100 | le16_to_cpu(tl->tl_used)); | ||
6101 | 6108 | ||
6102 | *tl_copy = kmalloc(tl_bh->b_size, GFP_KERNEL); | 6109 | *tl_copy = kmalloc(tl_bh->b_size, GFP_KERNEL); |
6103 | if (!(*tl_copy)) { | 6110 | if (!(*tl_copy)) { |
@@ -6154,8 +6161,9 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, | |||
6154 | 6161 | ||
6155 | tl = &tl_copy->id2.i_dealloc; | 6162 | tl = &tl_copy->id2.i_dealloc; |
6156 | num_recs = le16_to_cpu(tl->tl_used); | 6163 | num_recs = le16_to_cpu(tl->tl_used); |
6157 | mlog(0, "cleanup %u records from %llu\n", num_recs, | 6164 | trace_ocfs2_complete_truncate_log_recovery( |
6158 | (unsigned long long)le64_to_cpu(tl_copy->i_blkno)); | 6165 | (unsigned long long)le64_to_cpu(tl_copy->i_blkno), |
6166 | num_recs); | ||
6159 | 6167 | ||
6160 | mutex_lock(&tl_inode->i_mutex); | 6168 | mutex_lock(&tl_inode->i_mutex); |
6161 | for(i = 0; i < num_recs; i++) { | 6169 | for(i = 0; i < num_recs; i++) { |
@@ -6313,8 +6321,8 @@ static int ocfs2_free_cached_blocks(struct ocfs2_super *osb, | |||
6313 | else | 6321 | else |
6314 | bg_blkno = ocfs2_which_suballoc_group(head->free_blk, | 6322 | bg_blkno = ocfs2_which_suballoc_group(head->free_blk, |
6315 | head->free_bit); | 6323 | head->free_bit); |
6316 | mlog(0, "Free bit: (bit %u, blkno %llu)\n", | 6324 | trace_ocfs2_free_cached_blocks( |
6317 | head->free_bit, (unsigned long long)head->free_blk); | 6325 | (unsigned long long)head->free_blk, head->free_bit); |
6318 | 6326 | ||
6319 | ret = ocfs2_free_suballoc_bits(handle, inode, di_bh, | 6327 | ret = ocfs2_free_suballoc_bits(handle, inode, di_bh, |
6320 | head->free_bit, bg_blkno, 1); | 6328 | head->free_bit, bg_blkno, 1); |
@@ -6367,8 +6375,7 @@ int ocfs2_cache_cluster_dealloc(struct ocfs2_cached_dealloc_ctxt *ctxt, | |||
6367 | return ret; | 6375 | return ret; |
6368 | } | 6376 | } |
6369 | 6377 | ||
6370 | mlog(0, "Insert clusters: (bit %u, blk %llu)\n", | 6378 | trace_ocfs2_cache_cluster_dealloc((unsigned long long)blkno, bit); |
6371 | bit, (unsigned long long)blkno); | ||
6372 | 6379 | ||
6373 | item->free_blk = blkno; | 6380 | item->free_blk = blkno; |
6374 | item->free_bit = bit; | 6381 | item->free_bit = bit; |
@@ -6443,8 +6450,8 @@ int ocfs2_run_deallocs(struct ocfs2_super *osb, | |||
6443 | fl = ctxt->c_first_suballocator; | 6450 | fl = ctxt->c_first_suballocator; |
6444 | 6451 | ||
6445 | if (fl->f_first) { | 6452 | if (fl->f_first) { |
6446 | mlog(0, "Free items: (type %u, slot %d)\n", | 6453 | trace_ocfs2_run_deallocs(fl->f_inode_type, |
6447 | fl->f_inode_type, fl->f_slot); | 6454 | fl->f_slot); |
6448 | ret2 = ocfs2_free_cached_blocks(osb, | 6455 | ret2 = ocfs2_free_cached_blocks(osb, |
6449 | fl->f_inode_type, | 6456 | fl->f_inode_type, |
6450 | fl->f_slot, | 6457 | fl->f_slot, |
@@ -6521,8 +6528,9 @@ int ocfs2_cache_block_dealloc(struct ocfs2_cached_dealloc_ctxt *ctxt, | |||
6521 | goto out; | 6528 | goto out; |
6522 | } | 6529 | } |
6523 | 6530 | ||
6524 | mlog(0, "Insert: (type %d, slot %u, bit %u, blk %llu)\n", | 6531 | trace_ocfs2_cache_block_dealloc(type, slot, |
6525 | type, slot, bit, (unsigned long long)blkno); | 6532 | (unsigned long long)suballoc, |
6533 | (unsigned long long)blkno, bit); | ||
6526 | 6534 | ||
6527 | item->free_bg = suballoc; | 6535 | item->free_bg = suballoc; |
6528 | item->free_blk = blkno; | 6536 | item->free_blk = blkno; |
@@ -7002,8 +7010,11 @@ start: | |||
7002 | goto bail; | 7010 | goto bail; |
7003 | } | 7011 | } |
7004 | 7012 | ||
7005 | mlog(0, "inode->ip_clusters = %u, tree_depth = %u\n", | 7013 | trace_ocfs2_commit_truncate( |
7006 | OCFS2_I(inode)->ip_clusters, path->p_tree_depth); | 7014 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
7015 | new_highest_cpos, | ||
7016 | OCFS2_I(inode)->ip_clusters, | ||
7017 | path->p_tree_depth); | ||
7007 | 7018 | ||
7008 | /* | 7019 | /* |
7009 | * By now, el will point to the extent list on the bottom most | 7020 | * By now, el will point to the extent list on the bottom most |