super.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * linux/fs/sysv/inode.c
  3. *
  4. * minix/inode.c
  5. * Copyright (C) 1991, 1992 Linus Torvalds
  6. *
  7. * xenix/inode.c
  8. * Copyright (C) 1992 Doug Evans
  9. *
  10. * coh/inode.c
  11. * Copyright (C) 1993 Pascal Haible, Bruno Haible
  12. *
  13. * sysv/inode.c
  14. * Copyright (C) 1993 Paul B. Monday
  15. *
  16. * sysv/inode.c
  17. * Copyright (C) 1993 Bruno Haible
  18. * Copyright (C) 1997, 1998 Krzysztof G. Baranowski
  19. *
  20. * This file contains code for read/parsing the superblock.
  21. */
  22. #include <linux/module.h>
  23. #include <linux/init.h>
  24. #include <linux/slab.h>
  25. #include <linux/buffer_head.h>
  26. #include "sysv.h"
  27. /*
  28. * The following functions try to recognize specific filesystems.
  29. *
  30. * We recognize:
  31. * - Xenix FS by its magic number.
  32. * - SystemV FS by its magic number.
  33. * - Coherent FS by its funny fname/fpack field.
  34. * - SCO AFS by s_nfree == 0xffff
  35. * - V7 FS has no distinguishing features.
  36. *
  37. * We discriminate among SystemV4 and SystemV2 FS by the assumption that
  38. * the time stamp is not < 01-01-1980.
  39. */
  40. enum {
  41. JAN_1_1980 = (10*365 + 2) * 24 * 60 * 60
  42. };
  43. static void detected_xenix(struct sysv_sb_info *sbi)
  44. {
  45. struct buffer_head *bh1 = sbi->s_bh1;
  46. struct buffer_head *bh2 = sbi->s_bh2;
  47. struct xenix_super_block * sbd1;
  48. struct xenix_super_block * sbd2;
  49. if (bh1 != bh2)
  50. sbd1 = sbd2 = (struct xenix_super_block *) bh1->b_data;
  51. else {
  52. /* block size = 512, so bh1 != bh2 */
  53. sbd1 = (struct xenix_super_block *) bh1->b_data;
  54. sbd2 = (struct xenix_super_block *) (bh2->b_data - 512);
  55. }
  56. sbi->s_link_max = XENIX_LINK_MAX;
  57. sbi->s_fic_size = XENIX_NICINOD;
  58. sbi->s_flc_size = XENIX_NICFREE;
  59. sbi->s_sbd1 = (char *)sbd1;
  60. sbi->s_sbd2 = (char *)sbd2;
  61. sbi->s_sb_fic_count = &sbd1->s_ninode;
  62. sbi->s_sb_fic_inodes = &sbd1->s_inode[0];
  63. sbi->s_sb_total_free_inodes = &sbd2->s_tinode;
  64. sbi->s_bcache_count = &sbd1->s_nfree;
  65. sbi->s_bcache = &sbd1->s_free[0];
  66. sbi->s_free_blocks = &sbd2->s_tfree;
  67. sbi->s_sb_time = &sbd2->s_time;
  68. sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd1->s_isize);
  69. sbi->s_nzones = fs32_to_cpu(sbi, sbd1->s_fsize);
  70. }
  71. static void detected_sysv4(struct sysv_sb_info *sbi)
  72. {
  73. struct sysv4_super_block * sbd;
  74. struct buffer_head *bh1 = sbi->s_bh1;
  75. struct buffer_head *bh2 = sbi->s_bh2;
  76. if (bh1 == bh2)
  77. sbd = (struct sysv4_super_block *) (bh1->b_data + BLOCK_SIZE/2);
  78. else
  79. sbd = (struct sysv4_super_block *) bh2->b_data;
  80. sbi->s_link_max = SYSV_LINK_MAX;
  81. sbi->s_fic_size = SYSV_NICINOD;
  82. sbi->s_flc_size = SYSV_NICFREE;
  83. sbi->s_sbd1 = (char *)sbd;
  84. sbi->s_sbd2 = (char *)sbd;
  85. sbi->s_sb_fic_count = &sbd->s_ninode;
  86. sbi->s_sb_fic_inodes = &sbd->s_inode[0];
  87. sbi->s_sb_total_free_inodes = &sbd->s_tinode;
  88. sbi->s_bcache_count = &sbd->s_nfree;
  89. sbi->s_bcache = &sbd->s_free[0];
  90. sbi->s_free_blocks = &sbd->s_tfree;
  91. sbi->s_sb_time = &sbd->s_time;
  92. sbi->s_sb_state = &sbd->s_state;
  93. sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize);
  94. sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize);
  95. }
  96. static void detected_sysv2(struct sysv_sb_info *sbi)
  97. {
  98. struct sysv2_super_block *sbd;
  99. struct buffer_head *bh1 = sbi->s_bh1;
  100. struct buffer_head *bh2 = sbi->s_bh2;
  101. if (bh1 == bh2)
  102. sbd = (struct sysv2_super_block *) (bh1->b_data + BLOCK_SIZE/2);
  103. else
  104. sbd = (struct sysv2_super_block *) bh2->b_data;
  105. sbi->s_link_max = SYSV_LINK_MAX;
  106. sbi->s_fic_size = SYSV_NICINOD;
  107. sbi->s_flc_size = SYSV_NICFREE;
  108. sbi->s_sbd1 = (char *)sbd;
  109. sbi->s_sbd2 = (char *)sbd;
  110. sbi->s_sb_fic_count = &sbd->s_ninode;
  111. sbi->s_sb_fic_inodes = &sbd->s_inode[0];
  112. sbi->s_sb_total_free_inodes = &sbd->s_tinode;
  113. sbi->s_bcache_count = &sbd->s_nfree;
  114. sbi->s_bcache = &sbd->s_free[0];
  115. sbi->s_free_blocks = &sbd->s_tfree;
  116. sbi->s_sb_time = &sbd->s_time;
  117. sbi->s_sb_state = &sbd->s_state;
  118. sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize);
  119. sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize);
  120. }
  121. static void detected_coherent(struct sysv_sb_info *sbi)
  122. {
  123. struct coh_super_block * sbd;
  124. struct buffer_head *bh1 = sbi->s_bh1;
  125. sbd = (struct coh_super_block *) bh1->b_data;
  126. sbi->s_link_max = COH_LINK_MAX;
  127. sbi->s_fic_size = COH_NICINOD;
  128. sbi->s_flc_size = COH_NICFREE;
  129. sbi->s_sbd1 = (char *)sbd;
  130. sbi->s_sbd2 = (char *)sbd;
  131. sbi->s_sb_fic_count = &sbd->s_ninode;
  132. sbi->s_sb_fic_inodes = &sbd->s_inode[0];
  133. sbi->s_sb_total_free_inodes = &sbd->s_tinode;
  134. sbi->s_bcache_count = &sbd->s_nfree;
  135. sbi->s_bcache = &sbd->s_free[0];
  136. sbi->s_free_blocks = &sbd->s_tfree;
  137. sbi->s_sb_time = &sbd->s_time;
  138. sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize);
  139. sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize);
  140. }
  141. static void detected_v7(struct sysv_sb_info *sbi)
  142. {
  143. struct buffer_head *bh2 = sbi->s_bh2;
  144. struct v7_super_block *sbd = (struct v7_super_block *)bh2->b_data;
  145. sbi->s_link_max = V7_LINK_MAX;
  146. sbi->s_fic_size = V7_NICINOD;
  147. sbi->s_flc_size = V7_NICFREE;
  148. sbi->s_sbd1 = (char *)sbd;
  149. sbi->s_sbd2 = (char *)sbd;
  150. sbi->s_sb_fic_count = &sbd->s_ninode;
  151. sbi->s_sb_fic_inodes = &sbd->s_inode[0];
  152. sbi->s_sb_total_free_inodes = &sbd->s_tinode;
  153. sbi->s_bcache_count = &sbd->s_nfree;
  154. sbi->s_bcache = &sbd->s_free[0];
  155. sbi->s_free_blocks = &sbd->s_tfree;
  156. sbi->s_sb_time = &sbd->s_time;
  157. sbi->s_firstdatazone = fs16_to_cpu(sbi, sbd->s_isize);
  158. sbi->s_nzones = fs32_to_cpu(sbi, sbd->s_fsize);
  159. }
  160. static int detect_xenix(struct sysv_sb_info *sbi, struct buffer_head *bh)
  161. {
  162. struct xenix_super_block *sbd = (struct xenix_super_block *)bh->b_data;
  163. if (*(__le32 *)&sbd->s_magic == cpu_to_le32(0x2b5544))
  164. sbi->s_bytesex = BYTESEX_LE;
  165. else if (*(__be32 *)&sbd->s_magic == cpu_to_be32(0x2b5544))
  166. sbi->s_bytesex = BYTESEX_BE;
  167. else
  168. return 0;
  169. switch (fs32_to_cpu(sbi, sbd->s_type)) {
  170. case 1:
  171. sbi->s_type = FSTYPE_XENIX;
  172. return 1;
  173. case 2:
  174. sbi->s_type = FSTYPE_XENIX;
  175. return 2;
  176. default:
  177. return 0;
  178. }
  179. }
  180. static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
  181. {
  182. struct super_block *sb = sbi->s_sb;
  183. /* All relevant fields are at the same offsets in R2 and R4 */
  184. struct sysv4_super_block * sbd;
  185. u32 type;
  186. sbd = (struct sysv4_super_block *) (bh->b_data + BLOCK_SIZE/2);
  187. if (*(__le32 *)&sbd->s_magic == cpu_to_le32(0xfd187e20))
  188. sbi->s_bytesex = BYTESEX_LE;
  189. else if (*(__be32 *)&sbd->s_magic == cpu_to_be32(0xfd187e20))
  190. sbi->s_bytesex = BYTESEX_BE;
  191. else
  192. return 0;
  193. type = fs32_to_cpu(sbi, sbd->s_type);
  194. if (fs16_to_cpu(sbi, sbd->s_nfree) == 0xffff) {
  195. sbi->s_type = FSTYPE_AFS;
  196. sbi->s_forced_ro = 1;
  197. if (!(sb->s_flags & MS_RDONLY)) {
  198. printk("SysV FS: SCO EAFS on %s detected, "
  199. "forcing read-only mode.\n",
  200. sb->s_id);
  201. }
  202. return type;
  203. }
  204. if (fs32_to_cpu(sbi, sbd->s_time) < JAN_1_1980) {
  205. /* this is likely to happen on SystemV2 FS */
  206. if (type > 3 || type < 1)
  207. return 0;
  208. sbi->s_type = FSTYPE_SYSV2;
  209. return type;
  210. }
  211. if ((type > 3 || type < 1) && (type > 0x30 || type < 0x10))
  212. return 0;
  213. /* On Interactive Unix (ISC) Version 4.0/3.x s_type field = 0x10,
  214. 0x20 or 0x30 indicates that symbolic links and the 14-character
  215. filename limit is gone. Due to lack of information about this
  216. feature read-only mode seems to be a reasonable approach... -KGB */
  217. if (type >= 0x10) {
  218. printk("SysV FS: can't handle long file names on %s, "
  219. "forcing read-only mode.\n", sb->s_id);
  220. sbi->s_forced_ro = 1;
  221. }
  222. sbi->s_type = FSTYPE_SYSV4;
  223. return type >= 0x10 ? type >> 4 : type;
  224. }
  225. static int detect_coherent(struct sysv_sb_info *sbi, struct buffer_head *bh)
  226. {
  227. struct coh_super_block * sbd;
  228. sbd = (struct coh_super_block *) (bh->b_data + BLOCK_SIZE/2);
  229. if ((memcmp(sbd->s_fname,"noname",6) && memcmp(sbd->s_fname,"xxxxx ",6))
  230. || (memcmp(sbd->s_fpack,"nopack",6) && memcmp(sbd->s_fpack,"xxxxx\n",6)))
  231. return 0;
  232. sbi->s_bytesex = BYTESEX_PDP;
  233. sbi->s_type = FSTYPE_COH;
  234. return 1;
  235. }
  236. static int detect_sysv_odd(struct sysv_sb_info *sbi, struct buffer_head *bh)
  237. {
  238. int size = detect_sysv(sbi, bh);
  239. return size>2 ? 0 : size;
  240. }
  241. static struct {
  242. int block;
  243. int (*test)(struct sysv_sb_info *, struct buffer_head *);
  244. } flavours[] = {
  245. {1, detect_xenix},
  246. {0, detect_sysv},
  247. {0, detect_coherent},
  248. {9, detect_sysv_odd},
  249. {15,detect_sysv_odd},
  250. {18,detect_sysv},
  251. };
  252. static char *flavour_names[] = {
  253. [FSTYPE_XENIX] = "Xenix",
  254. [FSTYPE_SYSV4] = "SystemV",
  255. [FSTYPE_SYSV2] = "SystemV Release 2",
  256. [FSTYPE_COH] = "Coherent",
  257. [FSTYPE_V7] = "V7",
  258. [FSTYPE_AFS] = "AFS",
  259. };
  260. static void (*flavour_setup[])(struct sysv_sb_info *) = {
  261. [FSTYPE_XENIX] = detected_xenix,
  262. [FSTYPE_SYSV4] = detected_sysv4,
  263. [FSTYPE_SYSV2] = detected_sysv2,
  264. [FSTYPE_COH] = detected_coherent,
  265. [FSTYPE_V7] = detected_v7,
  266. [FSTYPE_AFS] = detected_sysv4,
  267. };
  268. static int complete_read_super(struct super_block *sb, int silent, int size)
  269. {
  270. struct sysv_sb_info *sbi = SYSV_SB(sb);
  271. struct inode *root_inode;
  272. char *found = flavour_names[sbi->s_type];
  273. u_char n_bits = size+8;
  274. int bsize = 1 << n_bits;
  275. int bsize_4 = bsize >> 2;
  276. sbi->s_firstinodezone = 2;
  277. flavour_setup[sbi->s_type](sbi);
  278. sbi->s_truncate = 1;
  279. sbi->s_ndatazones = sbi->s_nzones - sbi->s_firstdatazone;
  280. sbi->s_inodes_per_block = bsize >> 6;
  281. sbi->s_inodes_per_block_1 = (bsize >> 6)-1;
  282. sbi->s_inodes_per_block_bits = n_bits-6;
  283. sbi->s_ind_per_block = bsize_4;
  284. sbi->s_ind_per_block_2 = bsize_4*bsize_4;
  285. sbi->s_toobig_block = 10 + bsize_4 * (1 + bsize_4 * (1 + bsize_4));
  286. sbi->s_ind_per_block_bits = n_bits-2;
  287. sbi->s_ninodes = (sbi->s_firstdatazone - sbi->s_firstinodezone)
  288. << sbi->s_inodes_per_block_bits;
  289. if (!silent)
  290. printk("VFS: Found a %s FS (block size = %ld) on device %s\n",
  291. found, sb->s_blocksize, sb->s_id);
  292. sb->s_magic = SYSV_MAGIC_BASE + sbi->s_type;
  293. /* set up enough so that it can read an inode */
  294. sb->s_op = &sysv_sops;
  295. root_inode = iget(sb,SYSV_ROOT_INO);
  296. if (!root_inode || is_bad_inode(root_inode)) {
  297. printk("SysV FS: get root inode failed\n");
  298. return 0;
  299. }
  300. sb->s_root = d_alloc_root(root_inode);
  301. if (!sb->s_root) {
  302. iput(root_inode);
  303. printk("SysV FS: get root dentry failed\n");
  304. return 0;
  305. }
  306. if (sbi->s_forced_ro)
  307. sb->s_flags |= MS_RDONLY;
  308. if (sbi->s_truncate)
  309. sb->s_root->d_op = &sysv_dentry_operations;
  310. sb->s_dirt = 1;
  311. return 1;
  312. }
  313. static int sysv_fill_super(struct super_block *sb, void *data, int silent)
  314. {
  315. struct buffer_head *bh1, *bh = NULL;
  316. struct sysv_sb_info *sbi;
  317. unsigned long blocknr;
  318. int size = 0, i;
  319. if (1024 != sizeof (struct xenix_super_block))
  320. panic("Xenix FS: bad superblock size");
  321. if (512 != sizeof (struct sysv4_super_block))
  322. panic("SystemV FS: bad superblock size");
  323. if (512 != sizeof (struct sysv2_super_block))
  324. panic("SystemV FS: bad superblock size");
  325. if (500 != sizeof (struct coh_super_block))
  326. panic("Coherent FS: bad superblock size");
  327. if (64 != sizeof (struct sysv_inode))
  328. panic("sysv fs: bad inode size");
  329. sbi = kzalloc(sizeof(struct sysv_sb_info), GFP_KERNEL);
  330. if (!sbi)
  331. return -ENOMEM;
  332. sbi->s_sb = sb;
  333. sbi->s_block_base = 0;
  334. sb->s_fs_info = sbi;
  335. sb_set_blocksize(sb, BLOCK_SIZE);
  336. for (i = 0; i < ARRAY_SIZE(flavours) && !size; i++) {
  337. brelse(bh);
  338. bh = sb_bread(sb, flavours[i].block);
  339. if (!bh)
  340. continue;
  341. size = flavours[i].test(SYSV_SB(sb), bh);
  342. }
  343. if (!size)
  344. goto Eunknown;
  345. switch (size) {
  346. case 1:
  347. blocknr = bh->b_blocknr << 1;
  348. brelse(bh);
  349. sb_set_blocksize(sb, 512);
  350. bh1 = sb_bread(sb, blocknr);
  351. bh = sb_bread(sb, blocknr + 1);
  352. break;
  353. case 2:
  354. bh1 = bh;
  355. break;
  356. case 3:
  357. blocknr = bh->b_blocknr >> 1;
  358. brelse(bh);
  359. sb_set_blocksize(sb, 2048);
  360. bh1 = bh = sb_bread(sb, blocknr);
  361. break;
  362. default:
  363. goto Ebadsize;
  364. }
  365. if (bh && bh1) {
  366. sbi->s_bh1 = bh1;
  367. sbi->s_bh2 = bh;
  368. if (complete_read_super(sb, silent, size))
  369. return 0;
  370. }
  371. brelse(bh1);
  372. brelse(bh);
  373. sb_set_blocksize(sb, BLOCK_SIZE);
  374. printk("oldfs: cannot read superblock\n");
  375. failed:
  376. kfree(sbi);
  377. return -EINVAL;
  378. Eunknown:
  379. brelse(bh);
  380. if (!silent)
  381. printk("VFS: unable to find oldfs superblock on device %s\n",
  382. sb->s_id);
  383. goto failed;
  384. Ebadsize:
  385. brelse(bh);
  386. if (!silent)
  387. printk("VFS: oldfs: unsupported block size (%dKb)\n",
  388. 1<<(size-2));
  389. goto failed;
  390. }
  391. static int v7_fill_super(struct super_block *sb, void *data, int silent)
  392. {
  393. struct sysv_sb_info *sbi;
  394. struct buffer_head *bh, *bh2 = NULL;
  395. struct v7_super_block *v7sb;
  396. struct sysv_inode *v7i;
  397. if (440 != sizeof (struct v7_super_block))
  398. panic("V7 FS: bad super-block size");
  399. if (64 != sizeof (struct sysv_inode))
  400. panic("sysv fs: bad i-node size");
  401. sbi = kzalloc(sizeof(struct sysv_sb_info), GFP_KERNEL);
  402. if (!sbi)
  403. return -ENOMEM;
  404. sbi->s_sb = sb;
  405. sbi->s_block_base = 0;
  406. sbi->s_type = FSTYPE_V7;
  407. sbi->s_bytesex = BYTESEX_PDP;
  408. sb->s_fs_info = sbi;
  409. sb_set_blocksize(sb, 512);
  410. if ((bh = sb_bread(sb, 1)) == NULL) {
  411. if (!silent)
  412. printk("VFS: unable to read V7 FS superblock on "
  413. "device %s.\n", sb->s_id);
  414. goto failed;
  415. }
  416. /* plausibility check on superblock */
  417. v7sb = (struct v7_super_block *) bh->b_data;
  418. if (fs16_to_cpu(sbi, v7sb->s_nfree) > V7_NICFREE ||
  419. fs16_to_cpu(sbi, v7sb->s_ninode) > V7_NICINOD ||
  420. fs32_to_cpu(sbi, v7sb->s_time) == 0)
  421. goto failed;
  422. /* plausibility check on root inode: it is a directory,
  423. with a nonzero size that is a multiple of 16 */
  424. if ((bh2 = sb_bread(sb, 2)) == NULL)
  425. goto failed;
  426. v7i = (struct sysv_inode *)(bh2->b_data + 64);
  427. if ((fs16_to_cpu(sbi, v7i->i_mode) & ~0777) != S_IFDIR ||
  428. (fs32_to_cpu(sbi, v7i->i_size) == 0) ||
  429. (fs32_to_cpu(sbi, v7i->i_size) & 017) != 0)
  430. goto failed;
  431. brelse(bh2);
  432. bh2 = NULL;
  433. sbi->s_bh1 = bh;
  434. sbi->s_bh2 = bh;
  435. if (complete_read_super(sb, silent, 1))
  436. return 0;
  437. failed:
  438. brelse(bh2);
  439. brelse(bh);
  440. kfree(sbi);
  441. return -EINVAL;
  442. }
  443. /* Every kernel module contains stuff like this. */
  444. static int sysv_get_sb(struct file_system_type *fs_type,
  445. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  446. {
  447. return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super,
  448. mnt);
  449. }
  450. static int v7_get_sb(struct file_system_type *fs_type,
  451. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  452. {
  453. return get_sb_bdev(fs_type, flags, dev_name, data, v7_fill_super, mnt);
  454. }
  455. static struct file_system_type sysv_fs_type = {
  456. .owner = THIS_MODULE,
  457. .name = "sysv",
  458. .get_sb = sysv_get_sb,
  459. .kill_sb = kill_block_super,
  460. .fs_flags = FS_REQUIRES_DEV,
  461. };
  462. static struct file_system_type v7_fs_type = {
  463. .owner = THIS_MODULE,
  464. .name = "v7",
  465. .get_sb = v7_get_sb,
  466. .kill_sb = kill_block_super,
  467. .fs_flags = FS_REQUIRES_DEV,
  468. };
  469. extern int sysv_init_icache(void) __init;
  470. extern void sysv_destroy_icache(void);
  471. static int __init init_sysv_fs(void)
  472. {
  473. int error;
  474. error = sysv_init_icache();
  475. if (error)
  476. goto out;
  477. error = register_filesystem(&sysv_fs_type);
  478. if (error)
  479. goto destroy_icache;
  480. error = register_filesystem(&v7_fs_type);
  481. if (error)
  482. goto unregister;
  483. return 0;
  484. unregister:
  485. unregister_filesystem(&sysv_fs_type);
  486. destroy_icache:
  487. sysv_destroy_icache();
  488. out:
  489. return error;
  490. }
  491. static void __exit exit_sysv_fs(void)
  492. {
  493. unregister_filesystem(&sysv_fs_type);
  494. unregister_filesystem(&v7_fs_type);
  495. sysv_destroy_icache();
  496. }
  497. module_init(init_sysv_fs)
  498. module_exit(exit_sysv_fs)
  499. MODULE_LICENSE("GPL");