linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [patch 15/30] smbfs: Convert server->sem to mutex
Date: Fri, 10 Sep 2010 08:46:29 -0400	[thread overview]
Message-ID: <20100910084629.239dc62f@corrin.poochiereds.net> (raw)
In-Reply-To: <20100907125056.136212826@linutronix.de>

On Tue, 07 Sep 2010 14:32:52 -0000
Thomas Gleixner <tglx@linutronix.de> wrote:

> server->sem is used as mutex so make it a mutex.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: linux-fsdevel@vger.kernel.org
> 
> ---
>  fs/smbfs/inode.c          |    2 +-
>  include/linux/smb_fs_sb.h |    8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/fs/smbfs/inode.c
> ===================================================================
> --- linux-2.6.orig/fs/smbfs/inode.c
> +++ linux-2.6/fs/smbfs/inode.c
> @@ -536,7 +536,7 @@ static int smb_fill_super(struct super_b
>  	server->mnt = NULL;
>  	server->sock_file = NULL;
>  	init_waitqueue_head(&server->conn_wq);
> -	init_MUTEX(&server->sem);
> +	mutex_init(&server->mutex);
>  	INIT_LIST_HEAD(&server->entry);
>  	INIT_LIST_HEAD(&server->xmitq);
>  	INIT_LIST_HEAD(&server->recvq);
> Index: linux-2.6/include/linux/smb_fs_sb.h
> ===================================================================
> --- linux-2.6.orig/include/linux/smb_fs_sb.h
> +++ linux-2.6/include/linux/smb_fs_sb.h
> @@ -58,7 +58,7 @@ struct smb_sb_info {
>  	struct smb_conn_opt opt;
>  	wait_queue_head_t conn_wq;
>  	int conn_complete;
> -	struct semaphore sem;
> +	struct mutex mutex;
>  
>  	unsigned char      header[SMB_HEADER_LEN + 20*2 + 2];
>  	u32                header_len;
> @@ -82,19 +82,19 @@ struct smb_sb_info {
>  static inline int
>  smb_lock_server_interruptible(struct smb_sb_info *server)
>  {
> -	return down_interruptible(&(server->sem));
> +	return mutex_lock_interruptible(&server->mutex);
>  }
>  
>  static inline void
>  smb_lock_server(struct smb_sb_info *server)
>  {
> -	down(&(server->sem));
> +	mutex_lock(&server->mutex);
>  }
>  
>  static inline void
>  smb_unlock_server(struct smb_sb_info *server)
>  {
> -	up(&(server->sem));
> +	mutex_unlock(&server->mutex);
>  }
>  
>  #endif
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


Seems harmless...

Acked-by: Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2010-09-10 12:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100907124636.880953480@linutronix.de>
2010-09-07 14:32 ` [patch 15/30] smbfs: Convert server->sem to mutex Thomas Gleixner
2010-09-10 12:46   ` Jeff Layton [this message]
2010-09-07 14:32 ` [patch 16/30] hpfs: Convert sbi->hpfs_creation_de " Thomas Gleixner
2010-09-07 14:33 ` [patch 17/30] hpfsplus: Convert tree_lock " Thomas Gleixner
2010-09-07 14:33 ` [patch 18/30] hfs: " Thomas Gleixner
2010-09-07 14:33 ` [patch 19/30] affs: use sema_init instead of init_MUTEX Thomas Gleixner

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=20100910084629.239dc62f@corrin.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).