![]() code like "return g->dlen;" is wrong as we do not hold the qlock of the global segment. another process could come in and override g->dlen making us return the wrong byte count. avoid copying when we already got a kernel address (kernel memory is the same on processes) which is the case with bread()/bwrite(). this is the same optimization that devsd does. also avoid allocating/freeing and copying while holding the qlock. when we copy to/from user memory, we might fault preventing others from accessing the segment while fault handling is in progress. |
||
---|---|---|
.. | ||
doc | ||
games/lib | ||
include | ||
lib | ||
man | ||
src |