Commit Graph

4001 Commits

Author SHA1 Message Date
enami 23114636eb Delete m_tag from a mbuf being non-pkthdr mbuf rather than newly becoming
pkthdr mbuf.
2004-09-17 23:24:03 +00:00
enami a3eb2d5952 - proc_alloc() already initializes p_stat to SIDL.
- copy unconditionaly inherited p_flag bits in a single place.
2004-09-17 23:20:21 +00:00
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
tls 95c72fc3de Add 50Hz support -- this will allow 'options NTP' to work on the Xen port,
once the Xen port's timer interrupts are made somewhat more sane (it "works"
now, but keeps worse time than without the option, ouch)
2004-09-15 04:56:14 +00:00
jdolecek e6e73849a5 g/c rest of COMPAT_AOUT support 2004-09-14 17:25:37 +00:00
jdolecek 023551ef44 gc opt_compat_aout.h include 2004-09-14 17:20:29 +00:00
jdolecek a6894024dd dostatvfs(): zero the statvfs structure before calling filesystem code, so that
unset parts would have defined value and not pass random parts of kernel stack
2004-09-13 20:02:20 +00:00
jdolecek c407d0a5ca copy_statvfs_info(): copy f_namemax too 2004-09-13 19:45:21 +00:00
thorpej 77f08a265c Move the 16/32-bit encode/decode to/from octet stream routines from
kern_uuid.c to sys/endian.h (where FreeBSD has them), and add 64-bit
variants.
2004-09-12 23:17:37 +00:00
jdolecek ca7fc04a65 use 'have_toupper' variable for awk toupper() function existence test, rather
than 'isgawk' - e.g. nawk has toupper() too
2004-09-12 11:24:15 +00:00
yamt 1304a56139 m_split: restore a behaviour on M_PKTHDR, which was unintentionaly
changed when i added m_copyback_cow.
2004-09-11 19:55:19 +00:00
yamt 6a2c652541 regen. 2004-09-10 09:38:17 +00:00
yamt 472da495d3 VOP_BMAP isn't protected by vnode locks these days. 2004-09-10 09:37:41 +00:00
jdolecek 734ccdcf2b fix/adjust comment a little 2004-09-10 06:09:15 +00:00
yamt 7b09a1e089 m_copyback, m_copyback_cow, m_copydata:
- caddr_t -> void *
- constify.
partly from openbsd.
2004-09-08 12:00:28 +00:00
yamt d08391b2a3 buf_trim: a buffer grabbed by getnewbuf() should be clean and anonymous.
thus, there's no need to check and handle B_WANTED here.
2004-09-08 10:20:15 +00:00
yamt e2139bcdc8 add m_copyback_cow and m_makewritable. 2004-09-06 09:43:29 +00:00
manu 6e3c639957 IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
2004-09-04 23:29:44 +00:00
manu 35053e0e8d Recognize bundles as mach-O executables 2004-09-04 23:21:26 +00:00
skrll ab05973128 Use "NULL" instead of "(struct foo *)0". 2004-09-04 07:09:35 +00:00
darrenr 02c34673a3 add a per-socket counter for dropped UDP packets when the internal buffers
are full.
2004-09-03 18:14:09 +00:00
drochner e66ef34b75 split out the check whether a driver supports a given interface
attribure, and add a diagnostic assertion to config_search_loc()
which ensures that a supplied attribute name is correct
2004-08-30 09:48:05 +00:00
thorpej e910f9082e - Define a constant to describe the length of a printed UUID string.
- Clean up the namespace of this module and enable the encode/decode
  functions and printing functions.
- Move the code that actually generates the UUID out of the system call
  routine and into its own function.
