dragonfly.git
16 years agoDefine that Dragonfly HAS isblank() as to fix the
David Rhodus [Sun, 18 Apr 2004 00:15:35 +0000 (00:15 +0000)]
Define that Dragonfly HAS isblank() as to fix the
buildworld process. Before awk checked for isblank
not being defined.

16 years agoUpdate to awk 20040207.
Eirik Nygaard [Sat, 17 Apr 2004 19:42:15 +0000 (19:42 +0000)]
Update to awk 20040207.

16 years agoMerge from vendor branch AWK:
Eirik Nygaard [Sat, 17 Apr 2004 19:41:31 +0000 (19:41 +0000)]
Merge from vendor branch AWK:
Import of awk 20040207

16 years agoImport of awk 20040207
Eirik Nygaard [Sat, 17 Apr 2004 19:41:31 +0000 (19:41 +0000)]
Import of awk 20040207

16 years agoAdd in kernel config file options that were
David Rhodus [Sat, 17 Apr 2004 03:57:22 +0000 (03:57 +0000)]
Add in kernel config file options that were
forgotten on last commit.

16 years agonetisr_queue() needs to reliably allocate the message used to reference the
Matthew Dillon [Sat, 17 Apr 2004 00:46:28 +0000 (00:46 +0000)]
netisr_queue() needs to reliably allocate the message used to reference the
mbuf so make the allocation M_WAITOK instead of M_NOWAIT.  This also fixes
an mbuf leak due to some users of netisr_queue() not checking the return
value.  Note, however, that there were and still are issues with
netisr_queue() blocking (due to occassionally waiting on kernel_map,
possible deadlock issues, and so forth).

16 years agoStyle(9) cleanup to src/sys/vfs, stage 9/21: msdosfs.
Chris Pressey [Sat, 17 Apr 2004 00:30:17 +0000 (00:30 +0000)]
Style(9) cleanup to src/sys/vfs, stage 9/21: msdosfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoChange WAIT_FOR_AUTO_NEG_DEFAULT to 0. Do not wait for auto-negotiation to
Matthew Dillon [Fri, 16 Apr 2004 23:18:14 +0000 (23:18 +0000)]
Change WAIT_FOR_AUTO_NEG_DEFAULT to 0.  Do not wait for auto-negotiation to
complete before continuing.  if_em can take over two seconds to autoneg, and it
renegotiates virtually every time the interface is manipulated.  For example,
running dhclient will cause if_em to renegotiate 3 times in a row.

Note that even when we were waiting for autoneg, the interface would not
always be completely up after the autoneg completed.  This is possibly
due to the watchdog timer (which is on a 2 second interval).  In fact, on
my test box this is what was tickling the recently fixed DNS bug (timing
out on part of the dns search path) and subsequent NFS mount failures.

16 years agoAdd in the twa(4) driver. This adds in support for the 3Ware
David Rhodus [Fri, 16 Apr 2004 20:13:17 +0000 (20:13 +0000)]
Add in the twa(4) driver. This adds in support for the 3Ware
Escalade 9000 series storage controllers. The driver is a
port of the work done by Vinod Kashyap in FreeBSD.

16 years agoPlace 'device acpica5' into the TINDERBOX kernel config so
David Rhodus [Fri, 16 Apr 2004 19:52:49 +0000 (19:52 +0000)]
Place 'device acpica5' into the TINDERBOX kernel config so
the tinderbox will build the new ACPI code and make sure the
complication remains working.

16 years agoAdd back in basic ACPI support into the LINT kernel build.
David Rhodus [Fri, 16 Apr 2004 19:49:09 +0000 (19:49 +0000)]
Add back in basic ACPI support into the LINT kernel build.
This option was lost during rev 1.24.

16 years agoMerge changes from FreeBSD 5:
Joerg Sonnenberger [Fri, 16 Apr 2004 15:40:21 +0000 (15:40 +0000)]
Merge changes from FreeBSD 5:
- remove dependency on device counting
- undo massive inlining on iavc

16 years agofor() ==> TAILQ_FOREACH
Joerg Sonnenberger [Fri, 16 Apr 2004 15:11:53 +0000 (15:11 +0000)]
for() ==> TAILQ_FOREACH

16 years agoNuke unused fields in struct ifnet, if_done and if_poll_* hasn't been used
Joerg Sonnenberger [Fri, 16 Apr 2004 14:24:36 +0000 (14:24 +0000)]
Nuke unused fields in struct ifnet, if_done and if_poll_* hasn't been used
for years and ipending was only used for some flags not stored in if_flags.

16 years agoMove IFF_PROMISC and IFF_POLLING from ifnet.ipending to ifnet.if_flags,
Joerg Sonnenberger [Fri, 16 Apr 2004 14:21:58 +0000 (14:21 +0000)]
Move IFF_PROMISC and IFF_POLLING from ifnet.ipending to ifnet.if_flags,
where they belong. Consistently use the higher bits of if_flags, not ipending.

16 years agoUpdate tag creation paths to reflect the cvs
David Rhodus [Thu, 15 Apr 2004 21:00:50 +0000 (21:00 +0000)]
Update tag creation paths to reflect the cvs
layout since we have moved lots of things around.
This also stops the annoying errors when generating
tags and LINK files.

16 years agoKObj extension stage IIIb/III
Joerg Sonnenberger [Thu, 15 Apr 2004 13:31:41 +0000 (13:31 +0000)]
KObj extension stage IIIb/III

Merge inheritance support from FreeBSD:
  * Add a simpler form of 'inheritance' for devclasses. Each devclass can
    have a parent devclass. Searches for drivers continue up the chain of
    devclasses until either a matching driver is found or a devclass is
    reached which has no parent. This can allow, for instance, pci drivers
    to match cardbus devices (assuming that cardbus declares pci as its
    parent devclass).

16 years agoUse "mixer -s" for saving the mixer settings and adjust messages since we
Joerg Sonnenberger [Thu, 15 Apr 2004 12:59:29 +0000 (12:59 +0000)]
Use "mixer -s" for saving the mixer settings and adjust messages since we
are now storing/restore all mixer settings.

16 years agoFix output format of "mixer -s", it is supposed to be =rec rdev1 rdev2 ...
Joerg Sonnenberger [Thu, 15 Apr 2004 12:58:12 +0000 (12:58 +0000)]
Fix output format of "mixer -s", it is supposed to be =rec rdev1 rdev2 ...

16 years agoDo some style(9) cleanups and make add static.
Joerg Sonnenberger [Thu, 15 Apr 2004 12:50:07 +0000 (12:50 +0000)]
Do some style(9) cleanups and make add static.

16 years agoDon't print the recording sources to stderr, the manpage doesn't indicate
Joerg Sonnenberger [Thu, 15 Apr 2004 12:38:02 +0000 (12:38 +0000)]
Don't print the recording sources to stderr, the manpage doesn't indicate
this and it doesn't seem sensible.

Print the recording source in parameter format, if mixer is called with -s.

16 years agoMake a comment less misleading. rpcbind_enable (portmap) isn't
Chris Pressey [Thu, 15 Apr 2004 01:02:45 +0000 (01:02 +0000)]
Make a comment less misleading.  rpcbind_enable (portmap) isn't
required for NFS client operation, so don't imply that it is.

16 years agoStyle(9) cleanup to src/sys/vfs, stage 8/21: mfs.
Chris Pressey [Thu, 15 Apr 2004 00:59:41 +0000 (00:59 +0000)]
Style(9) cleanup to src/sys/vfs, stage 8/21: mfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoDetect when the target process's thread is sitting on a message port and
Matthew Dillon [Thu, 15 Apr 2004 00:51:32 +0000 (00:51 +0000)]
Detect when the target process's thread is sitting on a message port and
schedule the thread in order to allow the message port handling code to
check for signals.

16 years agoImplement lwkt_abortmsg() support. This function chases down a message and
Matthew Dillon [Thu, 15 Apr 2004 00:50:05 +0000 (00:50 +0000)]
Implement lwkt_abortmsg() support.  This function chases down a message and
marks it MSGF_ABORTED, requeuing it to its target port for abort reprocessing.
The chasedown may run through multiple message forwardings and even chase the
message all the way back to the reply port (in which case the abort becomes a
NOP).  The queueing of a replied message is delayed if there is an abort
chasing it down until the abort chasedown has caught up to the message.

Support MSGF_PCATCH in the default waitport function.  If a signal is pending,
lwkt_default_waitport() (the default assigned to mp_waitport) will request
a message abort.  Note that we still have to wait for the message to be
returned after requesting a message abort.

Also do some minor performance tuning and adjust or move some of the inlines
from msgport2.h into lwkt_msgport.c.

16 years agoKObj extension stage IIIa/III
Joerg Sonnenberger [Wed, 14 Apr 2004 18:28:29 +0000 (18:28 +0000)]
KObj extension stage IIIa/III

Merge inheritance support from FreeBSD:
  * Add multiple inheritance to kobj. Each class can have zero or more base
    classes and if a method is not found in a given class, its base classes
    are searched (in the order they were declared). This search is recursive,
    i.e. a method may be define in a base class of a base class.

16 years agoRemove unit from sis_softc and use device_printf and if_printf instead of
Joerg Sonnenberger [Wed, 14 Apr 2004 18:24:34 +0000 (18:24 +0000)]
Remove unit from sis_softc and use device_printf and if_printf instead of
the "sis%d: ..." printfs. Use the device name for if_initname.

16 years agoRun the exec test for 5 seconds instead of 1 to improve measurement
Matthew Dillon [Wed, 14 Apr 2004 17:59:45 +0000 (17:59 +0000)]
Run the exec test for 5 seconds instead of 1 to improve measurement
statistics.

16 years agouio_td might be NULL, do not indirect through uio_td to get to td_proc
Matthew Dillon [Wed, 14 Apr 2004 01:24:24 +0000 (01:24 +0000)]
uio_td might be NULL, do not indirect through uio_td to get to td_proc
unless it is non-NULL.  Note that td_proc in msdosfs_write() is used only
to check resource limits.  Resource limits will not be checked if p is
NULL (which is ok for now).

16 years agores_search only incremented got_servfail for h_errno == TRY_AGAIN *AND*
Matthew Dillon [Tue, 13 Apr 2004 21:53:43 +0000 (21:53 +0000)]
res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND*
hp->rcode == SERVFAIL.  However, there are cases such as timeouts where
rcode is not always set to SERVFAIL.  This leads to inconsistent nameserver
operation during multi-domain and truncated dot searches, especially during
booting when portions of the network are being brought up simultanious with
dns lookups.

This patch attempts to correct the problem by unconditionally terminating
the search if TRY_AGAIN is returned (after res_query has gone through all
retries and name servers) instead of trying other domain elements in the
domain seach path.

This patch should fix reported problems (which I can reproduce) with some
NFS mounts failing during boot.  This occured because mount_nfs thought the
host name lookup returned a definitive failure using a non-dotted host name
when, in fact, it timed out on the first part (host.search.domain.name) and
got a definitive host-not-found response on the second part (host.).

Generally speaking, search path name server timeouts can exceed 60 seconds
per element and most machines which consistently timeout on earlier portions
of a search path are effectively non-operational due to the imposed delays.
It is more important for DNS lookups to return the proper error code then
to be able to recover a valid lookup in later portions of the search path
in these situations.

16 years agoUpdate diff, diff3 and sdiff to use diffutils 2.8.1
Eirik Nygaard [Tue, 13 Apr 2004 14:55:02 +0000 (14:55 +0000)]
Update diff, diff3 and sdiff to use diffutils 2.8.1

16 years agoRemove vim swap file, which should not have been imported.
Eirik Nygaard [Tue, 13 Apr 2004 14:25:13 +0000 (14:25 +0000)]
Remove vim swap file, which should not have been imported.

16 years agoMerge from vendor branch DIFFUTILS:
Eirik Nygaard [Tue, 13 Apr 2004 14:18:56 +0000 (14:18 +0000)]
Merge from vendor branch DIFFUTILS:
Import of diffutils 2.8.1

16 years agoImport of diffutils 2.8.1
Eirik Nygaard [Tue, 13 Apr 2004 14:18:56 +0000 (14:18 +0000)]
Import of diffutils 2.8.1

16 years agoFix a core dump caused by a .DEFAULT target with no commands.
Eirik Nygaard [Tue, 13 Apr 2004 13:49:00 +0000 (13:49 +0000)]
Fix a core dump caused by a .DEFAULT target with no commands.

Obtained from: NetBSD and FreeBSD

16 years agoDon't need opt_tcp_input.h for TCP_DISTRIBUTED_TCBINFO anymore.
Jeffrey Hsu [Tue, 13 Apr 2004 07:10:34 +0000 (07:10 +0000)]
Don't need opt_tcp_input.h for TCP_DISTRIBUTED_TCBINFO anymore.

16 years agoget rid of TCP_DISTRIBUTED_TCBINFO, it only added confusion.
Matthew Dillon [Tue, 13 Apr 2004 05:23:13 +0000 (05:23 +0000)]
get rid of TCP_DISTRIBUTED_TCBINFO, it only added confusion.

16 years agoCreate another entry point into ip_input() so MT_TAGs will work.
Jeffrey Hsu [Tue, 13 Apr 2004 00:14:01 +0000 (00:14 +0000)]
Create another entry point into ip_input() so MT_TAGs will work.

16 years agoStyle(9) cleanup to src/sys/vfs, stage 7/21: isofs.
Chris Pressey [Mon, 12 Apr 2004 23:18:55 +0000 (23:18 +0000)]
Style(9) cleanup to src/sys/vfs, stage 7/21: isofs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoThe malloc() call in at_fork() needs to use M_WAITOK instead of M_NOWAIT.
Matthew Dillon [Mon, 12 Apr 2004 17:49:27 +0000 (17:49 +0000)]
The malloc() call in at_fork() needs to use M_WAITOK instead of M_NOWAIT.
Note that at_fork() is not currently used by the system.

