linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org, linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 14/20] aio: abstract out io_event filler helper
Date: Mon, 26 Nov 2018 09:45:38 -0700	[thread overview]
Message-ID: <20181126164544.5699-15-axboe@kernel.dk> (raw)
In-Reply-To: <20181126164544.5699-1-axboe@kernel.dk>

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/aio.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index ba5758c854e8..12859ea1cb64 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1057,6 +1057,15 @@ static inline void iocb_put(struct aio_kiocb *iocb)
 	}
 }
 
+static void aio_fill_event(struct io_event *ev, struct aio_kiocb *iocb,
+			   long res, long res2)
+{
+	ev->obj = (u64)(unsigned long)iocb->ki_user_iocb;
+	ev->data = iocb->ki_user_data;
+	ev->res = res;
+	ev->res2 = res2;
+}
+
 /* aio_complete
  *	Called when the io request on the given iocb is complete.
  */
@@ -1084,10 +1093,7 @@ static void aio_complete(struct aio_kiocb *iocb, long res, long res2)
 	ev_page = kmap_atomic(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE]);
 	event = ev_page + pos % AIO_EVENTS_PER_PAGE;
 
-	event->obj = (u64)(unsigned long)iocb->ki_user_iocb;
-	event->data = iocb->ki_user_data;
-	event->res = res;
-	event->res2 = res2;
+	aio_fill_event(event, iocb, res, res2);
 
 	kunmap_atomic(ev_page);
 	flush_dcache_page(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE]);
-- 
2.17.1

  parent reply	other threads:[~2018-11-27  3:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 16:45 [PATCHSET v3 0/18] Support for polled aio Jens Axboe
2018-11-26 16:45 ` [PATCH 01/20] aio: fix failure to put the file pointer Jens Axboe
2018-11-27  8:16   ` Johannes Thumshirn
2018-11-26 16:45 ` [PATCH 02/20] aio: clear IOCB_HIPRI Jens Axboe
2018-11-27  8:18   ` Johannes Thumshirn
2018-11-26 16:45 ` [PATCH 03/20] fs: add an iopoll method to struct file_operations Jens Axboe
2018-11-27  8:24   ` Johannes Thumshirn
2018-11-26 16:45 ` [PATCH 04/20] block: wire up block device iopoll method Jens Axboe
2018-11-27  8:29   ` Johannes Thumshirn
2018-11-26 16:45 ` [PATCH 05/20] block: ensure that async polled IO is marked REQ_NOWAIT Jens Axboe
2018-11-26 16:45 ` [PATCH 06/20] iomap: wire up the iopoll method Jens Axboe
2018-11-26 16:45 ` [PATCH 07/20] iomap: ensure that async polled IO is marked REQ_NOWAIT Jens Axboe
2018-11-26 16:45 ` [PATCH 08/20] aio: use assigned completion handler Jens Axboe
2018-11-26 16:45 ` [PATCH 09/20] aio: separate out ring reservation from req allocation Jens Axboe
2018-11-26 16:45 ` [PATCH 10/20] aio: don't zero entire aio_kiocb aio_get_req() Jens Axboe
2018-11-26 16:45 ` [PATCH 11/20] aio: only use blk plugs for > 2 depth submissions Jens Axboe
2018-11-26 16:45 ` [PATCH 12/20] aio: use iocb_put() instead of open coding it Jens Axboe
2018-11-26 16:45 ` [PATCH 13/20] aio: split out iocb copy from io_submit_one() Jens Axboe
2018-11-26 16:45 ` Jens Axboe [this message]
2018-11-26 16:45 ` [PATCH 15/20] aio: add io_setup2() system call Jens Axboe
2018-11-26 16:45 ` [PATCH 16/20] aio: add support for having user mapped iocbs Jens Axboe
2018-11-26 16:45 ` [PATCH 17/20] aio: support for IO polling Jens Axboe
2018-11-27  9:53   ` Benny Halevy
2018-11-27 15:24     ` Jens Axboe
2018-11-28  9:33       ` Benny Halevy
2018-11-28 18:50         ` Jens Axboe
2018-11-29 14:10           ` Benny Halevy
2018-11-26 16:45 ` [PATCH 18/20] aio: add submission side request cache Jens Axboe
2018-11-26 16:45 ` [PATCH 19/20] fs: add fget_many() and fput_many() Jens Axboe
2018-11-26 16:45 ` [PATCH 20/20] aio: use fget/fput_many() for file references Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181126164544.5699-15-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-aio@kvack.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).