aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/readpage.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-31 13:31:34 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-05-31 13:31:34 -0400
commit614def7013574ffcd54019b6df40ac1c0df754af (patch)
tree50549389b403fac7179bc6f93ecb178091ad4c31 /fs/ext4/readpage.c
parent1aaa6e8b24114757a836ae0e62d2096deb76f274 (diff)
ext4 crypto: shrink size of the ext4_crypto_ctx structure
Some fields are only used when the crypto_ctx is being used on the read path, some are only used on the write path, and some are only used when the structure is on free list. Optimize memory use by using a union. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/readpage.c')
-rw-r--r--fs/ext4/readpage.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c
index 171b9ac4b45e..ec3ef93a52db 100644
--- a/fs/ext4/readpage.c
+++ b/fs/ext4/readpage.c
@@ -54,8 +54,8 @@ static void completion_pages(struct work_struct *work)
54{ 54{
55#ifdef CONFIG_EXT4_FS_ENCRYPTION 55#ifdef CONFIG_EXT4_FS_ENCRYPTION
56 struct ext4_crypto_ctx *ctx = 56 struct ext4_crypto_ctx *ctx =
57 container_of(work, struct ext4_crypto_ctx, work); 57 container_of(work, struct ext4_crypto_ctx, r.work);
58 struct bio *bio = ctx->bio; 58 struct bio *bio = ctx->r.bio;
59 struct bio_vec *bv; 59 struct bio_vec *bv;
60 int i; 60 int i;
61 61
@@ -109,9 +109,9 @@ static void mpage_end_io(struct bio *bio, int err)
109 if (err) { 109 if (err) {
110 ext4_release_crypto_ctx(ctx); 110 ext4_release_crypto_ctx(ctx);
111 } else { 111 } else {
112 INIT_WORK(&ctx->work, completion_pages); 112 INIT_WORK(&ctx->r.work, completion_pages);
113 ctx->bio = bio; 113 ctx->r.bio = bio;
114 queue_work(ext4_read_workqueue, &ctx->work); 114 queue_work(ext4_read_workqueue, &ctx->r.work);
115 return; 115 return;
116 } 116 }
117 } 117 }