16 years agoANSIfication/style cleanups (non operational)
Matthew Dillon [Mon, 12 Apr 2004 17:47:39 +0000 (17:47 +0000)]
ANSIfication/style cleanups (non operational)

16 years agoRemove the now obsolete /usr/include/g++. Cleanup after the nawk->awk
Matthew Dillon [Mon, 12 Apr 2004 16:29:05 +0000 (16:29 +0000)]
Remove the now obsolete /usr/include/g++.  Cleanup after the nawk->awk
changes by removing the old nawk binary (it is now just 'awk'), and the
old gawk and nawk manual pages (it is now just 'man awk').

16 years agoRemove gawk from the build and let one-true-awk be our default awk from now
Eirik Nygaard [Mon, 12 Apr 2004 13:18:11 +0000 (13:18 +0000)]
Remove gawk from the build and let one-true-awk be our default awk from now
on. [1]

Let the bootstraping build one-true-awk and not gawk, and add maketab.nx to
CLEANFILES.

Submitted by: ibotty <bsd@ibotty.net> [1]

16 years agoTell awk where the arguments for the program ends and where the arguments for
Eirik Nygaard [Mon, 12 Apr 2004 12:46:42 +0000 (12:46 +0000)]
Tell awk where the arguments for the program ends and where the arguments for
the awk script begins.

Written by: ibotty <me@ibotty.net> and myself.

16 years agoFix the conditional used to determine whether psignal() should be called.
Matthew Dillon [Mon, 12 Apr 2004 00:50:40 +0000 (00:50 +0000)]
Fix the conditional used to determine whether psignal() should be called.

Reported-by: Adam K Kirchhoff <adamk@voicenet.com>
16 years agoStyle(9) cleanup.
Chris Pressey [Sun, 11 Apr 2004 21:28:03 +0000 (21:28 +0000)]
Style(9) cleanup.

