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

Next file: linux/fs/readdir.c
Previous file: linux/fs/qnx4/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/ramfs/inode.c linux/fs/ramfs/inode.c
@@ -202,15 +202,21 @@
  */
 static int ramfs_empty(struct dentry *dentry)
 {
-	struct list_head *list = dentry->d_subdirs.next;
+	struct list_head *list;
+
+	spin_lock(&dcache_lock);
+	list = dentry->d_subdirs.next;
 
 	while (list != &dentry->d_subdirs) {
 		struct dentry *de = list_entry(list, struct dentry, d_child);
 
-		if (ramfs_positive(de))
+		if (ramfs_positive(de)) {
+			spin_unlock(&dcache_lock);
 			return 0;
+		}
 		list = list->next;
 	}
+	spin_unlock(&dcache_lock);
 	return 1;
 }
 
@@ -298,15 +304,9 @@
 	rename:		ramfs_rename,
 };
 
-static void ramfs_put_super(struct super_block *sb)
-{
-	d_genocide(sb->s_root);
-	shrink_dcache_parent(sb->s_root);
-}
-
 static struct super_operations ramfs_ops = {
-	put_super:	ramfs_put_super,
 	statfs:		ramfs_statfs,
+	put_inode:	force_delete,
 };
 
 static struct super_block *ramfs_read_super(struct super_block * sb, void * data, int silent)
@@ -331,7 +331,7 @@
 	return sb;
 }
 
-static DECLARE_FSTYPE(ramfs_fs_type, "ramfs", ramfs_read_super, 0);
+static DECLARE_FSTYPE(ramfs_fs_type, "ramfs", ramfs_read_super, FS_LITTER);
 
 static int __init init_ramfs_fs(void)
 {

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