Commit Graph

29 Commits

Author SHA1 Message Date
gmcgarry 95c7011935 Remove gcc variadic macros with comma elimination. 2008-06-24 10:37:19 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
christos e445d1fecf Coverity CID 992: Avoid NULL deref. 2006-04-12 01:16:02 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry bcfcddbac1 nuke trailing whitespace 2005-02-26 22:31:44 +00:00
jdolecek 1e14d87c7e follow FreeBSD and replace code using the try/catch paradigm
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
2004-03-21 10:09:52 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
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
2003-06-28 14:20:43 +00:00
jdolecek b37f22dc9f add support for asynchronous execution of SMB requests:
* 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
2003-04-07 11:23:02 +00:00
jdolecek 55535a9403 smb_iod_addrq(): change vc_maxmux check to #ifdef DIAGNOSTIC panic
change other SMBERROR() calls to SMBIODEBUG() - they are only useful when
debugging, and avoids spamming console/system logs with messages triggerable
from userland
2003-04-05 11:12:23 +00:00
jdolecek 6e5e05ca45 run iod at splnet, to eliminate race agains receive upcall wakeup,
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
2003-03-31 20:59:35 +00:00
jdolecek 95aaf6bde8 use callout for request timeout, so that it could expire independantly
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
2003-03-30 11:58:17 +00:00
jdolecek 349bcca42d whitespace fixes
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
2003-03-30 11:27:45 +00:00
jdolecek 41b5582182 iod_pingtimo is unused, #if 0
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
2003-03-24 07:49:48 +00:00
jdolecek fa1e2856c7 use simpleq instead of tailq for iod_rqlist - simpleq is enough
for our needs here
2003-03-23 10:32:05 +00:00
jdolecek f6f096034a Compute the request timeout time in smb_iod_sendrq() when the request is
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
2003-03-23 10:01:31 +00:00
jdolecek 9b7005c79d g/c some non-NetBSD code 2003-03-23 08:28:06 +00:00
kristerw 6c096545e5 ISO C requires a statement after a label. 2003-03-15 02:11:43 +00:00
jdolecek ede214240b #if 0 or g/c unused stuff
pointed out by Krister Walfridsson
2003-03-03 21:16:02 +00:00
jdolecek 11c209aa83 prefix tsleep() wmesg with 'smb', rather than '90'
drop #ifndef __NetBSD__ msleep() code, it only obfuscates the code
2003-02-26 19:30:51 +00:00
jdolecek e1ea74dfac add __KERNEL_RCSID 2003-02-25 09:12:11 +00:00
jdolecek c672cc0379 make sure sr_bcount, sr_rqtid and sr_rquid are wrote in alignment-safe way
problem pointed out by Martin Husemann

while here, turn some checks/SMBERROR()s to #ifdef DIAGNOSTIC panic()s
2003-02-24 21:13:13 +00:00
jdolecek fde501ab94 use explicit width macros from <sys/endian.h>, do not define&use
letohs/letohl/letohq and such
2003-02-18 10:18:52 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
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.
2003-02-01 06:23:35 +00:00
lukem 06de426449 SIMPLEQ rototill:
- 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
2002-06-01 23:50:52 +00:00
deberg f3b1291f2e resolve conflicts 2002-01-04 02:39:37 +00:00
deberg 16208c1279 now that this is in freebsd, import vendor copy as base. 2002-01-04 02:24:57 +00:00