summaryrefslogtreecommitdiffstats
path: root/fs/ext4/readpage.c
diff options
context:
space:
mode:
authorTheodore Ts'o2015-05-31 19:31:34 +0200
committerTheodore Ts'o2015-05-31 19:31:34 +0200
commit614def7013574ffcd54019b6df40ac1c0df754af (patch)
tree50549389b403fac7179bc6f93ecb178091ad4c31 /fs/ext4/readpage.c
parentext4 crypto: get rid of ci_mode from struct ext4_crypt_info (diff)
downloadkernel-qcow2-linux-614def7013574ffcd54019b6df40ac1c0df754af.tar.gz
kernel-qcow2-linux-614def7013574ffcd54019b6df40ac1c0df754af.tar.xz
kernel-qcow2-linux-614def7013574ffcd54019b6df40ac1c0df754af.zip
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)
{
#ifdef CONFIG_EXT4_FS_ENCRYPTION
struct ext4_crypto_ctx *ctx =
- container_of(work, struct ext4_crypto_ctx, work);
- struct bio *bio = ctx->bio;
+ container_of(work, struct ext4_crypto_ctx, r.work);
+ struct bio *bio = ctx->r.bio;
struct bio_vec *bv;
int i;
@@ -109,9 +109,9 @@ static void mpage_end_io(struct bio *bio, int err)
if (err) {
ext4_release_crypto_ctx(ctx);
} else {
- INIT_WORK(&ctx->work, completion_pages);
- ctx->bio = bio;
- queue_work(ext4_read_workqueue, &ctx->work);
+ INIT_WORK(&ctx->r.work, completion_pages);
+ ctx->r.bio = bio;
+ queue_work(ext4_read_workqueue, &ctx->r.work);
return;
}
}