super.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. /*
  2. * linux/fs/hfsplus/super.c
  3. *
  4. * Copyright (C) 2001
  5. * Brad Boyer (flar@allandria.com)
  6. * (C) 2003 Ardis Technologies <roman@ardistech.com>
  7. *
  8. */
  9. #include <linux/module.h>
  10. #include <linux/init.h>
  11. #include <linux/pagemap.h>
  12. #include <linux/fs.h>
  13. #include <linux/slab.h>
  14. #include <linux/vfs.h>
  15. #include <linux/nls.h>
  16. static struct inode *hfsplus_alloc_inode(struct super_block *sb);
  17. static void hfsplus_destroy_inode(struct inode *inode);
  18. #include "hfsplus_fs.h"
  19. static int hfsplus_system_read_inode(struct inode *inode)
  20. {
  21. struct hfsplus_vh *vhdr = HFSPLUS_SB(inode->i_sb)->s_vhdr;
  22. switch (inode->i_ino) {
  23. case HFSPLUS_EXT_CNID:
  24. hfsplus_inode_read_fork(inode, &vhdr->ext_file);
  25. inode->i_mapping->a_ops = &hfsplus_btree_aops;
  26. break;
  27. case HFSPLUS_CAT_CNID:
  28. hfsplus_inode_read_fork(inode, &vhdr->cat_file);
  29. inode->i_mapping->a_ops = &hfsplus_btree_aops;
  30. break;
  31. case HFSPLUS_ALLOC_CNID:
  32. hfsplus_inode_read_fork(inode, &vhdr->alloc_file);
  33. inode->i_mapping->a_ops = &hfsplus_aops;
  34. break;
  35. case HFSPLUS_START_CNID:
  36. hfsplus_inode_read_fork(inode, &vhdr->start_file);
  37. break;
  38. case HFSPLUS_ATTR_CNID:
  39. hfsplus_inode_read_fork(inode, &vhdr->attr_file);
  40. inode->i_mapping->a_ops = &hfsplus_btree_aops;
  41. break;
  42. default:
  43. return -EIO;
  44. }
  45. return 0;
  46. }
  47. struct inode *hfsplus_iget(struct super_block *sb, unsigned long ino)
  48. {
  49. struct hfs_find_data fd;
  50. struct inode *inode;
  51. int err;
  52. inode = iget_locked(sb, ino);
  53. if (!inode)
  54. return ERR_PTR(-ENOMEM);
  55. if (!(inode->i_state & I_NEW))
  56. return inode;
  57. INIT_LIST_HEAD(&HFSPLUS_I(inode)->open_dir_list);
  58. mutex_init(&HFSPLUS_I(inode)->extents_lock);
  59. HFSPLUS_I(inode)->flags = 0;
  60. HFSPLUS_I(inode)->extent_state = 0;
  61. HFSPLUS_I(inode)->rsrc_inode = NULL;
  62. atomic_set(&HFSPLUS_I(inode)->opencnt, 0);
  63. if (inode->i_ino >= HFSPLUS_FIRSTUSER_CNID ||
  64. inode->i_ino == HFSPLUS_ROOT_CNID) {
  65. hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
  66. err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd);
  67. if (!err)
  68. err = hfsplus_cat_read_inode(inode, &fd);
  69. hfs_find_exit(&fd);
  70. } else {
  71. err = hfsplus_system_read_inode(inode);
  72. }
  73. if (err) {
  74. iget_failed(inode);
  75. return ERR_PTR(err);
  76. }
  77. unlock_new_inode(inode);
  78. return inode;
  79. }
  80. static int hfsplus_system_write_inode(struct inode *inode)
  81. {
  82. struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
  83. struct hfsplus_vh *vhdr = sbi->s_vhdr;
  84. struct hfsplus_fork_raw *fork;
  85. struct hfs_btree *tree = NULL;
  86. switch (inode->i_ino) {
  87. case HFSPLUS_EXT_CNID:
  88. fork = &vhdr->ext_file;
  89. tree = sbi->ext_tree;
  90. break;
  91. case HFSPLUS_CAT_CNID:
  92. fork = &vhdr->cat_file;
  93. tree = sbi->cat_tree;
  94. break;
  95. case HFSPLUS_ALLOC_CNID:
  96. fork = &vhdr->alloc_file;
  97. break;
  98. case HFSPLUS_START_CNID:
  99. fork = &vhdr->start_file;
  100. break;
  101. case HFSPLUS_ATTR_CNID:
  102. fork = &vhdr->attr_file;
  103. tree = sbi->attr_tree;
  104. default:
  105. return -EIO;
  106. }
  107. if (fork->total_size != cpu_to_be64(inode->i_size)) {
  108. set_bit(HFSPLUS_SB_WRITEBACKUP, &sbi->flags);
  109. inode->i_sb->s_dirt = 1;
  110. }
  111. hfsplus_inode_write_fork(inode, fork);
  112. if (tree)
  113. hfs_btree_write(tree);
  114. return 0;
  115. }
  116. static int hfsplus_write_inode(struct inode *inode,
  117. struct writeback_control *wbc)
  118. {
  119. dprint(DBG_INODE, "hfsplus_write_inode: %lu\n", inode->i_ino);
  120. hfsplus_ext_write_extent(inode);
  121. if (inode->i_ino >= HFSPLUS_FIRSTUSER_CNID ||
  122. inode->i_ino == HFSPLUS_ROOT_CNID)
  123. return hfsplus_cat_write_inode(inode);
  124. else
  125. return hfsplus_system_write_inode(inode);
  126. }
  127. static void hfsplus_evict_inode(struct inode *inode)
  128. {
  129. dprint(DBG_INODE, "hfsplus_evict_inode: %lu\n", inode->i_ino);
  130. truncate_inode_pages(&inode->i_data, 0);
  131. end_writeback(inode);
  132. if (HFSPLUS_IS_RSRC(inode)) {
  133. HFSPLUS_I(HFSPLUS_I(inode)->rsrc_inode)->rsrc_inode = NULL;
  134. iput(HFSPLUS_I(inode)->rsrc_inode);
  135. }
  136. }
  137. int hfsplus_sync_fs(struct super_block *sb, int wait)
  138. {
  139. struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
  140. struct hfsplus_vh *vhdr = sbi->s_vhdr;
  141. int write_backup = 0;
  142. int error, error2;
  143. if (!wait)
  144. return 0;
  145. dprint(DBG_SUPER, "hfsplus_write_super\n");
  146. sb->s_dirt = 0;
  147. /*
  148. * Explicitly write out the special metadata inodes.
  149. *
  150. * While these special inodes are marked as hashed and written
  151. * out peridocically by the flusher threads we redirty them
  152. * during writeout of normal inodes, and thus the life lock
  153. * prevents us from getting the latest state to disk.
  154. */
  155. error = filemap_write_and_wait(sbi->cat_tree->inode->i_mapping);
  156. error2 = filemap_write_and_wait(sbi->ext_tree->inode->i_mapping);
  157. if (!error)
  158. error = error2;
  159. error2 = filemap_write_and_wait(sbi->alloc_file->i_mapping);
  160. if (!error)
  161. error = error2;
  162. mutex_lock(&sbi->vh_mutex);
  163. mutex_lock(&sbi->alloc_mutex);
  164. vhdr->free_blocks = cpu_to_be32(sbi->free_blocks);
  165. vhdr->next_cnid = cpu_to_be32(sbi->next_cnid);
  166. vhdr->folder_count = cpu_to_be32(sbi->folder_count);
  167. vhdr->file_count = cpu_to_be32(sbi->file_count);
  168. if (test_and_clear_bit(HFSPLUS_SB_WRITEBACKUP, &sbi->flags)) {
  169. memcpy(sbi->s_backup_vhdr, sbi->s_vhdr, sizeof(*sbi->s_vhdr));
  170. write_backup = 1;
  171. }
  172. error2 = hfsplus_submit_bio(sb->s_bdev,
  173. sbi->part_start + HFSPLUS_VOLHEAD_SECTOR,
  174. sbi->s_vhdr, WRITE_SYNC);
  175. if (!error)
  176. error = error2;
  177. if (!write_backup)
  178. goto out;
  179. error2 = hfsplus_submit_bio(sb->s_bdev,
  180. sbi->part_start + sbi->sect_count - 2,
  181. sbi->s_backup_vhdr, WRITE_SYNC);
  182. if (!error)
  183. error2 = error;
  184. out:
  185. mutex_unlock(&sbi->alloc_mutex);
  186. mutex_unlock(&sbi->vh_mutex);
  187. return error;
  188. }
  189. static void hfsplus_write_super(struct super_block *sb)
  190. {
  191. if (!(sb->s_flags & MS_RDONLY))
  192. hfsplus_sync_fs(sb, 1);
  193. else
  194. sb->s_dirt = 0;
  195. }
  196. static void hfsplus_put_super(struct super_block *sb)
  197. {
  198. struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
  199. dprint(DBG_SUPER, "hfsplus_put_super\n");
  200. if (!sb->s_fs_info)
  201. return;
  202. if (!(sb->s_flags & MS_RDONLY) && sbi->s_vhdr) {
  203. struct hfsplus_vh *vhdr = sbi->s_vhdr;
  204. vhdr->modify_date = hfsp_now2mt();
  205. vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_UNMNT);
  206. vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_INCNSTNT);
  207. hfsplus_sync_fs(sb, 1);
  208. }
  209. hfs_btree_close(sbi->cat_tree);
  210. hfs_btree_close(sbi->ext_tree);
  211. iput(sbi->alloc_file);
  212. iput(sbi->hidden_dir);
  213. kfree(sbi->s_vhdr);
  214. kfree(sbi->s_backup_vhdr);
  215. unload_nls(sbi->nls);
  216. kfree(sb->s_fs_info);
  217. sb->s_fs_info = NULL;
  218. }
  219. static int hfsplus_statfs(struct dentry *dentry, struct kstatfs *buf)
  220. {
  221. struct super_block *sb = dentry->d_sb;
  222. struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
  223. u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
  224. buf->f_type = HFSPLUS_SUPER_MAGIC;
  225. buf->f_bsize = sb->s_blocksize;
  226. buf->f_blocks = sbi->total_blocks << sbi->fs_shift;
  227. buf->f_bfree = sbi->free_blocks << sbi->fs_shift;
  228. buf->f_bavail = buf->f_bfree;
  229. buf->f_files = 0xFFFFFFFF;
  230. buf->f_ffree = 0xFFFFFFFF - sbi->next_cnid;
  231. buf->f_fsid.val[0] = (u32)id;
  232. buf->f_fsid.val[1] = (u32)(id >> 32);
  233. buf->f_namelen = HFSPLUS_MAX_STRLEN;
  234. return 0;
  235. }
  236. static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
  237. {
  238. if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
  239. return 0;
  240. if (!(*flags & MS_RDONLY)) {
  241. struct hfsplus_vh *vhdr = HFSPLUS_SB(sb)->s_vhdr;
  242. int force = 0;
  243. if (!hfsplus_parse_options_remount(data, &force))
  244. return -EINVAL;
  245. if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
  246. printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, "
  247. "running fsck.hfsplus is recommended. leaving read-only.\n");
  248. sb->s_flags |= MS_RDONLY;
  249. *flags |= MS_RDONLY;
  250. } else if (force) {
  251. /* nothing */
  252. } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
  253. printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n");
  254. sb->s_flags |= MS_RDONLY;
  255. *flags |= MS_RDONLY;
  256. } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
  257. printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n");
  258. sb->s_flags |= MS_RDONLY;
  259. *flags |= MS_RDONLY;
  260. }
  261. }
  262. return 0;
  263. }
  264. static const struct super_operations hfsplus_sops = {
  265. .alloc_inode = hfsplus_alloc_inode,
  266. .destroy_inode = hfsplus_destroy_inode,
  267. .write_inode = hfsplus_write_inode,
  268. .evict_inode = hfsplus_evict_inode,
  269. .put_super = hfsplus_put_super,
  270. .write_super = hfsplus_write_super,
  271. .sync_fs = hfsplus_sync_fs,
  272. .statfs = hfsplus_statfs,
  273. .remount_fs = hfsplus_remount,
  274. .show_options = hfsplus_show_options,
  275. };
  276. static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
  277. {
  278. struct hfsplus_vh *vhdr;
  279. struct hfsplus_sb_info *sbi;
  280. hfsplus_cat_entry entry;
  281. struct hfs_find_data fd;
  282. struct inode *root, *inode;
  283. struct qstr str;
  284. struct nls_table *nls = NULL;
  285. int err = -EINVAL;
  286. sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
  287. if (!sbi)
  288. return -ENOMEM;
  289. sb->s_fs_info = sbi;
  290. mutex_init(&sbi->alloc_mutex);
  291. mutex_init(&sbi->vh_mutex);
  292. hfsplus_fill_defaults(sbi);
  293. if (!hfsplus_parse_options(data, sbi)) {
  294. printk(KERN_ERR "hfs: unable to parse mount options\n");
  295. err = -EINVAL;
  296. goto cleanup;
  297. }
  298. /* temporarily use utf8 to correctly find the hidden dir below */
  299. nls = sbi->nls;
  300. sbi->nls = load_nls("utf8");
  301. if (!sbi->nls) {
  302. printk(KERN_ERR "hfs: unable to load nls for utf8\n");
  303. err = -EINVAL;
  304. goto cleanup;
  305. }
  306. /* Grab the volume header */
  307. if (hfsplus_read_wrapper(sb)) {
  308. if (!silent)
  309. printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n");
  310. err = -EINVAL;
  311. goto cleanup;
  312. }
  313. vhdr = sbi->s_vhdr;
  314. /* Copy parts of the volume header into the superblock */
  315. sb->s_magic = HFSPLUS_VOLHEAD_SIG;
  316. if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION ||
  317. be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) {
  318. printk(KERN_ERR "hfs: wrong filesystem version\n");
  319. goto cleanup;
  320. }
  321. sbi->total_blocks = be32_to_cpu(vhdr->total_blocks);
  322. sbi->free_blocks = be32_to_cpu(vhdr->free_blocks);
  323. sbi->next_cnid = be32_to_cpu(vhdr->next_cnid);
  324. sbi->file_count = be32_to_cpu(vhdr->file_count);
  325. sbi->folder_count = be32_to_cpu(vhdr->folder_count);
  326. sbi->data_clump_blocks =
  327. be32_to_cpu(vhdr->data_clump_sz) >> sbi->alloc_blksz_shift;
  328. if (!sbi->data_clump_blocks)
  329. sbi->data_clump_blocks = 1;
  330. sbi->rsrc_clump_blocks =
  331. be32_to_cpu(vhdr->rsrc_clump_sz) >> sbi->alloc_blksz_shift;
  332. if (!sbi->rsrc_clump_blocks)
  333. sbi->rsrc_clump_blocks = 1;
  334. /* Set up operations so we can load metadata */
  335. sb->s_op = &hfsplus_sops;
  336. sb->s_maxbytes = MAX_LFS_FILESIZE;
  337. if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
  338. printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, "
  339. "running fsck.hfsplus is recommended. mounting read-only.\n");
  340. sb->s_flags |= MS_RDONLY;
  341. } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) {
  342. /* nothing */
  343. } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
  344. printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n");
  345. sb->s_flags |= MS_RDONLY;
  346. } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && !(sb->s_flags & MS_RDONLY)) {
  347. printk(KERN_WARNING "hfs: write access to a journaled filesystem is not supported, "
  348. "use the force option at your own risk, mounting read-only.\n");
  349. sb->s_flags |= MS_RDONLY;
  350. }
  351. /* Load metadata objects (B*Trees) */
  352. sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
  353. if (!sbi->ext_tree) {
  354. printk(KERN_ERR "hfs: failed to load extents file\n");
  355. goto cleanup;
  356. }
  357. sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
  358. if (!sbi->cat_tree) {
  359. printk(KERN_ERR "hfs: failed to load catalog file\n");
  360. goto cleanup;
  361. }
  362. inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID);
  363. if (IS_ERR(inode)) {
  364. printk(KERN_ERR "hfs: failed to load allocation file\n");
  365. err = PTR_ERR(inode);
  366. goto cleanup;
  367. }
  368. sbi->alloc_file = inode;
  369. /* Load the root directory */
  370. root = hfsplus_iget(sb, HFSPLUS_ROOT_CNID);
  371. if (IS_ERR(root)) {
  372. printk(KERN_ERR "hfs: failed to load root directory\n");
  373. err = PTR_ERR(root);
  374. goto cleanup;
  375. }
  376. sb->s_root = d_alloc_root(root);
  377. if (!sb->s_root) {
  378. iput(root);
  379. err = -ENOMEM;
  380. goto cleanup;
  381. }
  382. sb->s_root->d_op = &hfsplus_dentry_operations;
  383. str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1;
  384. str.name = HFSP_HIDDENDIR_NAME;
  385. hfs_find_init(sbi->cat_tree, &fd);
  386. hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_ROOT_CNID, &str);
  387. if (!hfs_brec_read(&fd, &entry, sizeof(entry))) {
  388. hfs_find_exit(&fd);
  389. if (entry.type != cpu_to_be16(HFSPLUS_FOLDER))
  390. goto cleanup;
  391. inode = hfsplus_iget(sb, be32_to_cpu(entry.folder.id));
  392. if (IS_ERR(inode)) {
  393. err = PTR_ERR(inode);
  394. goto cleanup;
  395. }
  396. sbi->hidden_dir = inode;
  397. } else
  398. hfs_find_exit(&fd);
  399. if (sb->s_flags & MS_RDONLY)
  400. goto out;
  401. /* H+LX == hfsplusutils, H+Lx == this driver, H+lx is unused
  402. * all three are registered with Apple for our use
  403. */
  404. vhdr->last_mount_vers = cpu_to_be32(HFSP_MOUNT_VERSION);
  405. vhdr->modify_date = hfsp_now2mt();
  406. be32_add_cpu(&vhdr->write_count, 1);
  407. vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT);
  408. vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT);
  409. hfsplus_sync_fs(sb, 1);
  410. if (!sbi->hidden_dir) {
  411. mutex_lock(&sbi->vh_mutex);
  412. sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR);
  413. hfsplus_create_cat(sbi->hidden_dir->i_ino, sb->s_root->d_inode,
  414. &str, sbi->hidden_dir);
  415. mutex_unlock(&sbi->vh_mutex);
  416. mark_inode_dirty(sbi->hidden_dir);
  417. }
  418. out:
  419. unload_nls(sbi->nls);
  420. sbi->nls = nls;
  421. return 0;
  422. cleanup:
  423. hfsplus_put_super(sb);
  424. unload_nls(nls);
  425. return err;
  426. }
  427. MODULE_AUTHOR("Brad Boyer");
  428. MODULE_DESCRIPTION("Extended Macintosh Filesystem");
  429. MODULE_LICENSE("GPL");
  430. static struct kmem_cache *hfsplus_inode_cachep;
  431. static struct inode *hfsplus_alloc_inode(struct super_block *sb)
  432. {
  433. struct hfsplus_inode_info *i;
  434. i = kmem_cache_alloc(hfsplus_inode_cachep, GFP_KERNEL);
  435. return i ? &i->vfs_inode : NULL;
  436. }
  437. static void hfsplus_destroy_inode(struct inode *inode)
  438. {
  439. kmem_cache_free(hfsplus_inode_cachep, HFSPLUS_I(inode));
  440. }
  441. #define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info)
  442. static struct dentry *hfsplus_mount(struct file_system_type *fs_type,
  443. int flags, const char *dev_name, void *data)
  444. {
  445. return mount_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super);
  446. }
  447. static struct file_system_type hfsplus_fs_type = {
  448. .owner = THIS_MODULE,
  449. .name = "hfsplus",
  450. .mount = hfsplus_mount,
  451. .kill_sb = kill_block_super,
  452. .fs_flags = FS_REQUIRES_DEV,
  453. };
  454. static void hfsplus_init_once(void *p)
  455. {
  456. struct hfsplus_inode_info *i = p;
  457. inode_init_once(&i->vfs_inode);
  458. }
  459. static int __init init_hfsplus_fs(void)
  460. {
  461. int err;
  462. hfsplus_inode_cachep = kmem_cache_create("hfsplus_icache",
  463. HFSPLUS_INODE_SIZE, 0, SLAB_HWCACHE_ALIGN,
  464. hfsplus_init_once);
  465. if (!hfsplus_inode_cachep)
  466. return -ENOMEM;
  467. err = register_filesystem(&hfsplus_fs_type);
  468. if (err)
  469. kmem_cache_destroy(hfsplus_inode_cachep);
  470. return err;
  471. }
  472. static void __exit exit_hfsplus_fs(void)
  473. {
  474. unregister_filesystem(&hfsplus_fs_type);
  475. kmem_cache_destroy(hfsplus_inode_cachep);
  476. }
  477. module_init(init_hfsplus_fs)
  478. module_exit(exit_hfsplus_fs)