summaryrefslogtreecommitdiffstats
path: root/fs/verity/fsverity_private.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-06-03 19:23:48 -0700
committerEric Biggers <ebiggers@google.com>2023-06-04 05:56:11 -0700
commit32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e (patch)
tree1988c2696957c61a3e145b259ad56f4fb8a5680f /fs/verity/fsverity_private.h
parent8fcd94add6c5c93ed3b9314456e8420914401530 (diff)
downloadlinux-32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e.tar.gz
linux-32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e.tar.bz2
linux-32ab3c5e6226a5c39b6674b5fbb16b492c2faa2e.zip
fsverity: constify fsverity_hash_alg
Now that fsverity_hash_alg doesn't have an embedded mempool, it can be 'const' almost everywhere. Add it. Link: https://lore.kernel.org/r/20230604022348.48658-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/verity/fsverity_private.h')
-rw-r--r--fs/verity/fsverity_private.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h
index 8527beca2a45..49bf3a1eb2a0 100644
--- a/fs/verity/fsverity_private.h
+++ b/fs/verity/fsverity_private.h
@@ -33,7 +33,7 @@ struct fsverity_hash_alg {
/* Merkle tree parameters: hash algorithm, initial hash state, and topology */
struct merkle_tree_params {
- struct fsverity_hash_alg *hash_alg; /* the hash algorithm */
+ const struct fsverity_hash_alg *hash_alg; /* the hash algorithm */
const u8 *hashstate; /* initial hash state or NULL */
unsigned int digest_size; /* same as hash_alg->digest_size */
unsigned int block_size; /* size of data and tree blocks */
@@ -79,13 +79,13 @@ struct fsverity_info {
extern struct fsverity_hash_alg fsverity_hash_algs[];
-struct fsverity_hash_alg *fsverity_get_hash_alg(const struct inode *inode,
- unsigned int num);
-const u8 *fsverity_prepare_hash_state(struct fsverity_hash_alg *alg,
+const struct fsverity_hash_alg *fsverity_get_hash_alg(const struct inode *inode,
+ unsigned int num);
+const u8 *fsverity_prepare_hash_state(const struct fsverity_hash_alg *alg,
const u8 *salt, size_t salt_size);
int fsverity_hash_block(const struct merkle_tree_params *params,
const struct inode *inode, const void *data, u8 *out);
-int fsverity_hash_buffer(struct fsverity_hash_alg *alg,
+int fsverity_hash_buffer(const struct fsverity_hash_alg *alg,
const void *data, size_t size, u8 *out);
void __init fsverity_check_hash_algs(void);