Skip to content

Commit

Permalink
coda: 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: Jan Harkes <[email protected]>
CC: [email protected]
CC: [email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
jankara authored and axboe committed Apr 20, 2017
1 parent fa06052 commit a5695a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
goto unlock_out;
}

error = bdi_setup_and_register(&vc->bdi, "coda");
if (error)
goto unlock_out;

vc->vc_sb = sb;
mutex_unlock(&vc->vc_mutex);

Expand All @@ -197,7 +193,10 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
sb->s_magic = CODA_SUPER_MAGIC;
sb->s_op = &coda_super_operations;
sb->s_d_op = &coda_dentry_operations;
sb->s_bdi = &vc->bdi;

error = super_setup_bdi(sb);
if (error)
goto error;

/* get root fid from Venus: this needs the root inode */
error = venus_rootfid(sb, &fid);
Expand Down Expand Up @@ -228,7 +227,6 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)

error:
mutex_lock(&vc->vc_mutex);
bdi_destroy(&vc->bdi);
vc->vc_sb = NULL;
sb->s_fs_info = NULL;
unlock_out:
Expand All @@ -240,7 +238,6 @@ static void coda_put_super(struct super_block *sb)
{
struct venus_comm *vcp = coda_vcp(sb);
mutex_lock(&vcp->vc_mutex);
bdi_destroy(&vcp->bdi);
vcp->vc_sb = NULL;
sb->s_fs_info = NULL;
mutex_unlock(&vcp->vc_mutex);
Expand Down
1 change: 0 additions & 1 deletion include/linux/coda_psdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ struct venus_comm {
struct list_head vc_processing;
int vc_inuse;
struct super_block *vc_sb;
struct backing_dev_info bdi;
struct mutex vc_mutex;
};

Expand Down

0 comments on commit a5695a7

Please sign in to comment.