From patchwork Fri Sep 30 19:12:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaun Tancheff X-Patchwork-Id: 9358777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29257600C8 for ; Fri, 30 Sep 2016 19:14:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14B402A152 for ; Fri, 30 Sep 2016 19:14:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 097092A154; Fri, 30 Sep 2016 19:14:14 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 C0D252A164 for ; Fri, 30 Sep 2016 19:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934033AbcI3TOG (ORCPT ); Fri, 30 Sep 2016 15:14:06 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:36677 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934011AbcI3TN6 (ORCPT ); Fri, 30 Sep 2016 15:13:58 -0400 Received: by mail-it0-f68.google.com with SMTP id o19so2213648ito.3; Fri, 30 Sep 2016 12:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Mpt0UwKit8+MJ37FHVfPC9/p4trxFkz/WCcgzIsqRA=; b=My/yvkqeBQ6Smco/Xf+Pat2jxa1fUMRyoqLAnbKniWh2j9pQ3paxUz0fsPpTKjZrmG OU/OrgXGNt8mbl1n+FPwc1QEWf6xObbjPeiG24P9nPXqQD+66K0s+yntg3sKvAx16JVq fy0bx8VG7++c2co2EWYowWOkO4+BqRBvZ/GoMxFwF99w2iHgrBHTmAxLF73rMwe/i58F ldZJHFvxhuFyBbmWirD/Hhwk1Yt1u2YKOHL4T8v94Lj5W24npUwAxVpYuQ4Wli2lGRTw y6/MjT0nufOxDIlFDJ+bWu1wPb65Cc91zrvdsSFL/fhmohJgCNWe8LHZcIpfOyyrUiO4 eehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5Mpt0UwKit8+MJ37FHVfPC9/p4trxFkz/WCcgzIsqRA=; b=OkzOfitoOYxr5mXnKcm7WzA6Lj428rpAG2V6/+PgGvOgoWIxz2okaZMFTUI8nOrNMW BQdsu/C1T4kj00I82MBp8Gf6HRS88MqcbWXi21n7P46rndt4rSiT7InvUNKZgwZwKuWk HUIn54Oef6dWlcefmKOvne2rQXN0DjqYtRC8MXxRhwnPeg3vanecErhdlSzMIHE0ofUu XefHjKkA6BKHGMGR9e12jKFuvc4H2YoAbCd9tJmctO0cDpgCRy6ycOkJNpv1lt36EZZ/ Ie7+0SGl90ijl10d7Bz5Fjj6NMc59c/Y0dw6aZdARbyH/1qw2K91Lp0D/RBspK8djgrR XfSQ== X-Gm-Message-State: AA6/9RmmnOzFEdqoZTFmoTbC5Op6d04X97dBqUJuSfflYgwq/oe3uK1joaremr/iKljp8A== X-Received: by 10.36.75.77 with SMTP id q74mr6600992ita.47.1475262837099; Fri, 30 Sep 2016 12:13:57 -0700 (PDT) Received: from helios.aeonazure.com (173-16-223-93.client.mchsi.com. [173.16.223.93]) by smtp.gmail.com with ESMTPSA id n69sm2599900ita.0.2016.09.30.12.13.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2016 12:13:56 -0700 (PDT) From: Shaun Tancheff To: Jens Axboe Cc: Hannes Reinecke , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , "Martin K . Petersen" , "James E . J . Bottomley" , Damien Le Moal , Michael T Lombardi Subject: [PATCH v6 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Fri, 30 Sep 2016 14:12:31 -0500 Message-Id: <20160930191237.13695-3-shaun@tancheff.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160930191237.13695-1-shaun@tancheff.com> References: <20160930191237.13695-1-shaun@tancheff.com> 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 From: Hannes Reinecke The queue limits already have a 'chunk_sectors' setting, so we should be presenting it via sysfs. Signed-off-by: Hannes Reinecke [Damien: Updated Documentation/ABI/testing/sysfs-block] Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- Documentation/ABI/testing/sysfs-block | 13 +++++++++++++ block/blk-sysfs.c | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index 75a5055..ee2d5cd 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block @@ -251,3 +251,16 @@ Description: since drive-managed zoned block devices do not support zone commands, they will be treated as regular block devices and zoned will report "none". + +What: /sys/block//queue/chunk_sectors +Date: September 2016 +Contact: Hannes Reinecke +Description: + chunk_sectors has different meaning depending on the type + of the disk. For a RAID device (dm-raid), chunk_sectors + indicates the size in 512B sectors of the RAID volume + stripe segment. For a zoned block device, either + host-aware or host-managed, chunk_sectors indicates the + size of 512B sectors of the zones of the device, with + the eventual exception of the last zone of the device + which may be smaller. diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index ff9cd9c..488c2e2 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -130,6 +130,11 @@ static ssize_t queue_physical_block_size_show(struct request_queue *q, char *pag return queue_var_show(queue_physical_block_size(q), page); } +static ssize_t queue_chunk_sectors_show(struct request_queue *q, char *page) +{ + return queue_var_show(q->limits.chunk_sectors, page); +} + static ssize_t queue_io_min_show(struct request_queue *q, char *page) { return queue_var_show(queue_io_min(q), page); @@ -455,6 +460,11 @@ static struct queue_sysfs_entry queue_physical_block_size_entry = { .show = queue_physical_block_size_show, }; +static struct queue_sysfs_entry queue_chunk_sectors_entry = { + .attr = {.name = "chunk_sectors", .mode = S_IRUGO }, + .show = queue_chunk_sectors_show, +}; + static struct queue_sysfs_entry queue_io_min_entry = { .attr = {.name = "minimum_io_size", .mode = S_IRUGO }, .show = queue_io_min_show, @@ -555,6 +565,7 @@ static struct attribute *default_attrs[] = { &queue_hw_sector_size_entry.attr, &queue_logical_block_size_entry.attr, &queue_physical_block_size_entry.attr, + &queue_chunk_sectors_entry.attr, &queue_io_min_entry.attr, &queue_io_opt_entry.attr, &queue_discard_granularity_entry.attr,