/* * vfat shortname flags
*/ #define VFAT_SFN_DISPLAY_LOWER 0x0001 /* convert to lowercase for display */ #define VFAT_SFN_DISPLAY_WIN95 0x0002 /* emulate win95 rule for display */ #define VFAT_SFN_DISPLAY_WINNT 0x0004 /* emulate winnt rule for display */ #define VFAT_SFN_CREATE_WIN95 0x0100 /* emulate win95 rule for create */ #define VFAT_SFN_CREATE_WINNT 0x0200 /* emulate winnt rule for create */
#define FAT_ERRORS_CONT 1 /* ignore error and continue */ #define FAT_ERRORS_PANIC 2 /* panic on error */ #define FAT_ERRORS_RO 3 /* remount r/o on error */
#define FAT_NFS_STALE_RW 1 /* NFS RW support, can cause ESTALE */ #define FAT_NFS_NOSTALE_RO 2 /* NFS RO support, no ESTALE issue */
struct fat_mount_options {
kuid_t fs_uid;
kgid_t fs_gid; unsignedshort fs_fmask; unsignedshort fs_dmask; unsignedshort codepage; /* Codepage for shortname conversions */ int time_offset; /* Offset of timestamps from UTC (in minutes) */ char *iocharset; /* Charset used for filename input/display */ unsignedshort shortname; /* flags for shortname display/create rule */ unsignedchar name_check; /* r = relaxed, n = normal, s = strict */ unsignedchar errors; /* On error: continue, panic, remount-ro */ unsignedchar nfs; /* NFS support: nostale_ro, stale_rw */ unsignedshort allow_utime;/* permission for setting the [am]time */ unsigned quiet:1, /* set = fake successful chmods and chowns */
showexec:1, /* set = only set x bit for com/exe/bat */
sys_immutable:1, /* set = system files are immutable */
dotsOK:1, /* set = hidden and system files are named '.filename' */
isvfat:1, /* 0=no vfat long filename support, 1=vfat support */
utf8:1, /* Use of UTF-8 character set (Default) */
unicode_xlate:1, /* create escape sequences for unhandled Unicode */
numtail:1, /* Does first alias have a numeric '~1' type tail? */
flush:1, /* write things quickly */
nocase:1, /* Does this need case conversion? 0=need case conversion*/
usefree:1, /* Use free_clusters for FAT32 */
tz_set:1, /* Filesystem timestamps' offset set */
rodir:1, /* allow ATTR_RO for directory */
discard:1, /* Issue discard requests on deletions */
dos1xfloppy:1, /* Assume default BPB for DOS 1.x floppies */
debug:1; /* Not currently used */
};
unsignedint dirty; /* fs state before mount */ struct rcu_head rcu;
};
#define FAT_CACHE_VALID 0 /* special case for valid cache */
/* * MS-DOS file system inode data in memory
*/ struct msdos_inode_info {
spinlock_t cache_lru_lock; struct list_head cache_lru; int nr_caches; /* for avoiding the race between fat_free() and fat_get_cluster() */ unsignedint cache_valid_id;
/* NOTE: mmu_private is 64bits, so must hold ->i_mutex to access */
loff_t mmu_private; /* physically allocated size */
int i_start; /* first cluster or 0 */ int i_logstart; /* logical first cluster */ int i_attrs; /* unused attribute bits */
loff_t i_pos; /* on-disk position of directory entry or 0 */ struct hlist_node i_fat_hash; /* hash by i_location */ struct hlist_node i_dir_hash; /* hash by i_logstart */ struct rw_semaphore truncate_lock; /* protect bmap against truncate */ struct timespec64 i_crtime; /* File creation (birth) time */ struct inode vfs_inode;
};
struct fat_slot_info {
loff_t i_pos; /* on-disk position of directory entry */
loff_t slot_off; /* offset for slot or de start */ int nr_slots; /* number of slots + 1(de) in filename */ struct msdos_dir_entry *de; struct buffer_head *bh;
};
/* * Functions that determine the variant of the FAT file system (i.e., * whether this is FAT12, FAT16 or FAT32.
*/ staticinlinebool is_fat12(conststruct msdos_sb_info *sbi)
{ return sbi->fat_bits == 12;
}
/* * If ->i_mode can't hold S_IWUGO (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 fat_mode_can_hold_ro(struct inode *inode)
{ struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
umode_t mask;
if (S_ISDIR(inode->i_mode)) { if (!sbi->options.rodir) return 0;
mask = ~sbi->options.fs_dmask;
} else
mask = ~sbi->options.fs_fmask;
if (!(mask & S_IWUGO)) return 0; return 1;
}
/* Convert attribute bits and a mask to the UNIX mode. */ staticinline umode_t fat_make_mode(struct msdos_sb_info *sbi,
u8 attrs, umode_t mode)
{ if (attrs & ATTR_RO && !((attrs & ATTR_DIR) && !sbi->options.rodir))
mode &= ~S_IWUGO;
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.