blk-core.c (12f5b93145450c750f315657ef239a314811aeeb) blk-core.c (338aa96d5661048b3c0cafc6d91876025603cacf)
1/*
2 * Copyright (C) 1991, 1992 Linus Torvalds
3 * Copyright (C) 1994, Karl Keyte: Added support for disk statistics
4 * Elevator latency, (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
5 * Queue request tables / lock, selectable elevator, Jens Axboe <axboe@suse.de>
6 * kernel-doc documentation started by NeilBrown <neilb@cse.unsw.edu.au>
7 * - July2000
8 * bio rewrite, highmem i/o, etc, Jens Axboe <axboe@suse.de> - may 2001

--- 978 unchanged lines hidden (view full) ---

987 * setting the queue lock pointer explicitly to avoid triggering a sporadic
988 * crash in the blkcg code. This function namely calls blkcg_init_queue() and
989 * the queue lock pointer must be set before blkcg_init_queue() is called.
990 */
991struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id,
992 spinlock_t *lock)
993{
994 struct request_queue *q;
1/*
2 * Copyright (C) 1991, 1992 Linus Torvalds
3 * Copyright (C) 1994, Karl Keyte: Added support for disk statistics
4 * Elevator latency, (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
5 * Queue request tables / lock, selectable elevator, Jens Axboe <axboe@suse.de>
6 * kernel-doc documentation started by NeilBrown <neilb@cse.unsw.edu.au>
7 * - July2000
8 * bio rewrite, highmem i/o, etc, Jens Axboe <axboe@suse.de> - may 2001

--- 978 unchanged lines hidden (view full) ---

987 * setting the queue lock pointer explicitly to avoid triggering a sporadic
988 * crash in the blkcg code. This function namely calls blkcg_init_queue() and
989 * the queue lock pointer must be set before blkcg_init_queue() is called.
990 */
991struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id,
992 spinlock_t *lock)
993{
994 struct request_queue *q;
995 int ret;
995
996 q = kmem_cache_alloc_node(blk_requestq_cachep,
997 gfp_mask | __GFP_ZERO, node_id);
998 if (!q)
999 return NULL;
1000
1001 q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
1002 if (q->id < 0)
1003 goto fail_q;
1004
996
997 q = kmem_cache_alloc_node(blk_requestq_cachep,
998 gfp_mask | __GFP_ZERO, node_id);
999 if (!q)
1000 return NULL;
1001
1002 q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
1003 if (q->id < 0)
1004 goto fail_q;
1005
1005 q->bio_split = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
1006 if (!q->bio_split)
1006 ret = bioset_init(&q->bio_split, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
1007 if (ret)
1007 goto fail_id;
1008
1009 q->backing_dev_info = bdi_alloc_node(gfp_mask, node_id);
1010 if (!q->backing_dev_info)
1011 goto fail_split;
1012
1013 q->stats = blk_alloc_queue_stats();
1014 if (!q->stats)

--- 55 unchanged lines hidden (view full) ---

1070
1071fail_ref:
1072 percpu_ref_exit(&q->q_usage_counter);
1073fail_bdi:
1074 blk_free_queue_stats(q->stats);
1075fail_stats:
1076 bdi_put(q->backing_dev_info);
1077fail_split:
1008 goto fail_id;
1009
1010 q->backing_dev_info = bdi_alloc_node(gfp_mask, node_id);
1011 if (!q->backing_dev_info)
1012 goto fail_split;
1013
1014 q->stats = blk_alloc_queue_stats();
1015 if (!q->stats)

--- 55 unchanged lines hidden (view full) ---

1071
1072fail_ref:
1073 percpu_ref_exit(&q->q_usage_counter);
1074fail_bdi:
1075 blk_free_queue_stats(q->stats);
1076fail_stats:
1077 bdi_put(q->backing_dev_info);
1078fail_split:
1078 bioset_free(q->bio_split);
1079 bioset_exit(&q->bio_split);
1079fail_id:
1080 ida_simple_remove(&blk_queue_ida, q->id);
1081fail_q:
1082 kmem_cache_free(blk_requestq_cachep, q);
1083 return NULL;
1084}
1085EXPORT_SYMBOL(blk_alloc_queue_node);
1086

--- 2865 unchanged lines hidden ---
1080fail_id:
1081 ida_simple_remove(&blk_queue_ida, q->id);
1082fail_q:
1083 kmem_cache_free(blk_requestq_cachep, q);
1084 return NULL;
1085}
1086EXPORT_SYMBOL(blk_alloc_queue_node);
1087

--- 2865 unchanged lines hidden ---