diff options
author | Tao Ma <tao.ma@oracle.com> | 2008-08-18 05:38:43 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 16:57:58 -0400 |
commit | 811f933df1e55615fd0bb4818f31e3868a8e6e23 (patch) | |
tree | 53335e59bdff02d7ddb3a2ec15d36239fe50003d /fs/ocfs2/file.c | |
parent | 231b87d10920e024efaf0f9e86e1bab7bced1620 (diff) |
ocfs2: Use ocfs2_extent_list instead of ocfs2_dinode.
ocfs2_extend_meta_needed(), ocfs2_calc_extend_credits() and
ocfs2_reserve_new_metadata() are all useful for extent tree operations. But
they are all limited to an inode btree because they use a struct
ocfs2_dinode parameter. Change their parameter to struct ocfs2_extent_list
(the part of an ocfs2_dinode they actually use) so that the xattr btree code
can use these functions.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
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) { |