aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-01 16:56:45 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-05-01 16:56:45 -0400
commit5de0b4d0cd153c471640b13aae6ae6d18d0a4603 (patch)
treeea42bad982e25f1c880e363b55e8d1ff82e773fe /fs/ext4/ext4.h
parent6ddb2447846a8ece111e316a2863c2355023682d (diff)
ext4 crypto: simplify and speed up filename encryption
Avoid using SHA-1 when calculating the user-visible filename when the encryption key is available, and avoid decrypting lots of filenames when searching for a directory entry in a directory block. Change-Id: If4655f144784978ba0305b597bfa1c8d7bb69e63 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0179654faf79..dfb113816672 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2093,9 +2093,11 @@ u32 ext4_fname_crypto_round_up(u32 size, u32 blksize);
2093int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx, 2093int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx,
2094 u32 ilen, struct ext4_str *crypto_str); 2094 u32 ilen, struct ext4_str *crypto_str);
2095int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, 2095int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx,
2096 struct dx_hash_info *hinfo,
2096 const struct ext4_str *iname, 2097 const struct ext4_str *iname,
2097 struct ext4_str *oname); 2098 struct ext4_str *oname);
2098int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, 2099int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx,
2100 struct dx_hash_info *hinfo,
2099 const struct ext4_dir_entry_2 *de, 2101 const struct ext4_dir_entry_2 *de,
2100 struct ext4_str *oname); 2102 struct ext4_str *oname);
2101int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx, 2103int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx,
@@ -2104,11 +2106,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, 2106int ext4_fname_usr_to_hash(struct ext4_fname_crypto_ctx *ctx,
2105 const struct qstr *iname, 2107 const struct qstr *iname,
2106 struct dx_hash_info *hinfo); 2108 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, 2109int ext4_fname_crypto_namelen_on_disk(struct ext4_fname_crypto_ctx *ctx,
2111 u32 namelen); 2110 u32 namelen);
2111int ext4_fname_match(struct ext4_fname_crypto_ctx *ctx, struct ext4_str *cstr,
2112 int len, const char * const name,
2113 struct ext4_dir_entry_2 *de);
2114
2112 2115
2113#ifdef CONFIG_EXT4_FS_ENCRYPTION 2116#ifdef CONFIG_EXT4_FS_ENCRYPTION
2114void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx); 2117void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx);