vmapbuf confusion

Chuck Tuffli ctuffli at gmail.com
Thu Feb 16 14:03:58 PST 2006


I'm working on a kernel driver that implements read()/write() and ran
across something I didn't expect. The d_write_t entry point mimics
what CAM does for user space buffers: allocates a struct buf, fills in
the pointers and lengths from the struct uio, and calls vmapbuf() to
get a KVA. Due to a (dumb) logic bug, the driver never called
vmapbuf(), but access from the kernel to that user space address seem
to work just fine. So is the call to vmapbuf() unnecessary? Is it only
needed some of the time? If so, when? As always, any pointers are most
appreciated.

---chuck






More information about the Kernel mailing list