Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded by Matt Thomas.
Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize. Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.
Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.
Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
to pool_init. Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.
Convert struct session, ucred and lockf to pools.
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
convert all code to use smb_{rq|t2}_alloc() instead of allocating
structures on stack, make smb_rq_init()/smb_t2_init() static and not
exported outside smb_rq.c
* 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
on error returns paths with parent still locked, which would
cause 'locking against myself' panic with nonrecursive lock
fixes problem where invalid share name would cause a panic
via smb_sm_lookup() -> smb_share_put()
many thanks to Matthias Drochner for pointing out easy way how to
trigger this problem
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
incorrectly bombed when the exclusive lock was help by different process
(*yuck*)
lockmgr() checks for 'locking against myself' type of locking problems itself,
so no need to do any additional checks
get its ACKs faster.
From Darwin via FreeBSD.
XXX I don't have any idea if this is useful or reasonable, but it looks
XXX sane and the code works. "Remove if found nonuseful."
This makes it possible to use files >4G.
From Darwin via FreeBSD, but changed so that smb_{read|write}() directly
calls appropriate i/o variant, and replaced md_get_uint16le() with
md_get_uint16() for target == NULL cases.
Replace some size_t's by int's.
use temporary variable to fetch the 16bit value instead
remove some redundant temporaries, use NULL for those md_get_*() calls instead
make sv_sm 16bit - it is 16bit in later SMB dialects