]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
coda: Convert to separately allocated bdi
authorJan Kara <jack@suse.cz>
Wed, 12 Apr 2017 10:24:38 +0000 (12:24 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 20 Apr 2017 18:09:55 +0000 (12:09 -0600)
Allocate struct backing_dev_info separately instead of embedding it
inside the superblock. This unifies handling of bdi among users.

CC: Jan Harkes <jaharkes@cs.cmu.edu>
CC: coda@cs.cmu.edu
CC: codalist@coda.cs.cmu.edu
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/coda/inode.c
include/linux/coda_psdev.h

index 2dea594da19968288586138a35c22a81151914e7..6058df380cc00ed0d4be8cb81a0a87369cb9aac3 100644 (file)
@@ -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);
 
@@ -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);
@@ -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:
@@ -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);
index 5b8721efa948ec7d93fa7caeb79a535c51e8d69b..31e4e1f1547cc1698514d854898110446ba4a4f7 100644 (file)
@@ -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;
 };