* Re: [patch 05/10] cifs: convert semaphore to mutex
@ 2010-01-30 4:08 Steve French
2010-01-30 10:03 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Steve French @ 2010-01-30 4:08 UTC (permalink / raw)
To: Christoph Hellwig, Jeff Layton, LKML, Ingo Molnar,
Peter Zijlstra, Thomas Gleixner
Christoph Hellwig <hch@infradead.org> wrote on 01/29/2010 04:29:05 PM:
> Christoph Hellwig <hch@infradead.org>
> 01/29/2010 04:29 PM
>
> To
>
> Thomas Gleixner <tglx@linutronix.de>
>
> cc
>
> LKML <linux-kernel@vger.kernel.org>, Christoph Hellwig
> <hch@infradead.org>, Peter Zijlstra <peterz@infradead.org>, Ingo
> Molnar <mingo@elte.hu>, Jeff Layton <jlayton@redhat.com>, Steven
> French/Austin/IBM@IBMUS
>
> Subject
>
> Re: [patch 05/10] cifs: convert semaphore to mutex
>
> On Fri, Jan 29, 2010 at 08:38:50PM -0000, Thomas Gleixner wrote:
> > pSesInfo->sesSem is used as mutex. Rename it to session_mutex and
> > convert it to a real mutex.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Jeff Layton <jlayton@redhat.com>
> > Cc: Steve French <sfrench@us.ibm.com>
>
> Looks good, but I'm pretty sure I've seen an equivalent patch on the
> linux-cifs-client list before.
>
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Jeff and I acked the cifs part of the patch series in July - not sure
why the series didn't go in.
http://marc.info/?l=linux-kernel&m=124859649902788&w=2 looks like the
original post
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch 05/10] cifs: convert semaphore to mutex 2010-01-30 4:08 [patch 05/10] cifs: convert semaphore to mutex Steve French @ 2010-01-30 10:03 ` Thomas Gleixner 2010-01-30 23:49 ` Steve French 0 siblings, 1 reply; 5+ messages in thread From: Thomas Gleixner @ 2010-01-30 10:03 UTC (permalink / raw) To: Steve French Cc: Christoph Hellwig, Jeff Layton, LKML, Ingo Molnar, Peter Zijlstra On Fri, 29 Jan 2010, Steve French wrote: > > Looks good, but I'm pretty sure I've seen an equivalent patch on the > > linux-cifs-client list before. > > > > > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > Jeff and I acked the cifs part of the patch series in July - not sure > why the series didn't go in. > > http://marc.info/?l=linux-kernel&m=124859649902788&w=2 looks like the > original post Yeah, the patch was part of a larger series which had problems here and there. I forgot to split it out and push it seperately. Steve, can you pick that up and push it via the cifs tree ? It's completely stand alone and does not depend on other patches. Thanks, tglx ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 05/10] cifs: convert semaphore to mutex 2010-01-30 10:03 ` Thomas Gleixner @ 2010-01-30 23:49 ` Steve French 0 siblings, 0 replies; 5+ messages in thread From: Steve French @ 2010-01-30 23:49 UTC (permalink / raw) To: Thomas Gleixner Cc: Christoph Hellwig, Jeff Layton, LKML, Ingo Molnar, Peter Zijlstra On Sat, Jan 30, 2010 at 4:03 AM, Thomas Gleixner <tglx@linutronix.de> wrote: > On Fri, 29 Jan 2010, Steve French wrote: >> > Looks good, but I'm pretty sure I've seen an equivalent patch on the >> > linux-cifs-client list before. >> > >> > >> > Reviewed-by: Christoph Hellwig <hch@lst.de> >> >> Jeff and I acked the cifs part of the patch series in July - not sure >> why the series didn't go in. >> >> http://marc.info/?l=linux-kernel&m=124859649902788&w=2 looks like the >> original post > > Yeah, the patch was part of a larger series which had problems here > and there. I forgot to split it out and push it seperately. > > Steve, can you pick that up and push it via the cifs tree ? It's > completely stand alone and does not depend on other patches. np - will queue for 2.6.34 -- Thanks, Steve ^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 00/10] semaphore to mutex conversions @ 2010-01-29 20:38 Thomas Gleixner 2010-01-29 20:38 ` [patch 05/10] cifs: convert semaphore to mutex Thomas Gleixner 0 siblings, 1 reply; 5+ messages in thread From: Thomas Gleixner @ 2010-01-29 20:38 UTC (permalink / raw) To: LKML; +Cc: Christoph Hellwig, Peter Zijlstra, Ingo Molnar The following series converts semaphores which are semantically mutexes to real mutexes. This is part of the effort to remove init_MUTEX* Most of the patches have been in the -rt tree for quite a while with no bad side effects. Thanks, tglx ^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 05/10] cifs: convert semaphore to mutex 2010-01-29 20:38 [patch 00/10] semaphore to mutex conversions Thomas Gleixner @ 2010-01-29 20:38 ` Thomas Gleixner 2010-01-29 22:29 ` Christoph Hellwig 0 siblings, 1 reply; 5+ messages in thread From: Thomas Gleixner @ 2010-01-29 20:38 UTC (permalink / raw) To: LKML Cc: Christoph Hellwig, Peter Zijlstra, Ingo Molnar, Jeff Layton, Steve French [-- Attachment #1: cifs-convert-sema.patch --] [-- Type: text/plain, Size: 4051 bytes --] pSesInfo->sesSem is used as mutex. Rename it to session_mutex and convert it to a real mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jeff Layton <jlayton@redhat.com> Cc: Steve French <sfrench@us.ibm.com> --- fs/cifs/cifsglob.h | 2 +- fs/cifs/cifssmb.c | 12 ++++++------ fs/cifs/connect.c | 8 ++++---- fs/cifs/misc.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) Index: linux-2.6-tip/fs/cifs/cifsglob.h =================================================================== --- linux-2.6-tip.orig/fs/cifs/cifsglob.h +++ linux-2.6-tip/fs/cifs/cifsglob.h @@ -204,7 +204,7 @@ struct cifsUidInfo { struct cifsSesInfo { struct list_head smb_ses_list; struct list_head tcon_list; - struct semaphore sesSem; + struct mutex session_mutex; #if 0 struct cifsUidInfo *uidInfo; /* pointer to user info */ #endif Index: linux-2.6-tip/fs/cifs/cifssmb.c =================================================================== --- linux-2.6-tip.orig/fs/cifs/cifssmb.c +++ linux-2.6-tip/fs/cifs/cifssmb.c @@ -170,19 +170,19 @@ cifs_reconnect_tcon(struct cifsTconInfo * need to prevent multiple threads trying to simultaneously * reconnect the same SMB session */ - down(&ses->sesSem); + mutex_lock(&ses->session_mutex); if (ses->need_reconnect) rc = cifs_setup_session(0, ses, nls_codepage); /* do we need to reconnect tcon? */ if (rc || !tcon->need_reconnect) { - up(&ses->sesSem); + mutex_unlock(&ses->session_mutex); goto out; } mark_open_files_invalid(tcon); rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); - up(&ses->sesSem); + mutex_unlock(&ses->session_mutex); cFYI(1, ("reconnect tcon rc = %d", rc)); if (rc) @@ -700,13 +700,13 @@ CIFSSMBLogoff(const int xid, struct cifs if (!ses || !ses->server) return -EIO; - down(&ses->sesSem); + mutex_lock(&ses->session_mutex); if (ses->need_reconnect) goto session_already_dead; /* no need to send SMBlogoff if uid already closed due to reconnect */ rc = small_smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL, (void **)&pSMB); if (rc) { - up(&ses->sesSem); + mutex_unlock(&ses->session_mutex); return rc; } @@ -721,7 +721,7 @@ CIFSSMBLogoff(const int xid, struct cifs pSMB->AndXCommand = 0xFF; rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0); session_already_dead: - up(&ses->sesSem); + mutex_unlock(&ses->session_mutex); /* if session dead then we do not need to do ulogoff, since server closed smb session, no sense reporting Index: linux-2.6-tip/fs/cifs/connect.c =================================================================== --- linux-2.6-tip.orig/fs/cifs/connect.c +++ linux-2.6-tip/fs/cifs/connect.c @@ -2366,13 +2366,13 @@ try_mount_again: */ cifs_put_tcp_session(srvTcp); - down(&pSesInfo->sesSem); + mutex_lock(&pSesInfo->session_mutex); if (pSesInfo->need_reconnect) { cFYI(1, ("Session needs reconnect")); rc = cifs_setup_session(xid, pSesInfo, cifs_sb->local_nls); } - up(&pSesInfo->sesSem); + mutex_unlock(&pSesInfo->session_mutex); } else if (!rc) { cFYI(1, ("Existing smb sess not found")); pSesInfo = sesInfoAlloc(); @@ -2415,12 +2415,12 @@ try_mount_again: } pSesInfo->linux_uid = volume_info->linux_uid; pSesInfo->overrideSecFlg = volume_info->secFlg; - down(&pSesInfo->sesSem); + mutex_lock(&pSesInfo->session_mutex); /* BB FIXME need to pass vol->secFlgs BB */ rc = cifs_setup_session(xid, pSesInfo, cifs_sb->local_nls); - up(&pSesInfo->sesSem); + mutex_unlock(&pSesInfo->session_mutex); } /* search for existing tcon to this server share */ Index: linux-2.6-tip/fs/cifs/misc.c =================================================================== --- linux-2.6-tip.orig/fs/cifs/misc.c +++ linux-2.6-tip/fs/cifs/misc.c @@ -79,7 +79,7 @@ sesInfoAlloc(void) ++ret_buf->ses_count; INIT_LIST_HEAD(&ret_buf->smb_ses_list); INIT_LIST_HEAD(&ret_buf->tcon_list); - init_MUTEX(&ret_buf->sesSem); + mutex_init(&ret_buf->session_mutex); } return ret_buf; } ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 05/10] cifs: convert semaphore to mutex 2010-01-29 20:38 ` [patch 05/10] cifs: convert semaphore to mutex Thomas Gleixner @ 2010-01-29 22:29 ` Christoph Hellwig 0 siblings, 0 replies; 5+ messages in thread From: Christoph Hellwig @ 2010-01-29 22:29 UTC (permalink / raw) To: Thomas Gleixner Cc: LKML, Christoph Hellwig, Peter Zijlstra, Ingo Molnar, Jeff Layton, Steve French On Fri, Jan 29, 2010 at 08:38:50PM -0000, Thomas Gleixner wrote: > pSesInfo->sesSem is used as mutex. Rename it to session_mutex and > convert it to a real mutex. > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de> > Cc: Jeff Layton <jlayton@redhat.com> > Cc: Steve French <sfrench@us.ibm.com> Looks good, but I'm pretty sure I've seen an equivalent patch on the linux-cifs-client list before. Reviewed-by: Christoph Hellwig <hch@lst.de> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-30 23:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-01-30 4:08 [patch 05/10] cifs: convert semaphore to mutex Steve French 2010-01-30 10:03 ` Thomas Gleixner 2010-01-30 23:49 ` Steve French -- strict thread matches above, loose matches on Subject: below -- 2010-01-29 20:38 [patch 00/10] semaphore to mutex conversions Thomas Gleixner 2010-01-29 20:38 ` [patch 05/10] cifs: convert semaphore to mutex Thomas Gleixner 2010-01-29 22:29 ` Christoph Hellwig
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®