diff options
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/inode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 5448f625ab56..ca30b6ac03f0 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -401,6 +401,7 @@ static int fuse_show_options(struct seq_file *m, struct vfsmount *mnt) | |||
401 | static struct fuse_conn *new_conn(void) | 401 | static struct fuse_conn *new_conn(void) |
402 | { | 402 | { |
403 | struct fuse_conn *fc; | 403 | struct fuse_conn *fc; |
404 | int err; | ||
404 | 405 | ||
405 | fc = kzalloc(sizeof(*fc), GFP_KERNEL); | 406 | fc = kzalloc(sizeof(*fc), GFP_KERNEL); |
406 | if (fc) { | 407 | if (fc) { |
@@ -416,10 +417,17 @@ static struct fuse_conn *new_conn(void) | |||
416 | atomic_set(&fc->num_waiting, 0); | 417 | atomic_set(&fc->num_waiting, 0); |
417 | fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; | 418 | fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE; |
418 | fc->bdi.unplug_io_fn = default_unplug_io_fn; | 419 | fc->bdi.unplug_io_fn = default_unplug_io_fn; |
420 | err = bdi_init(&fc->bdi); | ||
421 | if (err) { | ||
422 | kfree(fc); | ||
423 | fc = NULL; | ||
424 | goto out; | ||
425 | } | ||
419 | fc->reqctr = 0; | 426 | fc->reqctr = 0; |
420 | fc->blocked = 1; | 427 | fc->blocked = 1; |
421 | get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key)); | 428 | get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key)); |
422 | } | 429 | } |
430 | out: | ||
423 | return fc; | 431 | return fc; |
424 | } | 432 | } |
425 | 433 | ||
@@ -429,6 +437,7 @@ void fuse_conn_put(struct fuse_conn *fc) | |||
429 | if (fc->destroy_req) | 437 | if (fc->destroy_req) |
430 | fuse_request_free(fc->destroy_req); | 438 | fuse_request_free(fc->destroy_req); |
431 | mutex_destroy(&fc->inst_mutex); | 439 | mutex_destroy(&fc->inst_mutex); |
440 | bdi_destroy(&fc->bdi); | ||
432 | kfree(fc); | 441 | kfree(fc); |
433 | } | 442 | } |
434 | } | 443 | } |