public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: linux-kernel@vger.kernel.org
Cc: reiserfs-devel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	kamalesh@linux.vnet.ibm.com
Subject: Re: [patch 2/3] [PATCH] reiserfs: convert j_flush_sem to mutex
Date: Wed, 14 May 2008 10:41:44 -0400	[thread overview]
Message-ID: <482AFA28.8020403@suse.com> (raw)
In-Reply-To: <20080508063651.715221085@suse.com>

Jeff Mahoney wrote:
>  j_flush_sem is a semaphore but uses it as if it were a mutex. This
>  patch converts it to a mutex.
> --- a/fs/reiserfs/journal.c
> +++ b/fs/reiserfs/journal.c
> @@ -1411,8 +1411,8 @@ static int flush_journal_list(struct sup
>  
>  	/* if flushall == 0, the lock is already held */
>  	if (flushall) {
> -		down(&journal->j_flush_sem);
> -	} else if (!down_trylock(&journal->j_flush_sem)) {
> +		mutex_lock(&journal->j_flush_mutex);
> +	} else if (!mutex_trylock(&journal->j_flush_mutex)) {
>  		BUG();
>  	}

Oops. This chunk didn't get refreshed, here's the right one.

-Jeff

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/reiserfs/journal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1410,7 +1410,7 @@ static int flush_journal_list(struct sup
 	/* if flushall == 0, the lock is already held */
 	if (flushall) {
 		mutex_lock(&journal->j_flush_mutex);
-	} else if (!mutex_trylock(&journal->j_flush_mutex)) {
+	} else if (mutex_trylock(&journal->j_flush_mutex)) {
 		BUG();
 	}
 


-- 
Jeff Mahoney
SUSE Labs

  reply	other threads:[~2008-05-14 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  6:35 [patch 0/3] eliminate struct semaphore from reiserfs Jeff Mahoney
2008-05-08  6:35 ` [patch 1/3] [PATCH] reiserfs: convert j_lock to mutex Jeff Mahoney
2008-05-08  6:35 ` [patch 2/3] [PATCH] reiserfs: convert j_flush_sem " Jeff Mahoney
2008-05-14 14:41   ` Jeff Mahoney [this message]
2008-05-14 18:22     ` Kamalesh Babulal
2008-05-08  6:36 ` [patch 3/3] [PATCH] reiserfs: convert j_commit_lock " Jeff Mahoney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=482AFA28.8020403@suse.com \
    --to=jeffm@suse.com \
    --cc=akpm@osdl.org \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox