From patchwork Mon Sep 26 11:14:40 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: 9350483 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 081456077A for ; Mon, 26 Sep 2016 11:15:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDB6C28AB4 for ; Mon, 26 Sep 2016 11:15:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E257828AE2; Mon, 26 Sep 2016 11:15:28 +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 75AB428B00 for ; Mon, 26 Sep 2016 11:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030310AbcIZLPZ (ORCPT ); Mon, 26 Sep 2016 07:15:25 -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 S965622AbcIZLPP (ORCPT ); Mon, 26 Sep 2016 07:15:15 -0400 X-IronPort-AV: E=Sophos;i="5.30,399,1470672000"; d="scan'208";a="21226627" Received: from mail-by2nam03lp0047.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.47]) by ob1.hgst.iphmx.com with ESMTP; 26 Sep 2016 19:15:16 +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=BFEKaSi9RA2K1i2VaOyzW1//imXUknRqa7uYV3gUVuo=; b=HoBlNBuDi1xLIKhQFsZbNgHG1qKMLgRyP9OZLCz460TTB2LwWPbFiPdwzxoaoNprl26C0IuxAJ8PlHmoc73RZvzLfKhRZ0YdUR2pCoQ1L8XQYS+bfiuoU8OhB+sdr6xlcuYl8b6qLonmHgr7/2G31zGxnwa/giTZ3OymsaxjKvI= 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:13 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Shaun Tancheff , Damien Le Moal Subject: [PATCH v2 4/7] block: Define zoned block device operations Date: Mon, 26 Sep 2016 20:14:40 +0900 Message-ID: <1474888483-29762-5-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: 8877a494-3022-4093-70d7-08d3e5fe635c X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 2:NTV2gQ/ebwO6JXHvWz45cs5sUwCktC+EmK+lYfB36ntrhRgjmDSEnc2nJwQkfv6fDsb+tq6TP0T6o44Hxizs21W3Em9vlxBGw6vHC3T5zbwWwvud18KAhTHXImlzxVJm1xq64YfJuYOHfRTWqhLXACFegPe1rKX4h56fTtTMPwmOTiUnFYccp4noU75/os4g; 3:x0AY37IEdHaPx697CvDN7nveDXNRDfACuC7zrNjFmc4euwavKN/JQt68qQVS/7xc12Wc+y3dHA/DjzaW0U8olpchREzyjkg5xEUpcDiHO6Lagu/ebNNlhZ/QH3X9n6ha X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR04MB1976; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 25:rdmbF/KOG09PYuqEopSn7ulID/tJMB69rMXiON5Mz6wa5CjVW6De70Mckyxoe6Ok8dZUqeVnVVMj748aQq+WC5ApRoCHsmSMApGANYJPqrQ27SJGl8XoXkNL1VlTKNri+wKKyQnBgERCnA2Tia7vucCOGB6tVPjuwEdlQjF+5U+E5BICiq4G99jgO28xIZQxC4UDJ0Gy51Ia62SSyV9x1z1863Q/tD87yUxkWIxQjgK6y+KR8ZGNHZ2mcCRZsvJ/8iuxIYB0ff0wcKAAGW0VaNVbmLOo4p06NWxHL5KrWs0g9wTkxT0hzNdMENHE67n7uZDOMz9fnL9cq67MNw8hqqU+h8PEUETPi8vq9abY1gWL2UghYXkYNnFcIe8r9h/yH8KLAHLDrFnCTuGea0GrlvQPXtIXooqEi6A0rTPHah99WH7t/V4eq3tFzCkZRERlnsb8f9N/pMggX2BEtQABJgkDuekklga0sPU+xdxRnj+k9m9955UPexx+pFo4OKScH8Ko43lNB38UHZYQweVFhdiUimANxdMKOR5JQgN2sb6gEIGMHR75mZ1x8BroTjX4JFrtPj58ivWIYY+zrsc2QpEdqN9ZLjs17SupPWTx1uUUIHnJyr5tbmOKA2VTxlTv+ExRwxfF/GRgcGkMSLq088kFn12kP2AMvpNpcrVaAG8O0d0pCgd03nOu57sxj7fyTkWPG25Sq6WVrohn04qscl91RCN5dy78OLOnWe+/FKVWJhQA5AiLFPS2Ngh5lKy5 X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 31:QKmpAPkIs35t5vOC7sc+zpIBAfVekc7brUWTbY0rW+a/fBjmSsOimHOpJg/VZI04K/Grw/kZEgG9ayAdnuqPMIfkE/QND6a6O1/7GKFCZjyu52FqdX09+sEy4U4Hg+Z+oTVOS1QnmQEtqS3roVIzWxsOxMdSreeTetMU4ToUDf2P226oFE6O2JCCGl0bZQkWx+biLGZDAvlwQLay4NGh/CFH+IVERJlx8+1zFo97SCI=; 20:02u8nl2ogtpwk3rred7uH8/b14z9z5MhRlziDBOcOVcEM2N02Q3kXU8Tx/eie7/N3Lup4BUkBZVPMcPwLoNCLgbQmY0qAudLCiYf0587IIYgCnmZZYUf75kE/fhMn0UrAAezfrQoqigHZk++Y6fhfWLK9P3Ej6uK1Z+PT7WbhmLXrlZL37OSOAItQ7yrdesq9kVf+42/wq2hIwjApPtpDXrIqzxiXPersnNMpgwJKtFQFvOiytdnKkzooSpe+gWX3RZbOZ7TznZBPt8Xga6m96lRIdlXGcFrVAJUMRUuZSpRmd4ayjnyPiQHs4aD490rT68LAFyfqoj10HqrkhomW6xc2jlLp78RTDGRIeAhcai4X+OzFzizbkhJmgJo7cXf7oGHDjDl3O4aAsuuS0N50UTkKGNFvJB6/QV65zG8TLrxcJzHsvCx3zarsgam5CiSzHvOg7p/y1ajFiLtvdAMk1kf9PK4MCvSaXEG+aduLSufRxO7wXIws8XnxSaLY4TG 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-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 4:gsE7N4NNahJoBiCZ+4F3HhtiDUWrhmssBCvuRifL1COUmcRFmFXgX7gTwsMCAdBMm1m5OOCt9Qhdp3DD4zskktOSaZKlJBhblIvNRI2klmSA3qkfsU+WjQej8XDec026/HJPzQyYJhq8MvD6sdZ4q0qaoGhdPgkdOdUU5U4n48wZVtRtBk/vjjns+tHjgFWe6NKm6L119V8+2XgD3HTZTagjjYtEKi1bXg8R7HltihNf1LZKxKXXQ2lnVb68yJZ4PjOwfAJeNBxRyO1vrGysHEGSMVEKpIuhjtlwMQBLhhh4dZgXaMsYXKcTLgfrUe5WRzzImmte1b03opGA/1jZTzuNNGunJFOLsn3EFiKAaguurM2eZxSy/lCWR7hO72U3yzOdgzvhV/GdnYsZPG2QZPl3Xn662uLccbsFVb+ATWPRB70oDY/WLpCu33s3oBxukvl9i2rxo7AvD+xs/2aEsw== 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:LqJZYZRSocRnU+sqPMUQTkuJJBklUO5Qj+9sGRIC0?= =?us-ascii?Q?OArYK1JsSNUQCwK9g2lUqV3JBfa0yQj6CyHqWYz327zEp/LUaUfv0EgnaUgY?= =?us-ascii?Q?y8NAU7mE9WibKKwuOEOCOhueLPRkEsnijhgJttL+z7CXmmT6tjRHgU3umTA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oFfAhq05a/n7o5785HqueZg+SO7pjpwaM4QizXhAUJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1976; 20:I2fREQTD+XxQk89ShlZbwEjloQfDuHY1ZCTpIlbnTFbNMRqrIod6gUtXSz+QmJSS4DqdTZuIruKuf8SOweoA9MT0LktDHq+uiqslqsgvgz1rexsbe4tmsLHX4AeWX7bcOTuikK9cUNBy3XUYaydPrmg/12EcqWcpQMncF0Jmlkw54G5MQyHiGZRZNDwwzAHakEkaViGrSMLWYi59SdYh0Oa0aRe5Y3tWF/G5bTfnuZ5Xb8jbMR9f/ECnQMSvdkwk X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 11:15:13.0009 (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: Shaun Tancheff Define REQ_OP_ZONE_REPORT and REQ_OP_ZONE_RESET for handling zones of host-managed and host-aware zoned block devices. With with these two new operations, the total number of operations defined reaches 8 and still fits with the 3 bits definition of REQ_OP_BITS. Signed-off-by: Shaun Tancheff Signed-off-by: Damien Le Moal --- block/blk-core.c | 4 ++++ include/linux/blk_types.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index 14d7c07..e4eda5d 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1941,6 +1941,10 @@ generic_make_request_checks(struct bio *bio) case REQ_OP_WRITE_SAME: if (!bdev_write_same(bio->bi_bdev)) goto not_supported; + case REQ_OP_ZONE_REPORT: + case REQ_OP_ZONE_RESET: + if (!bdev_is_zoned(bio->bi_bdev)) + goto not_supported; break; default: break; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index cd395ec..dd50dce 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -243,6 +243,8 @@ enum req_op { REQ_OP_SECURE_ERASE, /* request to securely erase sectors */ REQ_OP_WRITE_SAME, /* write same block many times */ REQ_OP_FLUSH, /* request for cache flush */ + REQ_OP_ZONE_REPORT, /* Get zone information */ + REQ_OP_ZONE_RESET, /* Reset a zone write pointer */ }; #define REQ_OP_BITS 3