Commit Graph

204 Commits

Author SHA1 Message Date
nakayama 361b8e4249 Tabify. 2012-05-12 01:40:37 +00:00
nakayama 0c073a1ca9 Since "len" has changed to (unsinged) size_t, the while loop
condition (len > 0) became less able to detect its underflow.
So check the subtrahend to avoid the underflow.

Should fix PR kern/44092.
2012-05-11 14:51:39 +00:00
dsl e05eb71de5 Remove everything to do with 'struct malloc_type' and the malloc link_set.
To make code in 'external' (etc) still compile, MALLOC_DECLARE() still
  has to generate something of type 'struct malloc_type *', with
  normal optimisation gcc generates a compile-time 0.
MALLOC_DEFINE() and friends have no effect.
Fix one or two places where the code would no longer compile.
2012-04-29 20:27:31 +00:00
elad 0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
christos 8b0d7f915b rename SMBFS_MAXFNAMELEN to SMBFS_MAXNAMLEN for consistency 2011-09-27 02:05:10 +00:00
christos 9d292e0f12 remove unused constant 2011-09-27 01:16:35 +00:00
chs 4364c9c0d3 don't mix static and non-static MALLOC_DEFINE()s in the same file,
it fails to compile with gcc 4.5 on alpha.
2011-09-25 13:42:30 +00:00
plunky 7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
pooka f4f60017b9 * remove #ifdef nonsense (which caused the lossage in the first place)
* make it a DRIVER so that it autoloads when /dev/nsmb is opened
2010-12-17 14:27:34 +00:00
pooka 3a3ba15647 Try to unbreak module a little. It would be really nice to not
utterly break things in the name of modularization, especially if
avoiding breakage takes 2min.
2010-12-17 13:24:45 +00:00
pooka 8fb9443f66 unifdef -D__NetBSD__ 2010-12-17 13:05:29 +00:00
ahoka 3531a9ba6c take two on module support
XXX this wont work as a builtin module
2010-12-15 12:58:13 +00:00
christos a39b3d540d Back this out. Fails lockdebug with duplicate lock initialization.
Please test with LOCKDEBUG!
2010-12-11 04:21:17 +00:00
ahoka 6110939092 Module support for NetBSD 2010-12-10 19:44:18 +00:00
christos 94320bc4fd Convert sizes/lengths to unsigned (size_t) or uint32_t
(for binary compatibility).
2010-07-12 02:58:01 +00:00
hannken 245651a23d Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode.  All LK_* flags move from sys/lock.h to sys/vnode.h.  Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
2010-07-01 13:00:54 +00:00
tron f996d27b06 Fix cut & paste error spotted by Nicolas Joly. 2009-10-18 23:20:31 +00:00
tron 9c260cf349 Fix detection of SMB capabilities according to the CIFS spec:
1.) SMB_CAP_LARGE_FILES advertises support for 64-bit file offsets.
2.) SMB_CAP_LARGE_READX and SMB_CAP_LARGE_WRITEX advertise support for
    large reads and writes (larger than 64KB).
The code previously only used SMB_CAP_LARGE_READX and SMB_CAP_LARGE_WRITEX
which is not correct and doesn't work for the Apple Time Capsule which
only supports SMB_CAP_LARGE_FILES. With these changes SMBFS can copy a
5GB to a Time Capsule and read it back without problems.

Thanks a lot to Allen Briggs for pointing out the broke assumptions
and explaining the CIFS spec to me. This fixes PR kern/42175.
2009-10-18 22:53:36 +00:00
njoly 3ca0c64cb2 Do not call smb_rqpool_fini() on device close. Otherwise, we'll crash
trying to use destroyed pools for SMB request.
2009-09-21 14:13:35 +00:00
pooka df6e37fb47 Convert POOL_INITs to proper cons/destructors. 2009-09-12 12:52:21 +00:00
pooka d42676af17 add comment to previous stating periodic wakeups can be nuked
once smb is mpsafe.
2009-09-04 16:18:34 +00:00
pooka d25f4faa30 defensive programming: wake up iod thread once a second "just in case" 2009-09-04 16:16:52 +00:00
pooka 56df608091 Send data for as long as there is new data available. Otherwise
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).
2009-09-04 16:12:45 +00:00
tls 8c208552ae Grr. One last thing from the upcall-direction patch which I failed to
check in correctly.
2009-09-04 01:41:06 +00:00
pooka 7f37fbb7ea Install smb headers relevant for userspace and make mount_smbfs
use installed headers instead of src/sys.
2009-09-03 12:04:50 +00:00
pooka 3ef732fbf6 fix tybo 2009-09-01 12:23:36 +00:00
njoly 03324155b9 Do initialise the callout when fetching a new request structure from
the pool, not when starting the timer. Likewise, destroy the callout
when giving back the item to the pool.
2009-07-06 11:46:49 +00:00
njoly d90ab2e01d Do not call callout_stop() unless the structure was previoulsy
initialised for a non null timeout.
2009-07-01 10:01:28 +00:00
tsutsui d779b85d3e Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
2009-04-18 14:58:02 +00:00
christos 2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
cegger e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger 35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
yamt 812bb0d164 restore the pre socket locking patch signal behaviour.
this fixes a busy-loop in nfs_connect.
2009-01-21 06:59:29 +00:00
cegger dcf705893e use M_ZERO on malloc() and remove subsequent bzero(). 2008-12-19 18:49:37 +00:00
cegger 9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
plunky fd7356a917 Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core
2008-08-06 15:01:23 +00:00
ad 79873daf65 Make it compile. 2008-06-24 11:20:37 +00:00
gmcgarry 95c7011935 Remove gcc variadic macros with comma elimination. 2008-06-24 10:37:19 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad 15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
ad 40379c8716 Commit the "per-CPU" select patch. This is the result of much work and
testing by rmind@ and myself.

Which approach to use is still being discussed, but I would like to get
this out of my working tree. If we decide to use a different approach
there is no problem with revisiting this.
2008-03-22 18:04:42 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
ad 89d4a45927 selclear() while exiting netsmb's custom copy of select(). PR kern/38123. 2008-03-05 18:09:57 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
ad 9ef95126d8 Replace crufty use of lockmgr. 2008-01-30 14:08:00 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 80da99483e Don't exit an unheld mutex. 2007-07-10 21:05:03 +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