10 #include <linux/module.h>
12 #include <linux/slab.h>
21 static int efs_fill_super(
struct super_block *
s,
void *
d,
int silent);
24 int flags,
const char *dev_name,
void *
data)
26 return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super);
37 static struct pt_types sgi_pt_types[] = {
39 {0x01,
"SGI trkrepl"},
40 {0x02,
"SGI secrepl"},
52 {0x83,
"Linux native"},
74 static void efs_destroy_inode(
struct inode *inode)
79 static void init_once(
void *
foo)
86 static int init_inodecache(
void)
92 if (efs_inode_cachep ==
NULL)
97 static void destroy_inodecache(
void)
120 .alloc_inode = efs_alloc_inode,
121 .destroy_inode = efs_destroy_inode,
122 .put_super = efs_put_super,
123 .statfs = efs_statfs,
124 .remount_fs = efs_remount,
133 static int __init init_efs_fs(
void) {
136 err = init_inodecache();
144 destroy_inodecache();
149 static void __exit exit_efs_fs(
void) {
151 destroy_inodecache();
174 ui = ((
__be32 *) (vh + 1)) - 1;
175 for(csum = 0; ui >= ((
__be32 *) vh);) {
180 printk(
KERN_INFO "EFS: SGI disklabel: checksum bad, label corrupted\n");
187 for(i = 0; i <
NVDIR; i++) {
192 name[
j] = vh->vh_vd[
i].vd_name[
j];
207 for(pt_entry = sgi_pt_types; pt_entry->
pt_name; pt_entry++) {
208 if (pt_type == pt_entry->
pt_type)
break;
212 printk(
KERN_DEBUG "EFS: pt %2d: start: %08d size: %08d type: 0x%02x (%s)\n",
256 static int efs_fill_super(
struct super_block *
s,
void *
d,
int silent)
259 struct buffer_head *bh;
301 if (efs_validate_super(sb, (
struct efs_super *) bh->b_data)) {
316 s->
s_op = &efs_superblock_operations;
344 u64 id = huge_encode_dev(sb->
s_bdev->bd_dev);