diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:29:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:29:44 -0400 |
commit | 23059a0df5fad3d83b9a21fc2696a39148f49617 (patch) | |
tree | c23275fb1d4f6b4990d38c01344770c2d10f8e71 /fs/fat/inode.c | |
parent | 4858704da75ba84ce21e6d4b3b974e8b8594c9f2 (diff) | |
parent | 21bea495943f9532f16e819066b340762124f5dd (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6:
fat: split fat_generic_ioctl
FAT: add 'errors' mount option
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 51a5ecf9000a..304b411cb8bc 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -76,7 +76,7 @@ static inline int __fat_get_block(struct inode *inode, sector_t iblock, | |||
76 | return 0; | 76 | return 0; |
77 | 77 | ||
78 | if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) { | 78 | if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) { |
79 | fat_fs_panic(sb, "corrupted file size (i_pos %lld, %lld)", | 79 | fat_fs_error(sb, "corrupted file size (i_pos %lld, %lld)", |
80 | MSDOS_I(inode)->i_pos, MSDOS_I(inode)->mmu_private); | 80 | MSDOS_I(inode)->i_pos, MSDOS_I(inode)->mmu_private); |
81 | return -EIO; | 81 | return -EIO; |
82 | } | 82 | } |
@@ -856,6 +856,12 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
856 | seq_puts(m, ",flush"); | 856 | seq_puts(m, ",flush"); |
857 | if (opts->tz_utc) | 857 | if (opts->tz_utc) |
858 | seq_puts(m, ",tz=UTC"); | 858 | seq_puts(m, ",tz=UTC"); |
859 | if (opts->errors == FAT_ERRORS_CONT) | ||
860 | seq_puts(m, ",errors=continue"); | ||
861 | else if (opts->errors == FAT_ERRORS_PANIC) | ||
862 | seq_puts(m, ",errors=panic"); | ||
863 | else | ||
864 | seq_puts(m, ",errors=remount-ro"); | ||
859 | 865 | ||
860 | return 0; | 866 | return 0; |
861 | } | 867 | } |
@@ -868,7 +874,8 @@ enum { | |||
868 | Opt_charset, Opt_shortname_lower, Opt_shortname_win95, | 874 | Opt_charset, Opt_shortname_lower, Opt_shortname_win95, |
869 | Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, | 875 | Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, |
870 | Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, | 876 | Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, |
871 | Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err, | 877 | Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont, |
878 | Opt_err_panic, Opt_err_ro, Opt_err, | ||
872 | }; | 879 | }; |
873 | 880 | ||
874 | static const match_table_t fat_tokens = { | 881 | static const match_table_t fat_tokens = { |
@@ -891,6 +898,11 @@ static const match_table_t fat_tokens = { | |||
891 | {Opt_showexec, "showexec"}, | 898 | {Opt_showexec, "showexec"}, |
892 | {Opt_debug, "debug"}, | 899 | {Opt_debug, "debug"}, |
893 | {Opt_immutable, "sys_immutable"}, | 900 | {Opt_immutable, "sys_immutable"}, |
901 | {Opt_flush, "flush"}, | ||
902 | {Opt_tz_utc, "tz=UTC"}, | ||
903 | {Opt_err_cont, "errors=continue"}, | ||
904 | {Opt_err_panic, "errors=panic"}, | ||
905 | {Opt_err_ro, "errors=remount-ro"}, | ||
894 | {Opt_obsolate, "conv=binary"}, | 906 | {Opt_obsolate, "conv=binary"}, |
895 | {Opt_obsolate, "conv=text"}, | 907 | {Opt_obsolate, "conv=text"}, |
896 | {Opt_obsolate, "conv=auto"}, | 908 | {Opt_obsolate, "conv=auto"}, |
@@ -902,8 +914,6 @@ static const match_table_t fat_tokens = { | |||
902 | {Opt_obsolate, "cvf_format=%20s"}, | 914 | {Opt_obsolate, "cvf_format=%20s"}, |
903 | {Opt_obsolate, "cvf_options=%100s"}, | 915 | {Opt_obsolate, "cvf_options=%100s"}, |
904 | {Opt_obsolate, "posix"}, | 916 | {Opt_obsolate, "posix"}, |
905 | {Opt_flush, "flush"}, | ||
906 | {Opt_tz_utc, "tz=UTC"}, | ||
907 | {Opt_err, NULL}, | 917 | {Opt_err, NULL}, |
908 | }; | 918 | }; |
909 | static const match_table_t msdos_tokens = { | 919 | static const match_table_t msdos_tokens = { |
@@ -973,6 +983,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug, | |||
973 | opts->numtail = 1; | 983 | opts->numtail = 1; |
974 | opts->usefree = opts->nocase = 0; | 984 | opts->usefree = opts->nocase = 0; |
975 | opts->tz_utc = 0; | 985 | opts->tz_utc = 0; |
986 | opts->errors = FAT_ERRORS_RO; | ||
976 | *debug = 0; | 987 | *debug = 0; |
977 | 988 | ||
978 | if (!options) | 989 | if (!options) |
@@ -1065,6 +1076,15 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug, | |||
1065 | case Opt_tz_utc: | 1076 | case Opt_tz_utc: |
1066 | opts->tz_utc = 1; | 1077 | opts->tz_utc = 1; |
1067 | break; | 1078 | break; |
1079 | case Opt_err_cont: | ||
1080 | opts->errors = FAT_ERRORS_CONT; | ||
1081 | break; | ||
1082 | case Opt_err_panic: | ||
1083 | opts->errors = FAT_ERRORS_PANIC; | ||
1084 | break; | ||
1085 | case Opt_err_ro: | ||
1086 | opts->errors = FAT_ERRORS_RO; | ||
1087 | break; | ||
1068 | 1088 | ||
1069 | /* msdos specific */ | 1089 | /* msdos specific */ |
1070 | case Opt_dots: | 1090 | case Opt_dots: |