From patchwork Wed Sep 28 01:22:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9353015 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 30B4D6077A for ; Wed, 28 Sep 2016 01:23:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E7BF28A38 for ; Wed, 28 Sep 2016 01:23:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1348129133; Wed, 28 Sep 2016 01:23:02 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 796E728A38 for ; Wed, 28 Sep 2016 01:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933138AbcI1BXA (ORCPT ); Tue, 27 Sep 2016 21:23:00 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:31916 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933226AbcI1BW5 (ORCPT ); Tue, 27 Sep 2016 21:22:57 -0400 X-IronPort-AV: E=Sophos;i="5.30,407,1470672000"; d="scan'";a="18715478" Received: from mail-co1nam03lp0018.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.18]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 09:22:56 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-hgst-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=42EmSULe2w1746w3Zu+CPWSmWs3oEjhMQO348jO+5IA=; b=ibcm7JWKpYmvcO86TwYgeyzEhB9Aj+MbRWRGPPnJB0PSD8tH9k6ZO/7b5wP2L+I85pw2pNHII/ZZ7cmNY1vXvzeD60XxINsU3x1gcKBXpQJdH73SNZvXGuVrUghdXMO3Pj63xGB5SOTaBA8o864Wey+CjcKmV+6BYg7sh3oPozw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by BL2PR04MB1972.namprd04.prod.outlook.com (10.167.97.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 28 Sep 2016 01:22:53 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v3 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Wed, 28 Sep 2016 10:22:32 +0900 Message-ID: <1475025757-6340-3-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475025757-6340-1-git-send-email-damien.lemoal@hgst.com> References: <1475025757-6340-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CY1PR13CA0119.namprd13.prod.outlook.com (10.164.65.45) To BL2PR04MB1972.namprd04.prod.outlook.com (10.167.97.144) X-MS-Office365-Filtering-Correlation-Id: 0ec873ff-5a34-480c-6a73-08d3e73df959 X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1972; 2:ikgevGX92rRyy6nXVyhJTGnzdBtxszChlkYiph5j7H+MobcwPakfvbFegNG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UsWvscv2j2BOt0g0mUVJ2hB75op3YdIrs3Oy5gPCqwaph7dv2chmLG6JhuzpDixUO8LtUGOVaNZw5edn7k5njjlK/jcU+ii0gagL0h7mpaeV+h5cMfc689eHhBNPdslnhmX7LVPRg7U+c5Mx0PbgHFnX Bleueu6sk5zruhd6cPdvFlHSne X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BL2PR04MB1972; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB1972; X-Forefront-PRVS: 0079056367 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(33646002)(77096005)(229853001)(3846002)(6116002)(586003)(105586002)(106356001)(107886002)(97736004)(4001430100002)(101416001)(189998001)(6916009)(2950100002)(42186005)(50986999)(76176999)(50226002)(86362001)(8676002)(19580395003)(19580405001)(4326007)(66066001)(36756003)(81156014)(81166006)(50466002)(7846002)(48376002)(305945005)(7736002)(68736007)(110136003)(5660300001)(2906002)(92566002)(5003940100001)(47776003)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB1972; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: hgst.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR04MB1972; 23:slsXj1y8V2cFFXMiVwp4cUhwBQLAcVidrS6krK/Iz?= =?us-ascii?Q?w34mJCOdx51dXZHDKCDebJoKAc8YHFJ5UAZcbot27QGDNRoip5LyHtTABJku?= =?us-ascii?Q?Sa/L5XhpzIYw0VzgJMQMFzL8+f90BQmQ0Gc73ZkvIo9noaN251Pp4WGtsLGE?= =?us-ascii?Q?+cXWXXZYQw/kHT6xgkvPKy49SZc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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1972; 20:MTtmzjrAXhm6LEZwrwMbm/0QwmrpyDXfa8TL6mQBjxddo4YkHzGdtWW7Qx7Qkqwq6JoAUDpge3x9lIqvUSRcZAcgDlb3Jb32flrv8yICRKNY4tV/+BHIVYdY+QpMMHOYll3xcJUuoNrAOlW3lMGNwxBCs7Jl4RzqSJIEt+4zAoKChr7H6fQQjnbV53W4jowaoRL/EGJ/wMOV+/BVxZXeqbGe84eZJR92u4BQ5fNQPiSi+Qlqm0j2t6ahv3gI2T3l X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 01:22:53.3474 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB1972 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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 Signed-off-by: Damien Le Moal Reviewed-by: Martin K. Petersen --- block/blk-sysfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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,