Skip to content

Commit d9f1439

Browse files
damien-lemoalaxboe
authored andcommitted
block: Move zone related debugfs attribute to blk-zoned.c
block/blk-mq-debugfs-zone.c contains a single debugfs attribute function. Defining this outside of block/blk-zoned.c does not really help in any way, so move this zone related debugfs attribute to block/blk-zoned.c and delete block/blk-mq-debugfs-zone.c. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Hans Holmberg <hans.holmberg@wdc.com> Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240408014128.205141-25-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bca150f commit d9f1439

5 files changed

Lines changed: 21 additions & 28 deletions

File tree

block/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ config BLK_DEBUG_FS
198198
Unless you are building a kernel for a tiny system, you should
199199
say Y here.
200200

201-
config BLK_DEBUG_FS_ZONED
202-
bool
203-
default BLK_DEBUG_FS && BLK_DEV_ZONED
204-
205201
config BLK_SED_OPAL
206202
bool "Logic for interfacing with Opal enabled SEDs"
207203
depends on KEYS

block/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
3333
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
3434
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
3535
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
36-
obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o
3736
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
3837
obj-$(CONFIG_BLK_PM) += blk-pm.o
3938
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += blk-crypto.o blk-crypto-profile.o \

block/blk-mq-debugfs-zoned.c

Lines changed: 0 additions & 22 deletions
This file was deleted.

block/blk-mq-debugfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
8383
}
8484
#endif
8585

86-
#ifdef CONFIG_BLK_DEBUG_FS_ZONED
86+
#if defined(CONFIG_BLK_DEV_ZONED) && defined(CONFIG_BLK_DEBUG_FS)
8787
int queue_zone_wlock_show(void *data, struct seq_file *m);
8888
#else
8989
static inline int queue_zone_wlock_show(void *data, struct seq_file *m)

block/blk-zoned.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "blk.h"
2525
#include "blk-mq-sched.h"
26+
#include "blk-mq-debugfs.h"
2627

2728
#define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name
2829
static const char *const zone_cond_name[] = {
@@ -1804,3 +1805,22 @@ int blk_revalidate_disk_zones(struct gendisk *disk)
18041805
return ret;
18051806
}
18061807
EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones);
1808+
1809+
#ifdef CONFIG_BLK_DEBUG_FS
1810+
1811+
int queue_zone_wlock_show(void *data, struct seq_file *m)
1812+
{
1813+
struct request_queue *q = data;
1814+
unsigned int i;
1815+
1816+
if (!q->disk->seq_zones_wlock)
1817+
return 0;
1818+
1819+
for (i = 0; i < q->disk->nr_zones; i++)
1820+
if (test_bit(i, q->disk->seq_zones_wlock))
1821+
seq_printf(m, "%u\n", i);
1822+
1823+
return 0;
1824+
}
1825+
1826+
#endif

0 commit comments

Comments
 (0)