diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 12:02:41 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 12:02:41 -0400 |
| commit | 8cf1a3fce0b95050b63d451c9d561da0da2aa4d6 (patch) | |
| tree | 0dc7f93474c3be601a5893900db1418dfd60ba5d /mm | |
| parent | fcff06c438b60f415af5983efe92811d6aa02ad1 (diff) | |
| parent | 80799fbb7d10c30df78015b3fa21f7ffcfc0eb2c (diff) | |
Merge branch 'for-3.6/core' of git://git.kernel.dk/linux-block
Pull core block IO bits from Jens Axboe:
"The most complicated part if this is the request allocation rework by
Tejun, which has been queued up for a long time and has been in
for-next ditto as well.
There are a few commits from yesterday and today, mostly trivial and
obvious fixes. So I'm pretty confident that it is sound. It's also
smaller than usual."
* 'for-3.6/core' of git://git.kernel.dk/linux-block:
block: remove dead func declaration
block: add partition resize function to blkpg ioctl
block: uninitialized ioc->nr_tasks triggers WARN_ON
block: do not artificially constrain max_sectors for stacking drivers
blkcg: implement per-blkg request allocation
block: prepare for multiple request_lists
block: add q->nr_rqs[] and move q->rq.elvpriv to q->nr_rqs_elvpriv
blkcg: inline bio_blkcg() and friends
block: allocate io_context upfront
block: refactor get_request[_wait]()
block: drop custom queue draining used by scsi_transport_{iscsi|fc}
mempool: add @gfp_mask to mempool_create_node()
blkcg: make root blkcg allocation use %GFP_KERNEL
blkcg: __blkg_lookup_create() doesn't need radix preload
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/mempool.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/mempool.c b/mm/mempool.c index d9049811f352..54990476c049 100644 --- a/mm/mempool.c +++ b/mm/mempool.c | |||
| @@ -63,19 +63,21 @@ EXPORT_SYMBOL(mempool_destroy); | |||
| 63 | mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | 63 | mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, |
| 64 | mempool_free_t *free_fn, void *pool_data) | 64 | mempool_free_t *free_fn, void *pool_data) |
| 65 | { | 65 | { |
| 66 | return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,-1); | 66 | return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data, |
| 67 | GFP_KERNEL, NUMA_NO_NODE); | ||
| 67 | } | 68 | } |
| 68 | EXPORT_SYMBOL(mempool_create); | 69 | EXPORT_SYMBOL(mempool_create); |
| 69 | 70 | ||
| 70 | mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, | 71 | mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, |
| 71 | mempool_free_t *free_fn, void *pool_data, int node_id) | 72 | mempool_free_t *free_fn, void *pool_data, |
| 73 | gfp_t gfp_mask, int node_id) | ||
| 72 | { | 74 | { |
| 73 | mempool_t *pool; | 75 | mempool_t *pool; |
| 74 | pool = kmalloc_node(sizeof(*pool), GFP_KERNEL | __GFP_ZERO, node_id); | 76 | pool = kmalloc_node(sizeof(*pool), gfp_mask | __GFP_ZERO, node_id); |
| 75 | if (!pool) | 77 | if (!pool) |
| 76 | return NULL; | 78 | return NULL; |
| 77 | pool->elements = kmalloc_node(min_nr * sizeof(void *), | 79 | pool->elements = kmalloc_node(min_nr * sizeof(void *), |
| 78 | GFP_KERNEL, node_id); | 80 | gfp_mask, node_id); |
| 79 | if (!pool->elements) { | 81 | if (!pool->elements) { |
| 80 | kfree(pool); | 82 | kfree(pool); |
| 81 | return NULL; | 83 | return NULL; |
| @@ -93,7 +95,7 @@ mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, | |||
| 93 | while (pool->curr_nr < pool->min_nr) { | 95 | while (pool->curr_nr < pool->min_nr) { |
| 94 | void *element; | 96 | void *element; |
| 95 | 97 | ||
| 96 | element = pool->alloc(GFP_KERNEL, pool->pool_data); | 98 | element = pool->alloc(gfp_mask, pool->pool_data); |
| 97 | if (unlikely(!element)) { | 99 | if (unlikely(!element)) { |
| 98 | mempool_destroy(pool); | 100 | mempool_destroy(pool); |
| 99 | return NULL; | 101 | return NULL; |