- Convert K&R-style function definitions to ANSI style.
- Remove `register' keywords.
- Use stdarg.h instead of varargs.h for variable numbers of arguments.
- #define _KERNEL_STRUCTURES when accessing kernel structures.
- No functional changes.

16 years agoStyle(9) cleanup to src/sys/vfs, stage 6/21: hpfs.
Chris Pressey [Sun, 11 Apr 2004 18:17:21 +0000 (18:17 +0000)]
Style(9) cleanup to src/sys/vfs, stage 6/21: hpfs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoSilence compiler warning by adding include files.
Jeffrey Hsu [Sun, 11 Apr 2004 07:41:52 +0000 (07:41 +0000)]
Silence compiler warning by adding include files.

16 years agoSilence warning about missing prototype.
Jeffrey Hsu [Sun, 11 Apr 2004 07:22:31 +0000 (07:22 +0000)]
Silence warning about missing prototype.

Reported by: Pete Carah <pete@altadena.net>

16 years agoFix compilation errors with missing header files and misnamed formal parameter.
Jeffrey Hsu [Sun, 11 Apr 2004 05:14:47 +0000 (05:14 +0000)]
Fix compilation errors with missing header files and misnamed formal parameter.

Reported by: David Rhodus

16 years agoUse the sf_buf facility rather then kmem_alloc_wait/pmap_kenter/kmem_free
Matthew Dillon [Sun, 11 Apr 2004 00:10:34 +0000 (00:10 +0000)]
Use the sf_buf facility rather then kmem_alloc_wait/pmap_kenter/kmem_free
to map the first page of a binary into memory during an exec.  This results
in 5-10% lower execl() overhead and approximately 2% lower sys time useage
in a buildworld (~15-20 second build time reduction on an AMD64/3200+),
with less code.  And its a nice cleanup as well.

Patch-by: Alan Cox <alc@cs.rice.edu>
16 years agoAdd vfork/exec perf test. exec1 tests static binaries, exec2 tests dynamic
Matthew Dillon [Sat, 10 Apr 2004 21:36:52 +0000 (21:36 +0000)]
Add vfork/exec perf test.  exec1 tests static binaries, exec2 tests dynamic
binaries (you can test resident dynamic binaries by 'resident /tmp/exec2'
and then running /tmp/exec2).

16 years agoDo some minor critical path performance improvements in the scheduler
Matthew Dillon [Sat, 10 Apr 2004 20:55:24 +0000 (20:55 +0000)]
Do some minor critical path performance improvements in the scheduler
and at the user/system boundary.  Avoid some unnecessary segment prefix ops,
remove some unnecessary memory ops by using more optimal critical
section inlines, and use 32 bit arithmatic instead of 64 bit arithmatic
when calculating system tick overheads in userret().

This saves a whopping 5ns worth of syscall overhead, which just proves
how silly I am sometimes.

16 years agoANSIfication and style cleanups. Non operational.
Matthew Dillon [Sat, 10 Apr 2004 18:15:37 +0000 (18:15 +0000)]
ANSIfication and style cleanups.  Non operational.

16 years agoExplicitly build the boot2.c without propolice. We can't really handle
Joerg Sonnenberger [Sat, 10 Apr 2004 12:07:20 +0000 (12:07 +0000)]
Explicitly build the boot2.c without propolice. We can't really handle
faults here anyway and it is size-sensitive too.

16 years agoAlways send the sendfile header out even if the file has no data.
Jeffrey Hsu [Sat, 10 Apr 2004 10:01:54 +0000 (10:01 +0000)]
Always send the sendfile header out even if the file has no data.
This roughly corresponds to FreeBSD rev 1.181.

16 years agoMake the declaration of notifymsglist visible outside #ifdef _KERNEL
Jeffrey Hsu [Sat, 10 Apr 2004 09:35:34 +0000 (09:35 +0000)]
Make the declaration of notifymsglist visible outside #ifdef _KERNEL
for struct selinfo.

Reported by: Donghui Wen <dhwen@eml.cc>
Diagnosed by: YONETANI Tomokazu <qhwt+dragonfly-kernel@les.ath.cx>

16 years agoAdd predicate message facility.
Jeffrey Hsu [Sat, 10 Apr 2004 00:48:06 +0000 (00:48 +0000)]
Add predicate message facility.

16 years agoSend connects to the right processor.
Jeffrey Hsu [Sat, 10 Apr 2004 00:10:42 +0000 (00:10 +0000)]
Send connects to the right processor.

16 years agoAdd header file to pull in the setting of the TCP_DISTRIBUTED_TCBINFO option.
Jeffrey Hsu [Sat, 10 Apr 2004 00:07:16 +0000 (00:07 +0000)]
Add header file to pull in the setting of the TCP_DISTRIBUTED_TCBINFO option.

16 years agoFix typo with last minute change in last commit.
Jeffrey Hsu [Fri, 9 Apr 2004 23:33:02 +0000 (23:33 +0000)]
Fix typo with last minute change in last commit.

16 years agoPush the lwkt_replymsg() up one level from netisr_service_loop() to
Jeffrey Hsu [Fri, 9 Apr 2004 22:34:10 +0000 (22:34 +0000)]
Push the lwkt_replymsg() up one level from netisr_service_loop() to
the message handler so we can explicitly reply or not reply as appropriate.

16 years agonawk => awk
Joerg Sonnenberger [Fri, 9 Apr 2004 13:06:15 +0000 (13:06 +0000)]
nawk => awk

16 years agoThis is _SYS_XIO_H, not _SYS_UIO_H.
Joerg Sonnenberger [Fri, 9 Apr 2004 12:51:20 +0000 (12:51 +0000)]
This is _SYS_XIO_H, not _SYS_UIO_H.

Noticed by: ibotty

16 years agoIntroduce negative (ENOENT) caching for NFS. Before this, an attempt to
Matthew Dillon [Thu, 8 Apr 2004 22:32:14 +0000 (22:32 +0000)]
Introduce negative (ENOENT) caching for NFS.  Before this, an attempt to
lookup a non-existant path would ALWAYS result in packet traffic.  That is,
NFS was only attribute-caching successful lookups, not failed lookups,
and was not making use of the VFS cache facility virtually at all.  This new
features complements the existing attribute cachign feature.

Add a sysctl, vfs.nfs.neg_cache_timeout, which controls the timeout for
negatively cached lookups.  The default is 3 seconds.  You can set this
sysctl to 0 to recover the old non-negative-caching behavior.

This makes a HUGE difference for programs which search nfs directories, such
as compilers (the header file search path), make, and a few other utilities.
NFS packet traffic can be reduced upwards of 90%.  For example, with /usr/src
mounted via NFS, building libc a second time without negative caching
generates 66000 packets of NFS traffic in each direction, building libc
a second time with negative caching enabled generates 9500 packets worth
of NFS traffic, in EACH DIRECTION.  While it is true that negative lookups
are cached on the NFS server, the huge reduction in network traffic and
equivalent reduction in synchronous read latencies result in radically
reduced overheads across the board for operations which generate a lot of
negative hits.

A buildworld test with the default 3 second negative caching timeout went
from 2265 seconds to 1900 seconds.

16 years agonamecache work stage 4a: Do some minor performance cleanups with negative
Matthew Dillon [Thu, 8 Apr 2004 22:00:41 +0000 (22:00 +0000)]
namecache work stage 4a: Do some minor performance cleanups with negative
caching, add a cache entry timeout feature.

16 years agoStyle(9) cleanup to src/sys/vfs, stage 5/21: ext2fs.
Chris Pressey [Thu, 8 Apr 2004 20:57:52 +0000 (20:57 +0000)]
Style(9) cleanup to src/sys/vfs, stage 5/21: ext2fs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoWorkaround for not having a proc context. Use the thread0 context when
Jeffrey Hsu [Thu, 8 Apr 2004 20:13:28 +0000 (20:13 +0000)]
Workaround for not having a proc context.  Use the thread0 context when
the real context is not available.  The real solution is to propagate
the information passed into ngc_send() down to here.  This workaround
implements the same incorrect behavior as FreeBSD as of rev 1.4 of
ng_ksocket.c in 1999.

16 years agonamecache work stage 4:
Matthew Dillon [Thu, 8 Apr 2004 17:56:48 +0000 (17:56 +0000)]
namecache work stage 4:

(1) Remove vnode->v_dd, vnode->v_ddid, namecache->nc_dvp_data, and
namecache->nc_dvp_id.  These identifiers were being used to detect stale
parent directory linkages in the namecache and were leftovers from the
original FreeBSD-4.x namecache topology.  The new namecache topology
actively discards such linkages and does not require them.

(2) Cleanup kern/vfs_cache.c, abstracting out allocation and parent
link/unlink operations into their own procedures.

(3) Formally allow a disjoint topology.  That is, allow the case where
nc_parent is NULL.  When constructing namecache entries (dvp,vp), require
that that dvp be associated with a namecache record so we can create the
proper parent->child linkage.  Since no naming information is known for
dbp, formally allow unnamed namecache records to be created in order to
create the association.

(4) Properly relink parent namecache entries when ".." is entered into
the cache.  This is what relinks a disjoint namecache topology after it
has been partially purged or when the namecache is instantiated in the
middle of the logical topology (and thus disjoint).

Note that the original plan was to not allow a disjoint topology, but after
much hair pulling I've come to the conclusion that it is impossible to do
this.  So the work now formally allows a disjoint topology but also, unlike
the original FreeBSD code, takes pains to try to keep the topology intact
by only recycling 'leaf' vnodes.  This is accomplished by vref()ing a vnode
when its namecache records have children.

16 years ago/tmp/motd* files were being left sitting around after a reboot when the
Matthew Dillon [Thu, 8 Apr 2004 17:35:22 +0000 (17:35 +0000)]
/tmp/motd* files were being left sitting around after a reboot when the
motd is found not to have changed.  Make sure both temporary files are
cleaned up.

16 years agoAdd support for AC'97 codec of the AMD-8111 chipset.
Joerg Sonnenberger [Thu, 8 Apr 2004 15:16:50 +0000 (15:16 +0000)]
Add support for AC'97 codec of the AMD-8111 chipset.

Obtained-From: FreeBSD kern/55932

16 years agoTCP statistics structure renamed tcpstat -> tcp_stats.
Matthew Dillon [Wed, 7 Apr 2004 21:40:19 +0000 (21:40 +0000)]
TCP statistics structure renamed tcpstat -> tcp_stats.

16 years agoMake TCP stats per-cpu. (forgot to add new header file)
Matthew Dillon [Wed, 7 Apr 2004 20:56:15 +0000 (20:56 +0000)]
Make TCP stats per-cpu. (forgot to add new header file)

Submitted-by: Hiten Pandya <hmp@crater.dragonflybsd.org>
16 years agoStyle(9) cleanup.
Chris Pressey [Wed, 7 Apr 2004 20:43:24 +0000 (20:43 +0000)]
Style(9) cleanup.

- Remove `register' keywords.
- No functional changes.

