diff options
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r-- | drivers/block/ll_rw_blk.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 81fe3a0c1fe7..cd8cf302068c 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/swap.h> | 29 | #include <linux/swap.h> |
30 | #include <linux/writeback.h> | 30 | #include <linux/writeback.h> |
31 | #include <linux/blkdev.h> | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * for max sense size | 34 | * for max sense size |
@@ -1645,7 +1646,8 @@ static int blk_init_free_list(request_queue_t *q) | |||
1645 | init_waitqueue_head(&rl->wait[WRITE]); | 1646 | init_waitqueue_head(&rl->wait[WRITE]); |
1646 | init_waitqueue_head(&rl->drain); | 1647 | init_waitqueue_head(&rl->drain); |
1647 | 1648 | ||
1648 | rl->rq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, request_cachep); | 1649 | rl->rq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, |
1650 | mempool_free_slab, request_cachep, q->node); | ||
1649 | 1651 | ||
1650 | if (!rl->rq_pool) | 1652 | if (!rl->rq_pool) |
1651 | return -ENOMEM; | 1653 | return -ENOMEM; |
@@ -1657,8 +1659,15 @@ static int __make_request(request_queue_t *, struct bio *); | |||
1657 | 1659 | ||
1658 | request_queue_t *blk_alloc_queue(int gfp_mask) | 1660 | request_queue_t *blk_alloc_queue(int gfp_mask) |
1659 | { | 1661 | { |
1660 | request_queue_t *q = kmem_cache_alloc(requestq_cachep, gfp_mask); | 1662 | return blk_alloc_queue_node(gfp_mask, -1); |
1663 | } | ||
1664 | EXPORT_SYMBOL(blk_alloc_queue); | ||
1665 | |||
1666 | request_queue_t *blk_alloc_queue_node(int gfp_mask, int node_id) | ||
1667 | { | ||
1668 | request_queue_t *q; | ||
1661 | 1669 | ||
1670 | q = kmem_cache_alloc_node(requestq_cachep, gfp_mask, node_id); | ||
1662 | if (!q) | 1671 | if (!q) |
1663 | return NULL; | 1672 | return NULL; |
1664 | 1673 | ||
@@ -1671,8 +1680,7 @@ request_queue_t *blk_alloc_queue(int gfp_mask) | |||
1671 | 1680 | ||
1672 | return q; | 1681 | return q; |
1673 | } | 1682 | } |
1674 | 1683 | EXPORT_SYMBOL(blk_alloc_queue_node); | |
1675 | EXPORT_SYMBOL(blk_alloc_queue); | ||
1676 | 1684 | ||
1677 | /** | 1685 | /** |
1678 | * blk_init_queue - prepare a request queue for use with a block device | 1686 | * blk_init_queue - prepare a request queue for use with a block device |
@@ -1705,13 +1713,22 @@ EXPORT_SYMBOL(blk_alloc_queue); | |||
1705 | * blk_init_queue() must be paired with a blk_cleanup_queue() call | 1713 | * blk_init_queue() must be paired with a blk_cleanup_queue() call |
1706 | * when the block device is deactivated (such as at module unload). | 1714 | * when the block device is deactivated (such as at module unload). |
1707 | **/ | 1715 | **/ |
1716 | |||
1708 | request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock) | 1717 | request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock) |
1709 | { | 1718 | { |
1710 | request_queue_t *q = blk_alloc_queue(GFP_KERNEL); | 1719 | return blk_init_queue_node(rfn, lock, -1); |
1720 | } | ||
1721 | EXPORT_SYMBOL(blk_init_queue); | ||
1722 | |||
1723 | request_queue_t * | ||
1724 | blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | ||
1725 | { | ||
1726 | request_queue_t *q = blk_alloc_queue_node(GFP_KERNEL, node_id); | ||
1711 | 1727 | ||
1712 | if (!q) | 1728 | if (!q) |
1713 | return NULL; | 1729 | return NULL; |
1714 | 1730 | ||
1731 | q->node = node_id; | ||
1715 | if (blk_init_free_list(q)) | 1732 | if (blk_init_free_list(q)) |
1716 | goto out_init; | 1733 | goto out_init; |
1717 | 1734 | ||
@@ -1754,8 +1771,7 @@ out_init: | |||
1754 | kmem_cache_free(requestq_cachep, q); | 1771 | kmem_cache_free(requestq_cachep, q); |
1755 | return NULL; | 1772 | return NULL; |
1756 | } | 1773 | } |
1757 | 1774 | EXPORT_SYMBOL(blk_init_queue_node); | |
1758 | EXPORT_SYMBOL(blk_init_queue); | ||
1759 | 1775 | ||
1760 | int blk_get_queue(request_queue_t *q) | 1776 | int blk_get_queue(request_queue_t *q) |
1761 | { | 1777 | { |