summaryrefslogtreecommitdiffstats
path: root/fs/ramfs/inode.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-15 01:55:58 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-15 01:55:58 +0000
commit53b3988d474435254a3b053a68bb24ce9e439295 (patch)
treef8da8e40f01f4ad02bbd76b8c9920749b118235f /fs/ramfs/inode.c
parentb0cb48abe83d1a4389ea938bf624f8baa82c5047 (diff)
Merge with 2.3.99-pre9.
Diffstat (limited to 'fs/ramfs/inode.c')
-rw-r--r--fs/ramfs/inode.c62
1 files changed, 8 insertions, 54 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 75e94efd9..4416e8be6 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -227,7 +227,6 @@ static int ramfs_unlink(struct inode * dir, struct dentry *dentry)
inode->i_nlink--;
dput(dentry); /* Undo the count from "create" - this does all the work */
- d_delete(dentry);
retval = 0;
}
return retval;
@@ -269,57 +268,6 @@ static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char *
return error;
}
-/*
- * This really should be the same as the proc filldir,
- * once proc does the "one dentry tree" thing..
- */
-static int ramfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
-{
- int i;
- struct dentry *dentry = filp->f_dentry;
-
- i = filp->f_pos;
- switch (i) {
- case 0:
- if (filldir(dirent, ".", 1, i, dentry->d_inode->i_ino) < 0)
- break;
- i++;
- filp->f_pos++;
- /* fallthrough */
- case 1:
- if (filldir(dirent, "..", 2, i, dentry->d_parent->d_inode->i_ino) < 0)
- break;
- i++;
- filp->f_pos++;
- /* fallthrough */
- default: {
- struct list_head *list = dentry->d_subdirs.next;
-
- int j = i-2;
- for (;;) {
- if (list == &dentry->d_subdirs)
- return 0;
- if (!j)
- break;
- j--;
- list = list->next;
- }
-
- do {
- struct dentry *de = list_entry(list, struct dentry, d_child);
-
- if (ramfs_positive(de)) {
- if (filldir(dirent, de->d_name.name, de->d_name.len, filp->f_pos, de->d_inode->i_ino) < 0)
- break;
- }
- filp->f_pos++;
- list = list->next;
- } while (list != &dentry->d_subdirs);
- }
- }
- return 0;
-}
-
static struct address_space_operations ramfs_aops = {
readpage: ramfs_readpage,
writepage: ramfs_writepage,
@@ -335,7 +283,7 @@ static struct file_operations ramfs_file_operations = {
static struct file_operations ramfs_dir_operations = {
read: generic_read_dir,
- readdir: ramfs_readdir,
+ readdir: dcache_readdir,
};
static struct inode_operations ramfs_dir_inode_operations = {
@@ -350,9 +298,15 @@ static struct inode_operations ramfs_dir_inode_operations = {
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 = {
- statfs: ramfs_statfs,
+ put_super: ramfs_put_super,
+ statfs: ramfs_statfs,
};
static struct super_block *ramfs_read_super(struct super_block * sb, void * data, int silent)