summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-08 00:12:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-08 00:12:44 -0400
commit5abe37954e9a315c35c9490f78d55f307c3c636b (patch)
treefa2034b03b270c48ac516a8fe308654443b4a7e2 /fs/ext4/ext4.h
parente5fef2a9732580c5bd30c0097f5e9091a3d58ce5 (diff)
parentdb90f41916cf04c020062f8d8b0385942248283e (diff)
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o: "Add as a feature case-insensitive directories (the casefold feature) using Unicode 12.1. Also, the usual largish number of cleanups and bug fixes" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (25 commits) ext4: export /sys/fs/ext4/feature/casefold if Unicode support is present ext4: fix ext4_show_options for file systems w/o journal unicode: refactor the rule for regenerating utf8data.h docs: ext4.rst: document case-insensitive directories ext4: Support case-insensitive file name lookups ext4: include charset encoding information in the superblock MAINTAINERS: add Unicode subsystem entry unicode: update unicode database unicode version 12.1.0 unicode: introduce test module for normalized utf8 implementation unicode: implement higher level API for string handling unicode: reduce the size of utf8data[] unicode: introduce code for UTF-8 normalization unicode: introduce UTF-8 character database ext4: actually request zeroing of inode table after grow ext4: cond_resched in work-heavy group loops ext4: fix use-after-free race with debug_want_extra_isize ext4: avoid drop reference to iloc.bh twice ext4: ignore e_value_offs for xattrs with value-in-ea-inode ext4: protect journal inode's blocks using block_validity ext4: use BUG() instead of BUG_ON(1) ...
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0833b5fc0668..ef755e5f6f2f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -399,10 +399,11 @@ struct flex_groups {
399#define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ 399#define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */
400#define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */ 400#define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */
401#define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ 401#define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
402#define EXT4_CASEFOLD_FL 0x40000000 /* Casefolded file */
402#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ 403#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
403 404
404#define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */ 405#define EXT4_FL_USER_VISIBLE 0x704BDFFF /* User visible flags */
405#define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */ 406#define EXT4_FL_USER_MODIFIABLE 0x604BC0FF /* User modifiable flags */
406 407
407/* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */ 408/* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */
408#define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \ 409#define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \
@@ -417,10 +418,10 @@ struct flex_groups {
417 EXT4_SYNC_FL | EXT4_NODUMP_FL | EXT4_NOATIME_FL |\ 418 EXT4_SYNC_FL | EXT4_NODUMP_FL | EXT4_NOATIME_FL |\
418 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\ 419 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\
419 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL |\ 420 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL |\
420 EXT4_PROJINHERIT_FL) 421 EXT4_PROJINHERIT_FL | EXT4_CASEFOLD_FL)
421 422
422/* Flags that are appropriate for regular files (all but dir-specific ones). */ 423/* Flags that are appropriate for regular files (all but dir-specific ones). */
423#define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL)) 424#define EXT4_REG_FLMASK (~(EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL | EXT4_CASEFOLD_FL))
424 425
425/* Flags that are appropriate for non-directories/regular files. */ 426/* Flags that are appropriate for non-directories/regular files. */
426#define EXT4_OTHER_FLMASK (EXT4_NODUMP_FL | EXT4_NOATIME_FL) 427#define EXT4_OTHER_FLMASK (EXT4_NODUMP_FL | EXT4_NOATIME_FL)
@@ -1313,7 +1314,9 @@ struct ext4_super_block {
1313 __u8 s_first_error_time_hi; 1314 __u8 s_first_error_time_hi;
1314 __u8 s_last_error_time_hi; 1315 __u8 s_last_error_time_hi;
1315 __u8 s_pad[2]; 1316 __u8 s_pad[2];
1316 __le32 s_reserved[96]; /* Padding to the end of the block */ 1317 __le16 s_encoding; /* Filename charset encoding */
1318 __le16 s_encoding_flags; /* Filename charset encoding flags */
1319 __le32 s_reserved[95]; /* Padding to the end of the block */
1317 __le32 s_checksum; /* crc32c(superblock) */ 1320 __le32 s_checksum; /* crc32c(superblock) */
1318}; 1321};
1319 1322
@@ -1338,6 +1341,16 @@ struct ext4_super_block {
1338/* Number of quota types we support */ 1341/* Number of quota types we support */
1339#define EXT4_MAXQUOTAS 3 1342#define EXT4_MAXQUOTAS 3
1340 1343
1344#define EXT4_ENC_UTF8_12_1 1
1345
1346/*
1347 * Flags for ext4_sb_info.s_encoding_flags.
1348 */
1349#define EXT4_ENC_STRICT_MODE_FL (1 << 0)
1350
1351#define ext4_has_strict_mode(sbi) \
1352 (sbi->s_encoding_flags & EXT4_ENC_STRICT_MODE_FL)
1353
1341/* 1354/*
1342 * fourth extended-fs super-block data in memory 1355 * fourth extended-fs super-block data in memory
1343 */ 1356 */
@@ -1387,6 +1400,10 @@ struct ext4_sb_info {
1387 struct kobject s_kobj; 1400 struct kobject s_kobj;
1388 struct completion s_kobj_unregister; 1401 struct completion s_kobj_unregister;
1389 struct super_block *s_sb; 1402 struct super_block *s_sb;
1403#ifdef CONFIG_UNICODE
1404 struct unicode_map *s_encoding;
1405 __u16 s_encoding_flags;
1406#endif
1390 1407
1391 /* Journaling */ 1408 /* Journaling */
1392 struct journal_s *s_journal; 1409 struct journal_s *s_journal;
@@ -1592,9 +1609,6 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1592#define EXT4_SB(sb) (sb) 1609#define EXT4_SB(sb) (sb)
1593#endif 1610#endif
1594 1611
1595/*
1596 * Returns true if the inode is inode is encrypted
1597 */
1598#define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime 1612#define NEXT_ORPHAN(inode) EXT4_I(inode)->i_dtime
1599 1613
1600/* 1614/*
@@ -1663,6 +1677,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1663#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ 1677#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */
1664#define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */ 1678#define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */
1665#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 1679#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
1680#define EXT4_FEATURE_INCOMPAT_CASEFOLD 0x20000
1666 1681
1667extern void ext4_update_dynamic_rev(struct super_block *sb); 1682extern void ext4_update_dynamic_rev(struct super_block *sb);
1668 1683
@@ -1756,6 +1771,7 @@ EXT4_FEATURE_INCOMPAT_FUNCS(csum_seed, CSUM_SEED)
1756EXT4_FEATURE_INCOMPAT_FUNCS(largedir, LARGEDIR) 1771EXT4_FEATURE_INCOMPAT_FUNCS(largedir, LARGEDIR)
1757EXT4_FEATURE_INCOMPAT_FUNCS(inline_data, INLINE_DATA) 1772EXT4_FEATURE_INCOMPAT_FUNCS(inline_data, INLINE_DATA)
1758EXT4_FEATURE_INCOMPAT_FUNCS(encrypt, ENCRYPT) 1773EXT4_FEATURE_INCOMPAT_FUNCS(encrypt, ENCRYPT)
1774EXT4_FEATURE_INCOMPAT_FUNCS(casefold, CASEFOLD)
1759 1775
1760#define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR 1776#define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR
1761#define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ 1777#define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
@@ -1783,6 +1799,7 @@ EXT4_FEATURE_INCOMPAT_FUNCS(encrypt, ENCRYPT)
1783 EXT4_FEATURE_INCOMPAT_MMP | \ 1799 EXT4_FEATURE_INCOMPAT_MMP | \
1784 EXT4_FEATURE_INCOMPAT_INLINE_DATA | \ 1800 EXT4_FEATURE_INCOMPAT_INLINE_DATA | \
1785 EXT4_FEATURE_INCOMPAT_ENCRYPT | \ 1801 EXT4_FEATURE_INCOMPAT_ENCRYPT | \
1802 EXT4_FEATURE_INCOMPAT_CASEFOLD | \
1786 EXT4_FEATURE_INCOMPAT_CSUM_SEED | \ 1803 EXT4_FEATURE_INCOMPAT_CSUM_SEED | \
1787 EXT4_FEATURE_INCOMPAT_LARGEDIR) 1804 EXT4_FEATURE_INCOMPAT_LARGEDIR)
1788#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 1805#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
@@ -2376,8 +2393,8 @@ extern int ext4_check_all_de(struct inode *dir, struct buffer_head *bh,
2376extern int ext4_sync_file(struct file *, loff_t, loff_t, int); 2393extern int ext4_sync_file(struct file *, loff_t, loff_t, int);
2377 2394
2378/* hash.c */ 2395/* hash.c */
2379extern int ext4fs_dirhash(const char *name, int len, struct 2396extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
2380 dx_hash_info *hinfo); 2397 struct dx_hash_info *hinfo);
2381 2398
2382/* ialloc.c */ 2399/* ialloc.c */
2383extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t, 2400extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t,
@@ -2973,6 +2990,10 @@ static inline void ext4_unlock_group(struct super_block *sb,
2973/* dir.c */ 2990/* dir.c */
2974extern const struct file_operations ext4_dir_operations; 2991extern const struct file_operations ext4_dir_operations;
2975 2992
2993#ifdef CONFIG_UNICODE
2994extern const struct dentry_operations ext4_dentry_ops;
2995#endif
2996
2976/* file.c */ 2997/* file.c */
2977extern const struct inode_operations ext4_file_inode_operations; 2998extern const struct inode_operations ext4_file_inode_operations;
2978extern const struct file_operations ext4_file_operations; 2999extern const struct file_operations ext4_file_operations;
@@ -3065,6 +3086,10 @@ extern void initialize_dirent_tail(struct ext4_dir_entry_tail *t,
3065extern int ext4_handle_dirty_dirent_node(handle_t *handle, 3086extern int ext4_handle_dirty_dirent_node(handle_t *handle,
3066 struct inode *inode, 3087 struct inode *inode,
3067 struct buffer_head *bh); 3088 struct buffer_head *bh);
3089extern int ext4_ci_compare(const struct inode *parent,
3090 const struct qstr *name,
3091 const struct qstr *entry);
3092
3068#define S_SHIFT 12 3093#define S_SHIFT 12
3069static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = { 3094static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = {
3070 [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE, 3095 [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE,