blkcg: make root blkcg allocation use %GFP_KERNEL
authorTejun Heo <tj@kernel.org>
Tue, 5 Jun 2012 03:40:52 +0000 (20:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jun 2012 09:53:46 +0000 (11:53 +0200)
commit159749937a3e1605068a454b1607cdc5714f16e6
tree28be38dcf91e5714c9e264da9c9502c5b642aa00
parent13589864be74736ca4e6def7376742eb1d2099bf
blkcg: make root blkcg allocation use %GFP_KERNEL

Currently, blkcg_activate_policy() depends on %GFP_ATOMIC allocation
from __blkg_lookup_create() for root blkcg creation.  This could make
policy fail unnecessarily.

Make blkg_alloc() take @gfp_mask, __blkg_lookup_create() take an
optional @new_blkg for preallocated blkg, and blkcg_activate_policy()
preload radix tree and preallocate blkg with %GFP_KERNEL before trying
to create the root blkg.

v2: __blkg_lookup_create() was returning %NULL on blkg alloc failure
   instead of ERR_PTR() value.  Fixed.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c