Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp659825ybt; Wed, 17 Jun 2020 10:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5iK/KvxI1rfo+nXTslZlgDGVqUvJcaW1U/37BqQL5UtiEerKpiXKdO6/36FhJAx0Zc2LA X-Received: by 2002:a17:907:40c0:: with SMTP id nu24mr232697ejb.141.1592415125150; Wed, 17 Jun 2020 10:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592415125; cv=none; d=google.com; s=arc-20160816; b=aGh4D7nGWxjcTZQjTrIVoMD6CeZh2yMULLUkDwMKoByXpoKaLdmfmavGnTo+fsm+jj jM3Ji0wt7Y25nvGOfH8L7wn6MRR8hRA13SociVGYQvhi/ZpPLeGn2rIe85ynjDFNrIoR +lXChaSBZRD90DQ5PIOLIvOu0W9xwh8A4sM0D2VLmu7LmoSTYpMZ78ennrzY/Afg0HOy 1PmPrsMLhuy4HdKPVHvEBCKzgmk89une8dV/UNO+44y9ZeAmMlk1JoTlD7HJRhPsS5S5 qEoxGTZa5IwvnmsNUh5CbVpfmI28IOs9bfFurnP2CzPLHmZ82bw566/czrZ1jCPZEMWK skyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=LBOG9REbmAYlHxyR7jvFKAsWiegyIQK04zGZkOS/AuM=; b=D1voVLKFxEFTBcS0yWIAJnwgvnzuVdp7CE3tpwUdZiRram58yWepTrEH56o3r7yL+P CcRdXMA8PmLrFOLiICw4o7217/33pymxkYqCycyDwNZRyrgLwfjdOSUKI6ZpWVHV5qsm 9Wtfxsye0Xcwo4mSY2dsQo5FGb8m9VhA+rOrEjsv0WpddxRLNEuyvhodh81/zakXVW1W 7W/adXoJsnsAT3mrzq2Tl7qQIyFoHbrCfXjUvw8xXX2tUW7MYjGf5hFab/MNRY7+SXnw AQAsSZZQaflnbALJbTtNKg5RSGZFtlUAE/PFMaOBnxJjVWIkXRb4Qa3Y2dpF0whjBtlh uCEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VIVRo5P+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si383615edl.255.2020.06.17.10.31.41; Wed, 17 Jun 2020 10:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VIVRo5P+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbgFQR1N (ORCPT + 99 others); Wed, 17 Jun 2020 13:27:13 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:54221 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbgFQR1L (ORCPT ); Wed, 17 Jun 2020 13:27:11 -0400 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200617172708epoutp038d7922afa5e3a88db4188abcd782eb76~ZZNlmrz5e0963109631epoutp03Z for ; Wed, 17 Jun 2020 17:27:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200617172708epoutp038d7922afa5e3a88db4188abcd782eb76~ZZNlmrz5e0963109631epoutp03Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592414828; bh=LBOG9REbmAYlHxyR7jvFKAsWiegyIQK04zGZkOS/AuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VIVRo5P+85YJNvtuuFawNE3HwwsLkXdVdxOvwMCADalzbiDuM4IxSx+DDkZukEkoc AAt6jDlJL8y4vkF1yrCL1pIfvToZ1low1JB3j2MCnsGIcgIW/JGc1B4dHca7myxrYH 5MCS7vNX88+qulds/3tvF/FpZzo/qmzm+YuBX300= Received: from epsmges5p2new.samsung.com (unknown [182.195.42.74]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20200617172707epcas5p22cf195448282ebdc2ef7834a5b393f9a~ZZNk6izzV1456214562epcas5p2u; Wed, 17 Jun 2020 17:27:07 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 67.B1.09703.B625AEE5; Thu, 18 Jun 2020 02:27:07 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20200617172706epcas5p4dcbc164063f58bad95b211b9d6dfbfa9~ZZNkWh_sk1866218662epcas5p4h; Wed, 17 Jun 2020 17:27:06 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200617172706epsmtrp21060c8d107a2d39f9ec9248ee4cf3b76~ZZNkVqCpa0603706037epsmtrp2T; Wed, 17 Jun 2020 17:27:06 +0000 (GMT) X-AuditID: b6c32a4a-4b5ff700000025e7-34-5eea526b99d7 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id AB.2C.08382.A625AEE5; Thu, 18 Jun 2020 02:27:06 +0900 (KST) Received: from localhost.localdomain (unknown [107.110.206.5]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200617172704epsmtip1b3a347b0422349a9dbfab1eae38da006~ZZNiMuSIR0780107801epsmtip1G; Wed, 17 Jun 2020 17:27:04 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk, viro@zeniv.linux.org.uk, bcrl@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-block@vger.kernel.org, selvakuma.s1@samsung.com, nj.shetty@samsung.com, javier.gonz@samsung.com, Kanchan Joshi , Arnav Dawn Subject: [PATCH 2/3] aio: add support for zone-append Date: Wed, 17 Jun 2020 22:53:38 +0530 Message-Id: <1592414619-5646-3-git-send-email-joshi.k@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592414619-5646-1-git-send-email-joshi.k@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWy7bCmpm520Ks4g717hS1+b3vEYrH6bj+b Rde/LSwW71rPsVg8vvOZ3eLo/7dsFgs3LmOymDKtidFi7y1tiz17T7JYXN41h81i2+/5zBZX pixitnj94ySbxfm/x1kd+D0uny312PRpErtH35ZVjB6fN8l5bHrylimANYrLJiU1J7MstUjf LoErY9O+CywFK/kqNvxfz9rA+JO7i5GTQ0LAROLTyrVsXYxcHEICuxkl+vqbGEESQgKfGCWu TJWASHxjlFg8aSYjTMem2x+ZIYr2Mkrc3VUHUfSZUeLAhs1MXYwcHGwCmhIXJpeCmCICNhI7 l6iAlDMLLGSS2PZMH8QWFjCV2LDsCthIFgFViYMvb4GN5BVwkvje+RZqlZzEzXOdYHFOAWeJ 2ZsvsYKskhBo5ZBY8/cPM0SRi8Sfk2+YIGxhiVfHt7BD2FISn9/tZYOwiyV+3TnKDNHcwShx vWEmC0TCXuLinr9gNzMD3bx+lz7EoXwSvb+fgIUlBHglOtqEIKoVJe5NesoKYYtLPJyxBMr2 kOi6M4UFEgzTGCXeLrrPPIFRdhbC1AWM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sSQ1OzW1ILUIJsvEwSnV wLT3uIqg5B7H8B97Jlpun8m15+epddz3M7qTnyr67dpV5Bp+5/7aL9ffaay4/p3j5n47nbgb OfNu7mX/vW3S0t5CNZmnNpPvpjfvrOJfffLoFO9c20cClxe8OvSwTnLyw8IWD3X1tD1mJUrz xFvmZx0OZ3ZwF5zZs2t10Pbttr3hWQXrbk7aFlLubLGwNH7hmrbKOb8tevZOyWjyrUo+KbR7 jffVHuNTM+41lvxNEY84aP4ySyLr2rqlXDesZPuFT978xn9ULq5n+uOne0LSYpa++yj5jbuJ /blFR/f1fb41nAsabnlE9a2RX3G2uEgu5amPd3LPpgOHTpfP8mU6NXe9y6JDqeUR82/ZZW98 bc6nxFKckWioxVxUnAgAqm13RdACAAA= X-CMS-MailID: 20200617172706epcas5p4dcbc164063f58bad95b211b9d6dfbfa9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P X-CMS-RootMailID: 20200617172706epcas5p4dcbc164063f58bad95b211b9d6dfbfa9 References: <1592414619-5646-1-git-send-email-joshi.k@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce IOCB_CMD_ZONE_APPEND opcode for zone-append. On append completion zone-relative offset is returned using io_event->res2. Signed-off-by: Kanchan Joshi Signed-off-by: Arnav Dawn Signed-off-by: SelvaKumar S Signed-off-by: Nitesh Shetty Signed-off-by: Javier Gonzalez --- fs/aio.c | 8 ++++++++ include/uapi/linux/aio_abi.h | 1 + 2 files changed, 9 insertions(+) diff --git a/fs/aio.c b/fs/aio.c index 7ecddc2..8b10a55d 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1579,6 +1579,10 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb, __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); __sb_writers_release(file_inode(file)->i_sb, SB_FREEZE_WRITE); } +#ifdef CONFIG_BLK_DEV_ZONED + if (iocb->aio_lio_opcode == IOCB_CMD_ZONE_APPEND) + req->ki_flags |= IOCB_ZONE_APPEND; +#endif req->ki_flags |= IOCB_WRITE; aio_rw_done(req, call_write_iter(file, req, &iter)); } @@ -1846,6 +1850,10 @@ static int __io_submit_one(struct kioctx *ctx, const struct iocb *iocb, return aio_fsync(&req->fsync, iocb, true); case IOCB_CMD_POLL: return aio_poll(req, iocb); +#ifdef CONFIG_BLK_DEV_ZONED + case IOCB_CMD_ZONE_APPEND: + return aio_write(&req->rw, iocb, false, compat); +#endif default: pr_debug("invalid aio operation %d\n", iocb->aio_lio_opcode); return -EINVAL; diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h index 8387e0a..541d96a 100644 --- a/include/uapi/linux/aio_abi.h +++ b/include/uapi/linux/aio_abi.h @@ -43,6 +43,7 @@ enum { IOCB_CMD_NOOP = 6, IOCB_CMD_PREADV = 7, IOCB_CMD_PWRITEV = 8, + IOCB_CMD_ZONE_APPEND = 9, }; /* -- 2.7.4