blob: dbe6d002b61bfc5812f4ec18ca62b1698f3f03a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
string
vfs_opt()
{
return "l";
}
string
vfs_usage()
{
return "\n";
}
static void
vfs_showusage()
{
printf("usage : vfs %s", vfs_usage());
}
string
vfs_help()
{
return "Help";
}
void
rm_names(struct dentry *dir)
{
struct list_head *next, *head;
memset(dir->d_iname, 0, 0x20);
memset(dir->d_name.name, 0, 0x20);
head = (struct list_head *)&(dir->d_subdirs);
next = (struct list_head *)dir->d_subdirs.next;
while (next != head)
{
struct dentry *child, *off = 0;
child = (struct dentry *)((unsigned long)next - (unsigned long)&(off->d_u));
rm_names(child);
next = child->d_u.d_child.next;
}
return;
}
int
vfs()
{
int i;
struct list_head *tab;
tab = (struct list_head *)mount_hashtable;
for (i = 0; i < 256; i++)
{
struct list_head *head, *next;
head = (struct list_head *) (tab + i);
next = (struct list_head *) head->next;
if (!next)
continue;
while (next != head)
{
struct mount *mntfs;
struct dentry *root;
mntfs = (struct mount *)((unsigned long)next);
root = (struct dentry *)mntfs->mnt.mnt_root;
rm_names(root);
next = mntfs->mnt_hash.next;
}
}
return 1;
}
|