diff options
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 33d5cab5e690..c078b3b1f01e 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -2807,36 +2807,28 @@ static int ocfs2_try_to_merge_extent(struct inode *inode, | |||
2807 | struct ocfs2_merge_ctxt *ctxt) | 2807 | struct ocfs2_merge_ctxt *ctxt) |
2808 | 2808 | ||
2809 | { | 2809 | { |
2810 | int ret = 0, delete_tail_recs = 0; | 2810 | int ret = 0; |
2811 | struct ocfs2_extent_list *el = path_leaf_el(left_path); | 2811 | struct ocfs2_extent_list *el = path_leaf_el(left_path); |
2812 | struct ocfs2_extent_rec *rec = &el->l_recs[split_index]; | 2812 | struct ocfs2_extent_rec *rec = &el->l_recs[split_index]; |
2813 | 2813 | ||
2814 | BUG_ON(ctxt->c_contig_type == CONTIG_NONE); | 2814 | BUG_ON(ctxt->c_contig_type == CONTIG_NONE); |
2815 | 2815 | ||
2816 | if (ctxt->c_split_covers_rec) { | 2816 | if (ctxt->c_split_covers_rec && ctxt->c_has_empty_extent) { |
2817 | delete_tail_recs++; | 2817 | /* |
2818 | 2818 | * The merge code will need to create an empty | |
2819 | if (ctxt->c_contig_type == CONTIG_LEFTRIGHT || | 2819 | * extent to take the place of the newly |
2820 | ctxt->c_has_empty_extent) | 2820 | * emptied slot. Remove any pre-existing empty |
2821 | delete_tail_recs++; | 2821 | * extents - having more than one in a leaf is |
2822 | 2822 | * illegal. | |
2823 | if (ctxt->c_has_empty_extent) { | 2823 | */ |
2824 | /* | 2824 | ret = ocfs2_rotate_tree_left(inode, handle, left_path, |
2825 | * The merge code will need to create an empty | 2825 | dealloc); |
2826 | * extent to take the place of the newly | 2826 | if (ret) { |
2827 | * emptied slot. Remove any pre-existing empty | 2827 | mlog_errno(ret); |
2828 | * extents - having more than one in a leaf is | 2828 | goto out; |
2829 | * illegal. | ||
2830 | */ | ||
2831 | ret = ocfs2_rotate_tree_left(inode, handle, left_path, | ||
2832 | dealloc); | ||
2833 | if (ret) { | ||
2834 | mlog_errno(ret); | ||
2835 | goto out; | ||
2836 | } | ||
2837 | split_index--; | ||
2838 | rec = &el->l_recs[split_index]; | ||
2839 | } | 2829 | } |
2830 | split_index--; | ||
2831 | rec = &el->l_recs[split_index]; | ||
2840 | } | 2832 | } |
2841 | 2833 | ||
2842 | if (ctxt->c_contig_type == CONTIG_LEFTRIGHT) { | 2834 | if (ctxt->c_contig_type == CONTIG_LEFTRIGHT) { |