[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1592414619-5646-3-git-send-email-joshi.k@samsung.com>
Date: Wed, 17 Jun 2020 22:53:38 +0530
From: Kanchan Joshi <joshi.k@...sung.com>
To: axboe@...nel.dk, viro@...iv.linux.org.uk, bcrl@...ck.org
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-aio@...ck.org, io-uring@...r.kernel.org,
linux-block@...r.kernel.org, selvakuma.s1@...sung.com,
nj.shetty@...sung.com, javier.gonz@...sung.com,
Kanchan Joshi <joshi.k@...sung.com>,
Arnav Dawn <a.dawn@...sung.com>
Subject: [PATCH 2/3] aio: add support for zone-append
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 <joshi.k@...sung.com>
Signed-off-by: Arnav Dawn <a.dawn@...sung.com>
Signed-off-by: SelvaKumar S <selvakuma.s1@...sung.com>
Signed-off-by: Nitesh Shetty <nj.shetty@...sung.com>
Signed-off-by: Javier Gonzalez <javier.gonz@...sung.com>
---
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
Powered by blists - more mailing lists