aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/inode.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index a8129e82d594..2c55e8dce793 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -825,6 +825,8 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
825 } 825 }
826 if (opts->name_check != 'n') 826 if (opts->name_check != 'n')
827 seq_printf(m, ",check=%c", opts->name_check); 827 seq_printf(m, ",check=%c", opts->name_check);
828 if (opts->usefree)
829 seq_puts(m, ",usefree");
828 if (opts->quiet) 830 if (opts->quiet)
829 seq_puts(m, ",quiet"); 831 seq_puts(m, ",quiet");
830 if (opts->showexec) 832 if (opts->showexec)
@@ -850,7 +852,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
850 852
851enum { 853enum {
852 Opt_check_n, Opt_check_r, Opt_check_s, Opt_uid, Opt_gid, 854 Opt_check_n, Opt_check_r, Opt_check_s, Opt_uid, Opt_gid,
853 Opt_umask, Opt_dmask, Opt_fmask, Opt_codepage, Opt_nocase, 855 Opt_umask, Opt_dmask, Opt_fmask, Opt_codepage, Opt_usefree, Opt_nocase,
854 Opt_quiet, Opt_showexec, Opt_debug, Opt_immutable, 856 Opt_quiet, Opt_showexec, Opt_debug, Opt_immutable,
855 Opt_dots, Opt_nodots, 857 Opt_dots, Opt_nodots,
856 Opt_charset, Opt_shortname_lower, Opt_shortname_win95, 858 Opt_charset, Opt_shortname_lower, Opt_shortname_win95,
@@ -872,6 +874,7 @@ static match_table_t fat_tokens = {
872 {Opt_dmask, "dmask=%o"}, 874 {Opt_dmask, "dmask=%o"},
873 {Opt_fmask, "fmask=%o"}, 875 {Opt_fmask, "fmask=%o"},
874 {Opt_codepage, "codepage=%u"}, 876 {Opt_codepage, "codepage=%u"},
877 {Opt_usefree, "usefree"},
875 {Opt_nocase, "nocase"}, 878 {Opt_nocase, "nocase"},
876 {Opt_quiet, "quiet"}, 879 {Opt_quiet, "quiet"},
877 {Opt_showexec, "showexec"}, 880 {Opt_showexec, "showexec"},
@@ -951,7 +954,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
951 opts->quiet = opts->showexec = opts->sys_immutable = opts->dotsOK = 0; 954 opts->quiet = opts->showexec = opts->sys_immutable = opts->dotsOK = 0;
952 opts->utf8 = opts->unicode_xlate = 0; 955 opts->utf8 = opts->unicode_xlate = 0;
953 opts->numtail = 1; 956 opts->numtail = 1;
954 opts->nocase = 0; 957 opts->usefree = opts->nocase = 0;
955 *debug = 0; 958 *debug = 0;
956 959
957 if (!options) 960 if (!options)
@@ -979,6 +982,9 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
979 case Opt_check_n: 982 case Opt_check_n:
980 opts->name_check = 'n'; 983 opts->name_check = 'n';
981 break; 984 break;
985 case Opt_usefree:
986 opts->usefree = 1;
987 break;
982 case Opt_nocase: 988 case Opt_nocase:
983 if (!is_vfat) 989 if (!is_vfat)
984 opts->nocase = 1; 990 opts->nocase = 1;
@@ -1304,7 +1310,9 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
1304 le32_to_cpu(fsinfo->signature2), 1310 le32_to_cpu(fsinfo->signature2),
1305 sbi->fsinfo_sector); 1311 sbi->fsinfo_sector);
1306 } else { 1312 } else {
1307 sbi->free_clusters = le32_to_cpu(fsinfo->free_clusters); 1313 if (sbi->options.usefree)
1314 sbi->free_clusters =
1315 le32_to_cpu(fsinfo->free_clusters);
1308 sbi->prev_free = le32_to_cpu(fsinfo->next_cluster); 1316 sbi->prev_free = le32_to_cpu(fsinfo->next_cluster);
1309 } 1317 }
1310 1318