We agree it's a violation in the worst sense. :) The problem is there
was no good way to set AS_KERNEL without calling map_user_kiobuf() on
your own. Until such a scheme is put in place (which we believe will be
at some point soon), we put something in to make it work for us. It's
certainly better than a conditional check in map_user_kiobuf(). :)
|>What I need is to move map_user_kiobuf() up to sd_raw_{read,write} and
|>make the map call conditional on some external data (filp flag?). Use
|>map_user_kiobuf() by default or use map_kernel_kiobuf() if the filp is
|>marked "use kernel pages". That way the syscall code makes the
|>decision about whether to use kernel or user mappings and passes the
|>resulting mapped kiobuf to the low level raw I/O code. No decisions in
|>the low level code about what mappings to use.
|>
|>So all we need is a map_kernel_kiobuf() routine and a wrapper
|>map_kiobuf() which takes a flag and calls the relevant map_xxx_kiobuf()
|>routine. That has a restriction that all the pages in a single kiobuf
|>are mapped the same way but that is probably acceptable, the kiovec
|>lets you plug kiobufs together.
|>
|>Does this sound sensible?
That'd be fine, or as you stated in a previous response, a way to set
a struct file flag to indicate kernel pages that would be universal.
--Matt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/