]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.suse/ocfs2-Support-nested-transactions.patch
Move xen patchset to new version's subdir.
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / ocfs2-Support-nested-transactions.patch
CommitLineData
00e5a55c
BS
1From: Jan Kara <jack@suse.cz>
2References: fate#302681
3Subject: [PATCH 19/28] ocfs2: Support nested transactions
4Patch-mainline: 2.6.29?
5
6OCFS2 can easily support nested transactions. We just have to
7take care and not spoil statistics acquire semaphore unnecessarily.
8
9Signed-off-by: Jan Kara <jack@suse.cz>
10---
11 fs/ocfs2/journal.c | 14 +++++++-------
12 1 files changed, 7 insertions(+), 7 deletions(-)
13
14Index: 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
18@@ -256,11 +256,9 @@
19 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);
20 BUG_ON(max_buffs <= 0);
21
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");
25- BUG();
26- }
27+ /* Nested transaction? Just return the handle... */
28+ if (journal_current_handle())
29+ return jbd2_journal_start(journal, max_buffs);
30
31 down_read(&osb->journal->j_trans_barrier);
32
33@@ -285,16 +283,18 @@
34 int ocfs2_commit_trans(struct ocfs2_super *osb,
35 handle_t *handle)
36 {
37- int ret;
38+ int ret, nested;
39 struct ocfs2_journal *journal = osb->journal;
40
41 BUG_ON(!handle);
42
43+ nested = handle->h_ref > 1;
44 ret = jbd2_journal_stop(handle);
45 if (ret < 0)
46 mlog_errno(ret);
47
48- up_read(&journal->j_trans_barrier);
49+ if (!nested)
50+ up_read(&journal->j_trans_barrier);
51
52 return ret;
53 }