add patch fix-checks-for-data-ordered-and-journal_async_commit-options
[ext4-patch-queue.git] / rename-get_crypt_info
blobf23c6c907df97c067b12919d4b3e30e8e106a737
1 fscrypt: rename get_crypt_info() to fscrypt_get_crypt_info()
3 To avoid namespace collisions, rename get_crypt_info() to
4 fscrypt_get_crypt_info().  The function is only used inside the
5 fs/crypto directory, so declare it in the new header file,
6 fscrypt_private.h.
8 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 Reviewed-by: Eric Biggers <ebiggers@google.com>
10 ---
11  fs/crypto/fname.c           |  4 ++--
12  fs/crypto/fscrypt_private.h | 19 +++++++++++++++++++
13  fs/crypto/keyinfo.c         |  6 +++---
14  include/linux/fscrypto.h    |  1 -
15  4 files changed, 24 insertions(+), 6 deletions(-)
17 diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c
18 index 6b45d9caeeb0..56ad9d195f18 100644
19 --- a/fs/crypto/fname.c
20 +++ b/fs/crypto/fname.c
21 @@ -12,7 +12,7 @@
23  #include <linux/scatterlist.h>
24  #include <linux/ratelimit.h>
25 -#include <linux/fscrypto.h>
26 +#include "fscrypt_private.h"
28  /**
29   * fname_crypt_complete() - completion callback for filename crypto
30 @@ -350,7 +350,7 @@ int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,
31                 fname->disk_name.len = iname->len;
32                 return 0;
33         }
34 -       ret = get_crypt_info(dir);
35 +       ret = fscrypt_get_crypt_info(dir);
36         if (ret && ret != -EOPNOTSUPP)
37                 return ret;
39 diff --git a/fs/crypto/fscrypt_private.h b/fs/crypto/fscrypt_private.h
40 new file mode 100644
41 index 000000000000..7c31108728e4
42 --- /dev/null
43 +++ b/fs/crypto/fscrypt_private.h
44 @@ -0,0 +1,19 @@
45 +/*
46 + * fscrypt_private.h
47 + *
48 + * Copyright (C) 2015, Google, Inc.
49 + *
50 + * This contains encryption key functions.
51 + *
52 + * Written by Michael Halcrow, Ildar Muslukhov, and Uday Savagaonkar, 2015.
53 + */
55 +#ifndef _FSCRYPT_PRIVATE_H
56 +#define _FSCRYPT_PRIVATE_H
58 +#include <linux/fscrypto.h>
60 +/* keyinfo.c */
61 +extern int fscrypt_get_crypt_info(struct inode *);
63 +#endif /* _FSCRYPT_PRIVATE_H */
64 diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c
65 index 67fb6d8876d0..35d3317a27b3 100644
66 --- a/fs/crypto/keyinfo.c
67 +++ b/fs/crypto/keyinfo.c
68 @@ -10,7 +10,7 @@
70  #include <keys/user-type.h>
71  #include <linux/scatterlist.h>
72 -#include <linux/fscrypto.h>
73 +#include "fscrypt_private.h"
75  static void derive_crypt_complete(struct crypto_async_request *req, int rc)
76  {
77 @@ -178,7 +178,7 @@ static void put_crypt_info(struct fscrypt_info *ci)
78         kmem_cache_free(fscrypt_info_cachep, ci);
79  }
81 -int get_crypt_info(struct inode *inode)
82 +int fscrypt_get_crypt_info(struct inode *inode)
83  {
84         struct fscrypt_info *crypt_info;
85         struct fscrypt_context ctx;
86 @@ -327,7 +327,7 @@ int fscrypt_get_encryption_info(struct inode *inode)
87                  (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |
88                                                (1 << KEY_FLAG_REVOKED) |
89                                                (1 << KEY_FLAG_DEAD)))))
90 -               return get_crypt_info(inode);
91 +               return fscrypt_get_crypt_info(inode);
92         return 0;
93  }
94  EXPORT_SYMBOL(fscrypt_get_encryption_info);
95 diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h
96 index be94684dc05f..2f8894f0696c 100644
97 --- a/include/linux/fscrypto.h
98 +++ b/include/linux/fscrypto.h
99 @@ -265,7 +265,6 @@ extern int fscrypt_has_permitted_context(struct inode *, struct inode *);
100  extern int fscrypt_inherit_context(struct inode *, struct inode *,
101                                         void *, bool);
102  /* keyinfo.c */
103 -extern int get_crypt_info(struct inode *);
104  extern int fscrypt_get_encryption_info(struct inode *);
105  extern void fscrypt_put_encryption_info(struct inode *, struct fscrypt_info *);