From patchwork Fri Sep 30 19:12:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaun Tancheff X-Patchwork-Id: 9358787 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 6C83E600C8 for ; Fri, 30 Sep 2016 19:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 591FE2A152 for ; Fri, 30 Sep 2016 19:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D9262A164; Fri, 30 Sep 2016 19:14:50 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 C524B2A152 for ; Fri, 30 Sep 2016 19:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933188AbcI3TOb (ORCPT ); Fri, 30 Sep 2016 15:14:31 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:36727 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934050AbcI3TOI (ORCPT ); Fri, 30 Sep 2016 15:14:08 -0400 Received: by mail-it0-f66.google.com with SMTP id o19so2214197ito.3; Fri, 30 Sep 2016 12:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7+Dhq23T0iCfD9bEj8xc77q+6yFbT2KOyQAXrOkco+o=; b=ANpBZVfGkufMX9ZF2XvGWF+dtqgNs7CVepJZidBa7vSB2xw2rD4aMMLBLT7Fjo+U7s iGkmRRoape3tf/KBRdY/2UywPLOVs1IbA3wLje6qyUdG0J6nvKKHdCO3A4vFPb2s3Nsd aS0Q9GaofD4Z8x618CX3BYzHvi1dpeb8g+AMH/NCiLE2NsQvQW/45b4XfnADI2u1DNtb 1TC+qYfpQEt0sdzDjwunQ4Rn/8Yg7NOw91vUGfaNrR1YR0I3nyQyCa8DlLgqGvEgvIjA g38yVEvVJK3vnoe5khqIfTXXpp638EdH83TZLXLn42K+HQSIW4XyyawY58MwXyRoLv+/ 1YrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7+Dhq23T0iCfD9bEj8xc77q+6yFbT2KOyQAXrOkco+o=; b=FmL4x9mbuXOUvMuoLcMicDLGueilBUN0/404WlAb4TwaXLzgYipGwxW3/cnddyRRpP fJKeryM1gyaCQUpjbTTLM+/5X2peIsdZVPXZtkMVENK3HzO3Bl2lBfIPMIXfVOvfV3Vn 4fX/i30nrPxrN+HuzXZlJHtpjRXseWO2Ss+LBFBv6sFJ33bkaq7fpmgQXg3wL7UZN8cR blnK/M5o4DyNjY0L+2PUP0KOdcoqHYqFcp+2TNpLXdLaoT017pywWfkRmptwFn6YSge6 zGCscKH/A2YCvD27UDTVG8XRSOnq4T69S3na7IuMPECgK1+5ZSWpXhdXqLnPxj/YeKnO IIPA== X-Gm-Message-State: AA6/9RkmUUv9SynFCvnufMIjMkl3Vm2GFOAP3M8FthnrjdiQa9o9GO1C8UxMCaPiJSZhqQ== X-Received: by 10.107.158.80 with SMTP id h77mr12365050ioe.152.1475262847640; Fri, 30 Sep 2016 12:14:07 -0700 (PDT) Received: from helios.aeonazure.com (173-16-223-93.client.mchsi.com. [173.16.223.93]) by smtp.gmail.com with ESMTPSA id n69sm2599900ita.0.2016.09.30.12.14.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2016 12:14:06 -0700 (PDT) From: Shaun Tancheff To: Jens Axboe Cc: Shaun Tancheff , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , "Martin K . Petersen" , "James E . J . Bottomley" , Damien Le Moal , Hannes Reinecke , Michael T Lombardi Subject: [PATCH v6 4/7] block: Define zoned block device operations Date: Fri, 30 Sep 2016 14:12:33 -0500 Message-Id: <20160930191237.13695-5-shaun@tancheff.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160930191237.13695-1-shaun@tancheff.com> References: <20160930191237.13695-1-shaun@tancheff.com> 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 --- 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