From patchwork Fri Apr 5 04:42:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 786393 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 055C147A7D; Fri, 5 Apr 2024 04:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712292165; cv=none; b=i49oxty1D1oNaByoFmIJfmhjmcSk0GcSEUrwdErrFXIQMf5Q9cFGjCI0UN/sfof3bZvPdPwDNieRUszskwcrAtxvxSAYS8rArPhfvx2GOgpJu5NzoLDJ91eb06TcBsljM3/D+pRGJK+jb4mcqqgKvGvz9qwLMWh030Eh6yAsFVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712292165; c=relaxed/simple; bh=4Pg4XzbZBz92WmhDBNN7ZA4tIi5+gef+Z+WV/wX2CXI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=srDUfcS7ki7r+krFwE3UBNEiVmHr8OUSiEJnZ3x2yqm601rWIt3PSpjuPRmyJ73UjkSs2GfdpuxnhJ+XQssbWdNecbqzAkoNvZhmQOU6OKy5/CnShbqoe0QrlXfV5KNZaoTkZiSLStzLeSO6LjZ/maaQKXeWDEhdvSNecMvL7dE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lL89E9hp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lL89E9hp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE1A4C433B1; Fri, 5 Apr 2024 04:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712292164; bh=4Pg4XzbZBz92WmhDBNN7ZA4tIi5+gef+Z+WV/wX2CXI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lL89E9hpzHYUoXgi/p7sWduvcUrZs0JuEQczeAPi4fXOkhERCJFP/TuHcIKUjZfhl x8OFZEHsK2FTNn1fmkY+sBB5tZCn7dHNPOcLEZbdAp7c6U+EBYGtT9PDujGFEcXdh0 AToxRmBBHXfRTpXdxSg2yuAQNpXRmUSSOF3cG9NVyPhBB2aqFjjfi30FfpZsvtsEtE 5HqSPcRkeilgQ5kz3k4vc1SJXWIwlP1SEqZX8xrQ/NRmlHaxuhsQczVDxQ/BvCuIhH gg4KBh9rHUMLJ3hFht23Bpf80IZVxZSHcJ/T2IM53V2kRsndbd4tb28MWQ6sTR/nSm qnNcDBac2bEVQ== From: Damien Le Moal To: linux-block@vger.kernel.org, Jens Axboe , linux-scsi@vger.kernel.org, "Martin K . Petersen" , dm-devel@lists.linux.dev, Mike Snitzer , linux-nvme@lists.infradead.org, Keith Busch , Christoph Hellwig Subject: [PATCH v6 24/28] block: Move zone related debugfs attribute to blk-zoned.c Date: Fri, 5 Apr 2024 13:42:03 +0900 Message-ID: <20240405044207.1123462-25-dlemoal@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240405044207.1123462-1-dlemoal@kernel.org> References: <20240405044207.1123462-1-dlemoal@kernel.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Tested-by: Hans Holmberg --- block/Kconfig | 4 ---- block/Makefile | 1 - block/blk-mq-debugfs-zoned.c | 22 ---------------------- block/blk-mq-debugfs.h | 2 +- block/blk-zoned.c | 20 ++++++++++++++++++++ 5 files changed, 21 insertions(+), 28 deletions(-) delete mode 100644 block/blk-mq-debugfs-zoned.c diff --git a/block/Kconfig b/block/Kconfig index 1de4682d48cc..9f647149fbee 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -198,10 +198,6 @@ config BLK_DEBUG_FS Unless you are building a kernel for a tiny system, you should say Y here. -config BLK_DEBUG_FS_ZONED - bool - default BLK_DEBUG_FS && BLK_DEV_ZONED - config BLK_SED_OPAL bool "Logic for interfacing with Opal enabled SEDs" depends on KEYS diff --git a/block/Makefile b/block/Makefile index 46ada9dc8bbf..168150b9c510 100644 --- a/block/Makefile +++ b/block/Makefile @@ -33,7 +33,6 @@ obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o obj-$(CONFIG_BLK_WBT) += blk-wbt.o obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o -obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o obj-$(CONFIG_BLK_PM) += blk-pm.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += blk-crypto.o blk-crypto-profile.o \ diff --git a/block/blk-mq-debugfs-zoned.c b/block/blk-mq-debugfs-zoned.c deleted file mode 100644 index a77b099c34b7..000000000000 --- a/block/blk-mq-debugfs-zoned.c +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2017 Western Digital Corporation or its affiliates. - */ - -#include -#include "blk-mq-debugfs.h" - -int queue_zone_wlock_show(void *data, struct seq_file *m) -{ - struct request_queue *q = data; - unsigned int i; - - if (!q->disk->seq_zones_wlock) - return 0; - - for (i = 0; i < q->disk->nr_zones; i++) - if (test_bit(i, q->disk->seq_zones_wlock)) - seq_printf(m, "%u\n", i); - - return 0; -} diff --git a/block/blk-mq-debugfs.h b/block/blk-mq-debugfs.h index 9c7d4b6117d4..3ebe2c29b624 100644 --- a/block/blk-mq-debugfs.h +++ b/block/blk-mq-debugfs.h @@ -83,7 +83,7 @@ static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos) } #endif -#ifdef CONFIG_BLK_DEBUG_FS_ZONED +#if defined(CONFIG_BLK_DEV_ZONED) && defined(CONFIG_BLK_DEBUG_FS) int queue_zone_wlock_show(void *data, struct seq_file *m); #else static inline int queue_zone_wlock_show(void *data, struct seq_file *m) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index e46d23ad2fa9..a06d7f7a54c7 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -23,6 +23,7 @@ #include "blk.h" #include "blk-mq-sched.h" +#include "blk-mq-debugfs.h" #define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name static const char *const zone_cond_name[] = { @@ -1804,3 +1805,22 @@ int blk_revalidate_disk_zones(struct gendisk *disk) return ret; } EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones); + +#ifdef CONFIG_BLK_DEBUG_FS + +int queue_zone_wlock_show(void *data, struct seq_file *m) +{ + struct request_queue *q = data; + unsigned int i; + + if (!q->disk->seq_zones_wlock) + return 0; + + for (i = 0; i < q->disk->nr_zones; i++) + if (test_bit(i, q->disk->seq_zones_wlock)) + seq_printf(m, "%u\n", i); + + return 0; +} + +#endif