Skip to content

Commit

Permalink
ecryptfs: Convert to separately allocated bdi
Browse files Browse the repository at this point in the history
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: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Jan Kara authored and Jens Axboe committed Apr 20, 2017
1 parent 851ea08 commit e836818
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion fs/ecryptfs/ecryptfs_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ struct ecryptfs_mount_crypt_stat {
struct ecryptfs_sb_info {
struct super_block *wsi_sb;
struct ecryptfs_mount_crypt_stat mount_crypt_stat;
struct backing_dev_info bdi;
};

/* file private data. */
Expand Down
4 changes: 1 addition & 3 deletions fs/ecryptfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,11 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
goto out;
}

rc = bdi_setup_and_register(&sbi->bdi, "ecryptfs");
rc = super_setup_bdi(s);
if (rc)
goto out1;

ecryptfs_set_superblock_private(s, sbi);
s->s_bdi = &sbi->bdi;

/* ->kill_sb() will take care of sbi after that point */
sbi = NULL;
Expand Down Expand Up @@ -633,7 +632,6 @@ static void ecryptfs_kill_block_super(struct super_block *sb)
if (!sb_info)
return;
ecryptfs_destroy_mount_crypt_stat(&sb_info->mount_crypt_stat);
bdi_destroy(&sb_info->bdi);
kmem_cache_free(ecryptfs_sb_info_cache, sb_info);
}

Expand Down

0 comments on commit e836818

Please sign in to comment.