~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to fs/fat/misc.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * In case the file system is remounted read-only, it can be made writable
21
21
 * again by remounting it.
22
22
 */
23
 
void __fat_fs_error(struct super_block *s, int report, const char *fmt, ...)
 
23
void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
24
24
{
25
 
        struct fat_mount_options *opts = &MSDOS_SB(s)->options;
 
25
        struct fat_mount_options *opts = &MSDOS_SB(sb)->options;
26
26
        va_list args;
 
27
        struct va_format vaf;
27
28
 
28
29
        if (report) {
29
 
                printk(KERN_ERR "FAT: Filesystem error (dev %s)\n", s->s_id);
30
 
 
31
 
                printk(KERN_ERR "    ");
32
30
                va_start(args, fmt);
33
 
                vprintk(fmt, args);
 
31
                vaf.fmt = fmt;
 
32
                vaf.va = &args;
 
33
                printk(KERN_ERR "FAT-fs (%s): error, %pV\n", sb->s_id, &vaf);
34
34
                va_end(args);
35
 
                printk("\n");
36
35
        }
37
36
 
38
37
        if (opts->errors == FAT_ERRORS_PANIC)
39
 
                panic("FAT: fs panic from previous error\n");
40
 
        else if (opts->errors == FAT_ERRORS_RO && !(s->s_flags & MS_RDONLY)) {
41
 
                s->s_flags |= MS_RDONLY;
42
 
                printk(KERN_ERR "FAT: Filesystem has been set read-only\n");
 
38
                panic("FAT-fs (%s): fs panic from previous error\n", sb->s_id);
 
39
        else if (opts->errors == FAT_ERRORS_RO && !(sb->s_flags & MS_RDONLY)) {
 
40
                sb->s_flags |= MS_RDONLY;
 
41
                printk(KERN_ERR "FAT-fs (%s): Filesystem has been "
 
42
                                "set read-only\n", sb->s_id);
43
43
        }
44
44
}
45
45
EXPORT_SYMBOL_GPL(__fat_fs_error);
46
46
 
 
47
/**
 
48
 * fat_msg() - print preformated FAT specific messages. Every thing what is
 
49
 * not fat_fs_error() should be fat_msg().
 
50
 */
 
51
void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...)
 
52
{
 
53
        struct va_format vaf;
 
54
        va_list args;
 
55
 
 
56
        va_start(args, fmt);
 
57
        vaf.fmt = fmt;
 
58
        vaf.va = &args;
 
59
        printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf);
 
60
        va_end(args);
 
61
}
 
62
 
47
63
/* Flushes the number of free clusters on FAT32 */
48
64
/* XXX: Need to write one per FSINFO block.  Currently only writes 1 */
49
65
int fat_clusters_flush(struct super_block *sb)
57
73
 
58
74
        bh = sb_bread(sb, sbi->fsinfo_sector);
59
75
        if (bh == NULL) {
60
 
                printk(KERN_ERR "FAT: bread failed in fat_clusters_flush\n");
 
76
                fat_msg(sb, KERN_ERR, "bread failed in fat_clusters_flush");
61
77
                return -EIO;
62
78
        }
63
79
 
64
80
        fsinfo = (struct fat_boot_fsinfo *)bh->b_data;
65
81
        /* Sanity check */
66
82
        if (!IS_FSINFO(fsinfo)) {
67
 
                printk(KERN_ERR "FAT: Invalid FSINFO signature: "
68
 
                       "0x%08x, 0x%08x (sector = %lu)\n",
 
83
                fat_msg(sb, KERN_ERR, "Invalid FSINFO signature: "
 
84
                       "0x%08x, 0x%08x (sector = %lu)",
69
85
                       le32_to_cpu(fsinfo->signature1),
70
86
                       le32_to_cpu(fsinfo->signature2),
71
87
                       sbi->fsinfo_sector);