Here's part #2 in my sendfile refactoring. This is a little more
intrusive than the first patch.


My aim here is to move the sendfile_sync stuff out of uipc_syscalls.c
and out of sendfile-only code and into something that can be reused
elsewhere or replaced later on. I've created methods for all the
sendfile_sync stuff, I've moved it out of the do_sendfile() loop so
do_sendfile() doesn't specifically implement the completion behaviour.

Initially, I'm going to implement a sendfile knote representing the
completion of this particular mbuf transaction.

I also have a vague, handwav-y idea to use this kind of mbuf
transaction representation for later work with aio_write() (and maybe
an aio_writev()) when writing to a socket - wire in the userland
memory, create a chain of mbufs to represent those, wrap them up in a
sendfile_sync (or whatever it mutates into) and then use that for the
kqueue completion notification. It needs the same kind of mbuf
transaction and kqueue notification mechanism so I'd like to
eventually make the sendfile_sync stuff generic, or use the memory
buffer representation from jhb, to implement this in a variety of

I'm not entirely happy where the sendfile_sync stuff is living but
this is all meant to be transition-y and enable further hacking on
sendfile / variations thereof without having to duplicate too much


freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to