16 years agoEnable propolice (stack smashing detector) by default on gcc3.
Matthew Dillon [Wed, 7 Apr 2004 17:48:03 +0000 (17:48 +0000)]
Enable propolice (stack smashing detector) by default on gcc3.

16 years agoMake TCP stats per-cpu.
Matthew Dillon [Wed, 7 Apr 2004 17:01:27 +0000 (17:01 +0000)]
Make TCP stats per-cpu.

Submitted-by: Hiten Pandya <hmp@crater.dragonflybsd.org>
16 years agoAdjust the C++ preprocessor to include /usr/include/c++ by default for
Joerg Sonnenberger [Wed, 7 Apr 2004 14:02:41 +0000 (14:02 +0000)]
Adjust the C++ preprocessor to include /usr/include/c++ by default for
version independent C++ header files.

For GCC 2.95 this is done by adding a new define GPLUSPLUS_INCLUDE_DIR2,
for GCC 3.3 the version depend path is now included in
GPLUSPLUS_TOOL_INCLUDE_DIR and the version independ path in
GPLUSPLUS_INCLUDE_DIR. If the compiler is updated, it should be checked
that /usr/include/c++/$CCVER is still included before /usr/include/c++.

16 years agoSince GCC 2.95.4 is known to produce bad code for higher optimization
Joerg Sonnenberger [Wed, 7 Apr 2004 12:57:31 +0000 (12:57 +0000)]
Since GCC 2.95.4 is known to produce bad code for higher optimization
levels and CPU specific instructions sets, disable those for the system
C compiler. Keeping at least the C compiler working is more important
than a slight increase in compilation speed.

