summaryrefslogtreecommitdiffstats
path: root/fs/afs/volume.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-04-22 11:58:18 +0200
committerJens Axboe <jens.axboe@oracle.com>2010-04-22 11:58:18 +0200
commite1da0222753a2322d76c97fc02396fb83143c7ac (patch)
treecba5f8058b48cc0f6c6647e3f217bf0cfb7b60ef /fs/afs/volume.c
parent9p: add bdi backing to mount session (diff)
downloadlinux-e1da0222753a2322d76c97fc02396fb83143c7ac.tar.xz
linux-e1da0222753a2322d76c97fc02396fb83143c7ac.zip
afs: add bdi backing to mount session.
This ensures that dirty data gets flushed properly. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to '')
-rw-r--r--fs/afs/volume.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/afs/volume.c b/fs/afs/volume.c
index a353e69e2391..401eeb21869f 100644
--- a/fs/afs/volume.c
+++ b/fs/afs/volume.c
@@ -106,6 +106,10 @@ struct afs_volume *afs_volume_lookup(struct afs_mount_params *params)
volume->cell = params->cell;
volume->vid = vlocation->vldb.vid[params->type];
+ ret = bdi_setup_and_register(&volume->bdi, "afs", BDI_CAP_MAP_COPY);
+ if (ret)
+ goto error_bdi;
+
init_rwsem(&volume->server_sem);
/* look up all the applicable server records */
@@ -151,6 +155,8 @@ error:
return ERR_PTR(ret);
error_discard:
+ bdi_destroy(&volume->bdi);
+error_bdi:
up_write(&params->cell->vl_sem);
for (loop = volume->nservers - 1; loop >= 0; loop--)
@@ -200,6 +206,7 @@ void afs_put_volume(struct afs_volume *volume)
for (loop = volume->nservers - 1; loop >= 0; loop--)
afs_put_server(volume->servers[loop]);
+ bdi_destroy(&volume->bdi);
kfree(volume);
_leave(" [destroyed]");