From patchwork Fri Sep 30 04:11: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: 9357635 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 9A883600C8 for ; Fri, 30 Sep 2016 04:12:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A27E029D9D for ; Fri, 30 Sep 2016 04:12:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 963AB29DB8; Fri, 30 Sep 2016 04:12:09 +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 2C26829D9D for ; Fri, 30 Sep 2016 04:12:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932525AbcI3EMI (ORCPT ); Fri, 30 Sep 2016 00:12:08 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:32793 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbcI3EMC (ORCPT ); Fri, 30 Sep 2016 00:12:02 -0400 X-IronPort-AV: E=Sophos;i="5.31,418,1473091200"; d="scan'208";a="22622632" Received: from mail-co1nam03lp0017.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.17]) by ob1.hgst.iphmx.com with ESMTP; 30 Sep 2016 12:12:02 +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=z2MufAAPVYu2mUNuEZOjFd4kFylfn3bNig07EPkuoX0=; b=h/pKPM6PB9egclVMjQ9wpS6JIA7SPO58fa2RF7ofFkPD+dRb0ztklDQ6+pkqOA8oDakrkZpU4jPyZlDRaqPMVL2aU3vZ3kosPcZQdcG8SYz97EK6lJWgBepDxzHzMXYMHiHIJp8e20T62VdNJmPMqS6YACFFedWaBZvNUq1wkH4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by CY1PR04MB1979.namprd04.prod.outlook.com (10.166.191.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Fri, 30 Sep 2016 04:11: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 v5 4/7] block: Define zoned block device operations Date: Fri, 30 Sep 2016 13:11:36 +0900 Message-ID: <1475208699-27310-5-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475208699-27310-1-git-send-email-damien.lemoal@hgst.com> References: <1475208699-27310-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: BY2PR12CA0020.namprd12.prod.outlook.com (10.160.121.30) To CY1PR04MB1979.namprd04.prod.outlook.com (10.166.191.15) X-MS-Office365-Filtering-Correlation-Id: 47b5352f-108b-45f2-43b4-08d3e8e7ece7 X-Microsoft-Exchange-Diagnostics: 1; CY1PR04MB1979; 2:aFuxoepdUKLjKnbdgRC3VI/Im16zIDl3v9BIQnj0X6aLKNO//o4zAt5N5Bx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b324muGXUzDGlGNUjI3RqCnZjb5ND8DEVYF25zwAIW0v51JNLgee9FlpmQYlijzI5KA8nIsZ+7htXP0y+5EtB0sS6wRSbAGKat5NUJr57WzcCJCluassyqyQ8O8d55h5PTzqJ+IwQK51qwuOE8BCb6/js9KWG90GItlP9bwg61Qt4ZVpc1O5pTL6hJHeVAd+jr4Ef+XvlD3RiXMnNUy/JvPwfkBvYnBPuSSh5pn3T8zboPRGzxQ6YYJE3eFxNQ3SmKSAuZARiMYZ/+kC4Rxs+SJgjPo+eWLrZUf64xCNkMSGH1fouwk0j+zf5ZC+rKi2CjdKf+7iBqV97v1ObIMkmdaAd4nqstZrMQxJuhswLKYET8aVMSVQ4ZpW79q3WBESV5AB5KksJ/PXcFvceMnNdhix9Zhy1PjbZ0xr4ZwcZoeYXLO9/0eo5Q2WnNc09vFV2SMkFvBNFBn3Rwq77M5ZljC2rk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR04MB1979; BCL:0; PCL:0; RULEID:; SRVR:CY1PR04MB1979; X-Microsoft-Exchange-Diagnostics: 1; CY1PR04MB1979; 4:l9CDL3D+bGR5ToDT6VsqnYCNsz85+4qdY2gMShR9d0nuOqdmaln/Zpev/n8NphCy9NnLY4tZKWl3ZCTI0cNkml4FZvyl1rm+co2bktljnKN0oK4jEYM2qClr34UfgM1iHLjJu5UrkxyEFeE1DEJcFGZjBCTlxHhK91ZyfZVRdU/l3RGwmORd60uNRNHyzWX/YO60yTpdLUUnF2+McX5WflSoF7/Z2Ir+AmwA1InulLd/5jJW8lUwqtm+rb/HFIsG7GNcibUFd6ANs1KpB+UJ3qhg63j5IV/Fc1TaGI7K6e8bg0kmeNn6kX7GBh3+vcIU09Z7yFnJIy+lmm88ZHrwil5SWwk437+YEgnwM+KJP/p5qPPCKS2wrQedDZNhbsO0O/MH5VjprGbR/uwhi6It+G4VRU/H1gzJmFx6B82wvqt9A3UZMjNBEAPuU8WGt6yl0te31Rnn3qMJ0ZNegp9KgbKxbqFYybeHRgz2/jCus4w= X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(8676002)(42186005)(2950100002)(81156014)(6916009)(6666003)(81166006)(5003940100001)(47776003)(66066001)(229853001)(106356001)(7846002)(105586002)(305945005)(2906002)(36756003)(189998001)(7736002)(5660300001)(76176999)(50986999)(97736004)(586003)(4326007)(3846002)(50226002)(33646002)(50466002)(86362001)(68736007)(77096005)(110136003)(101416001)(19580395003)(92566002)(19580405001)(48376002)(6116002)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR04MB1979; 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; CY1PR04MB1979; 23:6ZTBJj4FDTIt+DdS5X8GVpWeSvQc1R2DNuNXxI5PC?= =?us-ascii?Q?g6ZXQ3uPYkCo7FdYE6FcZWiL22SarYt/M37ORmOmHhBP/uytb9tia8/zqPvj?= =?us-ascii?Q?dN3xHU4uwjrlwdiNXDukNKSHLtNBnsRjVEL/Z4Y2mS1CSeI2uuxiSF7pU6CH?= =?us-ascii?Q?MdKrgJV0lqhTwSPqvJniK1+s0TIz3RX930sx2SHY/wn9zpGGC/p90aJJePn8?= =?us-ascii?Q?+1+c+D1A+9A4AZsECa+vIrKCZomuQTkqY1OQnrLg8qs+T2Tazk7ZX7LNSjEz?= =?us-ascii?Q?P6Aj4viw6Dxzb30yiXzrSDVCPFodYe+8+FRnR64Xvhu3q656AFO9pDr3gMHC?= =?us-ascii?Q?+ma8e6FtASOjq6xXBvqjG5zPDbq3f3/hRrV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iK+EMiALoicB0sUR+JrS7xLEwqxZtbOI/pIUmwtlwj0TrVCtvTwDauxUjyvWF X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 04:11:58.2667 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR04MB1979 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: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- 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