From patchwork Mon Sep 19 21:27:27 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: 9340559 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 CD6D6607D0 for ; Mon, 19 Sep 2016 21:28:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE54829906 for ; Mon, 19 Sep 2016 21:28:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2A5529909; Mon, 19 Sep 2016 21:28:39 +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 031EA29906 for ; Mon, 19 Sep 2016 21:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932584AbcISV2i (ORCPT ); Mon, 19 Sep 2016 17:28:38 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20108 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752876AbcISV2f (ORCPT ); Mon, 19 Sep 2016 17:28:35 -0400 X-IronPort-AV: E=Sophos;i="5.30,363,1470672000"; d="scan'208";a="15969614" Received: from mail-bn3nam01lp0180.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.180]) by ob1.hgst.iphmx.com with ESMTP; 20 Sep 2016 05:27:58 +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=Th+JG+4hp/zHD20vo1UzCrIPtxuUXOSXujAX2O3KVuM=; b=dbaZ0CLBrIxTcZsQnYFc1YT5Y9n7D0VO6QdxAEoz6xtVYJHZpR1T7JEvm6rDxE3pETG2t8gkY2oKz/IZU89XpmaFamBldy155XPSS5cePDiPSb1FG+Fq58Cegus+CyrtseOAny1DvHZJviPqI7l1bJ6P+8Q9ESbFQj8ALSGk7Ok= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from localhost.localdomain.localdomain (4.28.11.153) by BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Mon, 19 Sep 2016 21:27:55 +0000 From: Damien Le Moal To: , CC: , , , , Damien Le Moal Subject: [PATCH 2/9] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Tue, 20 Sep 2016 06:27:27 +0900 Message-ID: <1474320454-5264-3-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> References: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [4.28.11.153] X-ClientProxiedBy: BY2PR12CA0038.namprd12.prod.outlook.com (10.160.121.48) To BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) X-MS-Office365-Filtering-Correlation-Id: 4cf2b8a7-9a1f-4b0a-0aaa-08d3e0d3d1f7 X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 2:oO4s7a8sRIKFr0IZjwKMjMkARuIAnPCfF6PJnpm6WdPCM+Bhxfpa9ORrQhMZXI7QfvIDM+/aba6vrEit2cAs6tqxoShm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-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 31:xkizAg99+QQXSfNsT9rDq6vMEyVParn15UvjwQ0hFYUbx0XhxZz3b3P4Jlv94cF8lvNeqjRHdJj013ac7fK3Qe+oLDeiJP86ou1mgZCUDbrg60+7UbO6eN9Thxe96vkPCFGzm05q8zypZ4Xjy2yF59d5TpAkW8QTidpwhWdpCtkN7aLzm4gOFMnCwjZ9F6hPPQiQs7XnMys5Wq4Tkn2J6ptpkHg4/Qq4+/xMSeCA0Do=; 20:KbycNfZqVG8Ax/7kjXCSQVWwxGZfzSi9HJohMqggoH/ZvZNpbmvfPQnPmxa5cOAfOVZ4UdJDN7gihUiXzrKKF0HIgwlDQjv8v4OpWA2QQzYqMm6ohLb1HCZReXSvxOhXfrBwPGrK6oKkPYu4ANPqAuVv+7ozvalLuqlX2KFH/tEq3d2GtUVn8ydzJII+QI0XrVxHCEy5Ex8KhWC35dRXKwbEFXkNc/wGorfVNq7MVCMEDd+yikzktXtufeEJZBXD72S46Q8mMTvLkdlQRnZL7DK77G4gmrjU09kKO9wUuVMQ+wdot6UrY5G4vZAbrhmMif7jrKF4O7FY/fbbjtD4FGaOMboi3Vfq7xWxmH0SesLvBKvGiHoIdqt02lgDFFWY0QMZ1yMhB+gseEpdJdDGbqtWU2/nJ9tg92rZeDOK4RignxyGIbznyLkUKTOY4AYdHiwteJWIHA4YUiKFBtN/zpuThVSJF7rx9hG3lw9ZVgN5hmXjjmHl3FVYCabgVyOk 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)(3002001)(10201501046)(6055026); SRVR:BY2PR04MB1975; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1975; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 4:rR2gmpoJZVvmLDPM9jQxHLViG3EUjhzjONYxEeWJ2YfzzhlUoHBZPz+3rffArwkrfwxUETONmkBVNiUBvImoDEOP2q9z4q6FFf5ic+Jlx9/dR02F5fr1IB7qM7Kj5y8/oVKGe7NezIS2760CkCzUU3d5XxldnnTZN0+MqJ0h/1f6gPOyf0lGKHUNE2OOb6zAPMNorooSDxA114UMNpG+2+bShGlfysfOADdz0ot0gTNHfmH+xxLYPvhPOR1k4tpltlWiCm18KHcIaSNo4OTDtGC6+j/VkJH7Kabj2+FusWyeqVxv/mtWSsCVqf8DL36bfCVF+Ahi6x5W2tIPITBjMu9sm/+EvF/UTb+VfyM8E+olLZNGThjbZ/NkxPmjAilqyCIvLtIlYxu1a83xNKIPliViK4s/rN9DVmJjXcaZ/2+O0ViArFR3H99mqQuVsRUj X-Forefront-PRVS: 0070A8666B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(4001430100002)(305945005)(5660300001)(2950100001)(5003940100001)(86362001)(47776003)(33646002)(66066001)(97736004)(5001770100001)(50986999)(2906002)(229853001)(6116002)(4326007)(3846002)(76176999)(189998001)(101416001)(106356001)(105586002)(586003)(42186005)(77096005)(36756003)(50466002)(48376002)(19580405001)(81166006)(37156001)(92566002)(7736002)(8676002)(50226002)(68736007)(19580395003)(81156014)(7846002)(107886002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1975; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BY2PR04MB1975; 23:XURZ4EHjIMV2R6mNwbr/xC5TsxNll3wwzJNujfNaY?= =?us-ascii?Q?tknGiJ3csxHCyvEkuRrNT1qhSjLd+YLJ47bmWXISu7TmPmw0kyWhdk9hPvSW?= =?us-ascii?Q?mAharlZpJQvRbR36bs5MIXmciClvLuTpn/BvlofYUxbhc51fhABExpqX6qUo?= =?us-ascii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SLsqGkmV0t6j3onWUS64fVAS6/l6Q6ZE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 20:C3+1HSBYrUj8VdEXMtXjsAP5cS4Xes4NNgyoL7kdDFAffQLJKNl2iIGp3+7bHnKpARGqHrRqQK2LBZHcJq4Ew5pf6bozuWSo1CGhAbocXPoMw2QMKCKOZbP4qry9POZ9oRAnYVLiL5s4fPtAPBRj1foh6rX7ZxBezHRozpwu0TS0hKRsJvF3J06czeq8JhOWgWJhjajBG4xptn70q+BNfbJOkikNBQcGkgDR7ZbbbfFM6lBs4o5u535W5SPGbFRn X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2016 21:27:55.3550 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1975 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 --- block/blk-sysfs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 31ecff9..15e5baf 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,