aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/crypto/crypto.c6
-rw-r--r--fs/crypto/fscrypt_private.h2
-rw-r--r--include/linux/fscrypto.h1
3 files changed, 4 insertions, 5 deletions
diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c
index bc1d4781b9ec..ac8e4f6a3773 100644
--- a/fs/crypto/crypto.c
+++ b/fs/crypto/crypto.c
@@ -63,7 +63,7 @@ void fscrypt_release_ctx(struct fscrypt_ctx *ctx)
63{ 63{
64 unsigned long flags; 64 unsigned long flags;
65 65
66 if (ctx->flags & FS_WRITE_PATH_FL && ctx->w.bounce_page) { 66 if (ctx->flags & FS_CTX_HAS_BOUNCE_BUFFER_FL && ctx->w.bounce_page) {
67 mempool_free(ctx->w.bounce_page, fscrypt_bounce_page_pool); 67 mempool_free(ctx->w.bounce_page, fscrypt_bounce_page_pool);
68 ctx->w.bounce_page = NULL; 68 ctx->w.bounce_page = NULL;
69 } 69 }
@@ -121,7 +121,7 @@ struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, gfp_t gfp_flags)
121 } else { 121 } else {
122 ctx->flags &= ~FS_CTX_REQUIRES_FREE_ENCRYPT_FL; 122 ctx->flags &= ~FS_CTX_REQUIRES_FREE_ENCRYPT_FL;
123 } 123 }
124 ctx->flags &= ~FS_WRITE_PATH_FL; 124 ctx->flags &= ~FS_CTX_HAS_BOUNCE_BUFFER_FL;
125 return ctx; 125 return ctx;
126} 126}
127EXPORT_SYMBOL(fscrypt_get_ctx); 127EXPORT_SYMBOL(fscrypt_get_ctx);
@@ -210,7 +210,7 @@ static struct page *alloc_bounce_page(struct fscrypt_ctx *ctx, gfp_t gfp_flags)
210 ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool, gfp_flags); 210 ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool, gfp_flags);
211 if (ctx->w.bounce_page == NULL) 211 if (ctx->w.bounce_page == NULL)
212 return ERR_PTR(-ENOMEM); 212 return ERR_PTR(-ENOMEM);
213 ctx->flags |= FS_WRITE_PATH_FL; 213 ctx->flags |= FS_CTX_HAS_BOUNCE_BUFFER_FL;
214 return ctx->w.bounce_page; 214 return ctx->w.bounce_page;
215} 215}
216 216
diff --git a/fs/crypto/fscrypt_private.h b/fs/crypto/fscrypt_private.h
index 7ba10cd45a2e..aeab032d7d35 100644
--- a/fs/crypto/fscrypt_private.h
+++ b/fs/crypto/fscrypt_private.h
@@ -72,7 +72,7 @@ struct fscrypt_info {
72}; 72};
73 73
74#define FS_CTX_REQUIRES_FREE_ENCRYPT_FL 0x00000001 74#define FS_CTX_REQUIRES_FREE_ENCRYPT_FL 0x00000001
75#define FS_WRITE_PATH_FL 0x00000002 75#define FS_CTX_HAS_BOUNCE_BUFFER_FL 0x00000002
76 76
77struct fscrypt_completion_result { 77struct fscrypt_completion_result {
78 struct completion completion; 78 struct completion completion;
diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h
index 1adc1c758d31..c074b670aa99 100644
--- a/include/linux/fscrypto.h
+++ b/include/linux/fscrypto.h
@@ -21,7 +21,6 @@
21#define FS_CRYPTO_BLOCK_SIZE 16 21#define FS_CRYPTO_BLOCK_SIZE 16
22 22
23struct fscrypt_info; 23struct fscrypt_info;
24struct fscrypt_ctx;
25 24
26struct fscrypt_ctx { 25struct fscrypt_ctx {
27 union { 26 union {