The only reason the inode is being passed to fscrypt_get_ctx() is to verify that the encryption key is available. However, all callers already ensure this because if we get as far as trying to do I/O to an encrypted file without the key, there's already a bug. Therefore, remove this unnecessary argument.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -90,7 +90,7 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode) · 89 unmodified lines | ||
| 90 | 90 | |
| 91 | 91 | /* crypto.c */ |
| 92 | 92 | extern void fscrypt_enqueue_decrypt_work(struct work_struct *); |
| 93 | −extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t); | |
| 93 | +extern struct fscrypt_ctx *fscrypt_get_ctx(gfp_t); | |
| 94 | 94 | extern void fscrypt_release_ctx(struct fscrypt_ctx *); |
| 95 | 95 | extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *, |
| 96 | 96 | unsigned int, unsigned int, |
| @@ -247,8 +247,7 @@ static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work) · 150 unmodified lines | ||
| 247 | 247 | { |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | −static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, | |
| 251 | − gfp_t gfp_flags) | |
| 250 | +static inline struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags) | |
| 252 | 251 | { |
| 253 | 252 | return ERR_PTR(-EOPNOTSUPP); |
| 254 | 253 | } |