Lines Matching +full:add +full:- +full:fs
2 * linux/fs/fat/misc.c
5 * 22/11/2000 - Fixed fat_date_unix2dos for dates earlier than 01/01/1980
10 #include <linux/fs.h>
19 * or filesystem is remounted read-only (default behavior).
20 * In case the file system is remounted read-only, it can be made writable
25 struct fat_mount_options *opts = &MSDOS_SB(sb)->options; in __fat_fs_error()
33 printk(KERN_ERR "FAT-fs (%s): error, %pV\n", sb->s_id, &vaf); in __fat_fs_error()
37 if (opts->errors == FAT_ERRORS_PANIC) in __fat_fs_error()
38 panic("FAT-fs (%s): fs panic from previous error\n", sb->s_id); in __fat_fs_error()
39 else if (opts->errors == FAT_ERRORS_RO && !(sb->s_flags & MS_RDONLY)) { in __fat_fs_error()
40 sb->s_flags |= MS_RDONLY; in __fat_fs_error()
41 printk(KERN_ERR "FAT-fs (%s): Filesystem has been " in __fat_fs_error()
42 "set read-only\n", sb->s_id); in __fat_fs_error()
48 * fat_msg() - print preformated FAT specific messages. Every thing what is
59 printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf); in fat_msg()
71 if (sbi->fat_bits != 32) in fat_clusters_flush()
74 bh = sb_bread(sb, sbi->fsinfo_sector); in fat_clusters_flush()
77 return -EIO; in fat_clusters_flush()
80 fsinfo = (struct fat_boot_fsinfo *)bh->b_data; in fat_clusters_flush()
85 le32_to_cpu(fsinfo->signature1), in fat_clusters_flush()
86 le32_to_cpu(fsinfo->signature2), in fat_clusters_flush()
87 sbi->fsinfo_sector); in fat_clusters_flush()
89 if (sbi->free_clusters != -1) in fat_clusters_flush()
90 fsinfo->free_clusters = cpu_to_le32(sbi->free_clusters); in fat_clusters_flush()
91 if (sbi->prev_free != -1) in fat_clusters_flush()
92 fsinfo->next_cluster = cpu_to_le32(sbi->prev_free); in fat_clusters_flush()
106 struct super_block *sb = inode->i_sb; in fat_chain_add()
111 * We must locate the last cluster of the file to add this new in fat_chain_add()
115 if (MSDOS_I(inode)->i_start) { in fat_chain_add()
125 /* add new one to the last of the cluster chain */ in fat_chain_add()
140 MSDOS_I(inode)->i_start = new_dclus; in fat_chain_add()
141 MSDOS_I(inode)->i_logstart = new_dclus; in fat_chain_add()
146 if (S_ISDIR(inode->i_mode) && IS_DIRSYNC(inode)) { in fat_chain_add()
153 if (new_fclus != (inode->i_blocks >> (sbi->cluster_bits - 9))) { in fat_chain_add()
156 (llu)(inode->i_blocks >> (sbi->cluster_bits - 9))); in fat_chain_add()
159 inode->i_blocks += nr_cluster << (sbi->cluster_bits - 9); in fat_chain_add()
169 * date: 0 - 4: day (1 - 31)
170 * date: 5 - 8: month (1 - 12)
171 * date: 9 - 15: year (0 - 127) from 1980
172 * time: 0 - 4: sec (0 - 29) 2sec counts
173 * time: 5 - 10: min (0 - 59)
174 * time: 11 - 15: hour (0 - 23)
181 /* 120 (2100 - 1980) isn't leap year */
185 /* Linear day numbers of the respective 1sts in non-leap years. */
200 day = max(1, date & 0x1f) - 1; in fat_time_fat2unix()
204 leap_day--; in fat_time_fat2unix()
215 if (!sbi->options.tz_utc) in fat_time_fat2unix()
219 ts->tv_sec = second + (time_cs / 100); in fat_time_fat2unix()
220 ts->tv_nsec = (time_cs % 100) * 10000000; in fat_time_fat2unix()
222 ts->tv_sec = second; in fat_time_fat2unix()
223 ts->tv_nsec = 0; in fat_time_fat2unix()
232 time_to_tm(ts->tv_sec, sbi->options.tz_utc ? 0 : in fat_time_unix2fat()
233 -sys_tz.tz_minuteswest * 60, &tm); in fat_time_unix2fat()
236 if (tm.tm_year < 1980 - 1900) { in fat_time_unix2fat()
243 if (tm.tm_year > 2107 - 1900) { in fat_time_unix2fat()
251 /* from 1900 -> from 1980 */ in fat_time_unix2fat()
252 tm.tm_year -= 80; in fat_time_unix2fat()
253 /* 0~11 -> 1~12 */ in fat_time_unix2fat()
255 /* 0~59 -> 0~29(2sec counts) */ in fat_time_unix2fat()
261 *time_cs = (ts->tv_sec & 1) * 100 + ts->tv_nsec / 10000000; in fat_time_unix2fat()
275 err = -EIO; in fat_sync_bhs()