From patchwork Wed Sep 28 08:45:36 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: 9353347 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 6B6F960756 for ; Wed, 28 Sep 2016 08:47:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A7C829450 for ; Wed, 28 Sep 2016 08:47:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F11729455; Wed, 28 Sep 2016 08:47:05 +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 B2D0129450 for ; Wed, 28 Sep 2016 08:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbcI1IrE (ORCPT ); Wed, 28 Sep 2016 04:47:04 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20758 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcI1Iq6 (ORCPT ); Wed, 28 Sep 2016 04:46:58 -0400 X-IronPort-AV: E=Sophos;i="5.30,409,1470672000"; d="scan'208";a="18827662" Received: from mail-bn3nam01lp0176.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.176]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 16:46:49 +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=U2lFdaztE+ausaBlrtuZtFKSaFdemZqKRj1xE/gYDIciM7md6tqXQqjvzviOB/g3YyGs8cM2ARPNln4V3DtZ9vyz5JxCvIvKw5xAn0+C+RLZ1pV21MHfjdLcagoC+tqDQrX27Mh7gcW+VJBBFcoCvjbq45YY1CK3liIFYJx1x1k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) 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 08:46:46 +0000 From: Damien Le Moal To: Jens Axboe CC: , , Christoph Hellwig , "Martin K . Petersen" , Hannes Reinecke , Shaun Tancheff , Damien Le Moal , Shaun Tancheff Subject: [PATCH v4 4/7] block: Define zoned block device operations Date: Wed, 28 Sep 2016 17:45:36 +0900 Message-ID: <1475052339-10202-5-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> References: <1475052339-10202-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CO2PR18CA0029.namprd18.prod.outlook.com (10.161.80.39) To SN1PR04MB1983.namprd04.prod.outlook.com (10.166.69.143) X-MS-Office365-Filtering-Correlation-Id: 7eb07b2f-d4f8-44fc-1924-08d3e77bfbda X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 2:AFiDigj0LZM//QcOwd1lK/SJRaNt3W4U5KRR9VaDYlW2I272g9RTIyuew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R4JlKr+WUiq8now2hNhUO7p3QcywO36vlVejrm5HwurJhofJIE/3CLcj6k4L6YsCAVT+BYYVdZ9WIT6lU+2/J7LfZu3xd8UQhT3qRbNTYN+lb18SG1ttuRgm9c4wJHfkjUeoh4v0cR0kSBr/UHoPV7wrEx6eVHwRGvpHkHtThiQEwOlKlHBzSraVqU1S6Ky2jhdMPge6VkQgxtpMhR/TGWfmE1UCXGolZQjWkgWTaAOsvQlkBs55xps6DQ10zyF9fyQTwQk5e0W6O36D2tqO0OVuLFqH1hZ85N+Nw+J18JAQCS2TowMC1F5em3mO9ftSVsw4buYnqBhzupssZohJ9GellUldepyNeNsqu3RuTFd4g5e1/T37jw/FbmAR4yLCr9iLoLLsq8/42TYEnIT3dQELNo/YJSfprs3k6LhPNX3axYoVyHns2rPEgaXN0Yst3CfS7pW40D3b 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:SN1PR04MB1983; BCL:0; PCL:0; RULEID:; SRVR:SN1PR04MB1983; X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 4:oLNvc/xpD7Qeac3qiqkg8eboldDIbOAZteadvu3AP4k9DpRgWhjjXqgMEJZ3HeJCk/QP8axml0KGKQ4ESbR6iS9LnAQGMWSgXu2OSE1b9oL3UGNJvkVaUeG4HcHeK+C101qAuQwZHI0UUCwpF9HqPG5FuKp7xiMfUKxPW2oVHIMAkAfV55UvzUkztJWlG2z2mpnrxaB+M0ROLmTOrtcl5fOSOBPE0OlNDlPI9LGaKJBIDT/lZpVCvJEOlJC+IhUHREvSoLbydMNXTC7ictWPN3saZL9iaOHtubjKy7EPWKattDQOp2t4jfEbO/UdCxu80oS8eihH2L/vkYm+vHQIvoHPxWko6HH8vidDW1MljMot0WXzR9PytduUz2eOp3dP9iw5MPVhJxH9ifBqJrfHKTXlFKcH/gQh1f/+qrdHyIcKdl4Y3lEJVjKJa1bmmpFSF4Kx6ypJUDtYlJLPuXcHjg== X-Forefront-PRVS: 0079056367 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(77096005)(19580395003)(97736004)(2906002)(7846002)(19580405001)(305945005)(7736002)(5660300001)(68736007)(48376002)(66066001)(229853001)(86362001)(110136003)(50466002)(5003940100001)(47776003)(81156014)(586003)(3846002)(106356001)(6116002)(36756003)(4326007)(81166006)(105586002)(42186005)(6916009)(8676002)(189998001)(33646002)(50226002)(76176999)(2950100002)(50986999)(92566002)(101416001)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR04MB1983; H:washi.fujisawa.hgst.com; 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; SN1PR04MB1983; 23:YzPGikUyT0yHKbVxmYpQ514Q9W89+F8q88raSS/hR?= =?us-ascii?Q?HRCllKze/oiyrxLnFxxh7ov5GSx47lMxyVIrJc0fFbujaLqTZB5ylbZIXsVJ?= =?us-ascii?Q?vtIQyrVmzfHCN7AdA8GTXFaQrTkIZA1dD8FaXMA4kMYrnupyy45evn4m4A4K?= =?us-ascii?Q?TCyt2ysPQNsLLyuUWY5YnnPU1gkBJlJ/2r1JlgK+TPy/IFePBaIvgKcNFDPD?= =?us-ascii?Q?mJbafwGQlB37MJsED1CIFNOxvrdBkV5RbcfYkjnfgbPSFnNPMCk/hJAGi2RL?= =?us-ascii?Q?b0+gQSvYkbn9Nl9dzJ7kPHRAwWhAb1DEcLxVYk4xLLXuFo7dJoJRCkjSOUmW?= =?us-ascii?Q?TpDR5HzCRnmPXxbeAEeNDk8KQDFjqIcyoiixI658XMZEO1Ny7nBwP8ULkzqC?= =?us-ascii?Q?5UkNoe+oiw8Jq7WtVNuGb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fGUfq4IecLEwmLX0x3/8b97HYFalm/gf5agS6hrxlP27rM+8j8mdjPmUcHeDsXzNyhimd5Ne/z4OOWlHVhxMEK1bOc0t17+wyrkAMyrEUGdkdZkOZhaVZ2KuDyo2qwZz8aGS8+A==; 5:ikl4SXcWZa9Ors2pQUrA+VU062KD9eGeaIR9nji0iuU7puoVL91xGvJ1eWM+6BSRwEiEdCo96LuU/KWG376k9uw7S1bcle+5Qx6n1cPVljQoCuw/XBEuddpz/AgOJ25u9Y/SXxjNry5oe6b76zACGw==; 24:D/a8xW7vRmqyccxqCKfeVlKx5HBovfcLHw1C+MueZCaPGAghGBMyagzsRbRYURQ4pJTo3YtN5kfc/+Z+AkooxhQW75oST0JT6X0qiwftvgY=; 7:ZUXICPQqnvgqITeoLrkxkOGJiaSMhXX2CyjAN0y4z4HiyBFqRL6wbtotjHY8lDSNWc28/5MLAfre72rgsCM6CpNrMkBInVlFiGCjTjymiwB7cJRsEHXqqz2DnHv3QxZO78Ac0+sMzNsvQGwUw6VV8Jk20gTFR4yKteyQsTjgTcXFOxJPZm9o8eO42+NnNlz9VeVkhfUJo9FPkd1GxQlLvpDS345eBi/6yrhxYQzZL7i08aNr8OOBiOEGfj+VLPBeAse/ecps1XyTAy1yqL21RQY7rDmTQXFWJVZqqxsLzxiHemLD/Spyl1Far2kOuuhp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR04MB1983; 20:8n/ywdpgcXJq3NbGbYbF7nsnO/fjFM0L87ID94VJ4uAIbr23cT1FbuxRk3BAT7Dowf2185TyNqFYZ/gzk13Kg2oPdETneP7IlqG+MpINAkBXdt7ad4QodqNGBflPJUid1fLMBVwC+hYBYeqItO6ot8tlE3U6c18Bw1Dc8yVINb+db2VlakvZPdcodkkK1p8U1hTVV2rJBOWWaDDcIy6WO7TfgaI/OCeh0IQNBg+aUbOZlFTK6kQnnT9T0UweH7Mc X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 08:46:46.4075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR04MB1983 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 Reviewed-by: Martin K. Petersen --- 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