From patchwork Wed Jun 17 17:23:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kanchan Joshi X-Patchwork-Id: 11610339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD84060D for ; Wed, 17 Jun 2020 17:27:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1C6B21655 for ; Wed, 17 Jun 2020 17:27:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="VIVRo5P+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbgFQR1L (ORCPT ); Wed, 17 Jun 2020 13:27:11 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:57126 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgFQR1K (ORCPT ); Wed, 17 Jun 2020 13:27:10 -0400 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200617172707epoutp01d1b3eb1a2691d5c74ddb73a08a5614d6~ZZNlcZwt02594825948epoutp01W for ; Wed, 17 Jun 2020 17:27:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200617172707epoutp01d1b3eb1a2691d5c74ddb73a08a5614d6~ZZNlcZwt02594825948epoutp01W 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 kOi6M4UFEgzTGCXeLrrPPIFRdhbC1AWMjKsYJVMLinPTU4tNC4zyUsv1ihNzi0vz0vWS83M3 MYITiJbXDsaHDz7oHWJk4mA8xCjBwawkwuv8+0WcEG9KYmVValF+fFFpTmrxIUZpDhYlcV6l H2fihATSE0tSs1NTC1KLYLJMHJxSDUyL5t/ns5j7MOZW2am3gireHe+CYlIzRM52xRmrt+o6 LtQJXLo4O4lb0zFqxswN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FlLubLGwNH7hmrbKOb8tevZOyWjyrUo+KbR7 jffVHuNTM+41lvxNEY84aP4ySyLr2rqlXDesZPuFT978xn9ULq5n+uOne0LSYpa++yj5jbuJ /blFR/f1fb41nAsabnlE9a2RX3G2uEgu5amPd3LPpgOHTpfP8mU6NXe9y6JDqeUR82/ZZW98 bc6nxFKckWioxVxUnAgAqm13RdACAAA= X-CMS-MailID: 20200617172706epcas5p4dcbc164063f58bad95b211b9d6dfbfa9 X-Msg-Generator: CA CMS-TYPE: 105P X-CMS-RootMailID: 20200617172706epcas5p4dcbc164063f58bad95b211b9d6dfbfa9 References: <1592414619-5646-1-git-send-email-joshi.k@samsung.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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, }; /*