#define MAX_CHARSET_SIZE 6 /* max size of multi-byte character */ #define MAX_NAME_LENGTH 255 /* max len of file name excluding NULL */ #define MAX_VFSNAME_BUF_SIZE ((MAX_NAME_LENGTH + 1) * MAX_CHARSET_SIZE)
/* first empty entry hint information */ struct exfat_hint_femp { /* entry index of a directory */ int eidx; /* count of continuous empty entry */ int count; /* the cluster that first empty slot exists in */ struct exfat_chain cur;
};
/* hint structure */ struct exfat_hint { unsignedint clu; union { unsignedint off; /* cluster offset */ int eidx; /* entry index */
};
};
struct exfat_dir_entry { /* the cluster where file dentry is located */ struct exfat_chain dir; /* the index of file dentry in ->dir */ int entry; unsignedint type; unsignedint start_clu; unsignedchar flags; unsignedshort attr;
loff_t size;
loff_t valid_size; unsignedint num_subdirs; struct timespec64 atime; struct timespec64 mtime; struct timespec64 crtime; struct exfat_dentry_namebuf namebuf;
};
/* * exfat mount in-memory data
*/ struct exfat_mount_options {
kuid_t fs_uid;
kgid_t fs_gid; unsignedshort fs_fmask; unsignedshort fs_dmask; /* permission for setting the [am]time */ unsignedshort allow_utime; /* charset for filename input/display */ char *iocharset; /* on error: continue, panic, remount-ro */ enum exfat_error_mode errors; unsigned utf8:1, /* Use of UTF-8 character set */
sys_tz:1, /* Use local timezone */
discard:1, /* Issue discard requests on deletions */
keep_last_dots:1; /* Keep trailing periods in paths */ int time_offset; /* Offset of timestamps from UTC (in minutes) */ /* Support creating zero-size directory, default: false */ bool zero_size_dir;
};
/* * EXFAT file system superblock in-memory data
*/ struct exfat_sb_info { unsignedlonglong num_sectors; /* num of sectors in volume */ unsignedint num_clusters; /* num of clusters in volume */ unsignedint cluster_size; /* cluster size in bytes */ unsignedint cluster_size_bits; unsignedint sect_per_clus; /* cluster size in sectors */ unsignedint sect_per_clus_bits; unsignedlonglong FAT1_start_sector; /* FAT1 start sector */ unsignedlonglong FAT2_start_sector; /* FAT2 start sector */ unsignedlonglong data_start_sector; /* data area start sector */ unsignedint num_FAT_sectors; /* num of FAT sectors */ unsignedint root_dir; /* root dir cluster */ unsignedint dentries_per_clu; /* num of dentries per cluster */ unsignedint vol_flags; /* volume flags */ unsignedint vol_flags_persistent; /* volume flags to retain */ struct buffer_head *boot_bh; /* buffer_head of BOOT sector */
/* * EXFAT file system inode in-memory data
*/ struct exfat_inode_info { /* the cluster where file dentry is located */ struct exfat_chain dir; /* the index of file dentry in ->dir */ int entry; unsignedint type; unsignedshort attr; unsignedint start_clu; unsignedchar flags; /* * the copy of low 32bit of i_version to check * the validation of hint_stat.
*/ unsignedint version;
/* hint for cluster last accessed */ struct exfat_hint hint_bmap; /* hint for entry index we try to lookup next time */ struct exfat_hint hint_stat; /* hint for first empty entry */ struct exfat_hint_femp hint_femp;
spinlock_t cache_lru_lock; struct list_head cache_lru; int nr_caches; /* for avoiding the race between alloc and free */ unsignedint cache_valid_id;
/* on-disk position of directory entry or 0 */
loff_t i_pos;
loff_t valid_size; /* hash by i_location */ struct hlist_node i_hash_fat; /* protect bmap against truncate */ struct rw_semaphore truncate_lock; struct inode vfs_inode; /* File creation time */ struct timespec64 i_crtime;
};
/* * If ->i_mode can't hold 0222 (i.e. ATTR_RO), we use ->i_attrs to * save ATTR_RO instead of ->i_mode. * * If it's directory and !sbi->options.rodir, ATTR_RO isn't read-only * bit, it's just used as flag for app.
*/ staticinlineint exfat_mode_can_hold_ro(struct inode *inode)
{ struct exfat_sb_info *sbi = EXFAT_SB(inode->i_sb);
if (S_ISDIR(inode->i_mode)) return 0;
if ((~sbi->options.fs_fmask) & 0222) return 1; return 0;
}
/* Convert attribute bits and a mask to the UNIX mode. */ staticinline mode_t exfat_make_mode(struct exfat_sb_info *sbi, unsignedshort attr, mode_t mode)
{ if ((attr & EXFAT_ATTR_READONLY) && !(attr & EXFAT_ATTR_SUBDIR))
mode &= ~0222;
if (attr & EXFAT_ATTR_SUBDIR) return (mode & ~sbi->options.fs_dmask) | S_IFDIR;
void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
u8 tz, __le16 time, __le16 date, u8 time_cs); void exfat_truncate_atime(struct timespec64 *ts); void exfat_truncate_inode_atime(struct inode *inode); void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts,
u8 *tz, __le16 *time, __le16 *date, u8 *time_cs);
u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type);
u32 exfat_calc_chksum32(void *data, int len, u32 chksum, int type); void exfat_update_bh(struct buffer_head *bh, int sync); int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync); void exfat_chain_set(struct exfat_chain *ec, unsignedint dir, unsignedint size, unsignedchar flags); void exfat_chain_dup(struct exfat_chain *dup, struct exfat_chain *ec);
#endif/* !_EXFAT_FS_H */
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.