[CIFS] Change semaphore to mutex for cifs lock_sem
authorRoland Dreier <roland@digitalvampire.org>
Thu, 3 May 2007 04:33:45 +0000 (04:33 +0000)
committerSteve French <sfrench@us.ibm.com>
Thu, 3 May 2007 04:33:45 +0000 (04:33 +0000)
Originally at http://lkml.org/lkml/2006/9/2/86

The recent change to "allow Windows blocking locks to be cancelled via a
CANCEL_LOCK call" introduced a new semaphore in struct cifsFileInfo,
lock_sem.  However, semaphores used as mutexes are deprecated these days,
and there's no reason to add a new one to the kernel.  Therefore, convert
lock_sem to a struct mutex (and also fix one indentation glitch on one of
the lines changed anyway).

Signed-off-by: Roland Dreier <roland@digitalvampire.org>
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsglob.h
fs/cifs/dir.c
fs/cifs/file.c

index e4de8eb..23655de 100644 (file)
@@ -311,7 +311,7 @@ struct cifsFileInfo {
        /* lock scope id (0 if none) */
        struct file * pfile; /* needed for writepage */
        struct inode * pInode; /* needed for oplock break */
-       struct semaphore lock_sem;
+       struct mutex lock_mutex;
        struct list_head llist; /* list of byte range locks we have. */
        unsigned closePend:1;   /* file is marked to close */
        unsigned invalidHandle:1;  /* file closed via session abend */
index 3fad638..e521051 100644 (file)
@@ -274,7 +274,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                        pCifsFile->invalidHandle = FALSE;
                        pCifsFile->closePend     = FALSE;
                        init_MUTEX(&pCifsFile->fh_sem);
-                       init_MUTEX(&pCifsFile->lock_sem);
+                       mutex_init(&pCifsFile->lock_mutex);
                        INIT_LIST_HEAD(&pCifsFile->llist);
                        atomic_set(&pCifsFile->wrtPending,0);
 
diff --cc fs/cifs/file.c
Simple merge