mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mm: bdi init hooks
provide BDI constructor/destructor hooks [[email protected]: compile fix] Signed-off-by: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
dc62a30e27
commit
e0bf68ddec
19 changed files with 131 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue