From patchwork Wed Sep 28 01:22:34 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: 9353023 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 4B98F6086A for ; Wed, 28 Sep 2016 01:23:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A83528A38 for ; Wed, 28 Sep 2016 01:23:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F574291A8; Wed, 28 Sep 2016 01:23:08 +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 601FC28A38 for ; Wed, 28 Sep 2016 01:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934791AbcI1BXG (ORCPT ); Tue, 27 Sep 2016 21:23:06 -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 S934580AbcI1BXE (ORCPT ); Tue, 27 Sep 2016 21:23:04 -0400 X-IronPort-AV: E=Sophos;i="5.30,407,1470672000"; d="scan'208";a="18715526" Received: from mail-co1nam03lp0024.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.24]) by ob1.hgst.iphmx.com with ESMTP; 28 Sep 2016 09:23:03 +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=RCagxWxv6TfsZeId1xO17FrR5f2YmcJYLicYXgrLqeEBaxQK/ollO29pGVGmRvN3qCFMiEqCidjRJtjYjrGIUvS1hxdSfT8ic4CHNW6fNBVwZ4TeYdq4VJLqjlJ0Us1iCnrVcMRWO5lkFWsSaFrGhzSm0SjYkruR4J4I60VvTi0= 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:58 +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 v3 4/7] block: Define zoned block device operations Date: Wed, 28 Sep 2016 10:22:34 +0900 Message-ID: <1475025757-6340-5-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: eb02249c-daae-4311-5a96-08d3e73dfc56 X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1972; 2:CN02lO++TIeOZ4qxDmfojWivU+LivBhch2nUCbUljPkhs5v65Wg9z5SJsM/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sDUZ/hx6ucRK4Ppp99fH/Ur8NLoDooZ6/LtV/qmw13udF2A8AxfHTmtEodfsSiyXAXf2OjAX+6MYdtc9suIlpOIAIZ6e4R84EXUGjdQC2/p+FShSHpK7mPFTN5lFMbZiJCMl2gBnCxfKP0Y3GqKoQFLdFjU5O37O+sR/P9BBEEd0+445+hCUnKn8WEvHx8dbcCivHieUsUoTwnsvNfeyuZvbYYav2j5Udrzy8ogkgKoqikZWnPSJVFA3ivCo6HGSZQdPELO/ixEeWC+O5KEcxYS5M/YcYHyoINlterQkoceaLDEgEOA8ld97Ham+z4Pqxx3xD5J0ZP6EAoHXJzqU3QZUr2g07e197BqwYK2O8JWMo3wgt+WwQF1cuWUGyDNk1SES69UQ10NoquiLwVEpSnoh5Uvp3QXbDUY0pj12bt8ZJ/FGLzNfmfropPKwVQlJjotFkE8BJlQJfuenL0WGjC6ZZcJcAOm 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-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1972; 4:L55/bYPj03Crx3ImgvtXb4aZrRRjb4imIJ/4NnzUJ9cqhOWvM/ELiKnvMJrEDbL9t+t88ev4OYuyHQFV/B66FLUQ1eAQgoqUn0bA0jSDVDz14GHDpZKGkJiVgQ/RWL72D1cQ7F1SKT8wS5mOohRFOkTQKM8G+hUzYPka2PLjtARZRzq9InFjP4+/p+5uATQqjVTUIrUVP7TjGFre4BAx+V2hWzw64jeAVpN0glNwhHm0PyfgDQRacwkfX3OgL2zXwoexLS7wZZnHoTx7lgOoa2f4+a3lXLh2+nQdWhCA4neBXYaOI016oCZulVo+44jUS73QpB4OE0BWqjWlOKxPqwRhomFEjlsMOr7Q6McrmhxU17RcG5tpigkMHpwW2WhT9NZEuYLp68DEGfEcPJj/ZzISlzRTbynL/KzNtGDWZiQ0hrWjoaGCdCoxDGuu/dHm1xQPIIhhtmDSH7mCiWF+2g== 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)(97736004)(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:flkYbyMMDtY0jvr0UDWHAkxdH7Uj86w+nlf9T7e6Y?= =?us-ascii?Q?pkDwym1xWgz1yyAZ91DhdXGU/BO1wmerFWCWnsJgr2oriLL5XwAWQXPDO+MS?= =?us-ascii?Q?v1GMmkzZ6ZtV/AcvSBROPxIgVHdklL02IELA1w1PuU7BSeyf29s7XmHNok4j?= =?us-ascii?Q?P92wr563pLGtMghvmY9PC7BISfgFCbaBW46ZKel5tPdsv+k1PbbF6MHNZ5ZZ?= =?us-ascii?Q?XXlFhBhUGc+x1ReELtWhRJ3mNZFulVhsqSvWaslLafJktyJo7+WJYnOIs8Uo?= =?us-ascii?Q?ytx5/6rCAFtmWILMbmCEbTAzaUYlm5iyM8N9OrXBVxIBj6UxpL7pl/lg6ITD?= =?us-ascii?Q?bnisiDHZHUCGLLgODe+3NE5GNmTTuG2XTxvhWtE89R/+voPRU/e5qwhKiD9Q?= =?us-ascii?Q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o X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 01:22:58.1774 (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: 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