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

afs: 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: David Howells <dhowells@redhat.com>
CC: linux-afs@lists.infradead.org
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 e836818b
...@@ -318,7 +318,6 @@ struct afs_volume { ...@@ -318,7 +318,6 @@ struct afs_volume {
unsigned short rjservers; /* number of servers discarded due to -ENOMEDIUM */ unsigned short rjservers; /* number of servers discarded due to -ENOMEDIUM */
struct afs_server *servers[8]; /* servers on which volume resides (ordered) */ struct afs_server *servers[8]; /* servers on which volume resides (ordered) */
struct rw_semaphore server_sem; /* lock for accessing current server */ struct rw_semaphore server_sem; /* lock for accessing current server */
struct backing_dev_info bdi;
}; };
/* /*
......
...@@ -319,7 +319,10 @@ static int afs_fill_super(struct super_block *sb, ...@@ -319,7 +319,10 @@ static int afs_fill_super(struct super_block *sb,
sb->s_blocksize_bits = PAGE_SHIFT; sb->s_blocksize_bits = PAGE_SHIFT;
sb->s_magic = AFS_FS_MAGIC; sb->s_magic = AFS_FS_MAGIC;
sb->s_op = &afs_super_ops; sb->s_op = &afs_super_ops;
sb->s_bdi = &as->volume->bdi; ret = super_setup_bdi(sb);
if (ret)
return ret;
sb->s_bdi->ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_SIZE;
strlcpy(sb->s_id, as->volume->vlocation->vldb.name, sizeof(sb->s_id)); strlcpy(sb->s_id, as->volume->vlocation->vldb.name, sizeof(sb->s_id));
/* allocate the root inode and dentry */ /* allocate the root inode and dentry */
......
...@@ -106,11 +106,6 @@ struct afs_volume *afs_volume_lookup(struct afs_mount_params *params) ...@@ -106,11 +106,6 @@ struct afs_volume *afs_volume_lookup(struct afs_mount_params *params)
volume->cell = params->cell; volume->cell = params->cell;
volume->vid = vlocation->vldb.vid[params->type]; volume->vid = vlocation->vldb.vid[params->type];
volume->bdi.ra_pages = VM_MAX_READAHEAD*1024/PAGE_SIZE;
ret = bdi_setup_and_register(&volume->bdi, "afs");
if (ret)
goto error_bdi;
init_rwsem(&volume->server_sem); init_rwsem(&volume->server_sem);
/* look up all the applicable server records */ /* look up all the applicable server records */
...@@ -156,8 +151,6 @@ struct afs_volume *afs_volume_lookup(struct afs_mount_params *params) ...@@ -156,8 +151,6 @@ struct afs_volume *afs_volume_lookup(struct afs_mount_params *params)
return ERR_PTR(ret); return ERR_PTR(ret);
error_discard: error_discard:
bdi_destroy(&volume->bdi);
error_bdi:
up_write(&params->cell->vl_sem); up_write(&params->cell->vl_sem);
for (loop = volume->nservers - 1; loop >= 0; loop--) for (loop = volume->nservers - 1; loop >= 0; loop--)
...@@ -207,7 +200,6 @@ void afs_put_volume(struct afs_volume *volume) ...@@ -207,7 +200,6 @@ void afs_put_volume(struct afs_volume *volume)
for (loop = volume->nservers - 1; loop >= 0; loop--) for (loop = volume->nservers - 1; loop >= 0; loop--)
afs_put_server(volume->servers[loop]); afs_put_server(volume->servers[loop]);
bdi_destroy(&volume->bdi);
kfree(volume); kfree(volume);
_leave(" [destroyed]"); _leave(" [destroyed]");
......
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