linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation.
@ 2011-04-25  0:15 Manish Katiyar
  2011-04-27  7:44 ` Joel Becker
  2011-05-11 15:56 ` Jan Kara
  0 siblings, 2 replies; 3+ messages in thread
From: Manish Katiyar @ 2011-04-25  0:15 UTC (permalink / raw)
  To: ext4; +Cc: Manish Katiyar, Jan Kara, Theodore Ts'o

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

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 <mkatiyar@gmail.com>
---
 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

[-- Attachment #2: 0003-Update-ocfs-routines-to-use-the-updated-journal-rout.patch --]
[-- Type: text/x-patch, Size: 1861 bytes --]

From bb95830b270fce043b5b901d53d391189ee96878 Mon Sep 17 00:00:00 2001
From: Manish Katiyar <mkatiyar@gmail.com>
Date: Sun, 24 Apr 2011 00:27:31 -0700
Subject: [PATCH 3/5] Update ocfs 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 <mkatiyar@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation.
  2011-04-25  0:15 [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation Manish Katiyar
@ 2011-04-27  7:44 ` Joel Becker
  2011-05-11 15:56 ` Jan Kara
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2011-04-27  7:44 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: ext4, Manish Katiyar, Jan Kara, Theodore Ts'o

On Sun, Apr 24, 2011 at 05:15:35PM -0700, Manish Katiyar wrote:
> 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 <mkatiyar@gmail.com>

Works for me.
Acked-by: Joel Becker <jlbec@evilplan.org>

Joel

-- 

"Against stupidity the Gods themselves contend in vain."
	- Friedrich von Schiller

			http://www.jlbec.org/
			jlbec@evilplan.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation.
  2011-04-25  0:15 [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation Manish Katiyar
  2011-04-27  7:44 ` Joel Becker
@ 2011-05-11 15:56 ` Jan Kara
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2011-05-11 15:56 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: ext4, Manish Katiyar, Jan Kara, Theodore Ts'o

On Sun 24-04-11 17:15:35, Manish Katiyar wrote:
> Update ocfs2 routines to use the updated journal routines passing an
> extra parameter to specify whether transaction allocation can fail or
> not.
  This should be included in the first patch. Also I don't think there's a
need for special helpers since they are called from one / two sites anyway.

								Honza 
> 
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
> ---
>  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

> From bb95830b270fce043b5b901d53d391189ee96878 Mon Sep 17 00:00:00 2001
> From: Manish Katiyar <mkatiyar@gmail.com>
> Date: Sun, 24 Apr 2011 00:27:31 -0700
> Subject: [PATCH 3/5] Update ocfs 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 <mkatiyar@gmail.com>
> ---
>  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
> 

-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-11 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-25  0:15 [PATCH 3/5] ocfs2: Update ocfs2 routines to use the updated journal routines to specify gfp_mask for transaction allocation Manish Katiyar
2011-04-27  7:44 ` Joel Becker
2011-05-11 15:56 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).