summaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-11-22 21:00:13 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-11-22 21:00:13 -0500
commitb7e57e7c2a41826e51fe060fae5158bfc7a04e81 (patch)
tree2c7331402c731a9c6bb98827a4f6e5926fd90055 /fs/ext4/inode.c
parente4684b3fbb848446683feecb4aee133344c93933 (diff)
downloadop-kernel-dev-b7e57e7c2a41826e51fe060fae5158bfc7a04e81.zip
op-kernel-dev-b7e57e7c2a41826e51fe060fae5158bfc7a04e81.tar.gz
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.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index fa37f95..72c6943 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -767,7 +767,13 @@ failed:
/* Allocation failed, free what we already allocated */
for (i = 1; i <= n ; i++) {
BUFFER_TRACE(branch[i].bh, "call jbd2_journal_forget");
- ext4_journal_forget(handle, branch[i].bh);
+ /*
+ * Note: is_metadata is 0 because branch[i].bh is
+ * newly allocated, so there is no need to revoke the
+ * block. If we do, it's harmless, but not necessary.
+ */
+ ext4_forget(handle, 0, inode, branch[i].bh,
+ branch[i].bh->b_blocknr);
}
for (i = 0; i < indirect_blks; i++)
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,
err_out:
for (i = 1; i <= num; i++) {
BUFFER_TRACE(where[i].bh, "call jbd2_journal_forget");
- ext4_journal_forget(handle, where[i].bh);
+ /*
+ * Note: is_metadata is 0 because branch[i].bh is
+ * newly allocated, so there is no need to revoke the
+ * block. If we do, it's harmless, but not necessary.
+ */
+ ext4_forget(handle, 0, inode, where[i].bh,
+ where[i].bh->b_blocknr);
ext4_free_blocks(handle, inode,
le32_to_cpu(where[i-1].key), 1, 0);
}
OpenPOWER on IntegriCloud