patch-2.4.0-test3 linux/fs/fifo.c

Next file: linux/fs/file.c
Previous file: linux/fs/fcntl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/fifo.c linux/fs/fifo.c
@@ -11,6 +11,7 @@
 
 #include <linux/mm.h>
 #include <linux/malloc.h>
+#include <linux/smp_lock.h>
 
 static void wait_for_partner(struct inode* inode, unsigned int* cnt)
 {
@@ -32,6 +33,7 @@
 	int ret;
 
 	ret = -ERESTARTSYS;
+	lock_kernel();
 	if (down_interruptible(PIPE_SEM(*inode)))
 		goto err_nolock_nocleanup;
 
@@ -114,6 +116,7 @@
 
 	/* Ok! */
 	up(PIPE_SEM(*inode));
+	unlock_kernel();
 	return 0;
 
 err_rd:
@@ -140,6 +143,7 @@
 	up(PIPE_SEM(*inode));
 
 err_nolock_nocleanup:
+	unlock_kernel();
 	return ret;
 }
 

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