Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5077702imd; Tue, 30 Oct 2018 11:36:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5djUAv/5tzWQn6eOB3ezyv6Mnp5gICts7oYaSL4KJ5npMioF9OpFGob7zwxA866CeoHJ/Y4 X-Received: by 2002:a63:396:: with SMTP id 144mr37494pgd.68.1540924564988; Tue, 30 Oct 2018 11:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540924564; cv=none; d=google.com; s=arc-20160816; b=05Ymm/IY8X8jbHozj8PUBKR1jsT0YJffh/zoZxheFPX3WpTwzqcKYTPVUo7l6ETo8a e0+M8cV1vFsxWlCBRSsM6RZW0/98y9GRIItokdmnZmOS7hIOUKAPPRMyYwjJ5ezTLO2H FieIut9Ea2mBcQtS/+aNiEmpbVMKxsa63yjHICWZ5//xB1W5Fuf4BBMGqX0xoMEqWMZC fxiru7rY4J5V5FDOgJCOCc1AXZ8iEWlSxU1G/o8xvB40RUCJ+w3xsAgfMwtUWKzwpJys EbrZMn0TDVMbPv2jqvP1CZBZLZb6n71EbOtnHLknu1RcksE/jtxNfjGLXhu/bEXNAkep YcHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FDKGBdEnPJqmZMVEkJWhACz2yqqeabrzsupMLOYAhO4=; b=t9f+rHfgPxliTzy7V+g/Cc5Ur8EWXYjJ/eBdb2NJQ9QCFXqzo0Cs/DXi+ISr1HwnE9 IlQc0F/Vsg//kHfLVv4UhE9e380omMsIEJ09RI3JNG6ayuwgxD8NPRJgwV4psOX/NS8b 10Uv5fbqeWhUFkLQZQ2EHD4oOFaG31/6+OrdnmMVdfSCB7UvPgYRlHVcA2Q14JmEPBiN GPu1fbOB1NxY6DMJWdVRvtxTNvC2QL+8bE77pkhB+/JUPKigxJbPIn672v8N1Xye/iz1 MfLWFzTBZjPON90nvyeNiuJcG2FCBS8NObmeE7IKTTape8ABlqj8dPr/6tjp7sxmewok FNgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=sAQt6Arm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si24151278pgq.1.2018.10.30.11.35.42; Tue, 30 Oct 2018 11:36:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=sAQt6Arm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbeJaD1o (ORCPT + 99 others); Tue, 30 Oct 2018 23:27:44 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:51599 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbeJaD1n (ORCPT ); Tue, 30 Oct 2018 23:27:43 -0400 Received: by mail-it1-f194.google.com with SMTP id h13so2108200itl.1 for ; Tue, 30 Oct 2018 11:33:08 -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=FDKGBdEnPJqmZMVEkJWhACz2yqqeabrzsupMLOYAhO4=; b=sAQt6ArmCG29q2FC2N3AEPWxQsxpU9ESDqTKtgWldkMW2zejie424VUyRdwDv7/jyk GyqYFEYz4ONd0OYnjasEn/TFB6hImfM5yLp0uRFa9aLHzTAnwfAloAjbv9XSQuHSEtpi Ao3wpVsOXf+CPjgybmvDgJUbd6fUHHKIWo/qqzzt0lK/C5TAEf693/Jnutc5CUDF3TtE oM2KFZpex+B94D1hHl+W/JBGdFdn7V9ZLHp3gW8ElWLMBn3kR57HI+LSyIaYqEtIZqAr GuZr6MvIyKcjcS2MFzlVIeh+kiOBxOFZvDMyvgkKuv62C4Y3FaavZy8s5pjh7iMzVqIL bhvg== 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=FDKGBdEnPJqmZMVEkJWhACz2yqqeabrzsupMLOYAhO4=; b=jI4IVBDg6YugXSi+EqyyAwZ2xvCogK5yBj7UlC9dLZOD27zl7Xk1MN6+ItLAsD9b93 nDv00LZCZ/tZE1CFQjOqS+TXVyY59OUONcIiQnroIQ9+FPq1QrCYhAW7n2VLR3KxX1ep 5MMlxoOOyvPfsFYuFwps97F2rGrYy6sQkz5Y/GwNHFCZXfzZ5BZGkUBDZgZ7zxeUsEdt CWZMbX4qiTWnzcW6FNjj1YDhPQqBA8sNSV8FUtJ8t/xNnypHFSJaD9oGDDMm6DNT9goz BHsSCYQXeNxnJpIrBBoR+46jGi/Cf4FvIsx4Dqyy0Bw8/TxyNnk7nxbKqxKtYrl6EMy+ AQsA== X-Gm-Message-State: AGRZ1gJ5WFKNyUZBV3cWivQTUTxO8bVpGag5G1YR9ck+W1A9CoQjkn6k 2U0nr+FOavxF40pTD88CKA/pZQ== X-Received: by 2002:a24:4f51:: with SMTP id c78-v6mr22872itb.56.1540924388040; Tue, 30 Oct 2018 11:33:08 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id o20-v6sm4895739itc.34.2018.10.30.11.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 11:33:06 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 06/16] blk-mq: add 'type' attribute to the sysfs hctx directory Date: Tue, 30 Oct 2018 12:32:42 -0600 Message-Id: <20181030183252.17857-7-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181030183252.17857-1-axboe@kernel.dk> References: <20181030183252.17857-1-axboe@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe --- 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, }; -- 2.17.1