9 #include <linux/module.h>
12 #include <linux/time.h>
38 panic(
"FAT-fs (%s): fs panic from previous error\n", sb->
s_id);
42 "set read-only\n", sb->
s_id);
59 printk(
"%sFAT-fs (%s): %pV\n", level, sb->
s_id, &vaf);
68 struct buffer_head *bh;
84 "0x%08x, 0x%08x (sector = %lu)",
114 last = new_fclus = 0;
115 if (MSDOS_I(inode)->i_start) {
121 new_fclus = fclus + 1;
129 fatent_init(&fatent);
134 fatent_brelse(&fatent);
140 MSDOS_I(inode)->i_start = new_dclus;
141 MSDOS_I(inode)->i_logstart = new_dclus;
151 mark_inode_dirty(inode);
154 fat_fs_error(sb,
"clusters badly computed (%d != %llu)",
176 #define SECS_PER_MIN 60
177 #define SECS_PER_HOUR (60 * 60)
178 #define SECS_PER_DAY (SECS_PER_HOUR * 24)
180 #define DAYS_DELTA (365 * 10 + 2)
182 #define YEAR_2100 120
183 #define IS_LEAP_YEAR(y) (!((y) & 3) && (y) != YEAR_2100)
188 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 0, 0, 0,
199 month =
max(1, (
date >> 5) & 0xf);
202 leap_day = (year + 3) / 4;
208 second = (time & 0x1f) << 1;
211 second += (year * 365 + leap_day
219 ts->
tv_sec = second + (time_cs / 100);
220 ts->
tv_nsec = (time_cs % 100) * 10000000;
233 -
sys_tz.tz_minuteswest * 60, &tm);
236 if (tm.
tm_year < 1980 - 1900) {
243 if (tm.
tm_year > 2107 - 1900) {
269 for (i = 0; i < nr_bhs; i++)
272 for (i = 0; i < nr_bhs; i++) {
273 wait_on_buffer(bhs[i]);
274 if (!err && !buffer_uptodate(bhs[i]))