@@ -6581,7 +6581,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags)
return 0;
}
-#define IO_SENDZC_VALID_FLAGS IORING_SENDZC_FIXED_BUF
+#define IO_SENDZC_VALID_FLAGS (IORING_SENDZC_FIXED_BUF|IORING_SENDZC_FLUSH)
static int io_sendzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
@@ -6685,7 +6685,10 @@ static int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
msg.msg_ubuf = ¬if->uarg;
ret = sock_sendmsg(sock, &msg);
- if (unlikely(ret < min_ret)) {
+ if (likely(ret >= min_ret)) {
+ if (req->msgzc.zc_flags & IORING_SENDZC_FLUSH)
+ io_notif_slot_flush_submit(notif_slot, 0);
+ } else {
if (ret == -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK))
return -EAGAIN;
if (ret == -ERESTARTSYS)
@@ -279,6 +279,7 @@ enum {
*/
enum {
IORING_SENDZC_FIXED_BUF = (1U << 0),
+ IORING_SENDZC_FLUSH = (1U << 1),
};
/*
Allow to flush notifiers as a part of sendzc request by setting IORING_SENDZC_FLUSH flag. When the sendzc request succeedes it will flush the used [active] notifier. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- fs/io_uring.c | 7 +++++-- include/uapi/linux/io_uring.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-)