Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / hfs / mdb.c
index 217e32f..b4651e1 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"
@@ -46,7 +47,7 @@ static int hfs_get_last_session(struct super_block *sb,
                        *start = (sector_t)te.cdte_addr.lba << 2;
                        return 0;
                }
-               printk(KERN_ERR "HFS: Invalid session number or type of track\n");
+               printk(KERN_ERR "hfs: invalid session number or type of track\n");
                return -EINVAL;
        }
        ms_info.addr_format = CDROM_LBA;
@@ -99,7 +100,7 @@ int hfs_mdb_get(struct super_block *sb)
 
        HFS_SB(sb)->alloc_blksz = size = be32_to_cpu(mdb->drAlBlkSiz);
        if (!size || (size & (HFS_SECTOR_SIZE - 1))) {
-               hfs_warn("hfs_fs: bad allocation block size %d\n", size);
+               printk(KERN_ERR "hfs: bad allocation block size %d\n", size);
                goto out_bh;
        }
 
@@ -116,7 +117,7 @@ int hfs_mdb_get(struct super_block *sb)
                size >>= 1;
        brelse(bh);
        if (!sb_set_blocksize(sb, size)) {
-               printk("hfs_fs: unable to set blocksize to %u\n", size);
+               printk(KERN_ERR "hfs: unable to set blocksize to %u\n", size);
                goto out;
        }
 
@@ -160,8 +161,8 @@ int hfs_mdb_get(struct super_block *sb)
        }
 
        if (!HFS_SB(sb)->alt_mdb) {
-               hfs_warn("hfs_fs: unable to locate alternate MDB\n");
-               hfs_warn("hfs_fs: continuing without an alternate MDB\n");
+               printk(KERN_WARNING "hfs: unable to locate alternate MDB\n");
+               printk(KERN_WARNING "hfs: continuing without an alternate MDB\n");
        }
 
        HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0);
@@ -176,7 +177,7 @@ int hfs_mdb_get(struct super_block *sb)
        while (size) {
                bh = sb_bread(sb, off >> sb->s_blocksize_bits);
                if (!bh) {
-                       hfs_warn("hfs_fs: unable to read volume bitmap\n");
+                       printk(KERN_ERR "hfs: unable to read volume bitmap\n");
                        goto out;
                }
                off2 = off & (sb->s_blocksize - 1);
@@ -190,23 +191,23 @@ int hfs_mdb_get(struct super_block *sb)
 
        HFS_SB(sb)->ext_tree = hfs_btree_open(sb, HFS_EXT_CNID, hfs_ext_keycmp);
        if (!HFS_SB(sb)->ext_tree) {
-               hfs_warn("hfs_fs: unable to open extent tree\n");
+               printk(KERN_ERR "hfs: unable to open extent tree\n");
                goto out;
        }
        HFS_SB(sb)->cat_tree = hfs_btree_open(sb, HFS_CAT_CNID, hfs_cat_keycmp);
        if (!HFS_SB(sb)->cat_tree) {
-               hfs_warn("hfs_fs: unable to open catalog tree\n");
+               printk(KERN_ERR "hfs: unable to open catalog tree\n");
                goto out;
        }
 
        attrib = mdb->drAtrb;
        if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
-               hfs_warn("HFS-fs warning: Filesystem was not cleanly unmounted, "
+               printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, "
                         "running fsck.hfs is recommended.  mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
        }
        if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) {
-               hfs_warn("HFS-fs: Filesystem is marked locked, mounting read-only.\n");
+               printk(KERN_WARNING "hfs: filesystem is marked locked, mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
        }
        if (!(sb->s_flags & MS_RDONLY)) {
@@ -302,7 +303,7 @@ void hfs_mdb_commit(struct super_block *sb)
                while (size) {
                        bh = sb_bread(sb, block);
                        if (!bh) {
-                               hfs_warn("hfs_fs: unable to read volume bitmap\n");
+                               printk(KERN_ERR "hfs: unable to read volume bitmap\n");
                                break;
                        }
                        len = min((int)sb->s_blocksize - off, size);
@@ -343,6 +344,11 @@ void hfs_mdb_put(struct super_block *sb)
        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;
 }