Clean up whitespace and fixed a bug in the context inheritance error path
[ext4-patch-queue.git] / reserve-codepoints-used-by-the-ext4-encryption-feature
blob093c68960d342c78705277f084dca86696fe9a9c
1 ext4 crypto: reserve codepoints used by the ext4 encryption feature
3 From: Theodore Ts'o <tytso@mit.edu>
5 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 ---
7  fs/ext4/ext4.h | 16 +++++++++++++---
8  1 file changed, 13 insertions(+), 3 deletions(-)
10 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
11 index f7f3f58..e168382 100644
12 --- a/fs/ext4/ext4.h
13 +++ b/fs/ext4/ext4.h
14 @@ -422,7 +422,7 @@ enum {
15         EXT4_INODE_DIRTY        = 8,
16         EXT4_INODE_COMPRBLK     = 9,    /* One or more compressed clusters */
17         EXT4_INODE_NOCOMPR      = 10,   /* Don't compress */
18 -       EXT4_INODE_ENCRYPT      = 11,   /* Compression error */
19 +       EXT4_INODE_ENCRYPT      = 11,   /* Encrypted file */
20  /* End compression flags --- maybe not all used */
21         EXT4_INODE_INDEX        = 12,   /* hash-indexed directory */
22         EXT4_INODE_IMAGIC       = 13,   /* AFS directory */
23 @@ -582,6 +582,13 @@ enum {
24  #define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER  0x0010
25  #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER   0x0020
27 +/* Encryption algorithms */
28 +#define EXT4_ENCRYPTION_MODE_INVALID           0
29 +#define EXT4_ENCRYPTION_MODE_AES_256_XTS       1
30 +#define EXT4_ENCRYPTION_MODE_AES_256_GCM       2
31 +#define EXT4_ENCRYPTION_MODE_AES_256_CBC       3
32 +#define EXT4_ENCRYPTION_MODE_AES_256_CTS       4
34  /*
35   * ioctl commands
36   */
37 @@ -1142,7 +1149,8 @@ struct ext4_super_block {
38         __le32  s_raid_stripe_width;    /* blocks on all data disks (N*stride)*/
39         __u8    s_log_groups_per_flex;  /* FLEX_BG group size */
40         __u8    s_checksum_type;        /* metadata checksum algorithm used */
41 -       __le16  s_reserved_pad;
42 +       __u8    s_encryption_level;     /* versioning level for encryption */
43 +       __u8    s_reserved_pad;         /* Padding to next 32bits */
44         __le64  s_kbytes_written;       /* nr of lifetime kilobytes written */
45         __le32  s_snapshot_inum;        /* Inode number of active snapshot */
46         __le32  s_snapshot_id;          /* sequential ID of active snapshot */
47 @@ -1169,7 +1177,9 @@ struct ext4_super_block {
48         __le32  s_overhead_clusters;    /* overhead blocks/clusters in fs */
49         __le32  s_backup_bgs[2];        /* groups with sparse_super2 SBs */
50         __u8    s_encrypt_algos[4];     /* Encryption algorithms in use  */
51 -       __le32  s_reserved[105];        /* Padding to the end of the block */
52 +       __u8    s_encrypt_pw_salt[16];  /* Salt used for string2key algorithm */
53 +       __le32  s_lpf_ino;              /* Location of the lost+found inode */
54 +       __le32  s_reserved[100];        /* Padding to the end of the block */
55         __le32  s_checksum;             /* crc32c(superblock) */
56  };