fscrypt: add "fscrypt_" prefix to fname_encrypt()
authorEric Biggers <ebiggers@google.com>
Mon, 20 Jan 2020 07:17:36 +0000 (23:17 -0800)
committerEric Biggers <ebiggers@google.com>
Wed, 22 Jan 2020 22:45:10 +0000 (14:45 -0800)
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/20200120071736.45915-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/fname.c
fs/crypto/fscrypt_private.h
fs/crypto/hooks.c

index 3fd27e14ebdd61ce59d8d3c19e2320433f3bcd53..4614e496973622ef7e918721c307b8064385f4ee 100644 (file)
@@ -28,15 +28,15 @@ static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
 }
 
 /**
- * fname_encrypt() - encrypt a filename
+ * fscrypt_fname_encrypt() - encrypt a filename
  *
  * The output buffer must be at least as large as the input buffer.
  * Any extra space is filled with NUL padding before encryption.
  *
  * Return: 0 on success, -errno on failure
  */
-int fname_encrypt(const struct inode *inode, const struct qstr *iname,
-                 u8 *out, unsigned int olen)
+int fscrypt_fname_encrypt(const struct inode *inode, const struct qstr *iname,
+                         u8 *out, unsigned int olen)
 {
        struct skcipher_request *req = NULL;
        DECLARE_CRYPTO_WAIT(wait);
@@ -343,8 +343,8 @@ int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,
                if (!fname->crypto_buf.name)
                        return -ENOMEM;
 
-               ret = fname_encrypt(dir, iname, fname->crypto_buf.name,
-                                   fname->crypto_buf.len);
+               ret = fscrypt_fname_encrypt(dir, iname, fname->crypto_buf.name,
+                                           fname->crypto_buf.len);
                if (ret)
                        goto errout;
                fname->disk_name.name = fname->crypto_buf.name;
index b22e8decebeddfb69330eb999515157e9f187e01..fea7f55474285080d79d36df8752483786d0932d 100644 (file)
@@ -235,8 +235,9 @@ void fscrypt_generate_iv(union fscrypt_iv *iv, u64 lblk_num,
                         const struct fscrypt_info *ci);
 
 /* fname.c */
-extern int fname_encrypt(const struct inode *inode, const struct qstr *iname,
-                        u8 *out, unsigned int olen);
+extern int fscrypt_fname_encrypt(const struct inode *inode,
+                                const struct qstr *iname,
+                                u8 *out, unsigned int olen);
 extern bool fscrypt_fname_encrypted_size(const struct inode *inode,
                                         u32 orig_len, u32 max_len,
                                         u32 *encrypted_len_ret);
index bb3b7fcfdd48a3b60ef5ca637050f21dd12967d1..4081aae4bc3581794d4e901ab385923d60064b3d 100644 (file)
@@ -188,7 +188,8 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,
        ciphertext_len = disk_link->len - sizeof(*sd);
        sd->len = cpu_to_le16(ciphertext_len);
 
-       err = fname_encrypt(inode, &iname, sd->encrypted_path, ciphertext_len);
+       err = fscrypt_fname_encrypt(inode, &iname, sd->encrypted_path,
+                                   ciphertext_len);
        if (err)
                goto err_free_sd;