diff options
author | Yu Kuai <yukuai3@huawei.com> | 2022-10-19 20:15:17 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-10-23 18:59:17 -0600 |
commit | 181d06637451b5348d746039478e71fa53dfbff6 (patch) | |
tree | 4b88f1ab8dc366cda76066b8fab918c46ad72891 /block/elevator.c | |
parent | 3642ef4d95699193c4a461862382e643ae3720f0 (diff) |
elevator: add new field flags in struct elevator_queue
There are only one flag to indicate that elevator is registered currently,
prepare to add a flag to disable wbt if default elevator is bfq.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221019121518.3865235-6-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index 20e70fd3f77f..9e12706e8d8c 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -512,7 +512,7 @@ int elv_register_queue(struct request_queue *q, bool uevent) if (uevent) kobject_uevent(&e->kobj, KOBJ_ADD); - e->registered = 1; + set_bit(ELEVATOR_FLAG_REGISTERED, &e->flags); } return error; } @@ -523,11 +523,9 @@ void elv_unregister_queue(struct request_queue *q) lockdep_assert_held(&q->sysfs_lock); - if (e && e->registered) { + if (e && test_and_clear_bit(ELEVATOR_FLAG_REGISTERED, &e->flags)) { kobject_uevent(&e->kobj, KOBJ_REMOVE); kobject_del(&e->kobj); - - e->registered = 0; } } |