diff options
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index b6c483dfe615..a31bba6c5575 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -540,7 +540,7 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb, | |||
540 | goto leave; | 540 | goto leave; |
541 | } else if ((!free_extents) | 541 | } else if ((!free_extents) |
542 | && (ocfs2_alloc_context_bits_left(meta_ac) | 542 | && (ocfs2_alloc_context_bits_left(meta_ac) |
543 | < ocfs2_extend_meta_needed(fe))) { | 543 | < ocfs2_extend_meta_needed(&fe->id2.i_list))) { |
544 | mlog(0, "filesystem is really fragmented...\n"); | 544 | mlog(0, "filesystem is really fragmented...\n"); |
545 | status = -EAGAIN; | 545 | status = -EAGAIN; |
546 | reason = RESTART_META; | 546 | reason = RESTART_META; |
@@ -652,7 +652,7 @@ int ocfs2_lock_allocators(struct inode *inode, struct buffer_head *di_bh, | |||
652 | */ | 652 | */ |
653 | if (!num_free_extents || | 653 | if (!num_free_extents || |
654 | (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) { | 654 | (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) { |
655 | ret = ocfs2_reserve_new_metadata(osb, di, meta_ac); | 655 | ret = ocfs2_reserve_new_metadata(osb, &di->id2.i_list, meta_ac); |
656 | if (ret < 0) { | 656 | if (ret < 0) { |
657 | if (ret != -ENOSPC) | 657 | if (ret != -ENOSPC) |
658 | mlog_errno(ret); | 658 | mlog_errno(ret); |
@@ -732,7 +732,8 @@ restart_all: | |||
732 | goto leave; | 732 | goto leave; |
733 | } | 733 | } |
734 | 734 | ||
735 | credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add); | 735 | credits = ocfs2_calc_extend_credits(osb->sb, &fe->id2.i_list, |
736 | clusters_to_add); | ||
736 | handle = ocfs2_start_trans(osb, credits); | 737 | handle = ocfs2_start_trans(osb, credits); |
737 | if (IS_ERR(handle)) { | 738 | if (IS_ERR(handle)) { |
738 | status = PTR_ERR(handle); | 739 | status = PTR_ERR(handle); |
@@ -790,7 +791,7 @@ restarted_transaction: | |||
790 | mlog(0, "restarting transaction.\n"); | 791 | mlog(0, "restarting transaction.\n"); |
791 | /* TODO: This can be more intelligent. */ | 792 | /* TODO: This can be more intelligent. */ |
792 | credits = ocfs2_calc_extend_credits(osb->sb, | 793 | credits = ocfs2_calc_extend_credits(osb->sb, |
793 | fe, | 794 | &fe->id2.i_list, |
794 | clusters_to_add); | 795 | clusters_to_add); |
795 | status = ocfs2_extend_trans(handle, credits); | 796 | status = ocfs2_extend_trans(handle, credits); |
796 | if (status < 0) { | 797 | if (status < 0) { |