16 years agoCosmetic changes.
Jeffrey Hsu [Wed, 7 Apr 2004 09:36:07 +0000 (09:36 +0000)]
Cosmetic changes.

16 years agoGeneral ata malloc() flags cleanup. Use M_INTWAIT where appropriate and
Matthew Dillon [Wed, 7 Apr 2004 06:22:15 +0000 (06:22 +0000)]
General ata malloc() flags cleanup.  Use M_INTWAIT where appropriate and
get rid of unnecessary NULL checks.

16 years agoGeneral bus malloc() flags cleanup, M_NOWAIT -> M_INTWAIT. Note: leave
Matthew Dillon [Wed, 7 Apr 2004 05:54:41 +0000 (05:54 +0000)]
General bus malloc() flags cleanup, M_NOWAIT -> M_INTWAIT.  Note: leave
isa dmabuf bouncebuffer code as is (it uses malloc() M_NOWAIT and then
falls back to contigmalloc).

16 years agoGeneral netif malloc() flags cleanup. Use M_INTWAIT or M_WAITOK instead
Matthew Dillon [Wed, 7 Apr 2004 05:45:30 +0000 (05:45 +0000)]
General netif malloc() flags cleanup.  Use M_INTWAIT or M_WAITOK instead
of M_NOWAIT.  Generally use M_WAITOK in the attach code or ioctl code
typically called from userland, and M_INTWAIT for routines that might
be called during non-boot operations.  Since M*WAIT flags guarentee a
non-NULL result, also remove now-unnecessary NULL checks.

16 years agoUse hex bit values instead of decimal bit values (non operational change).
Matthew Dillon [Wed, 7 Apr 2004 05:18:19 +0000 (05:18 +0000)]
Use hex bit values instead of decimal bit values (non operational change).

16 years agoProtect nfs socket locks with a critical section. Recheck rep->r_mrep just
Matthew Dillon [Wed, 7 Apr 2004 05:15:48 +0000 (05:15 +0000)]
Protect nfs socket locks with a critical section.  Recheck rep->r_mrep just
prior to calling tsleep() in case another thread got in and handled the
request being waited for.  Rewrite the vnode scanning code in nfs_sync()
to use vmntvnodescan(), fixing a number of potential races.  Protect the
commit phase 2 scan in nfs_subs.c with the appropriate token (note: still
needs some work).

