diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-11-22 21:00:13 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-11-22 21:00:13 -0500 |
commit | b7e57e7c2a41826e51fe060fae5158bfc7a04e81 (patch) | |
tree | 2c7331402c731a9c6bb98827a4f6e5926fd90055 /fs/ext4/inode.c | |
parent | e4684b3fbb848446683feecb4aee133344c93933 (diff) |
ext4: fold ext4_journal_forget() into ext4_forget()
Convert the last two callers of ext4_journal_forget() to use
ext4_forget() instead, and then fold ext4_journal_forget() into
ext4_forget(). This reduces are code complexity and shortens our call
stack.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index fa37f9504ece..72c694323492 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -767,7 +767,13 @@ failed: | |||
767 | /* Allocation failed, free what we already allocated */ | 767 | /* Allocation failed, free what we already allocated */ |
768 | for (i = 1; i <= n ; i++) { | 768 | for (i = 1; i <= n ; i++) { |
769 | BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget"); | 769 | BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget"); |
770 | ext4_journal_forget(handle, branch[i].bh); | 770 | /* |
771 | * Note: is_metadata is 0 because branch[i].bh is | ||
772 | * newly allocated, so there is no need to revoke the | ||
773 | * block. If we do, it's harmless, but not necessary. | ||
774 | */ | ||
775 | ext4_forget(handle, 0, inode, branch[i].bh, | ||
776 | branch[i].bh->b_blocknr); | ||
771 | } | 777 | } |
772 | for (i = 0; i < indirect_blks; i++) | 778 | for (i = 0; i < indirect_blks; i++) |
773 | ext4_free_blocks(handle, inode, new_blocks[i], 1, 0); | 779 | ext4_free_blocks(handle, inode, new_blocks[i], 1, 0); |
@@ -852,7 +858,13 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode, | |||
852 | err_out: | 858 | err_out: |
853 | for (i = 1; i <= num; i++) { | 859 | for (i = 1; i <= num; i++) { |
854 | BUFFER_TRACE(where[i].bh, "call jbd2_journal_forget"); | 860 | BUFFER_TRACE(where[i].bh, "call jbd2_journal_forget"); |
855 | ext4_journal_forget(handle, where[i].bh); | 861 | /* |
862 | * Note: is_metadata is 0 because branch[i].bh is | ||
863 | * newly allocated, so there is no need to revoke the | ||
864 | * block. If we do, it's harmless, but not necessary. | ||
865 | */ | ||
866 | ext4_forget(handle, 0, inode, where[i].bh, | ||
867 | where[i].bh->b_blocknr); | ||
856 | ext4_free_blocks(handle, inode, | 868 | ext4_free_blocks(handle, inode, |
857 | le32_to_cpu(where[i-1].key), 1, 0); | 869 | le32_to_cpu(where[i-1].key), 1, 0); |
858 | } | 870 | } |