there was a danger of smb_iod_recvall() blocking, hence releasing
the kernel lock, new data creeping into the queue, and a wakeup
being missed (well, there's still a race, but since it's theoretical
enough for me to never have encountered it, I'll rather solve it
by periodic wakeups).
abstracted by itry, ithrow, icatch et.al. macros
there is problem with these in stack setup for FreeBSD/ia64 at least,
and in general the rewritten explicit code is slighly more optimal
and smaller in size
the NetBSD code change is somewhat different to what was done in FreeBSD,
to improve readability of the code
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.
Bump the kernel rev up to 1.6V
* add receive hook - if set, this function is called when request is finished
* unstatic smb_rq_enqueue(), smb_rq_reply() so that code can use that
independant of smb_rq_simple() et al
this is needed for NT DIRECTORY CHANGE NOTIFY SMB, since they typically
take very long to complete and we want to be able to use single kernel thread
to handle them all
add support for 'nowait' requests (flag SMBR_NOWAIT), which don't expect
and answer from server and are marked as 'processed' immediatelly
after they are sent to server - needed for NT CANCEL SMB
change other SMBERROR() calls to SMBIODEBUG() - they are only useful when
debugging, and avoids spamming console/system logs with messages triggerable
from userland
so that iod wouldn't pause when the reply comes fast enough
to catch iod between smb_iod_recvall() and tsleep()
this gives nice performance boost for workloads with many synchronously
submitted transactions, like ls -lR
iod now doesn't need to wakeup periodically, so don't use any timeout
for its tsleep(); also use higher priority PSOCK instead of PWAIT
of iod calling smb_iod_sendall()
g/c now unneeded request timeout expire check from smb_iod_sendall()
make it possible to override default request timeout - set timeout
value in smb_rq_init() to default value, caller can adjust the value
before calling smb_iod_sendrq(); value <=0 means no timeout
do not inline smb_iod_rqprocessed()
make smb_iod_sendall(), smb_iod_recvall() 'return' void - the return value
was always ignored
smb_iod_recvall(): turn an programming error condition check to KASSERT()
smb_iod_main(): g/c unused 'error' local
smb_iod_thread(): iod_p is assigned in smb_iod_create(), so just KASSERT()
it's correct here
iod_sleeptimo is set to same value always, so use the value directly
and #if 0 iod_sleeptimo
add one smb_iod_wakeup() in smb_iod_sendrq()
XXX unfortunately iod thread still must wakeup periodically to check
XXX for arriving replies - command latency might be improved if this could
XXX be avoided
sent out, use mono_time instead microtime(), and simplify computation
in smb_iod_sendall(). Also count the timout once, not twice as previous code.
#if 0 iod->iod_lastrqsent, it was write-only
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups