Lines 382-398
static int fat_fill_inode(struct inode *
Link Here
|
382 |
inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) |
382 |
inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) |
383 |
& ~((loff_t)sbi->cluster_size - 1)) >> 9; |
383 |
& ~((loff_t)sbi->cluster_size - 1)) >> 9; |
384 |
inode->i_mtime.tv_sec = |
384 |
inode->i_mtime.tv_sec = |
385 |
date_dos2unix(le16_to_cpu(de->time), le16_to_cpu(de->date)); |
385 |
date_dos2unix(le16_to_cpu(de->time), le16_to_cpu(de->date), |
|
|
386 |
sbi->options.tz_utc); |
386 |
inode->i_mtime.tv_nsec = 0; |
387 |
inode->i_mtime.tv_nsec = 0; |
387 |
if (sbi->options.isvfat) { |
388 |
if (sbi->options.isvfat) { |
388 |
int secs = de->ctime_cs / 100; |
389 |
int secs = de->ctime_cs / 100; |
389 |
int csecs = de->ctime_cs % 100; |
390 |
int csecs = de->ctime_cs % 100; |
390 |
inode->i_ctime.tv_sec = |
391 |
inode->i_ctime.tv_sec = |
391 |
date_dos2unix(le16_to_cpu(de->ctime), |
392 |
date_dos2unix(le16_to_cpu(de->ctime), |
392 |
le16_to_cpu(de->cdate)) + secs; |
393 |
le16_to_cpu(de->cdate), |
|
|
394 |
sbi->options.tz_utc) + secs; |
393 |
inode->i_ctime.tv_nsec = csecs * 10000000; |
395 |
inode->i_ctime.tv_nsec = csecs * 10000000; |
394 |
inode->i_atime.tv_sec = |
396 |
inode->i_atime.tv_sec = |
395 |
date_dos2unix(0, le16_to_cpu(de->adate)); |
397 |
date_dos2unix(0, le16_to_cpu(de->adate), |
|
|
398 |
sbi->options.tz_utc); |
396 |
inode->i_atime.tv_nsec = 0; |
399 |
inode->i_atime.tv_nsec = 0; |
397 |
} else |
400 |
} else |
398 |
inode->i_ctime = inode->i_atime = inode->i_mtime; |
401 |
inode->i_ctime = inode->i_atime = inode->i_mtime; |
Lines 592-602
retry:
Link Here
|
592 |
raw_entry->attr = fat_attr(inode); |
595 |
raw_entry->attr = fat_attr(inode); |
593 |
raw_entry->start = cpu_to_le16(MSDOS_I(inode)->i_logstart); |
596 |
raw_entry->start = cpu_to_le16(MSDOS_I(inode)->i_logstart); |
594 |
raw_entry->starthi = cpu_to_le16(MSDOS_I(inode)->i_logstart >> 16); |
597 |
raw_entry->starthi = cpu_to_le16(MSDOS_I(inode)->i_logstart >> 16); |
595 |
fat_date_unix2dos(inode->i_mtime.tv_sec, &raw_entry->time, &raw_entry->date); |
598 |
fat_date_unix2dos(inode->i_mtime.tv_sec, &raw_entry->time, |
|
|
599 |
&raw_entry->date, sbi->options.tz_utc); |
596 |
if (sbi->options.isvfat) { |
600 |
if (sbi->options.isvfat) { |
597 |
__le16 atime; |
601 |
__le16 atime; |
598 |
fat_date_unix2dos(inode->i_ctime.tv_sec,&raw_entry->ctime,&raw_entry->cdate); |
602 |
fat_date_unix2dos(inode->i_ctime.tv_sec, &raw_entry->ctime, |
599 |
fat_date_unix2dos(inode->i_atime.tv_sec,&atime,&raw_entry->adate); |
603 |
&raw_entry->cdate, sbi->options.tz_utc); |
|
|
604 |
fat_date_unix2dos(inode->i_atime.tv_sec, &atime, |
605 |
&raw_entry->adate, sbi->options.tz_utc); |
600 |
raw_entry->ctime_cs = (inode->i_ctime.tv_sec & 1) * 100 + |
606 |
raw_entry->ctime_cs = (inode->i_ctime.tv_sec & 1) * 100 + |
601 |
inode->i_ctime.tv_nsec / 10000000; |
607 |
inode->i_ctime.tv_nsec / 10000000; |
602 |
} |
608 |
} |
Lines 836-841
static int fat_show_options(struct seq_f
Link Here
|
836 |
} |
842 |
} |
837 |
if (sbi->options.flush) |
843 |
if (sbi->options.flush) |
838 |
seq_puts(m, ",flush"); |
844 |
seq_puts(m, ",flush"); |
|
|
845 |
if (opts->tz_utc) |
846 |
seq_puts(m, ",tz=UTC"); |
839 |
|
847 |
|
840 |
return 0; |
848 |
return 0; |
841 |
} |
849 |
} |
Lines 848-854
enum {
Link Here
|
848 |
Opt_charset, Opt_shortname_lower, Opt_shortname_win95, |
856 |
Opt_charset, Opt_shortname_lower, Opt_shortname_win95, |
849 |
Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, |
857 |
Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, |
850 |
Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, |
858 |
Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, |
851 |
Opt_obsolate, Opt_flush, Opt_err, |
859 |
Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_err, |
852 |
}; |
860 |
}; |
853 |
|
861 |
|
854 |
static match_table_t fat_tokens = { |
862 |
static match_table_t fat_tokens = { |
Lines 883-888
static match_table_t fat_tokens = {
Link Here
|
883 |
{Opt_obsolate, "cvf_options=%100s"}, |
891 |
{Opt_obsolate, "cvf_options=%100s"}, |
884 |
{Opt_obsolate, "posix"}, |
892 |
{Opt_obsolate, "posix"}, |
885 |
{Opt_flush, "flush"}, |
893 |
{Opt_flush, "flush"}, |
|
|
894 |
{Opt_tz_utc, "tz=UTC"}, |
886 |
{Opt_err, NULL}, |
895 |
{Opt_err, NULL}, |
887 |
}; |
896 |
}; |
888 |
static match_table_t msdos_tokens = { |
897 |
static match_table_t msdos_tokens = { |
Lines 947-952
static int parse_options(char *options,
Link Here
|
947 |
opts->utf8 = opts->unicode_xlate = 0; |
956 |
opts->utf8 = opts->unicode_xlate = 0; |
948 |
opts->numtail = 1; |
957 |
opts->numtail = 1; |
949 |
opts->usefree = opts->nocase = 0; |
958 |
opts->usefree = opts->nocase = 0; |
|
|
959 |
opts->tz_utc = 0; |
950 |
*debug = 0; |
960 |
*debug = 0; |
951 |
|
961 |
|
952 |
if (!options) |
962 |
if (!options) |
Lines 1036-1041
static int parse_options(char *options,
Link Here
|
1036 |
case Opt_flush: |
1046 |
case Opt_flush: |
1037 |
opts->flush = 1; |
1047 |
opts->flush = 1; |
1038 |
break; |
1048 |
break; |
|
|
1049 |
case Opt_tz_utc: |
1050 |
opts->tz_utc = 1; |
1051 |
break; |
1039 |
|
1052 |
|
1040 |
/* msdos specific */ |
1053 |
/* msdos specific */ |
1041 |
case Opt_dots: |
1054 |
case Opt_dots: |