Commit e836818b authored by Jan Kara's avatar Jan Kara Committed by Jens Axboe

ecryptfs: Convert to separately allocated bdi

Allocate struct backing_dev_info separately instead of embedding it
inside the superblock. This unifies handling of bdi among users.

CC: Tyler Hicks <tyhicks@canonical.com>
CC: ecryptfs@vger.kernel.org
Acked-by: default avatarTyler Hicks <tyhicks@canonical.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 851ea086
...@@ -349,7 +349,6 @@ struct ecryptfs_mount_crypt_stat { ...@@ -349,7 +349,6 @@ struct ecryptfs_mount_crypt_stat {
struct ecryptfs_sb_info { struct ecryptfs_sb_info {
struct super_block *wsi_sb; struct super_block *wsi_sb;
struct ecryptfs_mount_crypt_stat mount_crypt_stat; struct ecryptfs_mount_crypt_stat mount_crypt_stat;
struct backing_dev_info bdi;
}; };
/* file private data. */ /* file private data. */
......
...@@ -519,12 +519,11 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags ...@@ -519,12 +519,11 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
goto out; goto out;
} }
rc = bdi_setup_and_register(&sbi->bdi, "ecryptfs"); rc = super_setup_bdi(s);
if (rc) if (rc)
goto out1; goto out1;
ecryptfs_set_superblock_private(s, sbi); ecryptfs_set_superblock_private(s, sbi);
s->s_bdi = &sbi->bdi;
/* ->kill_sb() will take care of sbi after that point */ /* ->kill_sb() will take care of sbi after that point */
sbi = NULL; sbi = NULL;
...@@ -633,7 +632,6 @@ static void ecryptfs_kill_block_super(struct super_block *sb) ...@@ -633,7 +632,6 @@ static void ecryptfs_kill_block_super(struct super_block *sb)
if (!sb_info) if (!sb_info)
return; return;
ecryptfs_destroy_mount_crypt_stat(&sb_info->mount_crypt_stat); ecryptfs_destroy_mount_crypt_stat(&sb_info->mount_crypt_stat);
bdi_destroy(&sb_info->bdi);
kmem_cache_free(ecryptfs_sb_info_cache, sb_info); kmem_cache_free(ecryptfs_sb_info_cache, sb_info);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment