diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
commit | feaf222925cdfbc841a695fd30df8c6d0a694146 (patch) | |
tree | 9bba94f19346cd3cba0223741b38885b898491ae /fs/ext4/ext4.h | |
parent | be5e6616dd74e17fdd8e16ca015cfef94d49b467 (diff) | |
parent | 6f30b7e37a8239f9d27db626a1d3427bc7951908 (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o:
"Ext4 bug fixes.
We also reserved code points for encryption and read-only images (for
which the implementation is mostly just the reserved code point for a
read-only feature :-)"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix indirect punch hole corruption
ext4: ignore journal checksum on remount; don't fail
ext4: remove duplicate remount check for JOURNAL_CHECKSUM change
ext4: fix mmap data corruption in nodelalloc mode when blocksize < pagesize
ext4: support read-only images
ext4: change to use setup_timer() instead of init_timer()
ext4: reserve codepoints used by the ext4 encryption feature
jbd2: complain about descriptor block checksum errors
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 18 |
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| \ |