aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/misc.c')
-rw-r--r--fs/fat/misc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index 6d93360ca0cc..359d307b5507 100644
--- a/fs/fat/misc.c
+++ b/fs/fat/misc.c
@@ -135,6 +135,10 @@ int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster)
135 } 135 }
136 if (ret < 0) 136 if (ret < 0)
137 return ret; 137 return ret;
138 /*
139 * FIXME:Although we can add this cache, fat_cache_add() is
140 * assuming to be called after linear search with fat_cache_id.
141 */
138// fat_cache_add(inode, new_fclus, new_dclus); 142// fat_cache_add(inode, new_fclus, new_dclus);
139 } else { 143 } else {
140 MSDOS_I(inode)->i_start = new_dclus; 144 MSDOS_I(inode)->i_start = new_dclus;
@@ -212,8 +216,10 @@ void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,
212 + days_in_year[month] + day 216 + days_in_year[month] + day
213 + DAYS_DELTA) * SECS_PER_DAY; 217 + DAYS_DELTA) * SECS_PER_DAY;
214 218
215 if (!sbi->options.tz_utc) 219 if (!sbi->options.tz_set)
216 second += sys_tz.tz_minuteswest * SECS_PER_MIN; 220 second += sys_tz.tz_minuteswest * SECS_PER_MIN;
221 else
222 second -= sbi->options.time_offset * SECS_PER_MIN;
217 223
218 if (time_cs) { 224 if (time_cs) {
219 ts->tv_sec = second + (time_cs / 100); 225 ts->tv_sec = second + (time_cs / 100);
@@ -229,8 +235,9 @@ void fat_time_unix2fat(struct msdos_sb_info *sbi, struct timespec *ts,
229 __le16 *time, __le16 *date, u8 *time_cs) 235 __le16 *time, __le16 *date, u8 *time_cs)
230{ 236{
231 struct tm tm; 237 struct tm tm;
232 time_to_tm(ts->tv_sec, sbi->options.tz_utc ? 0 : 238 time_to_tm(ts->tv_sec,
233 -sys_tz.tz_minuteswest * 60, &tm); 239 (sbi->options.tz_set ? sbi->options.time_offset :
240 -sys_tz.tz_minuteswest) * SECS_PER_MIN, &tm);
234 241
235 /* FAT can only support year between 1980 to 2107 */ 242 /* FAT can only support year between 1980 to 2107 */
236 if (tm.tm_year < 1980 - 1900) { 243 if (tm.tm_year < 1980 - 1900) {