]>
Commit | Line | Data |
---|---|---|
0e45bb16 MF |
1 | typedef unsigned long long u64; |
2 | typedef u64 sector_t; | |
3 | extern struct module __this_module; | |
4 | struct super_block { | |
5 | unsigned long s_blocksize; | |
6 | struct block_device *s_bdev; | |
7 | }; | |
8 | struct file_system_type { | |
9 | const char *name; | |
10 | int fs_flags; | |
11 | int (*get_sb) (struct file_system_type *, int, const char *, void *, | |
12 | struct vfsmount *); | |
13 | void (*kill_sb) (struct super_block *); | |
14 | struct module *owner; | |
15 | }; | |
16 | void kill_block_super(struct super_block *sb); | |
17 | struct buffer_head { | |
18 | sector_t b_blocknr; | |
19 | }; | |
20 | static inline __attribute__ ((always_inline)) | |
21 | struct buffer_head *sb_bread(struct super_block *sb, sector_t block) | |
22 | { | |
23 | return __bread(sb->s_bdev, block, sb->s_blocksize); | |
24 | } | |
25 | static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) | |
26 | { | |
27 | } | |
28 | static struct { | |
29 | int (*test) (struct sysv_sb_info *, struct buffer_head *); | |
30 | } flavours[] = { | |
31 | { | |
32 | 0, detect_sysv} | |
33 | ,}; | |
34 | static int sysv_fill_super(struct super_block *sb, void *data, int silent) | |
35 | { | |
36 | struct buffer_head *bh1, *bh = ((void *)0); | |
37 | unsigned long blocknr; | |
38 | int size = 0, i; | |
39 | for (i = 0; i < (sizeof(flavours) / sizeof((flavours)[0]) + (sizeof(struct { | |
40 | } | |
41 | ))) | |
42 | && !size; i++) { | |
43 | size = flavours[i].test(SYSV_SB(sb), bh); | |
44 | } | |
45 | switch (size) { | |
46 | case 3: | |
47 | blocknr = bh->b_blocknr >> 1; | |
48 | bh1 = bh = sb_bread(sb, blocknr); | |
49 | } | |
50 | } | |
51 | static int sysv_get_sb(struct file_system_type *fs_type, int flags, | |
52 | const char *dev_name, void *data, struct vfsmount *mnt) | |
53 | { | |
54 | return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super, | |
55 | mnt); | |
56 | } | |
57 | static struct file_system_type sysv_fs_type = { | |
58 | .owner = (&__this_module),.name = "sysv",.get_sb = | |
59 | sysv_get_sb,.kill_sb = kill_block_super,.fs_flags = 1, | |
60 | }; | |
61 | static int __attribute__ ((__section__(".init.text"))) | |
62 | __attribute__ ((__cold__)) | |
63 | __attribute__ ((no_instrument_function)) init_sysv_fs(void) | |
64 | { | |
65 | unregister:unregister_filesystem(&sysv_fs_type); | |
66 | } | |
67 | int init_module(void) __attribute__ ((alias("init_sysv_fs"))); |