aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 982d934fd9ac..f63c3d5805c4 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -364,7 +364,8 @@ struct flex_groups {
364#define EXT4_DIRTY_FL 0x00000100 364#define EXT4_DIRTY_FL 0x00000100
365#define EXT4_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ 365#define EXT4_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
366#define EXT4_NOCOMPR_FL 0x00000400 /* Don't compress */ 366#define EXT4_NOCOMPR_FL 0x00000400 /* Don't compress */
367#define EXT4_ECOMPR_FL 0x00000800 /* Compression error */ 367 /* nb: was previously EXT2_ECOMPR_FL */
368#define EXT4_ENCRYPT_FL 0x00000800 /* encrypted file */
368/* End compression flags --- maybe not all used */ 369/* End compression flags --- maybe not all used */
369#define EXT4_INDEX_FL 0x00001000 /* hash-indexed directory */ 370#define EXT4_INDEX_FL 0x00001000 /* hash-indexed directory */
370#define EXT4_IMAGIC_FL 0x00002000 /* AFS directory */ 371#define EXT4_IMAGIC_FL 0x00002000 /* AFS directory */
@@ -421,7 +422,7 @@ enum {
421 EXT4_INODE_DIRTY = 8, 422 EXT4_INODE_DIRTY = 8,
422 EXT4_INODE_COMPRBLK = 9, /* One or more compressed clusters */ 423 EXT4_INODE_COMPRBLK = 9, /* One or more compressed clusters */
423 EXT4_INODE_NOCOMPR = 10, /* Don't compress */ 424 EXT4_INODE_NOCOMPR = 10, /* Don't compress */
424 EXT4_INODE_ECOMPR = 11, /* Compression error */ 425 EXT4_INODE_ENCRYPT = 11, /* Compression error */
425/* End compression flags --- maybe not all used */ 426/* End compression flags --- maybe not all used */
426 EXT4_INODE_INDEX = 12, /* hash-indexed directory */ 427 EXT4_INODE_INDEX = 12, /* hash-indexed directory */
427 EXT4_INODE_IMAGIC = 13, /* AFS directory */ 428 EXT4_INODE_IMAGIC = 13, /* AFS directory */
@@ -466,7 +467,7 @@ static inline void ext4_check_flag_values(void)
466 CHECK_FLAG_VALUE(DIRTY); 467 CHECK_FLAG_VALUE(DIRTY);
467 CHECK_FLAG_VALUE(COMPRBLK); 468 CHECK_FLAG_VALUE(COMPRBLK);
468 CHECK_FLAG_VALUE(NOCOMPR); 469 CHECK_FLAG_VALUE(NOCOMPR);
469 CHECK_FLAG_VALUE(ECOMPR); 470 CHECK_FLAG_VALUE(ENCRYPT);
470 CHECK_FLAG_VALUE(INDEX); 471 CHECK_FLAG_VALUE(INDEX);
471 CHECK_FLAG_VALUE(IMAGIC); 472 CHECK_FLAG_VALUE(IMAGIC);
472 CHECK_FLAG_VALUE(JOURNAL_DATA); 473 CHECK_FLAG_VALUE(JOURNAL_DATA);
@@ -1048,6 +1049,12 @@ extern void ext4_set_bits(void *bm, int cur, int len);
1048/* Metadata checksum algorithm codes */ 1049/* Metadata checksum algorithm codes */
1049#define EXT4_CRC32C_CHKSUM 1 1050#define EXT4_CRC32C_CHKSUM 1
1050 1051
1052/* Encryption algorithms */
1053#define EXT4_ENCRYPTION_MODE_INVALID 0
1054#define EXT4_ENCRYPTION_MODE_AES_256_XTS 1
1055#define EXT4_ENCRYPTION_MODE_AES_256_GCM 2
1056#define EXT4_ENCRYPTION_MODE_AES_256_CBC 3
1057
1051/* 1058/*
1052 * Structure of the super block 1059 * Structure of the super block
1053 */ 1060 */
@@ -1161,7 +1168,8 @@ struct ext4_super_block {
1161 __le32 s_grp_quota_inum; /* inode for tracking group quota */ 1168 __le32 s_grp_quota_inum; /* inode for tracking group quota */
1162 __le32 s_overhead_clusters; /* overhead blocks/clusters in fs */ 1169 __le32 s_overhead_clusters; /* overhead blocks/clusters in fs */
1163 __le32 s_backup_bgs[2]; /* groups with sparse_super2 SBs */ 1170 __le32 s_backup_bgs[2]; /* groups with sparse_super2 SBs */
1164 __le32 s_reserved[106]; /* Padding to the end of the block */ 1171 __u8 s_encrypt_algos[4]; /* Encryption algorithms in use */
1172 __le32 s_reserved[105]; /* Padding to the end of the block */
1165 __le32 s_checksum; /* crc32c(superblock) */ 1173 __le32 s_checksum; /* crc32c(superblock) */
1166}; 1174};
1167 1175
@@ -1527,6 +1535,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1527 * GDT_CSUM bits are mutually exclusive. 1535 * GDT_CSUM bits are mutually exclusive.
1528 */ 1536 */
1529#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400 1537#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400
1538#define EXT4_FEATURE_RO_COMPAT_READONLY 0x1000
1530 1539
1531#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001 1540#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
1532#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002 1541#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -1542,6 +1551,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1542#define EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM 0x2000 /* use crc32c for bg */ 1551#define EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM 0x2000 /* use crc32c for bg */
1543#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ 1552#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */
1544#define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */ 1553#define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */
1554#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
1545 1555
1546#define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR 1556#define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR
1547#define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ 1557#define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \