]> Pileus Git - ~andy/linux/blobdiff - block/blk-mq-tag.c
Linux 3.14
[~andy/linux] / block / blk-mq-tag.c
index d64a02fb1f7307e75bc64410104d22087b04965c..83ae96c51a2762cf7386f096e348eace58525e37 100644 (file)
@@ -36,7 +36,8 @@ static unsigned int __blk_mq_get_tag(struct blk_mq_tags *tags, gfp_t gfp)
 {
        int tag;
 
-       tag = percpu_ida_alloc(&tags->free_tags, gfp);
+       tag = percpu_ida_alloc(&tags->free_tags, (gfp & __GFP_WAIT) ?
+                              TASK_UNINTERRUPTIBLE : TASK_RUNNING);
        if (tag < 0)
                return BLK_MQ_TAG_FAIL;
        return tag + tags->nr_reserved_tags;
@@ -52,7 +53,8 @@ static unsigned int __blk_mq_get_reserved_tag(struct blk_mq_tags *tags,
                return BLK_MQ_TAG_FAIL;
        }
 
-       tag = percpu_ida_alloc(&tags->reserved_tags, gfp);
+       tag = percpu_ida_alloc(&tags->reserved_tags, (gfp & __GFP_WAIT) ?
+                              TASK_UNINTERRUPTIBLE : TASK_RUNNING);
        if (tag < 0)
                return BLK_MQ_TAG_FAIL;
        return tag;
@@ -182,7 +184,7 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
 ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page)
 {
        char *orig_page = page;
-       int cpu;
+       unsigned int cpu;
 
        if (!tags)
                return 0;