2004-08-30 02:56:03 +00:00
itojun 9ac7900a84 bug reported by millert@openbsd:
> Call dom_dispose() for any SCM_RIGHTS message that went through the
> read path rather than recv.  Previously, if an fd was passed via
> sendmsg() but was consumed by the receiver via read() the ref count
> was incremented and never decremented and so the ref count would
> never reach zero even when there was no long any processes holding
> the file open (this was especially bad for locked fds).
2004-08-25 09:03:23 +00:00
drochner 6860e77f9d include <sys/device> explicitely, found by Havard Eidnes 2004-08-19 15:12:36 +00:00
christos 43f6a1ad3b PR/26210: Matthew Mondor: Since revision 1.14 when net-2 was merged,
the code to do receive packet accounting has been disabled for no apparent
reason. Re-enable it.
2004-08-19 12:48:42 +00:00
drochner 4157766364 add a "drvctl" pseudo-device as userland interface to the autoconf
rescan() and detach() functions
2004-08-18 12:19:29 +00:00
drochner d95b59fae8 add a new "DRV" LKM type, and some glue code to make it use the new
autoconf capabilities
2004-08-17 22:38:50 +00:00
drochner 08538dce1b Add some extensions to the autoconf framework to better support
loadable drivers and user controlled attach/detach of devices.
An outline was given in
http://mail-index.NetBSD.org/tech-kern/2004/08/11/0000.html
To cite the relevant parts:
-Add a "child detached" and a "rescan" method (both optional)
 to the device driver. (This is added to the "cfattach" for now
 because this is under the driver writer's control. Logically
 it belongs more to the "cfdriver", but this is automatically
 generated now.)
 The "child detached" is called by the autoconf framework
 during config_detach(), after the child's ca_detach()
 function was called but before the device data structure
 is freed.
 The "rescan" is called explicitely, either after a driver LKM
 was loaded, or on user request (see the "control device" below).
-Add a field to the device instance where the "locators" (in
 terms of the autoconf framework), which describe the actual
 location of the device relatively to the parent bus, can be
 stored. This can be used by the "child detached" function
 for easier bookkeeping (no need to lookup by device instance
 pointer). (An idea for the future is to use this for generation
 of optimized kernel config files - like DEC's "doconfig".)
-Pass the locators tuple describing a device's location to
 various autoconf functions to support the previous. And since
 locators do only make sense in relation to an "interface
 attribute", pass this as well.
-Add helper functions to add/remove supplemental "cfdata"
 arrays. Needed for driver LKMs.

There is some code duplication which will hopefully resolved
when all "submatch"-style functions are changed to accept the
locator argument.
Some more cleanup can take place when config(8) issues more
information about locators, in particular the length and default
values. To be done later.
2004-08-17 22:13:18 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00
mycroft fbf03babff There is an annoying deadlock that goes like this:
* Process A is closing one file descriptor belonging to a device.  In doing so,
  ffs_update() is called and starts writing a block synchronously.  (Note: This
  leaves the vnode locked.  It also has other instances -- stdin, et al -- of
  the same device open, so v_usecount is definitely non-zero.)
* Process B does a revoke() on the device.  The revoke() has to wait for the
  vnode to be unlocked because ffs_update() is still in progress.
* Process C tries to open() the device.  It wedges in checkalias() repeatedly
  calling vget() because it returns EBUSY immediately.

To fix, this:
* checkalias() now uses LK_SLEEPFAIL rather than LK_NOWAIT.  Therefore it will
  wait for the vnode to become unlocked, but it will recheck that it is on the
  hash list, in case it was in the process of being revoke()d or was revoke()d
  again before we were woken up.
* Since we're relying on the vnode lock to tell us that the vnode hasn't been
  removed from the hash list *anyway*, I have moved the code to remove it into
  the DOCLOSE section of vclean(), inside the vnode lock.

In the example at hand, process A was sh(1), process B was a child of init(8),
and process C was syslogd(8).
2004-08-13 22:48:06 +00:00
hannken bc4af00256 Make it compile again for sparc64/DIAGNOSTIC.
All archs should use `cpuid_t ci_cpuid' ...
2004-08-12 12:15:21 +00:00
christos 5647899427 make the reset time a DIAGNOSTIC, and print the cpu#. 2004-08-11 16:25:51 +00:00
jdolecek 9aba366e0b Linux enforces CLONE_VM if CLONE_SIGHAND in clone(2) is specified,
follow the suit - this is intended to be Linux-compatible call
2004-08-08 11:02:10 +00:00
jdolecek 142def6b36 pass the fork flags down the emulation proc fork hook 2004-08-08 11:00:05 +00:00
christos 0b82702558 PR/26468: Andrew Brown: Setting stopfork can panic the kernel.
When stopfork is set, we need to set p_nrlwps, since we are not going to
ber running.
2004-08-07 03:35:55 +00:00
christos 251940a98f Use the P_ZOMBIE macro instead of open-coding it. No functional change. 2004-08-07 03:34:37 +00:00
enami 8d37dcb7dc The different loop variable is no longer necessary due to recent change. 2004-08-05 22:06:48 +00:00
yamt 1e4aff5d38 add missing wakeups in the cases of lock failure.
from Stephan Uphoff, FreeBSD PR/69964.

(http://www.freebsd.org/cgi/query-pr.cgi?pr=69964)
> The LK_WANT_EXCL and LK_WANT_UPGRADE bits act as mini-locks and can block
> other threads.
> Normally this is not a problem since the mini locks are upgraded to full loc
> and the release of the locks will unblock the other threads.
> However if a thread reset the bits without optaining a full lock
> other threads are not awoken.
> This can happens if obtaining the full lock fails because of a LK_SLEEPFAIL,
> or a signal (if lock priority includes PCATCH .. don't think this is used).
2004-08-04 10:37:08 +00:00
yamt 8b4f43c443 - revert a part of the previous which breaks LK_SPIN locks.
(reported by Nicolas Joly on current-users@)
- propagate the previous to spinlock_acquire_count.
2004-08-04 01:16:06 +00:00
yamt c602229c1a when acquiring an exclusive lock,
ensure that no one else have the same lock.
a patch from Stephan Uphoff, FreeBSD PR/69934.

(http://www.freebsd.org/cgi/query-pr.cgi?pr=69934)
>	Upgrading a lock does not play well together with acquiring
>	an exclusive lock and can lead to two threads being
>	granted exclusive access.
>
>	Problematic sequence:
>	Thread A acquires a previous unlocked lock in shared mode.
>	Thread B tries to acquire the same lock in exclusive mode
>	and blocks.
>	Thread A upgrades its lock - waking up thread B.
>	Thread B wakes up and also acquires the same lock as it only checks
>	if the lock is not shared or if someone wants to upgrade the lock
>	and not if someone already upgraded the lock to an exclusive lock.
2004-08-03 12:08:51 +00:00
jdolecek 41405858b3 bump the number of allowed sections to 1024; e.g. SuSE 9.1 packaged
Mozilla 1.6 has 726 sections
2004-08-01 22:16:19 +00:00
lukem 66ff0c053c Rename LIBCOMPAT* -> SYSLIBCOMPAT*, now that <bsd.own.mk> provides LIBCOMPAT.
Fixes kernel link problem noted by Sebastien Erard.
2004-07-31 00:55:51 +00:00
atatat 91e4762204 The message buffer datum instrumented by KERN_MSGBUFSIZE is actually a
long, not an int, and this causes "problems" on LP64be machines
(sparc64, etc).  Assign the value to a temporary int and instrument
that instead.  Should be fine until someone wants a message buffer
larger than two gigabytes.
2004-07-27 12:46:18 +00:00
yamt 1e19d56b66 m_pulldown: fix mbuf leaks and chain truncation
in the case that m_dup() returns a chain of mbufs.
eg. when you attempt to m_pulldown() the middle of
a large M_EXT mbuf.
2004-07-21 12:09:43 +00:00
yamt 7af0699fdd m_copyback: add an assertion to detect write attempts to a read-only mbuf. 2004-07-21 12:06:46 +00:00
he afe2341535 Cast register type via intptr_t before cast to pointer.
Fixes build problem for evbsh5.
2004-07-20 14:56:10 +00:00
chs 423159120b add support for hppa to the MI scheduler activations kernel code:
- on hppa the stack grows up, so handle that using the STACK_* macros.
2004-07-18 21:29:26 +00:00
mycroft 4605cec510 PRIBIO -> PSOCK. This emulates the pre-sys_pipe behavior, and avoids including
processes blocked on pipe I/O in the load average.
2004-07-17 20:50:08 +00:00
yamt 118553b061 sa_release: NULL out l_savp to avoid having a stale reference to per-vp data.
it matters when an application using SA does exec() an application which also
uses SA.  (firefox 0.9 seems to do this.)
2004-07-06 12:23:40 +00:00