aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-03 21:23:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-03 21:23:53 -0400
commit8663da2c0919896788321cd8a0016af08588c656 (patch)
tree9e92edcab3fa5187f8af2b02cdc791453b21c8b8 /fs/ext4/ext4.h
parent101a6fd387801bbe164eafea3950b98f8e6440bb (diff)
parent2c869b262a10ca99cb866d04087d75311587a30c (diff)
Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o: "Some miscellaneous bug fixes and some final on-disk and ABI changes for ext4 encryption which provide better security and performance" * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix growing of tiny filesystems ext4: move check under lock scope to close a race. ext4: fix data corruption caused by unwritten and delayed extents ext4 crypto: remove duplicated encryption mode definitions ext4 crypto: do not select from EXT4_FS_ENCRYPTION ext4 crypto: add padding to filenames before encrypting ext4 crypto: simplify and speed up filename encryption
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ef267adce19a..009a0590b20f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -911,6 +911,7 @@ struct ext4_inode_info {
911 911
912 /* on-disk additional length */ 912 /* on-disk additional length */
913 __u16 i_extra_isize; 913 __u16 i_extra_isize;
914 char i_crypt_policy_flags;
914 915
915 /* Indicate the inline data space. */ 916 /* Indicate the inline data space. */
916 u16 i_inline_off; 917 u16 i_inline_off;
@@ -1066,12 +1067,6 @@ extern void ext4_set_bits(void *bm, int cur, int len);
1066/* Metadata checksum algorithm codes */ 1067/* Metadata checksum algorithm codes */
1067#define EXT4_CRC32C_CHKSUM 1 1068#define EXT4_CRC32C_CHKSUM 1
1068 1069
1069/* Encryption algorithms */
1070#define EXT4_ENCRYPTION_MODE_INVALID 0
1071#define EXT4_ENCRYPTION_MODE_AES_256_XTS 1
1072#define EXT4_ENCRYPTION_MODE_AES_256_GCM 2
1073#define EXT4_ENCRYPTION_MODE_AES_256_CBC 3
1074
1075/* 1070/*
1076 * Structure of the super block 1071 * Structure of the super block
1077 */ 1072 */
@@ -2093,9 +2088,11 @@ u32 ext4_fname_crypto_round_up(u32 size, u32 blksize);
2093int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx, 2088int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx,
2094 u32 ilen, struct ext4_str *crypto_str); 2089 u32 ilen, struct ext4_str *crypto_str);
2095int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, 2090int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx,
2091 struct dx_hash_info *hinfo,
2096 const struct ext4_str *iname, 2092 const struct ext4_str *iname,
2097 struct ext4_str *oname); 2093 struct ext4_str *oname);
2098int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, 2094int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx,
2095 struct dx_hash_info *hinfo,
2099 const struct ext4_dir_entry_2 *de, 2096 const struct ext4_dir_entry_2 *de,
2100 struct ext4_str *oname); 2097 struct ext4_str *oname);
2101int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx, 2098int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx,
@@ -2104,11 +2101,12 @@ int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx,
2104int ext4_fname_usr_to_hash(struct ext4_fname_crypto_ctx *ctx, 2101int ext4_fname_usr_to_hash(struct ext4_fname_crypto_ctx *ctx,
2105 const struct qstr *iname, 2102 const struct qstr *iname,
2106 struct dx_hash_info *hinfo); 2103 struct dx_hash_info *hinfo);
2107int ext4_fname_disk_to_hash(struct ext4_fname_crypto_ctx *ctx,
2108 const struct ext4_dir_entry_2 *de,
2109 struct dx_hash_info *hinfo);
2110int ext4_fname_crypto_namelen_on_disk(struct ext4_fname_crypto_ctx *ctx, 2104int ext4_fname_crypto_namelen_on_disk(struct ext4_fname_crypto_ctx *ctx,
2111 u32 namelen); 2105 u32 namelen);
2106int ext4_fname_match(struct ext4_fname_crypto_ctx *ctx, struct ext4_str *cstr,
2107 int len, const char * const name,
2108 struct ext4_dir_entry_2 *de);
2109
2112 2110
2113#ifdef CONFIG_EXT4_FS_ENCRYPTION 2111#ifdef CONFIG_EXT4_FS_ENCRYPTION
2114void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx); 2112void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx);