inode.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. /*
  2. * ROMFS file system, Linux implementation
  3. *
  4. * Copyright (C) 1997-1999 Janos Farkas <chexum@shadow.banki.hu>
  5. *
  6. * Using parts of the minix filesystem
  7. * Copyright (C) 1991, 1992 Linus Torvalds
  8. *
  9. * and parts of the affs filesystem additionally
  10. * Copyright (C) 1993 Ray Burr
  11. * Copyright (C) 1996 Hans-Joachim Widmaier
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * as published by the Free Software Foundation; either version
  16. * 2 of the License, or (at your option) any later version.
  17. *
  18. * Changes
  19. * Changed for 2.1.19 modules
  20. * Jan 1997 Initial release
  21. * Jun 1997 2.1.43+ changes
  22. * Proper page locking in readpage
  23. * Changed to work with 2.1.45+ fs
  24. * Jul 1997 Fixed follow_link
  25. * 2.1.47
  26. * lookup shouldn't return -ENOENT
  27. * from Horst von Brand:
  28. * fail on wrong checksum
  29. * double unlock_super was possible
  30. * correct namelen for statfs
  31. * spotted by Bill Hawes:
  32. * readlink shouldn't iput()
  33. * Jun 1998 2.1.106 from Avery Pennarun: glibc scandir()
  34. * exposed a problem in readdir
  35. * 2.1.107 code-freeze spellchecker run
  36. * Aug 1998 2.1.118+ VFS changes
  37. * Sep 1998 2.1.122 another VFS change (follow_link)
  38. * Apr 1999 2.2.7 no more EBADF checking in
  39. * lookup/readdir, use ERR_PTR
  40. * Jun 1999 2.3.6 d_alloc_root use changed
  41. * 2.3.9 clean up usage of ENOENT/negative
  42. * dentries in lookup
  43. * clean up page flags setting
  44. * (error, uptodate, locking) in
  45. * in readpage
  46. * use init_special_inode for
  47. * fifos/sockets (and streamline) in
  48. * read_inode, fix _ops table order
  49. * Aug 1999 2.3.16 __initfunc() => __init change
  50. * Oct 1999 2.3.24 page->owner hack obsoleted
  51. * Nov 1999 2.3.27 2.3.25+ page->offset => index change
  52. */
  53. /* todo:
  54. * - see Documentation/filesystems/romfs.txt
  55. * - use allocated, not stack memory for file names?
  56. * - considering write access...
  57. * - network (tftp) files?
  58. * - merge back some _op tables
  59. */
  60. /*
  61. * Sorry about some optimizations and for some goto's. I just wanted
  62. * to squeeze some more bytes out of this code.. :)
  63. */
  64. #include <linux/module.h>
  65. #include <linux/types.h>
  66. #include <linux/errno.h>
  67. #include <linux/slab.h>
  68. #include <linux/romfs_fs.h>
  69. #include <linux/fs.h>
  70. #include <linux/init.h>
  71. #include <linux/pagemap.h>
  72. #include <linux/smp_lock.h>
  73. #include <linux/buffer_head.h>
  74. #include <linux/vfs.h>
  75. #include <asm/uaccess.h>
  76. struct romfs_inode_info {
  77. unsigned long i_metasize; /* size of non-data area */
  78. unsigned long i_dataoffset; /* from the start of fs */
  79. struct inode vfs_inode;
  80. };
  81. static struct inode *romfs_iget(struct super_block *, unsigned long);
  82. /* instead of private superblock data */
  83. static inline unsigned long romfs_maxsize(struct super_block *sb)
  84. {
  85. return (unsigned long)sb->s_fs_info;
  86. }
  87. static inline struct romfs_inode_info *ROMFS_I(struct inode *inode)
  88. {
  89. return container_of(inode, struct romfs_inode_info, vfs_inode);
  90. }
  91. static __u32
  92. romfs_checksum(void *data, int size)
  93. {
  94. __u32 sum;
  95. __be32 *ptr;
  96. sum = 0; ptr = data;
  97. size>>=2;
  98. while (size>0) {
  99. sum += be32_to_cpu(*ptr++);
  100. size--;
  101. }
  102. return sum;
  103. }
  104. static const struct super_operations romfs_ops;
  105. static int romfs_fill_super(struct super_block *s, void *data, int silent)
  106. {
  107. struct buffer_head *bh;
  108. struct romfs_super_block *rsb;
  109. struct inode *root;
  110. int sz, ret = -EINVAL;
  111. /* I would parse the options here, but there are none.. :) */
  112. sb_set_blocksize(s, ROMBSIZE);
  113. s->s_maxbytes = 0xFFFFFFFF;
  114. bh = sb_bread(s, 0);
  115. if (!bh) {
  116. /* XXX merge with other printk? */
  117. printk ("romfs: unable to read superblock\n");
  118. goto outnobh;
  119. }
  120. rsb = (struct romfs_super_block *)bh->b_data;
  121. sz = be32_to_cpu(rsb->size);
  122. if (rsb->word0 != ROMSB_WORD0 || rsb->word1 != ROMSB_WORD1
  123. || sz < ROMFH_SIZE) {
  124. if (!silent)
  125. printk ("VFS: Can't find a romfs filesystem on dev "
  126. "%s.\n", s->s_id);
  127. goto out;
  128. }
  129. if (romfs_checksum(rsb, min_t(int, sz, 512))) {
  130. printk ("romfs: bad initial checksum on dev "
  131. "%s.\n", s->s_id);
  132. goto out;
  133. }
  134. s->s_magic = ROMFS_MAGIC;
  135. s->s_fs_info = (void *)(long)sz;
  136. s->s_flags |= MS_RDONLY;
  137. /* Find the start of the fs */
  138. sz = (ROMFH_SIZE +
  139. strnlen(rsb->name, ROMFS_MAXFN) + 1 + ROMFH_PAD)
  140. & ROMFH_MASK;
  141. s->s_op = &romfs_ops;
  142. root = romfs_iget(s, sz);
  143. if (IS_ERR(root)) {
  144. ret = PTR_ERR(root);
  145. goto out;
  146. }
  147. ret = -ENOMEM;
  148. s->s_root = d_alloc_root(root);
  149. if (!s->s_root)
  150. goto outiput;
  151. brelse(bh);
  152. return 0;
  153. outiput:
  154. iput(root);
  155. out:
  156. brelse(bh);
  157. outnobh:
  158. return ret;
  159. }
  160. /* That's simple too. */
  161. static int
  162. romfs_statfs(struct dentry *dentry, struct kstatfs *buf)
  163. {
  164. buf->f_type = ROMFS_MAGIC;
  165. buf->f_bsize = ROMBSIZE;
  166. buf->f_bfree = buf->f_bavail = buf->f_ffree;
  167. buf->f_blocks = (romfs_maxsize(dentry->d_sb)+ROMBSIZE-1)>>ROMBSBITS;
  168. buf->f_namelen = ROMFS_MAXFN;
  169. return 0;
  170. }
  171. /* some helper routines */
  172. static int
  173. romfs_strnlen(struct inode *i, unsigned long offset, unsigned long count)
  174. {
  175. struct buffer_head *bh;
  176. unsigned long avail, maxsize, res;
  177. maxsize = romfs_maxsize(i->i_sb);
  178. if (offset >= maxsize)
  179. return -1;
  180. /* strnlen is almost always valid */
  181. if (count > maxsize || offset+count > maxsize)
  182. count = maxsize-offset;
  183. bh = sb_bread(i->i_sb, offset>>ROMBSBITS);
  184. if (!bh)
  185. return -1; /* error */
  186. avail = ROMBSIZE - (offset & ROMBMASK);
  187. maxsize = min_t(unsigned long, count, avail);
  188. res = strnlen(((char *)bh->b_data)+(offset&ROMBMASK), maxsize);
  189. brelse(bh);
  190. if (res < maxsize)
  191. return res; /* found all of it */
  192. while (res < count) {
  193. offset += maxsize;
  194. bh = sb_bread(i->i_sb, offset>>ROMBSBITS);
  195. if (!bh)
  196. return -1;
  197. maxsize = min_t(unsigned long, count - res, ROMBSIZE);
  198. avail = strnlen(bh->b_data, maxsize);
  199. res += avail;
  200. brelse(bh);
  201. if (avail < maxsize)
  202. return res;
  203. }
  204. return res;
  205. }
  206. static int
  207. romfs_copyfrom(struct inode *i, void *dest, unsigned long offset, unsigned long count)
  208. {
  209. struct buffer_head *bh;
  210. unsigned long avail, maxsize, res;
  211. maxsize = romfs_maxsize(i->i_sb);
  212. if (offset >= maxsize || count > maxsize || offset+count>maxsize)
  213. return -1;
  214. bh = sb_bread(i->i_sb, offset>>ROMBSBITS);
  215. if (!bh)
  216. return -1; /* error */
  217. avail = ROMBSIZE - (offset & ROMBMASK);
  218. maxsize = min_t(unsigned long, count, avail);
  219. memcpy(dest, ((char *)bh->b_data) + (offset & ROMBMASK), maxsize);
  220. brelse(bh);
  221. res = maxsize; /* all of it */
  222. while (res < count) {
  223. offset += maxsize;
  224. dest += maxsize;
  225. bh = sb_bread(i->i_sb, offset>>ROMBSBITS);
  226. if (!bh)
  227. return -1;
  228. maxsize = min_t(unsigned long, count - res, ROMBSIZE);
  229. memcpy(dest, bh->b_data, maxsize);
  230. brelse(bh);
  231. res += maxsize;
  232. }
  233. return res;
  234. }
  235. static unsigned char romfs_dtype_table[] = {
  236. DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_SOCK, DT_FIFO
  237. };
  238. static int
  239. romfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
  240. {
  241. struct inode *i = filp->f_path.dentry->d_inode;
  242. struct romfs_inode ri;
  243. unsigned long offset, maxoff;
  244. int j, ino, nextfh;
  245. int stored = 0;
  246. char fsname[ROMFS_MAXFN]; /* XXX dynamic? */
  247. lock_kernel();
  248. maxoff = romfs_maxsize(i->i_sb);
  249. offset = filp->f_pos;
  250. if (!offset) {
  251. offset = i->i_ino & ROMFH_MASK;
  252. if (romfs_copyfrom(i, &ri, offset, ROMFH_SIZE) <= 0)
  253. goto out;
  254. offset = be32_to_cpu(ri.spec) & ROMFH_MASK;
  255. }
  256. /* Not really failsafe, but we are read-only... */
  257. for(;;) {
  258. if (!offset || offset >= maxoff) {
  259. offset = maxoff;
  260. filp->f_pos = offset;
  261. goto out;
  262. }
  263. filp->f_pos = offset;
  264. /* Fetch inode info */
  265. if (romfs_copyfrom(i, &ri, offset, ROMFH_SIZE) <= 0)
  266. goto out;
  267. j = romfs_strnlen(i, offset+ROMFH_SIZE, sizeof(fsname)-1);
  268. if (j < 0)
  269. goto out;
  270. fsname[j]=0;
  271. romfs_copyfrom(i, fsname, offset+ROMFH_SIZE, j);
  272. ino = offset;
  273. nextfh = be32_to_cpu(ri.next);
  274. if ((nextfh & ROMFH_TYPE) == ROMFH_HRD)
  275. ino = be32_to_cpu(ri.spec);
  276. if (filldir(dirent, fsname, j, offset, ino,
  277. romfs_dtype_table[nextfh & ROMFH_TYPE]) < 0) {
  278. goto out;
  279. }
  280. stored++;
  281. offset = nextfh & ROMFH_MASK;
  282. }
  283. out:
  284. unlock_kernel();
  285. return stored;
  286. }
  287. static struct dentry *
  288. romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
  289. {
  290. unsigned long offset, maxoff;
  291. int fslen, res;
  292. struct inode *inode;
  293. char fsname[ROMFS_MAXFN]; /* XXX dynamic? */
  294. struct romfs_inode ri;
  295. const char *name; /* got from dentry */
  296. int len;
  297. res = -EACCES; /* placeholder for "no data here" */
  298. offset = dir->i_ino & ROMFH_MASK;
  299. lock_kernel();
  300. if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0)
  301. goto out;
  302. maxoff = romfs_maxsize(dir->i_sb);
  303. offset = be32_to_cpu(ri.spec) & ROMFH_MASK;
  304. /* OK, now find the file whose name is in "dentry" in the
  305. * directory specified by "dir". */
  306. name = dentry->d_name.name;
  307. len = dentry->d_name.len;
  308. for(;;) {
  309. if (!offset || offset >= maxoff)
  310. goto out0;
  311. if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0)
  312. goto out;
  313. /* try to match the first 16 bytes of name */
  314. fslen = romfs_strnlen(dir, offset+ROMFH_SIZE, ROMFH_SIZE);
  315. if (len < ROMFH_SIZE) {
  316. if (len == fslen) {
  317. /* both are shorter, and same size */
  318. romfs_copyfrom(dir, fsname, offset+ROMFH_SIZE, len+1);
  319. if (strncmp (name, fsname, len) == 0)
  320. break;
  321. }
  322. } else if (fslen >= ROMFH_SIZE) {
  323. /* both are longer; XXX optimize max size */
  324. fslen = romfs_strnlen(dir, offset+ROMFH_SIZE, sizeof(fsname)-1);
  325. if (len == fslen) {
  326. romfs_copyfrom(dir, fsname, offset+ROMFH_SIZE, len+1);
  327. if (strncmp(name, fsname, len) == 0)
  328. break;
  329. }
  330. }
  331. /* next entry */
  332. offset = be32_to_cpu(ri.next) & ROMFH_MASK;
  333. }
  334. /* Hard link handling */
  335. if ((be32_to_cpu(ri.next) & ROMFH_TYPE) == ROMFH_HRD)
  336. offset = be32_to_cpu(ri.spec) & ROMFH_MASK;
  337. inode = romfs_iget(dir->i_sb, offset);
  338. if (IS_ERR(inode)) {
  339. res = PTR_ERR(inode);
  340. goto out;
  341. }
  342. /*
  343. * it's a bit funky, _lookup needs to return an error code
  344. * (negative) or a NULL, both as a dentry. ENOENT should not
  345. * be returned, instead we need to create a negative dentry by
  346. * d_add(dentry, NULL); and return 0 as no error.
  347. * (Although as I see, it only matters on writable file
  348. * systems).
  349. */
  350. out0: inode = NULL;
  351. res = 0;
  352. d_add (dentry, inode);
  353. out: unlock_kernel();
  354. return ERR_PTR(res);
  355. }
  356. /*
  357. * Ok, we do readpage, to be able to execute programs. Unfortunately,
  358. * we can't use bmap, since we may have looser alignments.
  359. */
  360. static int
  361. romfs_readpage(struct file *file, struct page * page)
  362. {
  363. struct inode *inode = page->mapping->host;
  364. loff_t offset, avail, readlen;
  365. void *buf;
  366. int result = -EIO;
  367. page_cache_get(page);
  368. lock_kernel();
  369. buf = kmap(page);
  370. if (!buf)
  371. goto err_out;
  372. /* 32 bit warning -- but not for us :) */
  373. offset = page_offset(page);
  374. if (offset < i_size_read(inode)) {
  375. avail = inode->i_size-offset;
  376. readlen = min_t(unsigned long, avail, PAGE_SIZE);
  377. if (romfs_copyfrom(inode, buf, ROMFS_I(inode)->i_dataoffset+offset, readlen) == readlen) {
  378. if (readlen < PAGE_SIZE) {
  379. memset(buf + readlen,0,PAGE_SIZE-readlen);
  380. }
  381. SetPageUptodate(page);
  382. result = 0;
  383. }
  384. }
  385. if (result) {
  386. memset(buf, 0, PAGE_SIZE);
  387. SetPageError(page);
  388. }
  389. flush_dcache_page(page);
  390. unlock_page(page);
  391. kunmap(page);
  392. err_out:
  393. page_cache_release(page);
  394. unlock_kernel();
  395. return result;
  396. }
  397. /* Mapping from our types to the kernel */
  398. static const struct address_space_operations romfs_aops = {
  399. .readpage = romfs_readpage
  400. };
  401. static const struct file_operations romfs_dir_operations = {
  402. .read = generic_read_dir,
  403. .readdir = romfs_readdir,
  404. };
  405. static const struct inode_operations romfs_dir_inode_operations = {
  406. .lookup = romfs_lookup,
  407. };
  408. static mode_t romfs_modemap[] =
  409. {
  410. 0, S_IFDIR+0644, S_IFREG+0644, S_IFLNK+0777,
  411. S_IFBLK+0600, S_IFCHR+0600, S_IFSOCK+0644, S_IFIFO+0644
  412. };
  413. static struct inode *
  414. romfs_iget(struct super_block *sb, unsigned long ino)
  415. {
  416. int nextfh;
  417. struct romfs_inode ri;
  418. struct inode *i;
  419. ino &= ROMFH_MASK;
  420. i = iget_locked(sb, ino);
  421. if (!i)
  422. return ERR_PTR(-ENOMEM);
  423. if (!(i->i_state & I_NEW))
  424. return i;
  425. i->i_mode = 0;
  426. /* Loop for finding the real hard link */
  427. for(;;) {
  428. if (romfs_copyfrom(i, &ri, ino, ROMFH_SIZE) <= 0) {
  429. printk(KERN_ERR "romfs: read error for inode 0x%lx\n",
  430. ino);
  431. iget_failed(i);
  432. return ERR_PTR(-EIO);
  433. }
  434. /* XXX: do romfs_checksum here too (with name) */
  435. nextfh = be32_to_cpu(ri.next);
  436. if ((nextfh & ROMFH_TYPE) != ROMFH_HRD)
  437. break;
  438. ino = be32_to_cpu(ri.spec) & ROMFH_MASK;
  439. }
  440. i->i_nlink = 1; /* Hard to decide.. */
  441. i->i_size = be32_to_cpu(ri.size);
  442. i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0;
  443. i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0;
  444. i->i_uid = i->i_gid = 0;
  445. /* Precalculate the data offset */
  446. ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN);
  447. if (ino >= 0)
  448. ino = ((ROMFH_SIZE+ino+1+ROMFH_PAD)&ROMFH_MASK);
  449. else
  450. ino = 0;
  451. ROMFS_I(i)->i_metasize = ino;
  452. ROMFS_I(i)->i_dataoffset = ino+(i->i_ino&ROMFH_MASK);
  453. /* Compute permissions */
  454. ino = romfs_modemap[nextfh & ROMFH_TYPE];
  455. /* only "normal" files have ops */
  456. switch (nextfh & ROMFH_TYPE) {
  457. case 1:
  458. i->i_size = ROMFS_I(i)->i_metasize;
  459. i->i_op = &romfs_dir_inode_operations;
  460. i->i_fop = &romfs_dir_operations;
  461. if (nextfh & ROMFH_EXEC)
  462. ino |= S_IXUGO;
  463. i->i_mode = ino;
  464. break;
  465. case 2:
  466. i->i_fop = &generic_ro_fops;
  467. i->i_data.a_ops = &romfs_aops;
  468. if (nextfh & ROMFH_EXEC)
  469. ino |= S_IXUGO;
  470. i->i_mode = ino;
  471. break;
  472. case 3:
  473. i->i_op = &page_symlink_inode_operations;
  474. i->i_data.a_ops = &romfs_aops;
  475. i->i_mode = ino | S_IRWXUGO;
  476. break;
  477. default:
  478. /* depending on MBZ for sock/fifos */
  479. nextfh = be32_to_cpu(ri.spec);
  480. init_special_inode(i, ino,
  481. MKDEV(nextfh>>16,nextfh&0xffff));
  482. }
  483. unlock_new_inode(i);
  484. return i;
  485. }
  486. static struct kmem_cache * romfs_inode_cachep;
  487. static struct inode *romfs_alloc_inode(struct super_block *sb)
  488. {
  489. struct romfs_inode_info *ei;
  490. ei = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
  491. if (!ei)
  492. return NULL;
  493. return &ei->vfs_inode;
  494. }
  495. static void romfs_destroy_inode(struct inode *inode)
  496. {
  497. kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
  498. }
  499. static void init_once(struct kmem_cache *cachep, void *foo)
  500. {
  501. struct romfs_inode_info *ei = foo;
  502. inode_init_once(&ei->vfs_inode);
  503. }
  504. static int init_inodecache(void)
  505. {
  506. romfs_inode_cachep = kmem_cache_create("romfs_inode_cache",
  507. sizeof(struct romfs_inode_info),
  508. 0, (SLAB_RECLAIM_ACCOUNT|
  509. SLAB_MEM_SPREAD),
  510. init_once);
  511. if (romfs_inode_cachep == NULL)
  512. return -ENOMEM;
  513. return 0;
  514. }
  515. static void destroy_inodecache(void)
  516. {
  517. kmem_cache_destroy(romfs_inode_cachep);
  518. }
  519. static int romfs_remount(struct super_block *sb, int *flags, char *data)
  520. {
  521. *flags |= MS_RDONLY;
  522. return 0;
  523. }
  524. static const struct super_operations romfs_ops = {
  525. .alloc_inode = romfs_alloc_inode,
  526. .destroy_inode = romfs_destroy_inode,
  527. .statfs = romfs_statfs,
  528. .remount_fs = romfs_remount,
  529. };
  530. static int romfs_get_sb(struct file_system_type *fs_type,
  531. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  532. {
  533. return get_sb_bdev(fs_type, flags, dev_name, data, romfs_fill_super,
  534. mnt);
  535. }
  536. static struct file_system_type romfs_fs_type = {
  537. .owner = THIS_MODULE,
  538. .name = "romfs",
  539. .get_sb = romfs_get_sb,
  540. .kill_sb = kill_block_super,
  541. .fs_flags = FS_REQUIRES_DEV,
  542. };
  543. static int __init init_romfs_fs(void)
  544. {
  545. int err = init_inodecache();
  546. if (err)
  547. goto out1;
  548. err = register_filesystem(&romfs_fs_type);
  549. if (err)
  550. goto out;
  551. return 0;
  552. out:
  553. destroy_inodecache();
  554. out1:
  555. return err;
  556. }
  557. static void __exit exit_romfs_fs(void)
  558. {
  559. unregister_filesystem(&romfs_fs_type);
  560. destroy_inodecache();
  561. }
  562. /* Yes, works even as a module... :) */
  563. module_init(init_romfs_fs)
  564. module_exit(exit_romfs_fs)
  565. MODULE_LICENSE("GPL");