1 From: Jan Kara <jack@suse.cz>
2 References: fate#302681
3 Subject: [PATCH 19/28] ocfs2: Support nested transactions
4 Patch-mainline: 2.6.29?
6 OCFS2 can easily support nested transactions. We just have to
7 take care and not spoil statistics acquire semaphore unnecessarily.
9 Signed-off-by: Jan Kara <jack@suse.cz>
11 fs/ocfs2/journal.c | 14 +++++++-------
12 1 files changed, 7 insertions(+), 7 deletions(-)
14 Index: linux-2.6.27/fs/ocfs2/journal.c
15 ===================================================================
16 --- linux-2.6.27.orig/fs/ocfs2/journal.c 2008-10-24 11:40:35.000000000 +0200
17 +++ linux-2.6.27/fs/ocfs2/journal.c 2008-10-24 14:19:31.000000000 +0200
19 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);
20 BUG_ON(max_buffs <= 0);
22 - /* JBD might support this, but our journalling code doesn't yet. */
23 - if (journal_current_handle()) {
24 - mlog(ML_ERROR, "Recursive transaction attempted!\n");
27 + /* Nested transaction? Just return the handle... */
28 + if (journal_current_handle())
29 + return jbd2_journal_start(journal, max_buffs);
31 down_read(&osb->journal->j_trans_barrier);
34 int ocfs2_commit_trans(struct ocfs2_super *osb,
39 struct ocfs2_journal *journal = osb->journal;
43 + nested = handle->h_ref > 1;
44 ret = jbd2_journal_stop(handle);
48 - up_read(&journal->j_trans_barrier);
50 + up_read(&journal->j_trans_barrier);