diff options
| author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-03-07 20:10:03 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-03-08 16:13:48 -0500 |
| commit | f78bac2c8e69144781e271d9771bae8dbb4e7098 (patch) | |
| tree | 6897788655ef507c7a0c158fde32e2d15dadf539 /block | |
| parent | 66f91322f39cd18a01524264464c2ff4c98c936e (diff) | |
block: Use the queue_flag_*() functions instead of open-coding these
Except for changing the atomic queue flag manipulations that are
protected by the queue lock into non-atomic manipulations, this
patch does not change any functionality.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
| -rw-r--r-- | block/blk-core.c | 2 | ||||
| -rw-r--r-- | block/blk-mq.c | 2 | ||||
| -rw-r--r-- | block/blk-settings.c | 4 | ||||
| -rw-r--r-- | block/blk-stat.c | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 6febc69a58aa..241b73088617 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -994,7 +994,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, | |||
| 994 | * registered by blk_register_queue(). | 994 | * registered by blk_register_queue(). |
| 995 | */ | 995 | */ |
| 996 | q->bypass_depth = 1; | 996 | q->bypass_depth = 1; |
| 997 | __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); | 997 | queue_flag_set_unlocked(QUEUE_FLAG_BYPASS, q); |
| 998 | 998 | ||
| 999 | init_waitqueue_head(&q->mq_freeze_wq); | 999 | init_waitqueue_head(&q->mq_freeze_wq); |
| 1000 | 1000 | ||
diff --git a/block/blk-mq.c b/block/blk-mq.c index 75336848f7a7..e70cc7d48f58 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -2678,7 +2678,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, | |||
| 2678 | q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT; | 2678 | q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT; |
| 2679 | 2679 | ||
| 2680 | if (!(set->flags & BLK_MQ_F_SG_MERGE)) | 2680 | if (!(set->flags & BLK_MQ_F_SG_MERGE)) |
| 2681 | q->queue_flags |= 1 << QUEUE_FLAG_NO_SG_MERGE; | 2681 | queue_flag_set_unlocked(QUEUE_FLAG_NO_SG_MERGE, q); |
| 2682 | 2682 | ||
| 2683 | q->sg_reserved_size = INT_MAX; | 2683 | q->sg_reserved_size = INT_MAX; |
| 2684 | 2684 | ||
diff --git a/block/blk-settings.c b/block/blk-settings.c index 48ebe6be07b7..7f719da0eadd 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
| @@ -861,9 +861,9 @@ void blk_queue_flush_queueable(struct request_queue *q, bool queueable) | |||
| 861 | { | 861 | { |
| 862 | spin_lock_irq(q->queue_lock); | 862 | spin_lock_irq(q->queue_lock); |
| 863 | if (queueable) | 863 | if (queueable) |
| 864 | clear_bit(QUEUE_FLAG_FLUSH_NQ, &q->queue_flags); | 864 | queue_flag_clear(QUEUE_FLAG_FLUSH_NQ, q); |
| 865 | else | 865 | else |
| 866 | set_bit(QUEUE_FLAG_FLUSH_NQ, &q->queue_flags); | 866 | queue_flag_set(QUEUE_FLAG_FLUSH_NQ, q); |
| 867 | spin_unlock_irq(q->queue_lock); | 867 | spin_unlock_irq(q->queue_lock); |
| 868 | } | 868 | } |
| 869 | EXPORT_SYMBOL_GPL(blk_queue_flush_queueable); | 869 | EXPORT_SYMBOL_GPL(blk_queue_flush_queueable); |
diff --git a/block/blk-stat.c b/block/blk-stat.c index 28003bf9941c..b664aa6df725 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c | |||
| @@ -152,7 +152,7 @@ void blk_stat_add_callback(struct request_queue *q, | |||
| 152 | 152 | ||
| 153 | spin_lock(&q->stats->lock); | 153 | spin_lock(&q->stats->lock); |
| 154 | list_add_tail_rcu(&cb->list, &q->stats->callbacks); | 154 | list_add_tail_rcu(&cb->list, &q->stats->callbacks); |
| 155 | set_bit(QUEUE_FLAG_STATS, &q->queue_flags); | 155 | queue_flag_set(QUEUE_FLAG_STATS, q); |
| 156 | spin_unlock(&q->stats->lock); | 156 | spin_unlock(&q->stats->lock); |
| 157 | } | 157 | } |
| 158 | EXPORT_SYMBOL_GPL(blk_stat_add_callback); | 158 | EXPORT_SYMBOL_GPL(blk_stat_add_callback); |
| @@ -163,7 +163,7 @@ void blk_stat_remove_callback(struct request_queue *q, | |||
| 163 | spin_lock(&q->stats->lock); | 163 | spin_lock(&q->stats->lock); |
| 164 | list_del_rcu(&cb->list); | 164 | list_del_rcu(&cb->list); |
| 165 | if (list_empty(&q->stats->callbacks) && !q->stats->enable_accounting) | 165 | if (list_empty(&q->stats->callbacks) && !q->stats->enable_accounting) |
| 166 | clear_bit(QUEUE_FLAG_STATS, &q->queue_flags); | 166 | queue_flag_clear(QUEUE_FLAG_STATS, q); |
| 167 | spin_unlock(&q->stats->lock); | 167 | spin_unlock(&q->stats->lock); |
| 168 | 168 | ||
| 169 | del_timer_sync(&cb->timer); | 169 | del_timer_sync(&cb->timer); |
| @@ -191,7 +191,7 @@ void blk_stat_enable_accounting(struct request_queue *q) | |||
| 191 | { | 191 | { |
| 192 | spin_lock(&q->stats->lock); | 192 | spin_lock(&q->stats->lock); |
| 193 | q->stats->enable_accounting = true; | 193 | q->stats->enable_accounting = true; |
| 194 | set_bit(QUEUE_FLAG_STATS, &q->queue_flags); | 194 | queue_flag_set(QUEUE_FLAG_STATS, q); |
| 195 | spin_unlock(&q->stats->lock); | 195 | spin_unlock(&q->stats->lock); |
| 196 | } | 196 | } |
| 197 | 197 | ||
