aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/v9fs.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-04-22 05:42:00 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-22 05:42:00 -0400
commit0ed07ddb56d1348e5ce33f3b8de20d730351983a (patch)
tree2a1487252e9ecd6fe5b7ff87d9b035f040ab8ff1 /fs/9p/v9fs.c
parentc3c532061e46156e8aab1268f38d66cfb63aeb2d (diff)
9p: 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 'fs/9p/v9fs.c')
-rw-r--r--fs/9p/v9fs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 5c5bc8480070..f8b86e92cd66 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -238,6 +238,13 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
238 return ERR_PTR(-ENOMEM); 238 return ERR_PTR(-ENOMEM);
239 } 239 }
240 240
241 rc = bdi_setup_and_register(&v9ses->bdi, "9p", BDI_CAP_MAP_COPY);
242 if (rc) {
243 __putname(v9ses->aname);
244 __putname(v9ses->uname);
245 return ERR_PTR(rc);
246 }
247
241 spin_lock(&v9fs_sessionlist_lock); 248 spin_lock(&v9fs_sessionlist_lock);
242 list_add(&v9ses->slist, &v9fs_sessionlist); 249 list_add(&v9ses->slist, &v9fs_sessionlist);
243 spin_unlock(&v9fs_sessionlist_lock); 250 spin_unlock(&v9fs_sessionlist_lock);
@@ -301,6 +308,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
301 return fid; 308 return fid;
302 309
303error: 310error:
311 bdi_destroy(&v9ses->bdi);
304 return ERR_PTR(retval); 312 return ERR_PTR(retval);
305} 313}
306 314
@@ -326,6 +334,8 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
326 __putname(v9ses->uname); 334 __putname(v9ses->uname);
327 __putname(v9ses->aname); 335 __putname(v9ses->aname);
328 336
337 bdi_destroy(&v9ses->bdi);
338
329 spin_lock(&v9fs_sessionlist_lock); 339 spin_lock(&v9fs_sessionlist_lock);
330 list_del(&v9ses->slist); 340 list_del(&v9ses->slist);
331 spin_unlock(&v9fs_sessionlist_lock); 341 spin_unlock(&v9fs_sessionlist_lock);