From: Manish Katiyar Subject: [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation. Date: Sun, 24 Apr 2011 17:15:35 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0016364999f972708704a1b31c03 Cc: Manish Katiyar , Jan Kara , "Theodore Ts'o" To: ext4 Return-path: Received: from mail-qy0-f181.google.com ([209.85.216.181]:44414 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757834Ab1DYAP4 (ORCPT ); Sun, 24 Apr 2011 20:15:56 -0400 Received: by qyg14 with SMTP id 14so952253qyg.19 for ; Sun, 24 Apr 2011 17:15:55 -0700 (PDT) Sender: linux-ext4-owner@vger.kernel.org List-ID: --0016364999f972708704a1b31c03 Content-Type: text/plain; charset=ISO-8859-1 Update ocfs2 routines to use the updated journal routines passing an extra parameter to specify whether transaction allocation can fail or not. Signed-off-by: Manish Katiyar --- fs/ocfs2/journal.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index b141a44..51c60be 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -338,6 +338,16 @@ finally: return status; } +static handle_t *ocfs2_journal_start(journal_t *journal, int blocks) +{ + return jbd2_journal_start(journal, blocks, false); +} + +static int ocfs2_journal_restart(handle_t *handle, int blocks) +{ + return jbd2_journal_restart(handle, blocks, false); +} + handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs) { journal_t *journal = osb->journal->j_journal; @@ -353,11 +363,11 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs) /* Nested transaction? Just return the handle... */ if (journal_current_handle()) - return jbd2_journal_start(journal, max_buffs); + return ocfs2_journal_start(journal, max_buffs); down_read(&osb->journal->j_trans_barrier); - handle = jbd2_journal_start(journal, max_buffs); + handle = ocfs2_journal_start(journal, max_buffs); if (IS_ERR(handle)) { up_read(&osb->journal->j_trans_barrier); @@ -437,7 +447,7 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks) if (status > 0) { trace_ocfs2_extend_trans_restart(old_nblocks + nblocks); - status = jbd2_journal_restart(handle, + status = ocfs2_journal_restart(handle, old_nblocks + nblocks); if (status < 0) { mlog_errno(status); -- 1.7.1 -- Thanks - Manish --0016364999f972708704a1b31c03 Content-Type: text/x-patch; charset=US-ASCII; name="0003-Update-ocfs-routines-to-use-the-updated-journal-rout.patch" Content-Disposition: attachment; filename="0003-Update-ocfs-routines-to-use-the-updated-journal-rout.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gmwno0k50 RnJvbSBiYjk1ODMwYjI3MGZjZTA0M2I1YjkwMWQ1M2QzOTExODllZTk2ODc4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYW5pc2ggS2F0aXlhciA8bWthdGl5YXJAZ21haWwuY29tPgpE YXRlOiBTdW4sIDI0IEFwciAyMDExIDAwOjI3OjMxIC0wNzAwClN1YmplY3Q6IFtQQVRDSCAzLzVd IFVwZGF0ZSBvY2ZzIHJvdXRpbmVzIHRvIHVzZSB0aGUgdXBkYXRlZCBqb3VybmFsIHJvdXRpbmVz IHBhc3NpbmcgYW4gZXh0cmEgcGFyYW1ldGVyIHRvIHNwZWNpZnkgd2hldGhlciB0cmFuc2FjdGlv biBhbGxvY2F0aW9uIGNhbiBmYWlsIG9yIG5vdC4KClNpZ25lZC1vZmYtYnk6IE1hbmlzaCBLYXRp eWFyIDxta2F0aXlhckBnbWFpbC5jb20+Ci0tLQogZnMvb2NmczIvam91cm5hbC5jIHwgICAxNiAr KysrKysrKysrKysrLS0tCiAxIGZpbGVzIGNoYW5nZWQsIDEzIGluc2VydGlvbnMoKyksIDMgZGVs ZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZnMvb2NmczIvam91cm5hbC5jIGIvZnMvb2NmczIvam91 cm5hbC5jCmluZGV4IGIx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