patch-2.4.0-test3 linux/net/unix/af_unix.c

Next file: linux/scripts/kernel-doc
Previous file: linux/net/sunrpc/xprt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
@@ -8,7 +8,7 @@
  *		as published by the Free Software Foundation; either version
  *		2 of the License, or (at your option) any later version.
  *
- * Version:	$Id: af_unix.c,v 1.99 2000/06/22 11:42:32 davem Exp $
+ * Version:	$Id: af_unix.c,v 1.101 2000/07/06 01:41:46 davem Exp $
  *
  * Fixes:
  *		Linus Torvalds	:	Assorted bug cures.
@@ -381,10 +381,8 @@
 	}
 
 	if (dentry) {
-		lock_kernel();
 		dput(dentry);
 		mntput(mnt);
-		unlock_kernel();
 	}
 
 	sock_put(sk);
@@ -445,7 +443,7 @@
 {
 	struct sock *sk;
 
-	if (atomic_read(&unix_nr_socks) >= 2*max_files)
+	if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files)
 		return NULL;
 
 	MOD_INC_USE_COUNT;
@@ -574,14 +572,10 @@
 	int err = 0;
 	
 	if (sunname->sun_path[0]) {
-		/* Do not believe to VFS, grab kernel lock */
-		lock_kernel();
 		if (path_init(sunname->sun_path, LOOKUP_POSITIVE, &nd))
 			err = path_walk(sunname->sun_path, &nd);
-		if (err) {
-			unlock_kernel();
+		if (err)
 			goto fail;
-		}
 		err = permission(nd.dentry->d_inode,MAY_WRITE);
 		if (err)
 			goto put_fail;
@@ -594,7 +588,6 @@
 			goto put_fail;
 
 		path_release(&nd);
-		unlock_kernel();
 
 		err=-EPROTOTYPE;
 		if (u->type != type) {
@@ -611,7 +604,6 @@
 
 put_fail:
 	path_release(&nd);
-	unlock_kernel();
 fail:
 	*error=err;
 	return NULL;
@@ -660,7 +652,6 @@
 	atomic_set(&addr->refcnt, 1);
 
 	if (sunaddr->sun_path[0]) {
-		lock_kernel();
 		err = 0;
 		/*
 		 * Get the parent directory, calculate the hash for last
@@ -707,7 +698,6 @@
 		up(&nd.dentry->d_inode->i_sem);
 		dput(nd.dentry);
 		nd.dentry = dentry;
-		unlock_kernel();
 
 		addr->hash = UNIX_HASH_SIZE;
 	}
@@ -748,7 +738,6 @@
 out_mknod:
 	path_release(&nd);
 out_mknod_parent:
-	unlock_kernel();
 	if (err==-EEXIST)
 		err=-EADDRINUSE;
 	unix_release_addr(addr);
@@ -963,11 +952,8 @@
 		newsk->protinfo.af_unix.addr=other->protinfo.af_unix.addr;
 	}
 	if (other->protinfo.af_unix.dentry) {
-		/* Damn, even dget is not SMP safe. It becomes ridiculous... */
-		lock_kernel();
 		newsk->protinfo.af_unix.dentry=dget(other->protinfo.af_unix.dentry);
 		newsk->protinfo.af_unix.mnt=mntget(other->protinfo.af_unix.mnt);
-		unlock_kernel();
 	}
 
 	/* Set credentials */

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