From patchwork Mon Oct 29 16:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10659731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3FB61751 for ; Mon, 29 Oct 2018 16:38:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAFF329BB9 for ; Mon, 29 Oct 2018 16:38:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFB6029BBD; Mon, 29 Oct 2018 16:38:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 868D229BB9 for ; Mon, 29 Oct 2018 16:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728231AbeJ3B1Q (ORCPT ); Mon, 29 Oct 2018 21:27:16 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:55908 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727872AbeJ3B1Q (ORCPT ); Mon, 29 Oct 2018 21:27:16 -0400 Received: by mail-it1-f193.google.com with SMTP id e17so8687903itk.5 for ; Mon, 29 Oct 2018 09:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ibssz+RTYOgnABH8iblTDxiQJXKqVGK071Agvxpp/w8=; b=Euwd+xGSRZSC+Jh6OV9lsCHuG6H4fzJeU0B8PY06fsrW/ClKm3j1ZubHWn/hbqk+MX i9O7SucqpPAUU6rGYbR3uKT3JjhuS5fzzmycCZmcZNo59RLfAcvLQDChoU48oCaEm6g3 sNDmMCiAJPp4xKZzvupi6Zd5W11NpbFBnzQeNP+gIg46fSti73Qm2nENXuzAwE/HCJWm HIPaIiZAnm/JBHPN9+K88/zdPiR/BwsYmV3mmkrO3SVjY1soX1ooT4mTEvpkxs2+bnQv ChVrII9kfhvhl+IKVfmmeb3vt4M17tjvqH6/xVPDodP169qoLWGmSLPTvIB6jvp6hcjP cqYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ibssz+RTYOgnABH8iblTDxiQJXKqVGK071Agvxpp/w8=; b=BSh8KLuZm3tcYUWQvO8N7nyT1rHLO9mKLsqoGTTjMv+XzRCDrtBH5dP9purlYk68qD h8ELkem1WLwPj8m4w+w6i55AGwsUUXQQg+e0tiGzBBs8x1/unTtxYiRXo9PB7yYCMufr y74XSdIA0ok6VRP6kzlm+UcbDXxqxyaeiCTNjk3WhN7/oDR61fsEcKwULHRoxDvV5+xD jXlubODYn8DjAYioKgDWSNc1FmE1Le0dvBxKzVPWKYZMRbzJYp7pcy+oMEGuwLSNXC5q xe7IrPpsoOVF6hGw4eU1ZYfYZs7IADSR/9jI/h8a+Zl7hjUP8gS8i3xCRV1NWEkmCDKu zPjg== X-Gm-Message-State: AGRZ1gIX2e66/6W6STyIim8rtG64l0i4HZaXOC2oSF/PDvOBlWgTEoFD xzbbKsfBlYQ/4GnsubMVAadr4w== X-Google-Smtp-Source: AJdET5faGUrC0AwyueMFKr4H1ego6W+WoFGqiU8vFsgz6fuMjIPXRnSB/jMgScRdMdmN+lzkCuIJlA== X-Received: by 2002:a24:b341:: with SMTP id z1-v6mr11211615iti.62.1540831074546; Mon, 29 Oct 2018 09:37:54 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id q15-v6sm3367019itc.38.2018.10.29.09.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:37:52 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 06/14] blk-mq: add 'type' attribute to the sysfs hctx directory Date: Mon, 29 Oct 2018 10:37:30 -0600 Message-Id: <20181029163738.10172-7-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029163738.10172-1-axboe@kernel.dk> References: <20181029163738.10172-1-axboe@kernel.dk> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It can be useful for a user to verify what type a given hardware queue is, expose this information in sysfs. Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe Reviewed-by: Bart Van Assche --- block/blk-mq-sysfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index aafb44224c89..2d737f9e7ba7 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -161,6 +161,11 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) return ret; } +static ssize_t blk_mq_hw_sysfs_type_show(struct blk_mq_hw_ctx *hctx, char *page) +{ + return sprintf(page, "%u\n", hctx->type); +} + static struct attribute *default_ctx_attrs[] = { NULL, }; @@ -177,11 +182,16 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = { .attr = {.name = "cpu_list", .mode = 0444 }, .show = blk_mq_hw_sysfs_cpus_show, }; +static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_type = { + .attr = {.name = "type", .mode = 0444 }, + .show = blk_mq_hw_sysfs_type_show, +}; static struct attribute *default_hw_ctx_attrs[] = { &blk_mq_hw_sysfs_nr_tags.attr, &blk_mq_hw_sysfs_nr_reserved_tags.attr, &blk_mq_hw_sysfs_cpus.attr, + &blk_mq_hw_sysfs_type.attr, NULL, };