summaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorPeter Zijlstra2007-10-17 08:25:46 +0200
committerLinus Torvalds2007-10-17 17:42:45 +0200
commite0bf68ddec4f4f90e5871404be4f1854c17f3120 (patch)
tree36203a3558cbe26d698bed18be69b3822fb5eef2 /fs/fuse/inode.c
parentlib: percpu_counter_init_irq (diff)
downloadkernel-qcow2-linux-e0bf68ddec4f4f90e5871404be4f1854c17f3120.tar.gz
kernel-qcow2-linux-e0bf68ddec4f4f90e5871404be4f1854c17f3120.tar.xz
kernel-qcow2-linux-e0bf68ddec4f4f90e5871404be4f1854c17f3120.zip
mm: bdi init hooks
provide BDI constructor/destructor hooks [akpm@linux-foundation.org: compile fix] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c9
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)
static struct fuse_conn *new_conn(void)
{
struct fuse_conn *fc;
+ int err;
fc = kzalloc(sizeof(*fc), GFP_KERNEL);
if (fc) {
@@ -416,10 +417,17 @@ static struct fuse_conn *new_conn(void)
atomic_set(&fc->num_waiting, 0);
fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
fc->bdi.unplug_io_fn = default_unplug_io_fn;
+ err = bdi_init(&fc->bdi);
+ if (err) {
+ kfree(fc);
+ fc = NULL;
+ goto out;
+ }
fc->reqctr = 0;
fc->blocked = 1;
get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
}
+out:
return fc;
}
@@ -429,6 +437,7 @@ void fuse_conn_put(struct fuse_conn *fc)
if (fc->destroy_req)
fuse_request_free(fc->destroy_req);
mutex_destroy(&fc->inst_mutex);
+ bdi_destroy(&fc->bdi);
kfree(fc);
}
}