aboutsummaryrefslogtreecommitdiff
path: root/include/linux/fscrypt.h
diff options
context:
space:
mode:
authorGravatar Eric Biggers <ebiggers@google.com> 2019-12-15 13:39:47 -0800
committerGravatar Eric Biggers <ebiggers@google.com> 2019-12-31 10:33:50 -0600
commit8a4ab0b866d8aba85b9899edebf14b87b25f817f (patch)
tree9390b2c28ef2cb17fcb170847871dd167154ddcd /include/linux/fscrypt.h
parentfscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand() (diff)
downloadlinux-8a4ab0b866d8aba85b9899edebf14b87b25f817f.tar.gz
linux-8a4ab0b866d8aba85b9899edebf14b87b25f817f.tar.bz2
linux-8a4ab0b866d8aba85b9899edebf14b87b25f817f.zip
fscrypt: constify inode parameter to filename encryption functions
Constify the struct inode parameter to fscrypt_fname_disk_to_usr() and the other filename encryption functions so that users don't have to pass in a non-const inode when they are dealing with a const one, as in [1]. [1] https://lkml.kernel.org/linux-ext4/20191203051049.44573-6-drosen@google.com/ Cc: Daniel Rosenberg <drosen@google.com> Link: https://lore.kernel.org/r/20191215213947.9521-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include/linux/fscrypt.h')
-rw-r--r--include/linux/fscrypt.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 1a7bffe78ed5..6eaa729544a3 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -153,8 +153,10 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname)
extern int fscrypt_fname_alloc_buffer(const struct inode *, u32,
struct fscrypt_str *);
extern void fscrypt_fname_free_buffer(struct fscrypt_str *);
-extern int fscrypt_fname_disk_to_usr(struct inode *, u32, u32,
- const struct fscrypt_str *, struct fscrypt_str *);
+extern int fscrypt_fname_disk_to_usr(const struct inode *inode,
+ u32 hash, u32 minor_hash,
+ const struct fscrypt_str *iname,
+ struct fscrypt_str *oname);
#define FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE 32
@@ -438,7 +440,7 @@ static inline void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str)
return;
}
-static inline int fscrypt_fname_disk_to_usr(struct inode *inode,
+static inline int fscrypt_fname_disk_to_usr(const struct inode *inode,
u32 hash, u32 minor_hash,
const struct fscrypt_str *iname,
struct fscrypt_str *oname)