Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
0004  */
0005 
0006 #ifndef _EXFAT_FS_H
0007 #define _EXFAT_FS_H
0008 
0009 #include <linux/fs.h>
0010 #include <linux/ratelimit.h>
0011 #include <linux/nls.h>
0012 
0013 #define EXFAT_ROOT_INO      1
0014 
0015 #define EXFAT_CLUSTERS_UNTRACKED (~0u)
0016 
0017 /*
0018  * exfat error flags
0019  */
0020 enum exfat_error_mode {
0021     EXFAT_ERRORS_CONT,  /* ignore error and continue */
0022     EXFAT_ERRORS_PANIC, /* panic on error */
0023     EXFAT_ERRORS_RO,    /* remount r/o on error */
0024 };
0025 
0026 /*
0027  * exfat nls lossy flag
0028  */
0029 enum {
0030     NLS_NAME_NO_LOSSY = 0,  /* no lossy */
0031     NLS_NAME_LOSSY =    1 << 0, /* just detected incorrect filename(s) */
0032     NLS_NAME_OVERLEN =  1 << 1, /* the length is over than its limit */
0033 };
0034 
0035 #define EXFAT_HASH_BITS     8
0036 #define EXFAT_HASH_SIZE     (1UL << EXFAT_HASH_BITS)
0037 
0038 /*
0039  * Type Definitions
0040  */
0041 #define ES_2_ENTRIES        2
0042 #define ES_ALL_ENTRIES      0
0043 
0044 #define DIR_DELETED     0xFFFF0321
0045 
0046 /* type values */
0047 #define TYPE_UNUSED     0x0000
0048 #define TYPE_DELETED        0x0001
0049 #define TYPE_INVALID        0x0002
0050 #define TYPE_CRITICAL_PRI   0x0100
0051 #define TYPE_BITMAP     0x0101
0052 #define TYPE_UPCASE     0x0102
0053 #define TYPE_VOLUME     0x0103
0054 #define TYPE_DIR        0x0104
0055 #define TYPE_FILE       0x011F
0056 #define TYPE_CRITICAL_SEC   0x0200
0057 #define TYPE_STREAM     0x0201
0058 #define TYPE_EXTEND     0x0202
0059 #define TYPE_ACL        0x0203
0060 #define TYPE_BENIGN_PRI     0x0400
0061 #define TYPE_GUID       0x0401
0062 #define TYPE_PADDING        0x0402
0063 #define TYPE_ACLTAB     0x0403
0064 #define TYPE_BENIGN_SEC     0x0800
0065 #define TYPE_ALL        0x0FFF
0066 
0067 #define MAX_CHARSET_SIZE    6 /* max size of multi-byte character */
0068 #define MAX_NAME_LENGTH     255 /* max len of file name excluding NULL */
0069 #define MAX_VFSNAME_BUF_SIZE    ((MAX_NAME_LENGTH + 1) * MAX_CHARSET_SIZE)
0070 
0071 /* Enough size to hold 256 dentry (even 512 Byte sector) */
0072 #define DIR_CACHE_SIZE      (256*sizeof(struct exfat_dentry)/512+1)
0073 
0074 #define EXFAT_HINT_NONE     -1
0075 #define EXFAT_MIN_SUBDIR    2
0076 
0077 /*
0078  * helpers for cluster size to byte conversion.
0079  */
0080 #define EXFAT_CLU_TO_B(b, sbi)      ((b) << (sbi)->cluster_size_bits)
0081 #define EXFAT_B_TO_CLU(b, sbi)      ((b) >> (sbi)->cluster_size_bits)
0082 #define EXFAT_B_TO_CLU_ROUND_UP(b, sbi) \
0083     (((b - 1) >> (sbi)->cluster_size_bits) + 1)
0084 #define EXFAT_CLU_OFFSET(off, sbi)  ((off) & ((sbi)->cluster_size - 1))
0085 
0086 /*
0087  * helpers for block size to byte conversion.
0088  */
0089 #define EXFAT_BLK_TO_B(b, sb)       ((b) << (sb)->s_blocksize_bits)
0090 #define EXFAT_B_TO_BLK(b, sb)       ((b) >> (sb)->s_blocksize_bits)
0091 #define EXFAT_B_TO_BLK_ROUND_UP(b, sb)  \
0092     (((b - 1) >> (sb)->s_blocksize_bits) + 1)
0093 #define EXFAT_BLK_OFFSET(off, sb)   ((off) & ((sb)->s_blocksize - 1))
0094 
0095 /*
0096  * helpers for block size to dentry size conversion.
0097  */
0098 #define EXFAT_B_TO_DEN_IDX(b, sbi)  \
0099     ((b) << ((sbi)->cluster_size_bits - DENTRY_SIZE_BITS))
0100 #define EXFAT_B_TO_DEN(b)       ((b) >> DENTRY_SIZE_BITS)
0101 #define EXFAT_DEN_TO_B(b)       ((b) << DENTRY_SIZE_BITS)
0102 
0103 /*
0104  * helpers for fat entry.
0105  */
0106 #define FAT_ENT_SIZE (4)
0107 #define FAT_ENT_SIZE_BITS (2)
0108 #define FAT_ENT_OFFSET_SECTOR(sb, loc) (EXFAT_SB(sb)->FAT1_start_sector + \
0109     (((u64)loc << FAT_ENT_SIZE_BITS) >> sb->s_blocksize_bits))
0110 #define FAT_ENT_OFFSET_BYTE_IN_SECTOR(sb, loc)  \
0111     ((loc << FAT_ENT_SIZE_BITS) & (sb->s_blocksize - 1))
0112 
0113 /*
0114  * helpers for bitmap.
0115  */
0116 #define CLUSTER_TO_BITMAP_ENT(clu) ((clu) - EXFAT_RESERVED_CLUSTERS)
0117 #define BITMAP_ENT_TO_CLUSTER(ent) ((ent) + EXFAT_RESERVED_CLUSTERS)
0118 #define BITS_PER_SECTOR(sb) ((sb)->s_blocksize * BITS_PER_BYTE)
0119 #define BITS_PER_SECTOR_MASK(sb) (BITS_PER_SECTOR(sb) - 1)
0120 #define BITMAP_OFFSET_SECTOR_INDEX(sb, ent) \
0121     ((ent / BITS_PER_BYTE) >> (sb)->s_blocksize_bits)
0122 #define BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent) (ent & BITS_PER_SECTOR_MASK(sb))
0123 #define BITMAP_OFFSET_BYTE_IN_SECTOR(sb, ent) \
0124     ((ent / BITS_PER_BYTE) & ((sb)->s_blocksize - 1))
0125 #define BITS_PER_BYTE_MASK  0x7
0126 #define IGNORED_BITS_REMAINED(clu, clu_base) ((1 << ((clu) - (clu_base))) - 1)
0127 
0128 struct exfat_dentry_namebuf {
0129     char *lfn;
0130     int lfnbuf_len; /* usually MAX_UNINAME_BUF_SIZE */
0131 };
0132 
0133 /* unicode name structure */
0134 struct exfat_uni_name {
0135     /* +3 for null and for converting */
0136     unsigned short name[MAX_NAME_LENGTH + 3];
0137     u16 name_hash;
0138     unsigned char name_len;
0139 };
0140 
0141 /* directory structure */
0142 struct exfat_chain {
0143     unsigned int dir;
0144     unsigned int size;
0145     unsigned char flags;
0146 };
0147 
0148 /* first empty entry hint information */
0149 struct exfat_hint_femp {
0150     /* entry index of a directory */
0151     int eidx;
0152     /* count of continuous empty entry */
0153     int count;
0154     /* the cluster that first empty slot exists in */
0155     struct exfat_chain cur;
0156 };
0157 
0158 /* hint structure */
0159 struct exfat_hint {
0160     unsigned int clu;
0161     union {
0162         unsigned int off; /* cluster offset */
0163         int eidx; /* entry index */
0164     };
0165 };
0166 
0167 struct exfat_entry_set_cache {
0168     struct super_block *sb;
0169     bool modified;
0170     unsigned int start_off;
0171     int num_bh;
0172     struct buffer_head *bh[DIR_CACHE_SIZE];
0173     unsigned int num_entries;
0174 };
0175 
0176 struct exfat_dir_entry {
0177     struct exfat_chain dir;
0178     int entry;
0179     unsigned int type;
0180     unsigned int start_clu;
0181     unsigned char flags;
0182     unsigned short attr;
0183     loff_t size;
0184     unsigned int num_subdirs;
0185     struct timespec64 atime;
0186     struct timespec64 mtime;
0187     struct timespec64 crtime;
0188     struct exfat_dentry_namebuf namebuf;
0189 };
0190 
0191 /*
0192  * exfat mount in-memory data
0193  */
0194 struct exfat_mount_options {
0195     kuid_t fs_uid;
0196     kgid_t fs_gid;
0197     unsigned short fs_fmask;
0198     unsigned short fs_dmask;
0199     /* permission for setting the [am]time */
0200     unsigned short allow_utime;
0201     /* charset for filename input/display */
0202     char *iocharset;
0203     /* on error: continue, panic, remount-ro */
0204     enum exfat_error_mode errors;
0205     unsigned utf8:1, /* Use of UTF-8 character set */
0206          sys_tz:1, /* Use local timezone */
0207          discard:1, /* Issue discard requests on deletions */
0208          keep_last_dots:1; /* Keep trailing periods in paths */
0209     int time_offset; /* Offset of timestamps from UTC (in minutes) */
0210 };
0211 
0212 /*
0213  * EXFAT file system superblock in-memory data
0214  */
0215 struct exfat_sb_info {
0216     unsigned long long num_sectors; /* num of sectors in volume */
0217     unsigned int num_clusters; /* num of clusters in volume */
0218     unsigned int cluster_size; /* cluster size in bytes */
0219     unsigned int cluster_size_bits;
0220     unsigned int sect_per_clus; /* cluster size in sectors */
0221     unsigned int sect_per_clus_bits;
0222     unsigned long long FAT1_start_sector; /* FAT1 start sector */
0223     unsigned long long FAT2_start_sector; /* FAT2 start sector */
0224     unsigned long long data_start_sector; /* data area start sector */
0225     unsigned int num_FAT_sectors; /* num of FAT sectors */
0226     unsigned int root_dir; /* root dir cluster */
0227     unsigned int dentries_per_clu; /* num of dentries per cluster */
0228     unsigned int vol_flags; /* volume flags */
0229     unsigned int vol_flags_persistent; /* volume flags to retain */
0230     struct buffer_head *boot_bh; /* buffer_head of BOOT sector */
0231 
0232     unsigned int map_clu; /* allocation bitmap start cluster */
0233     unsigned int map_sectors; /* num of allocation bitmap sectors */
0234     struct buffer_head **vol_amap; /* allocation bitmap */
0235 
0236     unsigned short *vol_utbl; /* upcase table */
0237 
0238     unsigned int clu_srch_ptr; /* cluster search pointer */
0239     unsigned int used_clusters; /* number of used clusters */
0240 
0241     struct mutex s_lock; /* superblock lock */
0242     struct mutex bitmap_lock; /* bitmap lock */
0243     struct exfat_mount_options options;
0244     struct nls_table *nls_io; /* Charset used for input and display */
0245     struct ratelimit_state ratelimit;
0246 
0247     spinlock_t inode_hash_lock;
0248     struct hlist_head inode_hashtable[EXFAT_HASH_SIZE];
0249 
0250     struct rcu_head rcu;
0251 };
0252 
0253 #define EXFAT_CACHE_VALID   0
0254 
0255 /*
0256  * EXFAT file system inode in-memory data
0257  */
0258 struct exfat_inode_info {
0259     struct exfat_chain dir;
0260     int entry;
0261     unsigned int type;
0262     unsigned short attr;
0263     unsigned int start_clu;
0264     unsigned char flags;
0265     /*
0266      * the copy of low 32bit of i_version to check
0267      * the validation of hint_stat.
0268      */
0269     unsigned int version;
0270 
0271     /* hint for cluster last accessed */
0272     struct exfat_hint hint_bmap;
0273     /* hint for entry index we try to lookup next time */
0274     struct exfat_hint hint_stat;
0275     /* hint for first empty entry */
0276     struct exfat_hint_femp hint_femp;
0277 
0278     spinlock_t cache_lru_lock;
0279     struct list_head cache_lru;
0280     int nr_caches;
0281     /* for avoiding the race between alloc and free */
0282     unsigned int cache_valid_id;
0283 
0284     /*
0285      * NOTE: i_size_ondisk is 64bits, so must hold ->inode_lock to access.
0286      * physically allocated size.
0287      */
0288     loff_t i_size_ondisk;
0289     /* block-aligned i_size (used in cont_write_begin) */
0290     loff_t i_size_aligned;
0291     /* on-disk position of directory entry or 0 */
0292     loff_t i_pos;
0293     /* hash by i_location */
0294     struct hlist_node i_hash_fat;
0295     /* protect bmap against truncate */
0296     struct rw_semaphore truncate_lock;
0297     struct inode vfs_inode;
0298     /* File creation time */
0299     struct timespec64 i_crtime;
0300 };
0301 
0302 static inline struct exfat_sb_info *EXFAT_SB(struct super_block *sb)
0303 {
0304     return sb->s_fs_info;
0305 }
0306 
0307 static inline struct exfat_inode_info *EXFAT_I(struct inode *inode)
0308 {
0309     return container_of(inode, struct exfat_inode_info, vfs_inode);
0310 }
0311 
0312 /*
0313  * If ->i_mode can't hold 0222 (i.e. ATTR_RO), we use ->i_attrs to
0314  * save ATTR_RO instead of ->i_mode.
0315  *
0316  * If it's directory and !sbi->options.rodir, ATTR_RO isn't read-only
0317  * bit, it's just used as flag for app.
0318  */
0319 static inline int exfat_mode_can_hold_ro(struct inode *inode)
0320 {
0321     struct exfat_sb_info *sbi = EXFAT_SB(inode->i_sb);
0322 
0323     if (S_ISDIR(inode->i_mode))
0324         return 0;
0325 
0326     if ((~sbi->options.fs_fmask) & 0222)
0327         return 1;
0328     return 0;
0329 }
0330 
0331 /* Convert attribute bits and a mask to the UNIX mode. */
0332 static inline mode_t exfat_make_mode(struct exfat_sb_info *sbi,
0333         unsigned short attr, mode_t mode)
0334 {
0335     if ((attr & ATTR_READONLY) && !(attr & ATTR_SUBDIR))
0336         mode &= ~0222;
0337 
0338     if (attr & ATTR_SUBDIR)
0339         return (mode & ~sbi->options.fs_dmask) | S_IFDIR;
0340 
0341     return (mode & ~sbi->options.fs_fmask) | S_IFREG;
0342 }
0343 
0344 /* Return the FAT attribute byte for this inode */
0345 static inline unsigned short exfat_make_attr(struct inode *inode)
0346 {
0347     unsigned short attr = EXFAT_I(inode)->attr;
0348 
0349     if (S_ISDIR(inode->i_mode))
0350         attr |= ATTR_SUBDIR;
0351     if (exfat_mode_can_hold_ro(inode) && !(inode->i_mode & 0222))
0352         attr |= ATTR_READONLY;
0353     return attr;
0354 }
0355 
0356 static inline void exfat_save_attr(struct inode *inode, unsigned short attr)
0357 {
0358     if (exfat_mode_can_hold_ro(inode))
0359         EXFAT_I(inode)->attr = attr & (ATTR_RWMASK | ATTR_READONLY);
0360     else
0361         EXFAT_I(inode)->attr = attr & ATTR_RWMASK;
0362 }
0363 
0364 static inline bool exfat_is_last_sector_in_cluster(struct exfat_sb_info *sbi,
0365         sector_t sec)
0366 {
0367     return ((sec - sbi->data_start_sector + 1) &
0368         ((1 << sbi->sect_per_clus_bits) - 1)) == 0;
0369 }
0370 
0371 static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
0372         unsigned int clus)
0373 {
0374     return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) +
0375         sbi->data_start_sector;
0376 }
0377 
0378 static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
0379         sector_t sec)
0380 {
0381     return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) +
0382         EXFAT_RESERVED_CLUSTERS;
0383 }
0384 
0385 static inline bool is_valid_cluster(struct exfat_sb_info *sbi,
0386         unsigned int clus)
0387 {
0388     return clus >= EXFAT_FIRST_CLUSTER && clus < sbi->num_clusters;
0389 }
0390 
0391 /* super.c */
0392 int exfat_set_volume_dirty(struct super_block *sb);
0393 int exfat_clear_volume_dirty(struct super_block *sb);
0394 
0395 /* fatent.c */
0396 #define exfat_get_next_cluster(sb, pclu) exfat_ent_get(sb, *(pclu), pclu)
0397 
0398 int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
0399         struct exfat_chain *p_chain, bool sync_bmap);
0400 int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain);
0401 int exfat_ent_get(struct super_block *sb, unsigned int loc,
0402         unsigned int *content);
0403 int exfat_ent_set(struct super_block *sb, unsigned int loc,
0404         unsigned int content);
0405 int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
0406         int entry, struct exfat_dentry *p_entry);
0407 int exfat_chain_cont_cluster(struct super_block *sb, unsigned int chain,
0408         unsigned int len);
0409 int exfat_zeroed_cluster(struct inode *dir, unsigned int clu);
0410 int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_chain,
0411         unsigned int *ret_clu);
0412 int exfat_count_num_clusters(struct super_block *sb,
0413         struct exfat_chain *p_chain, unsigned int *ret_count);
0414 
0415 /* balloc.c */
0416 int exfat_load_bitmap(struct super_block *sb);
0417 void exfat_free_bitmap(struct exfat_sb_info *sbi);
0418 int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync);
0419 void exfat_clear_bitmap(struct inode *inode, unsigned int clu, bool sync);
0420 unsigned int exfat_find_free_bitmap(struct super_block *sb, unsigned int clu);
0421 int exfat_count_used_clusters(struct super_block *sb, unsigned int *ret_count);
0422 int exfat_trim_fs(struct inode *inode, struct fstrim_range *range);
0423 
0424 /* file.c */
0425 extern const struct file_operations exfat_file_operations;
0426 int __exfat_truncate(struct inode *inode, loff_t new_size);
0427 void exfat_truncate(struct inode *inode, loff_t size);
0428 int exfat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
0429           struct iattr *attr);
0430 int exfat_getattr(struct user_namespace *mnt_userns, const struct path *path,
0431           struct kstat *stat, unsigned int request_mask,
0432           unsigned int query_flags);
0433 int exfat_file_fsync(struct file *file, loff_t start, loff_t end, int datasync);
0434 long exfat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
0435 long exfat_compat_ioctl(struct file *filp, unsigned int cmd,
0436                 unsigned long arg);
0437 
0438 /* namei.c */
0439 extern const struct dentry_operations exfat_dentry_ops;
0440 extern const struct dentry_operations exfat_utf8_dentry_ops;
0441 
0442 /* cache.c */
0443 int exfat_cache_init(void);
0444 void exfat_cache_shutdown(void);
0445 void exfat_cache_inval_inode(struct inode *inode);
0446 int exfat_get_cluster(struct inode *inode, unsigned int cluster,
0447         unsigned int *fclus, unsigned int *dclus,
0448         unsigned int *last_dclus, int allow_eof);
0449 
0450 /* dir.c */
0451 extern const struct inode_operations exfat_dir_inode_operations;
0452 extern const struct file_operations exfat_dir_operations;
0453 unsigned int exfat_get_entry_type(struct exfat_dentry *p_entry);
0454 int exfat_init_dir_entry(struct inode *inode, struct exfat_chain *p_dir,
0455         int entry, unsigned int type, unsigned int start_clu,
0456         unsigned long long size);
0457 int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
0458         int entry, int num_entries, struct exfat_uni_name *p_uniname);
0459 int exfat_remove_entries(struct inode *inode, struct exfat_chain *p_dir,
0460         int entry, int order, int num_entries);
0461 int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
0462         int entry);
0463 void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es);
0464 int exfat_calc_num_entries(struct exfat_uni_name *p_uniname);
0465 int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
0466         struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
0467         int num_entries, unsigned int type, struct exfat_hint *hint_opt);
0468 int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu);
0469 struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
0470         struct exfat_chain *p_dir, int entry, struct buffer_head **bh);
0471 struct exfat_dentry *exfat_get_dentry_cached(struct exfat_entry_set_cache *es,
0472         int num);
0473 struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb,
0474         struct exfat_chain *p_dir, int entry, unsigned int type);
0475 int exfat_free_dentry_set(struct exfat_entry_set_cache *es, int sync);
0476 int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir);
0477 
0478 /* inode.c */
0479 extern const struct inode_operations exfat_file_inode_operations;
0480 void exfat_sync_inode(struct inode *inode);
0481 struct inode *exfat_build_inode(struct super_block *sb,
0482         struct exfat_dir_entry *info, loff_t i_pos);
0483 void exfat_hash_inode(struct inode *inode, loff_t i_pos);
0484 void exfat_unhash_inode(struct inode *inode);
0485 struct inode *exfat_iget(struct super_block *sb, loff_t i_pos);
0486 int __exfat_write_inode(struct inode *inode, int sync);
0487 int exfat_write_inode(struct inode *inode, struct writeback_control *wbc);
0488 void exfat_evict_inode(struct inode *inode);
0489 int exfat_block_truncate_page(struct inode *inode, loff_t from);
0490 
0491 /* exfat/nls.c */
0492 unsigned short exfat_toupper(struct super_block *sb, unsigned short a);
0493 int exfat_uniname_ncmp(struct super_block *sb, unsigned short *a,
0494         unsigned short *b, unsigned int len);
0495 int exfat_utf16_to_nls(struct super_block *sb,
0496         struct exfat_uni_name *uniname, unsigned char *p_cstring,
0497         int len);
0498 int exfat_nls_to_utf16(struct super_block *sb,
0499         const unsigned char *p_cstring, const int len,
0500         struct exfat_uni_name *uniname, int *p_lossy);
0501 int exfat_create_upcase_table(struct super_block *sb);
0502 void exfat_free_upcase_table(struct exfat_sb_info *sbi);
0503 
0504 /* exfat/misc.c */
0505 void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
0506         __printf(3, 4) __cold;
0507 #define exfat_fs_error(sb, fmt, args...)          \
0508         __exfat_fs_error(sb, 1, fmt, ## args)
0509 #define exfat_fs_error_ratelimit(sb, fmt, args...) \
0510         __exfat_fs_error(sb, __ratelimit(&EXFAT_SB(sb)->ratelimit), \
0511         fmt, ## args)
0512 
0513 /* expand to pr_*() with prefix */
0514 #define exfat_err(sb, fmt, ...)                     \
0515     pr_err("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__)
0516 #define exfat_warn(sb, fmt, ...)                    \
0517     pr_warn("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__)
0518 #define exfat_info(sb, fmt, ...)                    \
0519     pr_info("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__)
0520 #define exfat_debug(sb, fmt, ...)                   \
0521     pr_debug("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__)
0522 
0523 void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
0524         u8 tz, __le16 time, __le16 date, u8 time_cs);
0525 void exfat_truncate_atime(struct timespec64 *ts);
0526 void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
0527         u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
0528 u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type);
0529 u32 exfat_calc_chksum32(void *data, int len, u32 chksum, int type);
0530 void exfat_update_bh(struct buffer_head *bh, int sync);
0531 int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync);
0532 void exfat_chain_set(struct exfat_chain *ec, unsigned int dir,
0533         unsigned int size, unsigned char flags);
0534 void exfat_chain_dup(struct exfat_chain *dup, struct exfat_chain *ec);
0535 
0536 #endif /* !_EXFAT_FS_H */