patch-2.3.2 linux/fs/ncpfs/dir.c

Next file: linux/fs/ncpfs/file.c
Previous file: linux/fs/msdos/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.1/linux/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c
@@ -38,8 +38,7 @@
 static int c_seen_eof;
 static int c_last_returned_index;
 static struct ncp_dirent *c_entry = NULL;
-static int c_lock = 0;
-static DECLARE_WAIT_QUEUE_HEAD(c_wait);
+static DECLARE_MUTEX(c_sem);
 
 static int ncp_read_volume_list(struct ncp_server *, int, int,
 					struct ncp_dirent *);
@@ -230,15 +229,12 @@
 
 static inline void ncp_lock_dircache(void)
 {
-	while (c_lock)
-		sleep_on(&c_wait);
-	c_lock = 1;
+	down(&c_sem);
 }
 
 static inline void ncp_unlock_dircache(void)
 {
-	c_lock = 0;
-	wake_up(&c_wait);
+	up(&c_sem);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)