aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 76b7961ab663..0ce143bd7d56 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -558,7 +558,7 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
558 buf->f_bavail = sbi->free_clusters; 558 buf->f_bavail = sbi->free_clusters;
559 buf->f_fsid.val[0] = (u32)id; 559 buf->f_fsid.val[0] = (u32)id;
560 buf->f_fsid.val[1] = (u32)(id >> 32); 560 buf->f_fsid.val[1] = (u32)(id >> 32);
561 buf->f_namelen = sbi->options.isvfat ? 260 : 12; 561 buf->f_namelen = sbi->options.isvfat ? FAT_LFN_LEN : 12;
562 562
563 return 0; 563 return 0;
564} 564}
@@ -577,7 +577,7 @@ static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
577 return i_pos; 577 return i_pos;
578} 578}
579 579
580static int fat_write_inode(struct inode *inode, int wait) 580static int __fat_write_inode(struct inode *inode, int wait)
581{ 581{
582 struct super_block *sb = inode->i_sb; 582 struct super_block *sb = inode->i_sb;
583 struct msdos_sb_info *sbi = MSDOS_SB(sb); 583 struct msdos_sb_info *sbi = MSDOS_SB(sb);
@@ -634,9 +634,14 @@ retry:
634 return err; 634 return err;
635} 635}
636 636
637static int fat_write_inode(struct inode *inode, struct writeback_control *wbc)
638{
639 return __fat_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
640}
641
637int fat_sync_inode(struct inode *inode) 642int fat_sync_inode(struct inode *inode)
638{ 643{
639 return fat_write_inode(inode, 1); 644 return __fat_write_inode(inode, 1);
640} 645}
641 646
642EXPORT_SYMBOL_GPL(fat_sync_inode); 647EXPORT_SYMBOL_GPL(fat_sync_inode);
@@ -858,6 +863,8 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
858 seq_puts(m, ",errors=panic"); 863 seq_puts(m, ",errors=panic");
859 else 864 else
860 seq_puts(m, ",errors=remount-ro"); 865 seq_puts(m, ",errors=remount-ro");
866 if (opts->discard)
867 seq_puts(m, ",discard");
861 868
862 return 0; 869 return 0;
863} 870}
@@ -871,7 +878,7 @@ enum {
871 Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, 878 Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes,
872 Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, 879 Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes,
873 Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont, 880 Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont,
874 Opt_err_panic, Opt_err_ro, Opt_err, 881 Opt_err_panic, Opt_err_ro, Opt_discard, Opt_err,
875}; 882};
876 883
877static const match_table_t fat_tokens = { 884static const match_table_t fat_tokens = {
@@ -899,6 +906,7 @@ static const match_table_t fat_tokens = {
899 {Opt_err_cont, "errors=continue"}, 906 {Opt_err_cont, "errors=continue"},
900 {Opt_err_panic, "errors=panic"}, 907 {Opt_err_panic, "errors=panic"},
901 {Opt_err_ro, "errors=remount-ro"}, 908 {Opt_err_ro, "errors=remount-ro"},
909 {Opt_discard, "discard"},
902 {Opt_obsolate, "conv=binary"}, 910 {Opt_obsolate, "conv=binary"},
903 {Opt_obsolate, "conv=text"}, 911 {Opt_obsolate, "conv=text"},
904 {Opt_obsolate, "conv=auto"}, 912 {Opt_obsolate, "conv=auto"},
@@ -1136,6 +1144,9 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
1136 case Opt_rodir: 1144 case Opt_rodir:
1137 opts->rodir = 1; 1145 opts->rodir = 1;
1138 break; 1146 break;
1147 case Opt_discard:
1148 opts->discard = 1;
1149 break;
1139 1150
1140 /* obsolete mount options */ 1151 /* obsolete mount options */
1141 case Opt_obsolate: 1152 case Opt_obsolate: