Commit Graph

128 Commits

Author SHA1 Message Date
skrll
f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
drochner
5573193349 fix some questionable pointer casts; gcc-3.4.x didn't
like this
2004-06-24 16:45:47 +00:00
itojun
05c2e80700 remove debugging printf(), seems like mistakenly commited 2004-05-28 09:38:13 +00:00
jonathan
230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
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.
2004-05-22 22:52:13 +00:00
simonb
b5d0e6bf06 Initialise (most) pools from a link set instead of explicit calls
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.
2004-04-25 16:42:40 +00:00
itojun
e133d13e80 kill some strcpy 2004-04-21 18:16:14 +00:00
jdolecek
865a0b1787 align Extended file attributes defines 2004-03-22 16:42:06 +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
wiz
73e1501b98 parameter with two es. From Peter Postma. 2004-02-24 15:22:01 +00:00
wiz
f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
jdolecek
fc15b17c83 fix NT_OPEN_EXISTING to be really just 'open' and not include the 'create' bit
fixes the problem described in PR kern/22835 by Rob Quinn
2004-02-17 19:22:42 +00:00
simonb
a2facef339 Remove some assigned-to but otherwise unused variables. 2003-10-30 01:43:08 +00:00
jdolecek
e257c8b61f map ERRSRV:ERRbaduid to EAUTH 2003-09-27 12:24:25 +00:00
drochner
29eaa7cc18 "(u_short > 0xffff)" is never true, as gcc3 found out 2003-07-03 10:59:12 +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
itojun
5dcb6d7469 fix lwp lossage 2003-06-29 12:16:19 +00:00
martin
6b2ac9f5b4 Fix small merge botch in previous. 2003-06-29 12:04:32 +00:00
martin
8908626c9a struct proc -> struct lwp 2003-06-29 12:01:34 +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
martin
eac03aee15 Make it compile with DEBUG but no DIAGNOSTIC. 2003-06-02 20:43:36 +00:00
itojun
0c48aa3eda need dstlen to make it safe 2003-05-16 05:14:40 +00:00
jdolecek
c2704241db add a comment on SMB packet PID purpose to smb_rq_new()
adjust the commented out code to be compilable, but keep using '1' as the PID
2003-04-08 21:10:33 +00:00
jdolecek
dfc728f814 fix pasto in smb_rq_setcallback(), mistakely used SMBRQ_SLOCK() instead
of SMBRQ_SUNLOCK()
found during LOCKDEBUG PR kern/21067 hunt
2003-04-08 18:13:41 +00:00
jdolecek
49d2e49597 FILE_USE()/FILE_UNUSE() file entry returned from fd_getfile() properly
bug discovered with LOCKDEBUG, adresses PR kern/21067 by Martin Husemann
2003-04-08 16:29:11 +00:00
jdolecek
ddf683ae7a fix simplelock acquire/release in smb_co_rele()
adresses PR kern/21067 by Martin Husemann
2003-04-08 14:56:49 +00:00
jdolecek
1cd92a1660 use pools instead of malloc(9) for allocation of smb request structures
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
2003-04-07 19:35:39 +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
dfb3906cfb add bunch of NT DIRECTORY CHANGE NOTIFY and NT CREATE AND X related constants
add mapping for ERRDOS:STATUS_NOTIFY_ENUM_DIR and ERRHRD:ERRgeneral
2003-04-07 11:13:24 +00:00
jdolecek
dee9f67e51 add SMB_CAPS() macro, which returns session capabilities 2003-04-05 13:13:50 +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
cdfa2ea23e #ifdef MCHAIN_DEBUG a too verbose message 2003-04-04 08:20:50 +00:00
jdolecek
a1e8c55374 g/c vc_timo from struct smb_vc - it's not used anymore 2003-04-02 15:03:37 +00:00
jdolecek
e71b725363 we now use rqp->sr_timo for request timeout value, so don't
reset it in smb_rq_simple(); 5 ticks (vc_timo) would be generally
too small timeout anyway
2003-04-02 15:01:52 +00:00
jdolecek
b79183a11f g/c smb_smb_nomux(), use KASSERT() instead - if we get here with
process != iod, it's netsmb/smbfs code error
2003-04-01 08:35:42 +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
dc859b2165 do recursive lock in smb_co_gone() - this code could be invoked
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
2003-03-31 18:24:58 +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
3cac807cc4 whitespace KNF 2003-03-30 09:44:28 +00:00
jdolecek
32657d0d79 remove incorrect DEBUG check of recursive lock in smb_co_lock() - the check
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
2003-03-29 21:42:44 +00:00
jdolecek
d6eaa60e05 parenthesize NB_ENCNAMELEN value 2003-03-27 11:22:29 +00:00
jdolecek
78b50cb215 Receive packets in a small pieces (NB_SORECEIVE_CHUNK), so TCP slowstart will
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."
2003-03-24 18:08:51 +00:00
jdolecek
7ba3ded040 fix connecting to (samba) server when share-level security is in effect
(do not send second password at all)
from FreeBSD
2003-03-24 15:07:52 +00:00
jdolecek
01f94cf255 Implement support for mixed case passwords.
From Darwin via FreeBSD.

This will have some effect once the NetBSD iconv routines would
actually do something.
2003-03-24 15:03:58 +00:00
jdolecek
b55818f692 Use 'large' (64bit) readx and writex functions if server supports them.
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.
2003-03-24 14:24:14 +00:00
jdolecek
fbfa48d0a9 make smb_smb_read() and smb_smb_write() return EFBIG if offset is
at or beyond 4G - this interface supports 32bit offset only
2003-03-24 14:11:32 +00:00
jdolecek
de3ee118b5 map ERRDOS/ERRnotlocked to EBUSY 2003-03-24 10:05:43 +00:00
jdolecek
6e843721e9 don't access (u_int32_t *) as (u_int16_t *), this fails on BE machines -
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
2003-03-24 09:17:52 +00:00
jdolecek
6d65835e70 one more rename - ERRbaddevice -> ERRnoipc 2003-03-24 08:56:21 +00:00
jdolecek
2b08f4a53d fix some typos. from FreeBSD 2003-03-24 08:42:31 +00:00