fscrypt: Move several items from fscrypt_private.h to .c files
Eric Biggers
maintainerPATCH 1/1 fscrypt: Move several items from fscrypt_private.h to .c files
enum fscrypt_direction_t, struct fscrypt_symlink_data, and struct fscrypt_master_key_user are each used in only one file. Move them to their respective files.
Signed-off-by Eric Biggers <[email protected]>
--- fs/crypto/crypto.c | 5 +++++ fs/crypto/fscrypt_private.h | 27 --------------------------- fs/crypto/hooks.c | 9 +++++++++ fs/crypto/keyring.c | 13 +++++++++++++ 4 files changed, 27 insertions(+), 27 deletions(-)
fs/crypto/crypto.c +5 -0
@@ -98,6 +98,11 @@ void fscrypt_generate_iv(union fscrypt_iv *iv, u64 index, iv->index =cpu_to_le64 (index); } +typedef enum { +FS_DECRYPT =0 , +FS_ENCRYPT , +}fscrypt_direction_t ; +/* Encrypt or decrypt a single "data unit" of file contents. */ static int fscrypt_crypt_data_unit(const struct fscrypt_inode_info *ci, fscrypt_direction_t rw, u64 index,
fs/crypto/fscrypt_private.h +0 -27
@@ -219,15 +219,6 @@ fscrypt_policy_du_bits(const union fscrypt_policy *policy,BUG (); } -/* -* For encrypted symlinks, the ciphertext length is stored at the beginning -* of the string in little-endian format. -*/ -struct fscrypt_symlink_data { -__le16 len; -char encrypted_path[]; -} __packed; -/** * struct fscrypt_prepared_key - a key prepared for actual encryption/decryption * @tfm: crypto API transform object
@@ -321,11 +312,6 @@ struct fscrypt_inode_info {u8 ci_nonce[FSCRYPT_FILE_NONCE_SIZE ]; }; -typedef enum { -FS_DECRYPT =0 , -FS_ENCRYPT , -}fscrypt_direction_t ; -/* crypto.c */ extern struct kmem_cache *fscrypt_inode_info_cachep;int fscrypt_initialize (struct super_block *sb);
@@ -473,19 +459,6 @@ fscrypt_is_key_prepared(const struct fscrypt_prepared_key *prep_key,/* keyring.c */ -/* -* fscrypt_master_key_user - a user's claim to a master key -*/ -struct fscrypt_master_key_user { -struct list_head link; -kuid_t uid; -/* -* This 'struct key' contains no secret. It exists solely to charge the -* appropriate user's key quota. -*/ -struct key *quota_key; -}; -/* * fscrypt_master_key_secret - secret key material of an in-use master key */
fs/crypto/hooks.c +9 -0
@@ -9,6 +9,15 @@#include "fscrypt_private.h" +/* +* For encrypted symlinks, the ciphertext length is stored at the beginning +* of the string in little-endian format. +*/ +struct fscrypt_symlink_data { +__le16 len; +char encrypted_path[]; +} __packed; +/** * fscrypt_file_open() - prepare to open a possibly-encrypted regular file * @inode: the inode being opened
fs/crypto/keyring.c +13 -0
@@ -145,6 +145,19 @@ static inline bool valid_key_spec(const struct fscrypt_key_specifier *spec)return master_key_spec_len (spec) !=0 ; } +/* +* fscrypt_master_key_user - a user's claim to a master key +*/ +struct fscrypt_master_key_user { +struct list_head link; +kuid_t uid; +/* +* This 'struct key' contains no secret. It exists solely to charge the +* appropriate user's key quota. +*/ +struct key *quota_key; +}; +static int fscrypt_user_key_instantiate (struct key *key,struct key_preparsed_payload *prep) {
base-commit: 165768bb70265b5c38cf0b73fafd75be235f8b14
Signature · 1 line
2.55.0