From patchwork Mon Sep 26 11:14:38 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: 9350493 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 897B36077A for ; Mon, 26 Sep 2016 11:15:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A5E728AB4 for ; Mon, 26 Sep 2016 11:15:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE6928AD4; Mon, 26 Sep 2016 11:15:31 +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=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 8D9EA28AC8 for ; Mon, 26 Sep 2016 11:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935225AbcIZLPT (ORCPT ); Mon, 26 Sep 2016 07:15:19 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:3782 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966409AbcIZLPM (ORCPT ); Mon, 26 Sep 2016 07:15:12 -0400 X-IronPort-AV: E=Sophos;i="5.30,399,1470672000"; d="scan'";a="21226604" Received: from mail-by2nam03lp0055.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.55]) by ob1.hgst.iphmx.com with ESMTP; 26 Sep 2016 19:15:13 +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=BzSQ932o+xWRo/x5NpuylrYkJccxupOOVXmU91w83UFyzJtEt8ro0Rw8+zXgpBuscPbDsAkP9ovYzLYWvj6IF9K5U2U7aukPpP2BsEAOGjJUk0+EONvUm1HB2n1wuU19roO7FD2Lmhvi4/FaSrUx5XrCiWOXVKS5TG9B1Rd4P8g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by BY2PR04MB1976.namprd04.prod.outlook.com (10.166.111.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 26 Sep 2016 11:15:09 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Damien Le Moal Subject: [PATCH v2 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes Date: Mon, 26 Sep 2016 20:14:38 +0900 Message-ID: <1474888483-29762-3-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474888483-29762-1-git-send-email-damien.lemoal@hgst.com> References: <1474888483-29762-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: BY1PR0201CA0007.namprd02.prod.outlook.com (10.160.191.145) To BY2PR04MB1976.namprd04.prod.outlook.com (10.166.111.16) X-MS-Office365-Filtering-Correlation-Id: 5a6efbb9-a926-4414-2ca7-08d3e5fe6166 X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 2:aRyUiJc8VXtM1NV4nNSylBNbnTiKph4q8RSbUkTqo63bJjcIlWmb7dW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Kp3dOJfFIkqodd7GCe4HQDJSqFxxP9sLYhP7ZIRtnPVYYxvEJ6o8Xp5+kueORM0YMhucS1Ey921kf/TSUFeRfZNCBYeVefFiLVNwdaV/ChOrWw5RB0lwulmqTYwqg/cq38uXtgiCFXEKeYwVAaoGLTnVocrAu4uOJ/lM 6eCBWQhCvJjIYx6+0uVQ7RDyq6 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)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BY2PR04MB1976; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1976; X-Forefront-PRVS: 00770C4423 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(2950100002)(77096005)(6916009)(36756003)(86362001)(50466002)(101416001)(107886002)(4001430100002)(97736004)(2906002)(50226002)(189998001)(68736007)(4326007)(19580405001)(50986999)(229853001)(66066001)(586003)(47776003)(7846002)(81166006)(81156014)(7736002)(106356001)(92566002)(305945005)(110136003)(5003940100001)(3846002)(48376002)(8676002)(105586002)(76176999)(5660300001)(33646002)(19580395003)(6116002)(42186005)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1976; 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; BY2PR04MB1976; 23:qfFyJfQoQlEF6Fb5S4MLmCao5eBacHNajKV3SD7M0?= =?us-ascii?Q?mvsOgF2LNaPDzxYcXC9V7PP2GLoDRHCY/cYUzym3CXcUH3Xu/q8Ynk6w8z8G?= =?us-ascii?Q?mKXsJYV8iDKPNCU8+jdRowO8hA+FwgiQM5/bzyUZrMFL+5mQau0zlZ+pg1No?= =?us-ascii?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AukDHKKcU65e+YyyjAG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 20:+f5X64RiZrjIz96K93RMzDw2VdRnBlMGkQk35viaXr7QkanWuubLo5BHGpn/NHaoYMBQn1LFcZIe8xvXOVzd3v1fDgGnNMBYMi02uv9KZ8hCQbEDK+yHPi7CwwFitUIViUfs1smMen0DlLS2iqYjpwwqILi5oh/9PhZcZO9RAVl3T6CcgQ835Qfuk6c2xoFKpG8aH+PL/60OelfuD4RUJsQ12/nnjVhx23aAZnCc5pqWLSJ0lIFbACIO7zc8uQCB X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 11:15:09.7103 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1976 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: Shaun Tancheff Tested-by: Shaun Tancheff --- 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,