]> err.no Git - linux-2.6/blobdiff - fs/hfs/mdb.c
[PATCH] Separate pci bits out of struct device_node
[linux-2.6] / fs / hfs / mdb.c
index 4efb640c4d0cc838938a1d1c202c3eb47d44ecc8..0a473f79c89feb192b71dba3f66a7951536c86f8 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/cdrom.h>
 #include <linux/genhd.h>
+#include <linux/nls.h>
 
 #include "hfs_fs.h"
 #include "btree.h"
@@ -333,6 +334,8 @@ void hfs_mdb_close(struct super_block *sb)
  * Release the resources associated with the in-core MDB.  */
 void hfs_mdb_put(struct super_block *sb)
 {
+       if (!HFS_SB(sb))
+               return;
        /* free the B-trees */
        hfs_btree_close(HFS_SB(sb)->ext_tree);
        hfs_btree_close(HFS_SB(sb)->cat_tree);
@@ -340,4 +343,12 @@ void hfs_mdb_put(struct super_block *sb)
        /* free the buffers holding the primary and alternate MDBs */
        brelse(HFS_SB(sb)->mdb_bh);
        brelse(HFS_SB(sb)->alt_mdb_bh);
+
+       if (HFS_SB(sb)->nls_io)
+               unload_nls(HFS_SB(sb)->nls_io);
+       if (HFS_SB(sb)->nls_disk)
+               unload_nls(HFS_SB(sb)->nls_disk);
+
+       kfree(HFS_SB(sb));
+       sb->s_fs_info = NULL;
 }