16 years agoStyle(9) cleanup to src/sys/vfs, stage 4/21: fifofs.
Chris Pressey [Tue, 6 Apr 2004 21:32:39 +0000 (21:32 +0000)]
Style(9) cleanup to src/sys/vfs, stage 4/21: fifofs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey
16 years agoDo not reset %gs in signal handlers, some programs depend on it (KDE in
Matthew Dillon [Mon, 5 Apr 2004 19:15:57 +0000 (19:15 +0000)]
Do not reset %gs in signal handlers, some programs depend on it (KDE in
particular, and nvidia video driver as well).

16 years agoSubsystems which install an so_upcall may themselves call socket functions
Matthew Dillon [Mon, 5 Apr 2004 18:53:03 +0000 (18:53 +0000)]
Subsystems which install an so_upcall may themselves call socket functions
from the handler thread, which can lead to deadlocks in lwkt_domsg().

Have the netmsg service loop install its own mp_putport() function which
checks for self-referential messages (curthread == port->mp_td) and executes
them synchronously.

16 years agoExport the lwkt_default_*() message port default functions so other
Matthew Dillon [Mon, 5 Apr 2004 18:49:19 +0000 (18:49 +0000)]
Export the lwkt_default_*() message port default functions so other
code (e.g. networking) can call them.

16 years agoReadd _G_config.h and the missing std headers. This brings C++ back to where
Joerg Sonnenberger [Mon, 5 Apr 2004 18:02:51 +0000 (18:02 +0000)]
Readd _G_config.h and the missing std headers. This brings C++ back to where
it was a week ago.

16 years agoper-cpu tcbinfo[]s aren't ready for prime time yet. The tcbinfo is assigned
Matthew Dillon [Mon, 5 Apr 2004 17:47:01 +0000 (17:47 +0000)]
per-cpu tcbinfo[]s aren't ready for prime time yet.  The tcbinfo is assigned
at tcp_attach time, but there is insufficient information available at this
time to select the hash table and the wrong one gets assigned N-1 out of N
times on MP systems (N = number of cpus), causing outgoing tcp connections
to fail.

An an option, TCP_DISTRIBUTED_TCBINFO, so MP-safe tcbinfo distribution can
continue to be developed without impacting users.

16 years agoWe are DragonFly not FreeBSD, so rename the name in GENERIC, and remove the
Eirik Nygaard [Mon, 5 Apr 2004 13:44:40 +0000 (13:44 +0000)]
We are DragonFly not FreeBSD, so rename the name in GENERIC, and remove the
reference to the local handbook, which we don't have.

16 years agoConsistently use "foreign" and "local", which are invariant on the
Jeffrey Hsu [Mon, 5 Apr 2004 09:17:48 +0000 (09:17 +0000)]
Consistently use "foreign" and "local", which are invariant on the
host machine, instead of "src" and "dst", which varies according
to whether a packet is being received or sent.

16 years agoRemove makewhatis from /usr/bin (it officially resides in /usr/sbin),
Matthew Dillon [Mon, 5 Apr 2004 05:41:43 +0000 (05:41 +0000)]
Remove makewhatis from /usr/bin (it officially resides in /usr/sbin),
remove /usr/sbin/prebind (no longer exists, see 'resident').

16 years agoPartial sync from FreeBSD adds some more support and fixes. Also replace a
Matthew Dillon [Mon, 5 Apr 2004 05:34:36 +0000 (05:34 +0000)]
Partial sync from FreeBSD adds some more support and fixes.  Also replace a
number of hardwired masks with appropriately defined constants.

16 years agoBring in FreeBSD 1.2.2.2. Properly unwind the stack when certain
Matthew Dillon [Mon, 5 Apr 2004 05:31:58 +0000 (05:31 +0000)]
Bring in FreeBSD 1.2.2.2.  Properly unwind the stack when certain
failure cases occur in rfork_thread().

Submitted-by: Igor Sysoev <is@rambler-co.ru>
16 years agoFix buildworld. Document TOOLS_PREFIX and USRDATA_PREFIX, improve INCLUDEDIR
Matthew Dillon [Mon, 5 Apr 2004 05:30:13 +0000 (05:30 +0000)]
Fix buildworld.  Document TOOLS_PREFIX and USRDATA_PREFIX, improve INCLUDEDIR
documentation.  Modify bsd.incs.mk to not install header files if BOOTSTRAPPING
is set (for buildworld), and change lex to install its C++ header file in
${INCLUDEDIR}/c++ instead of ${INCLUDEDIR}/g++.  Set DESTDIR for BMAKEENV,
set BOOTSTRAPPING for XMAKE (cross build tools).  Note that DESTDIR is set
in the bootstrap-tools: target, this will be removed in a later commit.

16 years agoUndo the last commit. Utility programs which install c++ includes have no
Matthew Dillon [Mon, 5 Apr 2004 02:03:24 +0000 (02:03 +0000)]
Undo the last commit.  Utility programs which install c++ includes have no
knowledge and should have no knowledge of particular compiler versions
installed.  They should install their C++ header files in one place.

16 years agoQuake 3 server (running under linux emulation) was failing with odd '
Matthew Dillon [Mon, 5 Apr 2004 00:06:02 +0000 (00:06 +0000)]
Quake 3 server (running under linux emulation) was failing with odd '
Protocol not available' errors.  The problem turned out to be the internal
IP_HDRINCL check that the linux emulation code in the kernel was doing in
linux_sendto().  If the internal check fails with an error, the emulation
code should simply assume that IP_HDRINCL is off rather then return the error.

The bug was introduced during the syscall separation work on this module.
FreeBSD-4.x properly ignores the error.  This patch restores behavior for
DFly.

Reported-by: Sascha Wildner <saw@online.de>
16 years agoFix a missing wildcard binding in the recent wildcard binding hash table work.
Matthew Dillon [Sun, 4 Apr 2004 22:13:38 +0000 (22:13 +0000)]
Fix a missing wildcard binding in the recent wildcard binding hash table work.
This prevented YP from working properly.

Reported-by: Richard Nyberg <rnyberg@it.su.se>
Patch-Supplied-by: Jeffrey Hsu <hsu@freebsd.org>
16 years agoCorrect C++ header handling for gcc2 and lex.
Joerg Sonnenberger [Sun, 4 Apr 2004 21:31:14 +0000 (21:31 +0000)]
Correct C++ header handling for gcc2 and lex.

gcc2 used a "beforeinstall" target instead of the standard bsd.incs.mk way.
Therefore certain headers weren't correctly installed when doing an
installincludes or "make includes" from the src root. The cc1plus part was
still installed to the old location and that broke e.g. textproc/jade.

lex installed its C++ interface still to /usr/include/g++, until a decision
about a generic C++ header location is made, a version for both system
compilers is installed.