inode.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. /*
  2. * QNX4 file system, Linux implementation.
  3. *
  4. * Version : 0.2.1
  5. *
  6. * Using parts of the xiafs filesystem.
  7. *
  8. * History :
  9. *
  10. * 01-06-1998 by Richard Frowijn : first release.
  11. * 20-06-1998 by Frank Denis : Linux 2.1.99+ support, boot signature, misc.
  12. * 30-06-1998 by Frank Denis : first step to write inodes.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/types.h>
  16. #include <linux/string.h>
  17. #include <linux/errno.h>
  18. #include <linux/slab.h>
  19. #include <linux/fs.h>
  20. #include <linux/qnx4_fs.h>
  21. #include <linux/init.h>
  22. #include <linux/highuid.h>
  23. #include <linux/smp_lock.h>
  24. #include <linux/pagemap.h>
  25. #include <linux/buffer_head.h>
  26. #include <linux/vfs.h>
  27. #include <asm/uaccess.h>
  28. #define QNX4_VERSION 4
  29. #define QNX4_BMNAME ".bitmap"
  30. static const struct super_operations qnx4_sops;
  31. #ifdef CONFIG_QNX4FS_RW
  32. int qnx4_sync_inode(struct inode *inode)
  33. {
  34. int err = 0;
  35. # if 0
  36. struct buffer_head *bh;
  37. bh = qnx4_update_inode(inode);
  38. if (bh && buffer_dirty(bh))
  39. {
  40. sync_dirty_buffer(bh);
  41. if (buffer_req(bh) && !buffer_uptodate(bh))
  42. {
  43. printk ("IO error syncing qnx4 inode [%s:%08lx]\n",
  44. inode->i_sb->s_id, inode->i_ino);
  45. err = -1;
  46. }
  47. brelse (bh);
  48. } else if (!bh) {
  49. err = -1;
  50. }
  51. # endif
  52. return err;
  53. }
  54. static void qnx4_delete_inode(struct inode *inode)
  55. {
  56. QNX4DEBUG(("qnx4: deleting inode [%lu]\n", (unsigned long) inode->i_ino));
  57. truncate_inode_pages(&inode->i_data, 0);
  58. inode->i_size = 0;
  59. qnx4_truncate(inode);
  60. lock_kernel();
  61. qnx4_free_inode(inode);
  62. unlock_kernel();
  63. }
  64. static void qnx4_write_super(struct super_block *sb)
  65. {
  66. lock_kernel();
  67. QNX4DEBUG(("qnx4: write_super\n"));
  68. sb->s_dirt = 0;
  69. unlock_kernel();
  70. }
  71. static int qnx4_write_inode(struct inode *inode, int unused)
  72. {
  73. struct qnx4_inode_entry *raw_inode;
  74. int block, ino;
  75. struct buffer_head *bh;
  76. ino = inode->i_ino;
  77. QNX4DEBUG(("qnx4: write inode 1.\n"));
  78. if (inode->i_nlink == 0) {
  79. return 0;
  80. }
  81. if (!ino) {
  82. printk("qnx4: bad inode number on dev %s: %d is out of range\n",
  83. inode->i_sb->s_id, ino);
  84. return -EIO;
  85. }
  86. QNX4DEBUG(("qnx4: write inode 2.\n"));
  87. block = ino / QNX4_INODES_PER_BLOCK;
  88. lock_kernel();
  89. if (!(bh = sb_bread(inode->i_sb, block))) {
  90. printk("qnx4: major problem: unable to read inode from dev "
  91. "%s\n", inode->i_sb->s_id);
  92. unlock_kernel();
  93. return -EIO;
  94. }
  95. raw_inode = ((struct qnx4_inode_entry *) bh->b_data) +
  96. (ino % QNX4_INODES_PER_BLOCK);
  97. raw_inode->di_mode = cpu_to_le16(inode->i_mode);
  98. raw_inode->di_uid = cpu_to_le16(fs_high2lowuid(inode->i_uid));
  99. raw_inode->di_gid = cpu_to_le16(fs_high2lowgid(inode->i_gid));
  100. raw_inode->di_nlink = cpu_to_le16(inode->i_nlink);
  101. raw_inode->di_size = cpu_to_le32(inode->i_size);
  102. raw_inode->di_mtime = cpu_to_le32(inode->i_mtime.tv_sec);
  103. raw_inode->di_atime = cpu_to_le32(inode->i_atime.tv_sec);
  104. raw_inode->di_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
  105. raw_inode->di_first_xtnt.xtnt_size = cpu_to_le32(inode->i_blocks);
  106. mark_buffer_dirty(bh);
  107. brelse(bh);
  108. unlock_kernel();
  109. return 0;
  110. }
  111. #endif
  112. static void qnx4_put_super(struct super_block *sb);
  113. static struct inode *qnx4_alloc_inode(struct super_block *sb);
  114. static void qnx4_destroy_inode(struct inode *inode);
  115. static int qnx4_remount(struct super_block *sb, int *flags, char *data);
  116. static int qnx4_statfs(struct dentry *, struct kstatfs *);
  117. static const struct super_operations qnx4_sops =
  118. {
  119. .alloc_inode = qnx4_alloc_inode,
  120. .destroy_inode = qnx4_destroy_inode,
  121. .put_super = qnx4_put_super,
  122. .statfs = qnx4_statfs,
  123. .remount_fs = qnx4_remount,
  124. #ifdef CONFIG_QNX4FS_RW
  125. .write_inode = qnx4_write_inode,
  126. .delete_inode = qnx4_delete_inode,
  127. .write_super = qnx4_write_super,
  128. #endif
  129. };
  130. static int qnx4_remount(struct super_block *sb, int *flags, char *data)
  131. {
  132. struct qnx4_sb_info *qs;
  133. qs = qnx4_sb(sb);
  134. qs->Version = QNX4_VERSION;
  135. #ifndef CONFIG_QNX4FS_RW
  136. *flags |= MS_RDONLY;
  137. #endif
  138. if (*flags & MS_RDONLY) {
  139. return 0;
  140. }
  141. mark_buffer_dirty(qs->sb_buf);
  142. return 0;
  143. }
  144. static struct buffer_head *qnx4_getblk(struct inode *inode, int nr,
  145. int create)
  146. {
  147. struct buffer_head *result = NULL;
  148. if ( nr >= 0 )
  149. nr = qnx4_block_map( inode, nr );
  150. if (nr) {
  151. result = sb_getblk(inode->i_sb, nr);
  152. return result;
  153. }
  154. if (!create) {
  155. return NULL;
  156. }
  157. #if 0
  158. tmp = qnx4_new_block(inode->i_sb);
  159. if (!tmp) {
  160. return NULL;
  161. }
  162. result = sb_getblk(inode->i_sb, tmp);
  163. if (tst) {
  164. qnx4_free_block(inode->i_sb, tmp);
  165. brelse(result);
  166. goto repeat;
  167. }
  168. tst = tmp;
  169. #endif
  170. inode->i_ctime = CURRENT_TIME_SEC;
  171. mark_inode_dirty(inode);
  172. return result;
  173. }
  174. struct buffer_head *qnx4_bread(struct inode *inode, int block, int create)
  175. {
  176. struct buffer_head *bh;
  177. bh = qnx4_getblk(inode, block, create);
  178. if (!bh || buffer_uptodate(bh)) {
  179. return bh;
  180. }
  181. ll_rw_block(READ, 1, &bh);
  182. wait_on_buffer(bh);
  183. if (buffer_uptodate(bh)) {
  184. return bh;
  185. }
  186. brelse(bh);
  187. return NULL;
  188. }
  189. static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create )
  190. {
  191. unsigned long phys;
  192. QNX4DEBUG(("qnx4: qnx4_get_block inode=[%ld] iblock=[%ld]\n",inode->i_ino,iblock));
  193. phys = qnx4_block_map( inode, iblock );
  194. if ( phys ) {
  195. // logical block is before EOF
  196. map_bh(bh, inode->i_sb, phys);
  197. } else if ( create ) {
  198. // to be done.
  199. }
  200. return 0;
  201. }
  202. unsigned long qnx4_block_map( struct inode *inode, long iblock )
  203. {
  204. int ix;
  205. long offset, i_xblk;
  206. unsigned long block = 0;
  207. struct buffer_head *bh = NULL;
  208. struct qnx4_xblk *xblk = NULL;
  209. struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode);
  210. u16 nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts);
  211. if ( iblock < le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size) ) {
  212. // iblock is in the first extent. This is easy.
  213. block = le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_blk) + iblock - 1;
  214. } else {
  215. // iblock is beyond first extent. We have to follow the extent chain.
  216. i_xblk = le32_to_cpu(qnx4_inode->di_xblk);
  217. offset = iblock - le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size);
  218. ix = 0;
  219. while ( --nxtnt > 0 ) {
  220. if ( ix == 0 ) {
  221. // read next xtnt block.
  222. bh = sb_bread(inode->i_sb, i_xblk - 1);
  223. if ( !bh ) {
  224. QNX4DEBUG(("qnx4: I/O error reading xtnt block [%ld])\n", i_xblk - 1));
  225. return -EIO;
  226. }
  227. xblk = (struct qnx4_xblk*)bh->b_data;
  228. if ( memcmp( xblk->xblk_signature, "IamXblk", 7 ) ) {
  229. QNX4DEBUG(("qnx4: block at %ld is not a valid xtnt\n", qnx4_inode->i_xblk));
  230. return -EIO;
  231. }
  232. }
  233. if ( offset < le32_to_cpu(xblk->xblk_xtnts[ix].xtnt_size) ) {
  234. // got it!
  235. block = le32_to_cpu(xblk->xblk_xtnts[ix].xtnt_blk) + offset - 1;
  236. break;
  237. }
  238. offset -= le32_to_cpu(xblk->xblk_xtnts[ix].xtnt_size);
  239. if ( ++ix >= xblk->xblk_num_xtnts ) {
  240. i_xblk = le32_to_cpu(xblk->xblk_next_xblk);
  241. ix = 0;
  242. brelse( bh );
  243. bh = NULL;
  244. }
  245. }
  246. if ( bh )
  247. brelse( bh );
  248. }
  249. QNX4DEBUG(("qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block));
  250. return block;
  251. }
  252. static int qnx4_statfs(struct dentry *dentry, struct kstatfs *buf)
  253. {
  254. struct super_block *sb = dentry->d_sb;
  255. lock_kernel();
  256. buf->f_type = sb->s_magic;
  257. buf->f_bsize = sb->s_blocksize;
  258. buf->f_blocks = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size) * 8;
  259. buf->f_bfree = qnx4_count_free_blocks(sb);
  260. buf->f_bavail = buf->f_bfree;
  261. buf->f_namelen = QNX4_NAME_MAX;
  262. unlock_kernel();
  263. return 0;
  264. }
  265. /*
  266. * Check the root directory of the filesystem to make sure
  267. * it really _is_ a qnx4 filesystem, and to check the size
  268. * of the directory entry.
  269. */
  270. static const char *qnx4_checkroot(struct super_block *sb)
  271. {
  272. struct buffer_head *bh;
  273. struct qnx4_inode_entry *rootdir;
  274. int rd, rl;
  275. int i, j;
  276. int found = 0;
  277. if (*(qnx4_sb(sb)->sb->RootDir.di_fname) != '/') {
  278. return "no qnx4 filesystem (no root dir).";
  279. } else {
  280. QNX4DEBUG(("QNX4 filesystem found on dev %s.\n", sb->s_id));
  281. rd = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_blk) - 1;
  282. rl = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_size);
  283. for (j = 0; j < rl; j++) {
  284. bh = sb_bread(sb, rd + j); /* root dir, first block */
  285. if (bh == NULL) {
  286. return "unable to read root entry.";
  287. }
  288. for (i = 0; i < QNX4_INODES_PER_BLOCK; i++) {
  289. rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE);
  290. if (rootdir->di_fname != NULL) {
  291. QNX4DEBUG(("Rootdir entry found : [%s]\n", rootdir->di_fname));
  292. if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) {
  293. found = 1;
  294. qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL );
  295. if (!qnx4_sb(sb)->BitMap) {
  296. brelse (bh);
  297. return "not enough memory for bitmap inode";
  298. }
  299. memcpy( qnx4_sb(sb)->BitMap, rootdir, sizeof( struct qnx4_inode_entry ) ); /* keep bitmap inode known */
  300. break;
  301. }
  302. }
  303. }
  304. brelse(bh);
  305. if (found != 0) {
  306. break;
  307. }
  308. }
  309. if (found == 0) {
  310. return "bitmap file not found.";
  311. }
  312. }
  313. return NULL;
  314. }
  315. static int qnx4_fill_super(struct super_block *s, void *data, int silent)
  316. {
  317. struct buffer_head *bh;
  318. struct inode *root;
  319. const char *errmsg;
  320. struct qnx4_sb_info *qs;
  321. int ret = -EINVAL;
  322. qs = kzalloc(sizeof(struct qnx4_sb_info), GFP_KERNEL);
  323. if (!qs)
  324. return -ENOMEM;
  325. s->s_fs_info = qs;
  326. sb_set_blocksize(s, QNX4_BLOCK_SIZE);
  327. /* Check the superblock signature. Since the qnx4 code is
  328. dangerous, we should leave as quickly as possible
  329. if we don't belong here... */
  330. bh = sb_bread(s, 1);
  331. if (!bh) {
  332. printk("qnx4: unable to read the superblock\n");
  333. goto outnobh;
  334. }
  335. if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) {
  336. if (!silent)
  337. printk("qnx4: wrong fsid in superblock.\n");
  338. goto out;
  339. }
  340. s->s_op = &qnx4_sops;
  341. s->s_magic = QNX4_SUPER_MAGIC;
  342. #ifndef CONFIG_QNX4FS_RW
  343. s->s_flags |= MS_RDONLY; /* Yup, read-only yet */
  344. #endif
  345. qnx4_sb(s)->sb_buf = bh;
  346. qnx4_sb(s)->sb = (struct qnx4_super_block *) bh->b_data;
  347. /* check before allocating dentries, inodes, .. */
  348. errmsg = qnx4_checkroot(s);
  349. if (errmsg != NULL) {
  350. if (!silent)
  351. printk("qnx4: %s\n", errmsg);
  352. goto out;
  353. }
  354. /* does root not have inode number QNX4_ROOT_INO ?? */
  355. root = qnx4_iget(s, QNX4_ROOT_INO * QNX4_INODES_PER_BLOCK);
  356. if (IS_ERR(root)) {
  357. printk("qnx4: get inode failed\n");
  358. ret = PTR_ERR(root);
  359. goto out;
  360. }
  361. ret = -ENOMEM;
  362. s->s_root = d_alloc_root(root);
  363. if (s->s_root == NULL)
  364. goto outi;
  365. brelse(bh);
  366. return 0;
  367. outi:
  368. iput(root);
  369. out:
  370. brelse(bh);
  371. outnobh:
  372. kfree(qs);
  373. s->s_fs_info = NULL;
  374. return ret;
  375. }
  376. static void qnx4_put_super(struct super_block *sb)
  377. {
  378. struct qnx4_sb_info *qs = qnx4_sb(sb);
  379. kfree( qs->BitMap );
  380. kfree( qs );
  381. sb->s_fs_info = NULL;
  382. return;
  383. }
  384. static int qnx4_writepage(struct page *page, struct writeback_control *wbc)
  385. {
  386. return block_write_full_page(page,qnx4_get_block, wbc);
  387. }
  388. static int qnx4_readpage(struct file *file, struct page *page)
  389. {
  390. return block_read_full_page(page,qnx4_get_block);
  391. }
  392. static int qnx4_write_begin(struct file *file, struct address_space *mapping,
  393. loff_t pos, unsigned len, unsigned flags,
  394. struct page **pagep, void **fsdata)
  395. {
  396. struct qnx4_inode_info *qnx4_inode = qnx4_i(mapping->host);
  397. *pagep = NULL;
  398. return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
  399. qnx4_get_block,
  400. &qnx4_inode->mmu_private);
  401. }
  402. static sector_t qnx4_bmap(struct address_space *mapping, sector_t block)
  403. {
  404. return generic_block_bmap(mapping,block,qnx4_get_block);
  405. }
  406. static const struct address_space_operations qnx4_aops = {
  407. .readpage = qnx4_readpage,
  408. .writepage = qnx4_writepage,
  409. .sync_page = block_sync_page,
  410. .write_begin = qnx4_write_begin,
  411. .write_end = generic_write_end,
  412. .bmap = qnx4_bmap
  413. };
  414. struct inode *qnx4_iget(struct super_block *sb, unsigned long ino)
  415. {
  416. struct buffer_head *bh;
  417. struct qnx4_inode_entry *raw_inode;
  418. int block;
  419. struct qnx4_inode_entry *qnx4_inode;
  420. struct inode *inode;
  421. inode = iget_locked(sb, ino);
  422. if (!inode)
  423. return ERR_PTR(-ENOMEM);
  424. if (!(inode->i_state & I_NEW))
  425. return inode;
  426. qnx4_inode = qnx4_raw_inode(inode);
  427. inode->i_mode = 0;
  428. QNX4DEBUG(("Reading inode : [%d]\n", ino));
  429. if (!ino) {
  430. printk(KERN_ERR "qnx4: bad inode number on dev %s: %lu is "
  431. "out of range\n",
  432. sb->s_id, ino);
  433. iget_failed(inode);
  434. return ERR_PTR(-EIO);
  435. }
  436. block = ino / QNX4_INODES_PER_BLOCK;
  437. if (!(bh = sb_bread(sb, block))) {
  438. printk("qnx4: major problem: unable to read inode from dev "
  439. "%s\n", sb->s_id);
  440. iget_failed(inode);
  441. return ERR_PTR(-EIO);
  442. }
  443. raw_inode = ((struct qnx4_inode_entry *) bh->b_data) +
  444. (ino % QNX4_INODES_PER_BLOCK);
  445. inode->i_mode = le16_to_cpu(raw_inode->di_mode);
  446. inode->i_uid = (uid_t)le16_to_cpu(raw_inode->di_uid);
  447. inode->i_gid = (gid_t)le16_to_cpu(raw_inode->di_gid);
  448. inode->i_nlink = le16_to_cpu(raw_inode->di_nlink);
  449. inode->i_size = le32_to_cpu(raw_inode->di_size);
  450. inode->i_mtime.tv_sec = le32_to_cpu(raw_inode->di_mtime);
  451. inode->i_mtime.tv_nsec = 0;
  452. inode->i_atime.tv_sec = le32_to_cpu(raw_inode->di_atime);
  453. inode->i_atime.tv_nsec = 0;
  454. inode->i_ctime.tv_sec = le32_to_cpu(raw_inode->di_ctime);
  455. inode->i_ctime.tv_nsec = 0;
  456. inode->i_blocks = le32_to_cpu(raw_inode->di_first_xtnt.xtnt_size);
  457. memcpy(qnx4_inode, raw_inode, QNX4_DIR_ENTRY_SIZE);
  458. if (S_ISREG(inode->i_mode)) {
  459. inode->i_op = &qnx4_file_inode_operations;
  460. inode->i_fop = &qnx4_file_operations;
  461. inode->i_mapping->a_ops = &qnx4_aops;
  462. qnx4_i(inode)->mmu_private = inode->i_size;
  463. } else if (S_ISDIR(inode->i_mode)) {
  464. inode->i_op = &qnx4_dir_inode_operations;
  465. inode->i_fop = &qnx4_dir_operations;
  466. } else if (S_ISLNK(inode->i_mode)) {
  467. inode->i_op = &page_symlink_inode_operations;
  468. inode->i_mapping->a_ops = &qnx4_aops;
  469. qnx4_i(inode)->mmu_private = inode->i_size;
  470. } else {
  471. printk(KERN_ERR "qnx4: bad inode %lu on dev %s\n",
  472. ino, sb->s_id);
  473. iget_failed(inode);
  474. brelse(bh);
  475. return ERR_PTR(-EIO);
  476. }
  477. brelse(bh);
  478. unlock_new_inode(inode);
  479. return inode;
  480. }
  481. static struct kmem_cache *qnx4_inode_cachep;
  482. static struct inode *qnx4_alloc_inode(struct super_block *sb)
  483. {
  484. struct qnx4_inode_info *ei;
  485. ei = kmem_cache_alloc(qnx4_inode_cachep, GFP_KERNEL);
  486. if (!ei)
  487. return NULL;
  488. return &ei->vfs_inode;
  489. }
  490. static void qnx4_destroy_inode(struct inode *inode)
  491. {
  492. kmem_cache_free(qnx4_inode_cachep, qnx4_i(inode));
  493. }
  494. static void init_once(void *foo)
  495. {
  496. struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
  497. inode_init_once(&ei->vfs_inode);
  498. }
  499. static int init_inodecache(void)
  500. {
  501. qnx4_inode_cachep = kmem_cache_create("qnx4_inode_cache",
  502. sizeof(struct qnx4_inode_info),
  503. 0, (SLAB_RECLAIM_ACCOUNT|
  504. SLAB_MEM_SPREAD),
  505. init_once);
  506. if (qnx4_inode_cachep == NULL)
  507. return -ENOMEM;
  508. return 0;
  509. }
  510. static void destroy_inodecache(void)
  511. {
  512. kmem_cache_destroy(qnx4_inode_cachep);
  513. }
  514. static int qnx4_get_sb(struct file_system_type *fs_type,
  515. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  516. {
  517. return get_sb_bdev(fs_type, flags, dev_name, data, qnx4_fill_super,
  518. mnt);
  519. }
  520. static struct file_system_type qnx4_fs_type = {
  521. .owner = THIS_MODULE,
  522. .name = "qnx4",
  523. .get_sb = qnx4_get_sb,
  524. .kill_sb = kill_block_super,
  525. .fs_flags = FS_REQUIRES_DEV,
  526. };
  527. static int __init init_qnx4_fs(void)
  528. {
  529. int err;
  530. err = init_inodecache();
  531. if (err)
  532. return err;
  533. err = register_filesystem(&qnx4_fs_type);
  534. if (err) {
  535. destroy_inodecache();
  536. return err;
  537. }
  538. printk("QNX4 filesystem 0.2.3 registered.\n");
  539. return 0;
  540. }
  541. static void __exit exit_qnx4_fs(void)
  542. {
  543. unregister_filesystem(&qnx4_fs_type);
  544. destroy_inodecache();
  545. }
  546. module_init(init_qnx4_fs)
  547. module_exit(exit_qnx4_fs)
  548. MODULE_LICENSE("GPL");