@@ -462,7 +462,8 @@ static struct blk_mq_tags *blk_mq_init_bitmap_tags(struct blk_mq_tags *tags,
struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
unsigned int reserved_tags,
- int node, int alloc_policy)
+ int node, int alloc_policy,
+ gfp_t flags)
{
struct blk_mq_tags *tags;
@@ -471,7 +472,7 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
return NULL;
}
- tags = kzalloc_node(sizeof(*tags), GFP_KERNEL, node);
+ tags = kzalloc_node(sizeof(*tags), flags, node);
if (!tags)
return NULL;
@@ -22,7 +22,10 @@ struct blk_mq_tags {
};
-extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int reserved_tags, int node, int alloc_policy);
+extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
+ unsigned int reserved_tags,
+ int node, int alloc_policy,
+ gfp_t flags);
extern void blk_mq_free_tags(struct blk_mq_tags *tags);
extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
@@ -2090,7 +2090,8 @@ struct blk_mq_tags *blk_mq_alloc_rq_map(struct blk_mq_tag_set *set,
node = set->numa_node;
tags = blk_mq_init_tags(nr_tags, reserved_tags, node,
- BLK_MQ_FLAG_TO_ALLOC_POLICY(set->flags));
+ BLK_MQ_FLAG_TO_ALLOC_POLICY(set->flags),
+ GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY);
if (!tags)
return NULL;