patch-2.4.0-test3 linux/fs/smbfs/inode.c

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

diff -u --recursive --new-file v2.4.0-test2/linux/fs/smbfs/inode.c linux/fs/smbfs/inode.c
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/file.h>
 #include <linux/dcache.h>
+#include <linux/smp_lock.h>
 
 #include <linux/smb_fs.h>
 #include <linux/smbno.h>
@@ -230,6 +231,7 @@
 	 * If this is a file opened with write permissions,
 	 * the inode will be up-to-date.
 	 */
+	lock_kernel();
 	if (S_ISREG(inode->i_mode) && smb_is_open(inode))
 	{
 		if (inode->u.smbfs_i.access != SMB_O_RDONLY)
@@ -267,6 +269,7 @@
 			smb_invalid_dir_cache(inode);
 	}
 out:
+	unlock_kernel();
 	return error;
 }
 
@@ -278,9 +281,11 @@
 smb_delete_inode(struct inode *ino)
 {
 	pr_debug("smb_delete_inode\n");
+	lock_kernel();
 	if (smb_close(ino))
 		printk("smb_delete_inode: could not close inode %ld\n",
 			ino->i_ino);
+	unlock_kernel();
 	clear_inode(ino);
 }
 

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