blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled
authorYu Kuai <yukuai3@huawei.com>
Sat, 27 May 2023 01:06:40 +0000 (09:06 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Jun 2023 15:53:36 +0000 (09:53 -0600)
commit645a829e03384a235b3760959d4ebe420a0f2027
treebee82941f88b81d28568d96fd2b26bfd9a6207d2
parentc6b7a3a26e809c9d2a51ae303764c1d2994f31cf
blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled

sysfs entry /sys/block/[device]/queue/wbt_lat_usec will be created even
if CONFIG_BLK_WBT is disabled, while read and write will always fail.
It doesn't make sense to create a sysfs entry that can't be accessed,
so don't create such entry.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230527010644.647900-2-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-sysfs.c
block/blk-wbt.h