Skip to content

Commit 1b3b827

Browse files
committed
fscrypt: add "fscrypt_" prefix to fname_encrypt()
fname_encrypt() is a global function, due to being used in both fname.c and hooks.c. So it should be prefixed with "fscrypt_", like all the other global functions in fs/crypto/. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 13a10da commit 1b3b827

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

fs/crypto/fname.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
2828
}
2929

3030
/**
31-
* fname_encrypt() - encrypt a filename
31+
* fscrypt_fname_encrypt() - encrypt a filename
3232
*
3333
* The output buffer must be at least as large as the input buffer.
3434
* Any extra space is filled with NUL padding before encryption.
3535
*
3636
* Return: 0 on success, -errno on failure
3737
*/
38-
int fname_encrypt(const struct inode *inode, const struct qstr *iname,
39-
u8 *out, unsigned int olen)
38+
int fscrypt_fname_encrypt(const struct inode *inode, const struct qstr *iname,
39+
u8 *out, unsigned int olen)
4040
{
4141
struct skcipher_request *req = NULL;
4242
DECLARE_CRYPTO_WAIT(wait);
@@ -343,8 +343,8 @@ int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,
343343
if (!fname->crypto_buf.name)
344344
return -ENOMEM;
345345

346-
ret = fname_encrypt(dir, iname, fname->crypto_buf.name,
347-
fname->crypto_buf.len);
346+
ret = fscrypt_fname_encrypt(dir, iname, fname->crypto_buf.name,
347+
fname->crypto_buf.len);
348348
if (ret)
349349
goto errout;
350350
fname->disk_name.name = fname->crypto_buf.name;

fs/crypto/fscrypt_private.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ void fscrypt_generate_iv(union fscrypt_iv *iv, u64 lblk_num,
235235
const struct fscrypt_info *ci);
236236

237237
/* fname.c */
238-
extern int fname_encrypt(const struct inode *inode, const struct qstr *iname,
239-
u8 *out, unsigned int olen);
238+
extern int fscrypt_fname_encrypt(const struct inode *inode,
239+
const struct qstr *iname,
240+
u8 *out, unsigned int olen);
240241
extern bool fscrypt_fname_encrypted_size(const struct inode *inode,
241242
u32 orig_len, u32 max_len,
242243
u32 *encrypted_len_ret);

fs/crypto/hooks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,
188188
ciphertext_len = disk_link->len - sizeof(*sd);
189189
sd->len = cpu_to_le16(ciphertext_len);
190190

191-
err = fname_encrypt(inode, &iname, sd->encrypted_path, ciphertext_len);
191+
err = fscrypt_fname_encrypt(inode, &iname, sd->encrypted_path,
192+
ciphertext_len);
192193
if (err)
193194
goto err_free_sd;
194195

0 commit comments

Comments
 (0)