• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
4  */
5 
6 #ifndef _EXFAT_FS_H
7 #define _EXFAT_FS_H
8 
9 #include <linux/fs.h>
10 #include <linux/ratelimit.h>
11 #include <linux/nls.h>
12 
13 #define EXFAT_SUPER_MAGIC       0x2011BAB0UL
14 #define EXFAT_ROOT_INO		1
15 
16 #define EXFAT_CLUSTERS_UNTRACKED (~0u)
17 
18 /*
19  * exfat error flags
20  */
21 enum exfat_error_mode {
22 	EXFAT_ERRORS_CONT,	/* ignore error and continue */
23 	EXFAT_ERRORS_PANIC,	/* panic on error */
24 	EXFAT_ERRORS_RO,	/* remount r/o on error */
25 };
26 
27 /*
28  * exfat nls lossy flag
29  */
30 enum {
31 	NLS_NAME_NO_LOSSY,	/* no lossy */
32 	NLS_NAME_LOSSY,		/* just detected incorrect filename(s) */
33 	NLS_NAME_OVERLEN,	/* the length is over than its limit */
34 };
35 
36 #define EXFAT_HASH_BITS		8
37 #define EXFAT_HASH_SIZE		(1UL << EXFAT_HASH_BITS)
38 
39 /*
40  * Type Definitions
41  */
42 #define ES_2_ENTRIES		2
43 #define ES_ALL_ENTRIES		0
44 
45 #define DIR_DELETED		0xFFFFFFF7
46 
47 /* type values */
48 #define TYPE_UNUSED		0x0000
49 #define TYPE_DELETED		0x0001
50 #define TYPE_INVALID		0x0002
51 #define TYPE_CRITICAL_PRI	0x0100
52 #define TYPE_BITMAP		0x0101
53 #define TYPE_UPCASE		0x0102
54 #define TYPE_VOLUME		0x0103
55 #define TYPE_DIR		0x0104
56 #define TYPE_FILE		0x011F
57 #define TYPE_CRITICAL_SEC	0x0200
58 #define TYPE_STREAM		0x0201
59 #define TYPE_EXTEND		0x0202
60 #define TYPE_ACL		0x0203
61 #define TYPE_BENIGN_PRI		0x0400
62 #define TYPE_GUID		0x0401
63 #define TYPE_PADDING		0x0402
64 #define TYPE_ACLTAB		0x0403
65 #define TYPE_BENIGN_SEC		0x0800
66 #define TYPE_ALL		0x0FFF
67 
68 #define MAX_CHARSET_SIZE	6 /* max size of multi-byte character */
69 #define MAX_NAME_LENGTH		255 /* max len of file name excluding NULL */
70 #define MAX_VFSNAME_BUF_SIZE	((MAX_NAME_LENGTH + 1) * MAX_CHARSET_SIZE)
71 
72 /* Enough size to hold 256 dentry (even 512 Byte sector) */
73 #define DIR_CACHE_SIZE		(256*sizeof(struct exfat_dentry)/512+1)
74 
75 #define EXFAT_HINT_NONE		-1
76 #define EXFAT_MIN_SUBDIR	2
77 
78 /*
79  * helpers for cluster size to byte conversion.
80  */
81 #define EXFAT_CLU_TO_B(b, sbi)		((b) << (sbi)->cluster_size_bits)
82 #define EXFAT_B_TO_CLU(b, sbi)		((b) >> (sbi)->cluster_size_bits)
83 #define EXFAT_B_TO_CLU_ROUND_UP(b, sbi)	\
84 	(((b - 1) >> (sbi)->cluster_size_bits) + 1)
85 #define EXFAT_CLU_OFFSET(off, sbi)	((off) & ((sbi)->cluster_size - 1))
86 
87 /*
88  * helpers for block size to byte conversion.
89  */
90 #define EXFAT_BLK_TO_B(b, sb)		((b) << (sb)->s_blocksize_bits)
91 #define EXFAT_B_TO_BLK(b, sb)		((b) >> (sb)->s_blocksize_bits)
92 #define EXFAT_B_TO_BLK_ROUND_UP(b, sb)	\
93 	(((b - 1) >> (sb)->s_blocksize_bits) + 1)
94 #define EXFAT_BLK_OFFSET(off, sb)	((off) & ((sb)->s_blocksize - 1))
95 
96 /*
97  * helpers for block size to dentry size conversion.
98  */
99 #define EXFAT_B_TO_DEN_IDX(b, sbi)	\
100 	((b) << ((sbi)->cluster_size_bits - DENTRY_SIZE_BITS))
101 #define EXFAT_B_TO_DEN(b)		((b) >> DENTRY_SIZE_BITS)
102 #define EXFAT_DEN_TO_B(b)		((b) << DENTRY_SIZE_BITS)
103 
104 /*
105  * helpers for fat entry.
106  */
107 #define FAT_ENT_SIZE (4)
108 #define FAT_ENT_SIZE_BITS (2)
109 #define FAT_ENT_OFFSET_SECTOR(sb, loc) (EXFAT_SB(sb)->FAT1_start_sector + \
110 	(((u64)loc << FAT_ENT_SIZE_BITS) >> sb->s_blocksize_bits))
111 #define FAT_ENT_OFFSET_BYTE_IN_SECTOR(sb, loc)	\
112 	((loc << FAT_ENT_SIZE_BITS) & (sb->s_blocksize - 1))
113 
114 /*
115  * helpers for bitmap.
116  */
117 #define CLUSTER_TO_BITMAP_ENT(clu) ((clu) - EXFAT_RESERVED_CLUSTERS)
118 #define BITMAP_ENT_TO_CLUSTER(ent) ((ent) + EXFAT_RESERVED_CLUSTERS)
119 #define BITS_PER_SECTOR(sb) ((sb)->s_blocksize * BITS_PER_BYTE)
120 #define BITS_PER_SECTOR_MASK(sb) (BITS_PER_SECTOR(sb) - 1)
121 #define BITMAP_OFFSET_SECTOR_INDEX(sb, ent) \
122 	((ent / BITS_PER_BYTE) >> (sb)->s_blocksize_bits)
123 #define BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent) (ent & BITS_PER_SECTOR_MASK(sb))
124 #define BITMAP_OFFSET_BYTE_IN_SECTOR(sb, ent) \
125 	((ent / BITS_PER_BYTE) & ((sb)->s_blocksize - 1))
126 #define BITS_PER_BYTE_MASK	0x7
127 #define IGNORED_BITS_REMAINED(clu, clu_base) ((1 << ((clu) - (clu_base))) - 1)
128 
129 struct exfat_dentry_namebuf {
130 	char *lfn;
131 	int lfnbuf_len; /* usually MAX_UNINAME_BUF_SIZE */
132 };
133 
134 /* unicode name structure */
135 struct exfat_uni_name {
136 	/* +3 for null and for converting */
137 	unsigned short name[MAX_NAME_LENGTH + 3];
138 	u16 name_hash;
139 	unsigned char name_len;
140 };
141 
142 /* directory structure */
143 struct exfat_chain {
144 	unsigned int dir;
145 	unsigned int size;
146 	unsigned char flags;
147 };
148 
149 /* first empty entry hint information */
150 struct exfat_hint_femp {
151 	/* entry index of a directory */
152 	int eidx;
153 	/* count of continuous empty entry */
154 	int count;
155 	/* the cluster that first empty slot exists in */
156 	struct exfat_chain cur;
157 };
158 
159 /* hint structure */
160 struct exfat_hint {
161 	unsigned int clu;
162 	union {
163 		unsigned int off; /* cluster offset */
164 		int eidx; /* entry index */
165 	};
166 };
167 
168 struct exfat_entry_set_cache {
169 	struct super_block *sb;
170 	bool modified;
171 	unsigned int start_off;
172 	int num_bh;
173 	struct buffer_head *__bh[DIR_CACHE_SIZE];
174 	struct buffer_head **bh;
175 	unsigned int num_entries;
176 };
177 
178 #define IS_DYNAMIC_ES(es)	((es)->__bh != (es)->bh)
179 
180 struct exfat_dir_entry {
181 	struct exfat_chain dir;
182 	int entry;
183 	unsigned int type;
184 	unsigned int start_clu;
185 	unsigned char flags;
186 	unsigned short attr;
187 	loff_t size;
188 	unsigned int num_subdirs;
189 	struct timespec64 atime;
190 	struct timespec64 mtime;
191 	struct timespec64 crtime;
192 	struct exfat_dentry_namebuf namebuf;
193 };
194 
195 /*
196  * exfat mount in-memory data
197  */
198 struct exfat_mount_options {
199 	kuid_t fs_uid;
200 	kgid_t fs_gid;
201 	unsigned short fs_fmask;
202 	unsigned short fs_dmask;
203 	/* permission for setting the [am]time */
204 	unsigned short allow_utime;
205 	/* charset for filename input/display */
206 	char *iocharset;
207 	/* on error: continue, panic, remount-ro */
208 	enum exfat_error_mode errors;
209 	unsigned utf8:1, /* Use of UTF-8 character set */
210 		 discard:1; /* Issue discard requests on deletions */
211 	int time_offset; /* Offset of timestamps from UTC (in minutes) */
212 };
213 
214 /*
215  * EXFAT file system superblock in-memory data
216  */
217 struct exfat_sb_info {
218 	unsigned long long num_sectors; /* num of sectors in volume */
219 	unsigned int num_clusters; /* num of clusters in volume */
220 	unsigned int cluster_size; /* cluster size in bytes */
221 	unsigned int cluster_size_bits;
222 	unsigned int sect_per_clus; /* cluster size in sectors */
223 	unsigned int sect_per_clus_bits;
224 	unsigned long long FAT1_start_sector; /* FAT1 start sector */
225 	unsigned long long FAT2_start_sector; /* FAT2 start sector */
226 	unsigned long long data_start_sector; /* data area start sector */
227 	unsigned int num_FAT_sectors; /* num of FAT sectors */
228 	unsigned int root_dir; /* root dir cluster */
229 	unsigned int dentries_per_clu; /* num of dentries per cluster */
230 	unsigned int vol_flags; /* volume flags */
231 	unsigned int vol_flags_persistent; /* volume flags to retain */
232 	struct buffer_head *boot_bh; /* buffer_head of BOOT sector */
233 
234 	unsigned int map_clu; /* allocation bitmap start cluster */
235 	unsigned int map_sectors; /* num of allocation bitmap sectors */
236 	struct buffer_head **vol_amap; /* allocation bitmap */
237 
238 	unsigned short *vol_utbl; /* upcase table */
239 
240 	unsigned int clu_srch_ptr; /* cluster search pointer */
241 	unsigned int used_clusters; /* number of used clusters */
242 
243 	struct mutex s_lock; /* superblock lock */
244 	struct exfat_mount_options options;
245 	struct nls_table *nls_io; /* Charset used for input and display */
246 	struct ratelimit_state ratelimit;
247 
248 	spinlock_t inode_hash_lock;
249 	struct hlist_head inode_hashtable[EXFAT_HASH_SIZE];
250 
251 	struct rcu_head rcu;
252 };
253 
254 #define EXFAT_CACHE_VALID	0
255 
256 /*
257  * EXFAT file system inode in-memory data
258  */
259 struct exfat_inode_info {
260 	struct exfat_chain dir;
261 	int entry;
262 	unsigned int type;
263 	unsigned short attr;
264 	unsigned int start_clu;
265 	unsigned char flags;
266 	/*
267 	 * the copy of low 32bit of i_version to check
268 	 * the validation of hint_stat.
269 	 */
270 	unsigned int version;
271 
272 	/* hint for cluster last accessed */
273 	struct exfat_hint hint_bmap;
274 	/* hint for entry index we try to lookup next time */
275 	struct exfat_hint hint_stat;
276 	/* hint for first empty entry */
277 	struct exfat_hint_femp hint_femp;
278 
279 	spinlock_t cache_lru_lock;
280 	struct list_head cache_lru;
281 	int nr_caches;
282 	/* for avoiding the race between alloc and free */
283 	unsigned int cache_valid_id;
284 
285 	/*
286 	 * NOTE: i_size_ondisk is 64bits, so must hold ->inode_lock to access.
287 	 * physically allocated size.
288 	 */
289 	loff_t i_size_ondisk;
290 	/* block-aligned i_size (used in cont_write_begin) */
291 	loff_t i_size_aligned;
292 	/* on-disk position of directory entry or 0 */
293 	loff_t i_pos;
294 	/* hash by i_location */
295 	struct hlist_node i_hash_fat;
296 	/* protect bmap against truncate */
297 	struct rw_semaphore truncate_lock;
298 	struct inode vfs_inode;
299 	/* File creation time */
300 	struct timespec64 i_crtime;
301 };
302 
EXFAT_SB(struct super_block * sb)303 static inline struct exfat_sb_info *EXFAT_SB(struct super_block *sb)
304 {
305 	return sb->s_fs_info;
306 }
307 
EXFAT_I(struct inode * inode)308 static inline struct exfat_inode_info *EXFAT_I(struct inode *inode)
309 {
310 	return container_of(inode, struct exfat_inode_info, vfs_inode);
311 }
312 
313 /*
314  * If ->i_mode can't hold 0222 (i.e. ATTR_RO), we use ->i_attrs to
315  * save ATTR_RO instead of ->i_mode.
316  *
317  * If it's directory and !sbi->options.rodir, ATTR_RO isn't read-only
318  * bit, it's just used as flag for app.
319  */
exfat_mode_can_hold_ro(struct inode * inode)320 static inline int exfat_mode_can_hold_ro(struct inode *inode)
321 {
322 	struct exfat_sb_info *sbi = EXFAT_SB(inode->i_sb);
323 
324 	if (S_ISDIR(inode->i_mode))
325 		return 0;
326 
327 	if ((~sbi->options.fs_fmask) & 0222)
328 		return 1;
329 	return 0;
330 }
331 
332 /* Convert attribute bits and a mask to the UNIX mode. */
exfat_make_mode(struct exfat_sb_info * sbi,unsigned short attr,mode_t mode)333 static inline mode_t exfat_make_mode(struct exfat_sb_info *sbi,
334 		unsigned short attr, mode_t mode)
335 {
336 	if ((attr & ATTR_READONLY) && !(attr & ATTR_SUBDIR))
337 		mode &= ~0222;
338 
339 	if (attr & ATTR_SUBDIR)
340 		return (mode & ~sbi->options.fs_dmask) | S_IFDIR;
341 
342 	return (mode & ~sbi->options.fs_fmask) | S_IFREG;
343 }
344 
345 /* Return the FAT attribute byte for this inode */
exfat_make_attr(struct inode * inode)346 static inline unsigned short exfat_make_attr(struct inode *inode)
347 {
348 	unsigned short attr = EXFAT_I(inode)->attr;
349 
350 	if (S_ISDIR(inode->i_mode))
351 		attr |= ATTR_SUBDIR;
352 	if (exfat_mode_can_hold_ro(inode) && !(inode->i_mode & 0222))
353 		attr |= ATTR_READONLY;
354 	return attr;
355 }
356 
exfat_save_attr(struct inode * inode,unsigned short attr)357 static inline void exfat_save_attr(struct inode *inode, unsigned short attr)
358 {
359 	if (exfat_mode_can_hold_ro(inode))
360 		EXFAT_I(inode)->attr = attr & (ATTR_RWMASK | ATTR_READONLY);
361 	else
362 		EXFAT_I(inode)->attr = attr & ATTR_RWMASK;
363 }
364 
exfat_is_last_sector_in_cluster(struct exfat_sb_info * sbi,sector_t sec)365 static inline bool exfat_is_last_sector_in_cluster(struct exfat_sb_info *sbi,
366 		sector_t sec)
367 {
368 	return ((sec - sbi->data_start_sector + 1) &
369 		((1 << sbi->sect_per_clus_bits) - 1)) == 0;
370 }
371 
exfat_cluster_to_sector(struct exfat_sb_info * sbi,unsigned int clus)372 static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
373 		unsigned int clus)
374 {
375 	return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) +
376 		sbi->data_start_sector;
377 }
378 
exfat_sector_to_cluster(struct exfat_sb_info * sbi,sector_t sec)379 static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
380 		sector_t sec)
381 {
382 	return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) +
383 		EXFAT_RESERVED_CLUSTERS;
384 }
385 
is_valid_cluster(struct exfat_sb_info * sbi,unsigned int clus)386 static inline bool is_valid_cluster(struct exfat_sb_info *sbi,
387 		unsigned int clus)
388 {
389 	if (clus < EXFAT_FIRST_CLUSTER || sbi->num_clusters <= clus)
390 		return false;
391 	return true;
392 }
393 
394 /* super.c */
395 int exfat_set_volume_dirty(struct super_block *sb);
396 int exfat_clear_volume_dirty(struct super_block *sb);
397 
398 /* fatent.c */
399 #define exfat_get_next_cluster(sb, pclu) exfat_ent_get(sb, *(pclu), pclu)
400 
401 int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
402 		struct exfat_chain *p_chain, bool sync_bmap);
403 int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain);
404 int exfat_ent_get(struct super_block *sb, unsigned int loc,
405 		unsigned int *content);
406 int exfat_ent_set(struct super_block *sb, unsigned int loc,
407 		unsigned int content);
408 int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
409 		int entry, struct exfat_dentry *p_entry);
410 int exfat_chain_cont_cluster(struct super_block *sb, unsigned int chain,
411 		unsigned int len);
412 int exfat_zeroed_cluster(struct inode *dir, unsigned int clu);
413 int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_chain,
414 		unsigned int *ret_clu);
415 int exfat_count_num_clusters(struct super_block *sb,
416 		struct exfat_chain *p_chain, unsigned int *ret_count);
417 
418 /* balloc.c */
419 int exfat_load_bitmap(struct super_block *sb);
420 void exfat_free_bitmap(struct exfat_sb_info *sbi);
421 int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync);
422 void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync);
423 unsigned int exfat_find_free_bitmap(struct super_block *sb, unsigned int clu);
424 int exfat_count_used_clusters(struct super_block *sb, unsigned int *ret_count);
425 
426 /* file.c */
427 extern const struct file_operations exfat_file_operations;
428 int __exfat_truncate(struct inode *inode, loff_t new_size);
429 void exfat_truncate(struct inode *inode, loff_t size);
430 int exfat_setattr(struct dentry *dentry, struct iattr *attr);
431 int exfat_getattr(const struct path *path, struct kstat *stat,
432 		unsigned int request_mask, unsigned int query_flags);
433 int exfat_file_fsync(struct file *file, loff_t start, loff_t end, int datasync);
434 
435 /* namei.c */
436 extern const struct dentry_operations exfat_dentry_ops;
437 extern const struct dentry_operations exfat_utf8_dentry_ops;
438 
439 /* cache.c */
440 int exfat_cache_init(void);
441 void exfat_cache_shutdown(void);
442 void exfat_cache_inval_inode(struct inode *inode);
443 int exfat_get_cluster(struct inode *inode, unsigned int cluster,
444 		unsigned int *fclus, unsigned int *dclus,
445 		unsigned int *last_dclus, int allow_eof);
446 
447 /* dir.c */
448 extern const struct inode_operations exfat_dir_inode_operations;
449 extern const struct file_operations exfat_dir_operations;
450 unsigned int exfat_get_entry_type(struct exfat_dentry *p_entry);
451 int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
452 		int entry, unsigned int type, unsigned int start_clu,
453 		unsigned long long size);
454 int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
455 		int entry, int num_entries, struct exfat_uni_name *p_uniname);
456 int exfat_remove_entries(struct inode *inode, struct exfat_chain *p_dir,
457 		int entry, int order, int num_entries);
458 int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
459 		int entry);
460 void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es);
461 int exfat_calc_num_entries(struct exfat_uni_name *p_uniname);
462 int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
463 		struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
464 		int num_entries, unsigned int type, struct exfat_hint *hint_opt);
465 int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu);
466 int exfat_find_location(struct super_block *sb, struct exfat_chain *p_dir,
467 		int entry, sector_t *sector, int *offset);
468 struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
469 		struct exfat_chain *p_dir, int entry, struct buffer_head **bh,
470 		sector_t *sector);
471 struct exfat_dentry *exfat_get_dentry_cached(struct exfat_entry_set_cache *es,
472 		int num);
473 struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
474 		struct exfat_chain *p_dir, int entry, unsigned int type);
475 int exfat_free_dentry_set(struct exfat_entry_set_cache *es, int sync);
476 int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir);
477 
478 /* inode.c */
479 extern const struct inode_operations exfat_file_inode_operations;
480 void exfat_sync_inode(struct inode *inode);
481 struct inode *exfat_build_inode(struct super_block *sb,
482 		struct exfat_dir_entry *info, loff_t i_pos);
483 void exfat_hash_inode(struct inode *inode, loff_t i_pos);
484 void exfat_unhash_inode(struct inode *inode);
485 struct inode *exfat_iget(struct super_block *sb, loff_t i_pos);
486 int exfat_write_inode(struct inode *inode, struct writeback_control *wbc);
487 void exfat_evict_inode(struct inode *inode);
488 int exfat_block_truncate_page(struct inode *inode, loff_t from);
489 
490 /* exfat/nls.c */
491 unsigned short exfat_toupper(struct super_block *sb, unsigned short a);
492 int exfat_uniname_ncmp(struct super_block *sb, unsigned short *a,
493 		unsigned short *b, unsigned int len);
494 int exfat_utf16_to_nls(struct super_block *sb,
495 		struct exfat_uni_name *uniname, unsigned char *p_cstring,
496 		int len);
497 int exfat_nls_to_utf16(struct super_block *sb,
498 		const unsigned char *p_cstring, const int len,
499 		struct exfat_uni_name *uniname, int *p_lossy);
500 int exfat_create_upcase_table(struct super_block *sb);
501 void exfat_free_upcase_table(struct exfat_sb_info *sbi);
502 
503 /* exfat/misc.c */
504 void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
505 		__printf(3, 4) __cold;
506 #define exfat_fs_error(sb, fmt, args...)          \
507 		__exfat_fs_error(sb, 1, fmt, ## args)
508 #define exfat_fs_error_ratelimit(sb, fmt, args...) \
509 		__exfat_fs_error(sb, __ratelimit(&EXFAT_SB(sb)->ratelimit), \
510 		fmt, ## args)
511 void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, ...)
512 		__printf(3, 4) __cold;
513 #define exfat_err(sb, fmt, ...)						\
514 	exfat_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__)
515 #define exfat_warn(sb, fmt, ...)					\
516 	exfat_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__)
517 #define exfat_info(sb, fmt, ...)					\
518 	exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
519 
520 void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
521 		u8 tz, __le16 time, __le16 date, u8 time_cs);
522 void exfat_truncate_atime(struct timespec64 *ts);
523 void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
524 		u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
525 u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type);
526 u32 exfat_calc_chksum32(void *data, int len, u32 chksum, int type);
527 void exfat_update_bh(struct buffer_head *bh, int sync);
528 int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync);
529 void exfat_chain_set(struct exfat_chain *ec, unsigned int dir,
530 		unsigned int size, unsigned char flags);
531 void exfat_chain_dup(struct exfat_chain *dup, struct exfat_chain *ec);
532 
533 #endif /* !_EXFAT_FS_H */
534