dragonfly.git
19 years agoBack out constification. This caused a SIGBUS becaus a functon wanted to write
Eirik Nygaard [Mon, 15 Nov 2004 14:04:33 +0000 (14:04 +0000)]
Back out constification. This caused a SIGBUS becaus a functon wanted to write
to the var struct.

Noticed by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>

19 years agoCleanup send-pr and ptx on next update.
Joerg Sonnenberger [Mon, 15 Nov 2004 10:19:07 +0000 (10:19 +0000)]
Cleanup send-pr and ptx on next update.

19 years agoRemove the old release infrastruture. Certain parts e.g. sysinstall or
Joerg Sonnenberger [Mon, 15 Nov 2004 10:18:15 +0000 (10:18 +0000)]
Remove the old release infrastruture. Certain parts e.g. sysinstall or
the picobsd stuff should be kept for future reference in the attic.

19 years agoSync with FreeBSD. This removes the need for perl.
Joerg Sonnenberger [Mon, 15 Nov 2004 10:01:41 +0000 (10:01 +0000)]
Sync with FreeBSD. This removes the need for perl.

19 years agoAdd preprocessor handling for newer processor, they should get the better
Joerg Sonnenberger [Mon, 15 Nov 2004 08:16:02 +0000 (08:16 +0000)]
Add preprocessor handling for newer processor, they should get the better
assembler too.

19 years agoThe code and sources here haven't been used since FreeBSD 2.x, nuke
Joerg Sonnenberger [Mon, 15 Nov 2004 08:15:15 +0000 (08:15 +0000)]
The code and sources here haven't been used since FreeBSD 2.x, nuke
them.

Inspired-by: FreeBSD
19 years agoRemove ptx, it isn't maintained and hasn't been used by base for years.
Joerg Sonnenberger [Mon, 15 Nov 2004 08:14:00 +0000 (08:14 +0000)]
Remove ptx, it isn't maintained and hasn't been used by base for years.

Inspired-by: FreeBSD
Remove send-pr, once we have an official bugtracker, we can replace it
with a matching script. But we don't want to use GNATS, so no need for
send-pr.

19 years agoSync with FreeBSD. Most importantly, this removes the need for perl.
Joerg Sonnenberger [Mon, 15 Nov 2004 08:11:59 +0000 (08:11 +0000)]
Sync with FreeBSD. Most importantly, this removes the need for perl.

19 years agoFix an inverted conditional which could lead to nameBuf being truncated in
Matthew Dillon [Sun, 14 Nov 2004 20:13:12 +0000 (20:13 +0000)]
Fix an inverted conditional which could lead to nameBuf being truncated in
the later snprintf().

Noticed-by: Max Okumoto <okumoto@home>
19 years ago- Remove sys/time.h
Liam J. Foy [Sun, 14 Nov 2004 20:07:25 +0000 (20:07 +0000)]
- Remove sys/time.h
- Use __unused in the sig handlers
- Static functions
- Other minor changes

Note: The sig handler nonfs is not save. Joerg is going to work on this
himself.

19 years agoContinuing synchronization from FreeBSD.
Matthew Dillon [Sun, 14 Nov 2004 20:05:26 +0000 (20:05 +0000)]
Continuing synchronization from FreeBSD.

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoFix a lhs-cast by casting first to unsigned char and then to the
Joerg Sonnenberger [Sun, 14 Nov 2004 19:38:34 +0000 (19:38 +0000)]
Fix a lhs-cast by casting first to unsigned char and then to the
type-correct char.

19 years agoRemove the dependency on either asprintf or va_copy. This will be included
Joerg Sonnenberger [Sun, 14 Nov 2004 18:45:55 +0000 (18:45 +0000)]
Remove the dependency on either asprintf or va_copy. This will be included
in later versions by default.

Obtained-from: Tim Kientzle <tim@kientzle.com>

19 years agoRemove CFLAGS?= 2
Joerg Sonnenberger [Sun, 14 Nov 2004 18:20:08 +0000 (18:20 +0000)]
Remove CFLAGS?= 2

19 years ago-Wall -Wstrict-prototypes already in CFLAGS.
Joerg Sonnenberger [Sun, 14 Nov 2004 18:18:30 +0000 (18:18 +0000)]
-Wall -Wstrict-prototypes already in CFLAGS.

19 years ago-W is included in CFLAGS already.
Joerg Sonnenberger [Sun, 14 Nov 2004 18:17:41 +0000 (18:17 +0000)]
-W is included in CFLAGS already.

19 years agoFix an endian bug in pflog. The DragonFly version of PF uses the normal
Joerg Sonnenberger [Sun, 14 Nov 2004 17:27:31 +0000 (17:27 +0000)]
Fix an endian bug in pflog. The DragonFly version of PF uses the normal
host byte order instead of network byte order as used by OpenBSD and
FreeBSD. Normally the ether_output code converts this back, but for
pflog, we shortcut these code. Therefore, before calling bpf_mtap, switch
the byte order back to network order and revert it afterwards.

Problem-reported-by: Erik P. Skaalerud
19 years agoRemove xpt_release_simq_timeout(), this function has not been in use since the
Eirik Nygaard [Sun, 14 Nov 2004 16:48:36 +0000 (16:48 +0000)]
Remove xpt_release_simq_timeout(), this function has not been in use since the
timeout/untimeout ==> callout_* transformation.

19 years agoIf the first slot is empty, don't continue scanning. This fixes hangs
Joerg Sonnenberger [Sun, 14 Nov 2004 15:20:05 +0000 (15:20 +0000)]
If the first slot is empty, don't continue scanning. This fixes hangs
on some machines.

Obtained-from: FreeBSD

19 years agoMerge from vendor branch GDB:
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Merge from vendor branch GDB:
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

19 years agoAdd solib-legacy.c, it is needed for proper attach support.
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

19 years agoAdd solib-legacy.c, it is needed for proper attach support.
Joerg Sonnenberger [Sun, 14 Nov 2004 15:16:59 +0000 (15:16 +0000)]
Add solib-legacy.c, it is needed for proper attach support.

I don't really understand why gdb doesn't include this file for itself.

19 years agoConstify VAR.
Eirik Nygaard [Sun, 14 Nov 2004 13:58:42 +0000 (13:58 +0000)]
Constify VAR.

Submitted by: joerg

WARNS=6 cleanup.

19 years agodirect sysargs to /dev/null for the emualtion system call sets to avoid a
Matthew Dillon [Sun, 14 Nov 2004 01:45:25 +0000 (01:45 +0000)]
direct sysargs to /dev/null for the emualtion system call sets to avoid a
make all_sysent build error.

19 years agoPartial sync from FreeBSD, add dummy syscalls for extended attribte
Matthew Dillon [Sun, 14 Nov 2004 01:41:41 +0000 (01:41 +0000)]
Partial sync from FreeBSD, add dummy syscalls for extended attribte
operations to return ENOATTR rather then ENOSYS (which causes a core dump).

Reported-by: John Duncan <agley@optusnet.com.au>
19 years agoImplement SACK.
Jeffrey Hsu [Sun, 14 Nov 2004 00:49:08 +0000 (00:49 +0000)]
Implement SACK.

19 years ago* Restore indentation to tabs.
Matthew Dillon [Sat, 13 Nov 2004 23:23:08 +0000 (23:23 +0000)]
* Restore indentation to tabs.
* Make it WARNS?=6 clean.
* Remove an unnecessary void cast.
* Declare static functions as static..
* Remove some unnecessary return statements at the end of void functions.

Submitted-by: Sascha Wildner <saw@online.de>
19 years agoAdd support for the ATI Radeon 9600 XT and XT_S.
Matthew Dillon [Sat, 13 Nov 2004 23:04:14 +0000 (23:04 +0000)]
Add support for the ATI Radeon 9600 XT and XT_S.

Submitted-by: "Pablo M<E9>ndez Hern<E1>ndez" <ciph3r@telefonica.net>
19 years agoSpelling corrections.
Matthew Dillon [Sat, 13 Nov 2004 22:42:43 +0000 (22:42 +0000)]
Spelling corrections.

Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD (2001/02/18 10:43:32)

19 years agoRemove left-over '{'.
Joerg Sonnenberger [Sat, 13 Nov 2004 17:31:00 +0000 (17:31 +0000)]
Remove left-over '{'.

19 years agoFix the condition under which yacc -o is used. This should fix the parallel
Joerg Sonnenberger [Sat, 13 Nov 2004 16:52:36 +0000 (16:52 +0000)]
Fix the condition under which yacc -o is used. This should fix the parallel
build in gdb.

Obtained-from: FreeBSD
Problems-reported-by: various folks
19 years ago- Remove main proto
Liam J. Foy [Sat, 13 Nov 2004 16:14:33 +0000 (16:14 +0000)]
- Remove main proto
- Don't bother using *logfile, just use _PATH_LASTLOG
- WARN 6 and remove CFLAGS

Ok'ed: Joerg

19 years agoShow the CPU used by the multi-threaded network stack to handle a socket.
Joerg Sonnenberger [Sat, 13 Nov 2004 13:57:36 +0000 (13:57 +0000)]
Show the CPU used by the multi-threaded network stack to handle a socket.

Submitted-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Slightly modified to skip the column on single CPU machines.

19 years agoRemove ntpdate from FILES list as well.
Joerg Sonnenberger [Sat, 13 Nov 2004 13:12:09 +0000 (13:12 +0000)]
Remove ntpdate from FILES list as well.

Reminder-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
19 years agoMake both arguments to str_concat() const char *'s and remove STR_DOFREE
Matthew Dillon [Sat, 13 Nov 2004 07:25:17 +0000 (07:25 +0000)]
Make both arguments to str_concat() const char *'s and remove STR_DOFREE
support.  Manually free the strings in the one routine in dir.c that used
that option, plus some other minor cleanups.

Reported-by: Max Okumoto <okumoto@home>
19 years agoDocument the slightly surprising behaviour of 'ifconfig -alias' when
Chris Pressey [Sat, 13 Nov 2004 04:13:22 +0000 (04:13 +0000)]
Document the slightly surprising behaviour of 'ifconfig -alias' when
no network address is given.

Prompted-by: Marc G. Fournier <scrappyAThubDOTorg>'s Nov 5 2004
             post to freebsd-stable mailing list

19 years agoSplit var.c into var.c and var_modify.c and move all the modification funcs
Matthew Dillon [Sat, 13 Nov 2004 00:10:09 +0000 (00:10 +0000)]
Split var.c into var.c and var_modify.c and move all the modification funcs
to var_modify.c, for readability.  constify some low hanging fruit (string
manipulation functions) and the upper layers appropriately.  No longer use
the private strstr(3) implementation, while changing string code.  Add var.h

Taken-From: FreeBSD/jmallett

19 years agoSplit var.c into var.c and var_modify.c and move all the modification funcs
Matthew Dillon [Sat, 13 Nov 2004 00:06:16 +0000 (00:06 +0000)]
Split var.c into var.c and var_modify.c and move all the modification funcs
to var_modify.c, for readability.  constify some low hanging fruit (string
manipulation functions) and the upper layers appropriately.  No longer use
the private strstr(3) implementation, while changing string code.  Add var.h

Taken-From: FreeBSD/jmallett

19 years agoPossibly expand the variable name's embedded variables before using it, as
Matthew Dillon [Fri, 12 Nov 2004 23:26:52 +0000 (23:26 +0000)]
Possibly expand the variable name's embedded variables before using it, as
seen (somewhat) in NetBSD.  This catches a few extra recursion cases that
could be hidden by expanding a NIL variable causing an existing variable to
be returned (which caused infinite looping and climbing memory usage in at
least one case).

Taken-From: FreeBSD/1.27,1.28 (jmallett), originally obtained from NetBSD

19 years agoConvert make(1) to use ANSI style function declarations. Variable
Matthew Dillon [Fri, 12 Nov 2004 22:57:04 +0000 (22:57 +0000)]
Convert make(1) to use ANSI style function declarations.  Variable
documentation already adequatedly existed in the description in most
cases.  Where it did not, it was added.  If no documentation existed
beforehand, then none was added.  Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.

Taken-from: FreeBSD/jmallett

19 years agoMake the DEBUGF() macro portable by (ugh) adding a Debug() function, which
Matthew Dillon [Fri, 12 Nov 2004 22:42:36 +0000 (22:42 +0000)]
Make the DEBUGF() macro portable by (ugh) adding a Debug() function, which
is merely printf() but to stderr.  This takes care of the caveat which lead
to the use of a vararg macro -- getting everything to stderr.

Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
variable length arguments to a macro.  Bump version as this makes DEBUG
statements *always* go to stderr rather than sometimes stdout.  There are
a few stragglers, which I will take care of as soon as I can.  Mostly these
relate to the need-for-death-of some of the remote job code.

Taken-From: FreeBSD/jmallett

19 years agoDiff reduction for great justice against NetBSD, cast to unsigned char when
Matthew Dillon [Fri, 12 Nov 2004 22:28:05 +0000 (22:28 +0000)]
Diff reduction for great justice against NetBSD, cast to unsigned char when
passing an argument to isspace(3).

Taken-from: FreeBSD/jmallett

19 years agoPartial sync from FreeBSD/jmallet:
Matthew Dillon [Fri, 12 Nov 2004 22:11:33 +0000 (22:11 +0000)]
Partial sync from  FreeBSD/jmallet:

String lengths and sizeof()s are size_t not int.  Mark an unused parameter
of ReadMakefile as __unused, it's there because this function is used by
the abstracted list interface

19 years agoDo some deregisterization.
Matthew Dillon [Fri, 12 Nov 2004 22:02:51 +0000 (22:02 +0000)]
Do some deregisterization.

Taken-From: FreeBSD/obrien.

19 years agoefree()->free(). remove #define efree (which was defined to free).
Matthew Dillon [Fri, 12 Nov 2004 21:52:04 +0000 (21:52 +0000)]
efree()->free().  remove #define efree (which was defined to free).

Taken-From: FreeBSD

19 years agoThe strings package passes back a pointer via brk_string() to internal
Matthew Dillon [Fri, 12 Nov 2004 21:46:09 +0000 (21:46 +0000)]
The strings package passes back a pointer via brk_string() to internal
memory, it should not be deallocated.  The memory is allocated in str_init()
and release in str_end() which are only called in main().

Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD/1.22

19 years agoRemove various forms of NULL, and cleanup types. This is a partial sync from
Matthew Dillon [Fri, 12 Nov 2004 21:41:54 +0000 (21:41 +0000)]
Remove various forms of NULL, and cleanup types.  This is a partial sync from
FreeBSD's make.

Submitted-by: Max Okumoto <okumoto@home>
19 years agoAdd a missing com_unlock() to the serial port drain test code. This code
Matthew Dillon [Fri, 12 Nov 2004 20:51:29 +0000 (20:51 +0000)]
Add a missing com_unlock() to the serial port drain test code.  This code
is necessary to detect non-existant serial ports on machines (such as the
eMachines laptop) which don't have any serial port hardware at all, but
the missing com_unlock() caused systems to crash in certain situations for
obvious reasons.

Many thanks to Glenn Johnson <glennpj@charter.net> for keeping on my back
about the issue and for testing the fix.  This should also fix the last of the
serial-port related bug reports stemming from the original 1.0A release.

19 years agoSwitch to OpenNTPD by default. For the moment, the documentation is
Joerg Sonnenberger [Fri, 12 Nov 2004 19:45:36 +0000 (19:45 +0000)]
Switch to OpenNTPD by default. For the moment, the documentation is
not in-sync, -S [Do not set the time immediately], because when a
default route exists, but DNS traffic is lost, the startup time is
*big*.

You can change this by overriding ntpd_flags in /etc/rc.conf.

19 years agoFix systat -netstat and remove the dependency on KVM for this part.
Joerg Sonnenberger [Fri, 12 Nov 2004 19:03:10 +0000 (19:03 +0000)]
Fix systat -netstat and remove the dependency on KVM for this part.

Submitted-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
19 years agoChange zconf.h and zlib.h to use underscored protection macros.
Joerg Sonnenberger [Fri, 12 Nov 2004 18:10:42 +0000 (18:10 +0000)]
Change zconf.h and zlib.h to use underscored protection macros.

Reported-by: Andrew Houghton <aah@roarmouse.org>
19 years agoForced commit, correct comment for last commit. 1.25 has nothing to do with
Matthew Dillon [Fri, 12 Nov 2004 17:50:56 +0000 (17:50 +0000)]
Forced commit, correct comment for last commit.  1.25 has nothing to do with
VFS and instead fixes an arithmatic overflow in the calculation of
(primarily) the nanoseconds field.  In particular, cputimer_freq64_nsec
cannot be multiplied much beyond cputimer_freq without overflowing.  The
overflow can result in a seriously incorrect nanoseconds field and mess up
ntpdate and pthreads, amoung other things.

19 years agoSpelling: Filesystem is one word.
David Rhodus [Fri, 12 Nov 2004 16:38:06 +0000 (16:38 +0000)]
Spelling: Filesystem is one word.

19 years agoQuiet tinderbox:
David Rhodus [Fri, 12 Nov 2004 16:34:00 +0000 (16:34 +0000)]
Quiet tinderbox:
Turn off the build for NULLFS, UMAPFS, UNION, CODA filesystems until
we have time to rework their VOP entry methods.

19 years agoDefault vfs.fastdev to 1 for wider testing, so the vnode bypass for device
Matthew Dillon [Fri, 12 Nov 2004 10:58:59 +0000 (10:58 +0000)]
Default vfs.fastdev to 1 for wider testing, so the vnode bypass for device
read and write is now the default.

This is a precursor to the continued work on a kernel-managed cache layer
on top of the VFS layer.  That is, the intention is to eventually switch the
VM page cache to be ABOVE the VFS layer rather then BELOW the VFS layer for
standard read() and write() calls, with potentially major performance
benefits.

19 years agoTemporarily remove union and nullfs from the vfs build list, they are
Matthew Dillon [Fri, 12 Nov 2004 10:07:32 +0000 (10:07 +0000)]
Temporarily remove union and nullfs from the vfs build list, they are
currently broken in HEAD.

19 years agoInitialize pseudointr_ch in fdc.
Joerg Sonnenberger [Fri, 12 Nov 2004 09:50:38 +0000 (09:50 +0000)]
Initialize pseudointr_ch in fdc.

19 years agoAdd _ntp to the user database, correct the path to nologin for proxy
Joerg Sonnenberger [Fri, 12 Nov 2004 09:37:26 +0000 (09:37 +0000)]
Add _ntp to the user database, correct the path to nologin for proxy
and _pflogd.

19 years agoAdd a 'preupgrade' target which creates any missing users and groups
Matthew Dillon [Fri, 12 Nov 2004 09:10:01 +0000 (09:10 +0000)]
Add a 'preupgrade' target which creates any missing users and groups
(relative to FreeBSD-4) that are required before installworld can be
run.

Adjust the installworld prechecks to bail if required users or groups
do not exist, with a message pointing to the new preupgrade target.

The 'make upgrade' target will automatically run the preupgrade target.

Required users: smmsp, _pflogd, _ntp.
Required groups: smmsp, authpf, _pflogd, _ntp

Devon noted that the 'pw' program seems to do what we need here.

19 years agoCorrect minor tinderbox -DDEBUG error.
Matthew Dillon [Fri, 12 Nov 2004 06:07:36 +0000 (06:07 +0000)]
Correct minor tinderbox -DDEBUG error.

19 years agoInitialize 'version' variable to silence compiler warning.
David Rhodus [Fri, 12 Nov 2004 02:30:29 +0000 (02:30 +0000)]
Initialize 'version' variable to silence compiler warning.

19 years agoSpelling.
David Rhodus [Fri, 12 Nov 2004 02:25:51 +0000 (02:25 +0000)]
Spelling.

19 years agoSync up items from the GENERIC config and a few more items to make
David Rhodus [Fri, 12 Nov 2004 02:24:28 +0000 (02:24 +0000)]
Sync up items from the GENERIC config and a few more items to make
this config file more handy to use on testing systems.

19 years agoUpdate the 3ware card comment to better reflect which cards are supported.
David Rhodus [Fri, 12 Nov 2004 02:21:19 +0000 (02:21 +0000)]
Update the 3ware card comment to better reflect which cards are supported.

19 years agoVFS messaging/interfacing work stage 9/99: VFS 'NEW' API WORK.
Matthew Dillon [Fri, 12 Nov 2004 00:09:56 +0000 (00:09 +0000)]
VFS messaging/interfacing work stage 9/99: VFS 'NEW' API WORK.

NOTE: unionfs and nullfs are temporarily broken by this commit.

* Remove the old namecache API.  Remove vfs_cache_lookup(), cache_lookup(),
  cache_enter(), namei() and lookup() are all gone.  VOP_LOOKUP() and
  VOP_CACHEDLOOKUP() have been collapsed into a single non-caching
  VOP_LOOKUP().

* Complete the new VFS CACHE (namecache) API.  The new API is able to
  supply topological guarentees and is able to reserve namespaces,
  including negative cache spaces (whether the target name exists or not),
  which the new API uses to reserve namespace for things like NRENAME
  and NCREATE (and others).

* Complete the new namecache API.  VOP_NRESOLVE, NLOOKUPDOTDOT, NCREATE,
  NMKDIR, NMKNOD, NLINK, NSYMLINK, NWHITEOUT, NRENAME, NRMDIR, NREMOVE.
  These new calls take (typicaly locked) namecache pointers rather then
  combinations of directory vnodes, file vnodes, and name components.  The
  new calls are *MUCH* simpler in concept and implementation.  For example,
  VOP_RENAME() has 8 arguments while VOP_NRENAME() has only 3 arguments.

  The new namecache API uses the namecache to lock namespaces without having
  to lock the underlying vnodes.  For example, this allows the kernel
  to reserve the target name of a create function trivially.  Namecache
  records are maintained BY THE KERNEL for both positive and negative hits.

  Generally speaking, the kernel layer is now responsible for resolving
  path elements.  NRESOLVE is called when an unresolved namecache record
  needs to be resolved.  Unlike the old VOP_LOOKUP, NRESOLVE is simply
  responsible for associating a vnode to a namecache record (positive hit)
  or telling the system that it's a negative hit, and not responsible for
  handling symlinks or other special cases or doing any of the other
  path lookup work, much unlike the old VOP_LOOKUP.

  It should be particularly noted that the new namecache topology does not
  allow disconnected namecache records.  In rare cases where a vnode must
  be converted to a namecache pointer for new API operation via a file handle
  (i.e. NFS), the cache_fromdvp() function is provided and a new API VOP,
  VOP_NLOOKUPDOTDOT() is provided to allow the namecache to resolve the
  topology leading up to the requested vnode.  These and other topological
  guarentees greatly reduce the complexity of the new namecache API.

  The new namei() is called nlookup().  This function uses a combination
  of cache_n*() calls, VOP_NRESOLVE(), and standard VOP calls resolve the
  supplied path, deal with symlinks, and so forth, in a nice small compact
  compartmentalized procedure.

* The old VFS code is no longer responsible for maintaining namecache records,
  a function which was mostly adhoc cache_purge()s occuring before the VFS
  actually knows whether an operation will succeed or not.

  The new VFS code is typically responsible for adjusting the state of
  locked namecache records passed into it.  For example, if NCREATE succeeds
  it must call cache_setvp() to associate the passed namecache record with
  the vnode representing the successfully created file.  The new requirements
  are much less complex then the old requirements.

* Most VFSs still implement the old API calls, albeit somewhat modified
  and in particular the VOP_LOOKUP function is now *MUCH* simpler.  However,
  the kernel now uses the new API calls almost exclusively and relies on
  compatibility code installed in the default ops (vop_compat_*()) to
  convert the new calls to the old calls.

* All kernel system calls and related support functions which used to do
  complex and confusing namei() operations now do far less complex and
  far less confusing nlookup() operations.

* SPECOPS shortcutting has been implemented.  User reads and writes now go
  directly to supporting functions which talk to the device via fileops
  rather then having to be routed through VOP_READ or VOP_WRITE, saving
  significant overhead.  Note, however, that these only really effect
  /dev/null and /dev/zero.

  Implementing this was fairly easy, we now simply pass an optional
  struct file pointer to VOP_OPEN() and let spec_open() handle the
  override.

SPECIAL NOTES: It should be noted that we must still lock a directory vnode
LK_EXCLUSIVE before issuing a VOP_LOOKUP(), even for simple lookups, because
a number of VFS's (including UFS) store active directory scanning information
in the directory vnode.  The legacy NAMEI_LOOKUP cases can be changed to
use LK_SHARED once these VFS cases are fixed.  In particular, we are now
organized well enough to actually be able to do record locking within a
directory for handling NCREATE, NDELETE, and NRENAME situations, but it hasn't
been done yet.

Many thanks to all of the testers and in particular David Rhodus for
finding a large number of panics and other issues.

19 years agoStyle(9):
Chris Pressey [Thu, 11 Nov 2004 21:16:46 +0000 (21:16 +0000)]
Style(9):
- Do not implicitly treat NUL characters, NULL pointers, or 0-valued
  integers as false-valued booleans; use explicit tests instead.
- Prefer char **argv to char *argv[].
- Small whitespace adjustments.
- No functional changes.

19 years agoAdd various improvements to the "pre-flight installer":
Chris Pressey [Thu, 11 Nov 2004 20:30:05 +0000 (20:30 +0000)]
Add various improvements to the "pre-flight installer":

- Add pfi_autologin variable.  If set to a valid username, the
  installation medium boot process will automatically log in as
  that user.  Defaults to "NONE".

- Add pfi_shutdown_command variable.  This can be set to the
  desired command used to shut down the system when the installer
  finishes doing its thing.  Defaults to "shutdown -h now".

- Launch thttpd on boot if pfi_frontend="cgi".

  In combination, these three settings allow completely
  headless (no monitor, no keyboard) operation of the installer
  independent of a serial connection (i.e. over the network.)

- Have the pfi_sshd_permit_root_login variable honour
  "without-password" and "forced-commands-only" settings. [1]

[1] Submitted by: geekgod

19 years agoUpdate installer to 1.1.2.
Chris Pressey [Thu, 11 Nov 2004 19:45:19 +0000 (19:45 +0000)]
Update installer to 1.1.2.

The most significant change in this update is that there are now two
seperate directories on the install medium, /etc and /etc.hdd :

- /etc contains the configuration used for booting the LiveCD only.
  It is NOT copied to the hard drive.

- /etc.hdd contains the default configuration used for booting from
  a hard drive.  It is NOT used for booting the LiveCD.  It IS copied
  to the hard drive, as /etc .

This avoids the `copy pristine files afterward' rigamarole and, in
so doing, simplifies both manual and automatic install routines.

The README file has also been updated to reflect this change.

Suggested-by: dillon (a while ago)
19 years agoThe 'start = 1' change wasn't needed, revert that one little bit back to
Matthew Dillon [Wed, 10 Nov 2004 20:19:51 +0000 (20:19 +0000)]
The 'start = 1' change wasn't needed, revert that one little bit back to
'start = 0'.

19 years ago- style(9) cleanup
Joerg Sonnenberger [Wed, 10 Nov 2004 18:30:13 +0000 (18:30 +0000)]
- style(9) cleanup
- allow rl_detach to be used for all error recovery in rl_attach
- drop rl_unit and use device_printf instead
- rl_list_tx_init can't fail, make it void
- eliminate splimp in rl_attach, drop it ASAP in rl_detach
- use DEFINE_CLASS_0 instead of expanding it manually

From FreeBSD:
- support cardbus attachments
- support 6bit and 8bit EEPROMs
- use ether_crc32_be instead of local code
- fix some unnessary watchdog conditions
- depend on miibus
- use pci_get_powerstate()/pci_set_powerstate()
- add various PCI and CardBus devices
- bus_dma conversion

19 years agoAdd libarchive to prebuilt libraries.
Joerg Sonnenberger [Wed, 10 Nov 2004 18:05:36 +0000 (18:05 +0000)]
Add libarchive to prebuilt libraries.

19 years agoMerge from vendor branch LIBARCHIVE:
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

19 years agoMerge from vendor branch BSDTAR:
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Merge from vendor branch BSDTAR:
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

19 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

19 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

19 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

19 years agoFix a very serious bug in contigmalloc() which we inherited from FreeBSD-4.x.
Matthew Dillon [Wed, 10 Nov 2004 17:39:20 +0000 (17:39 +0000)]
Fix a very serious bug in contigmalloc() which we inherited from FreeBSD-4.x.
The contigmalloc() code incorrectly assumes that a page in PQ_CACHE can
be reused without having to do any further checks and it unconditionally
busies and frees such pages, and assumes that the page becomes PQ_FREE even
though it might actually have gone to a PQ_HOLD state.  Additionally the
contigmalloc() code unconditionally sets m->object to NULL, ignoring the
fact that the page will be in the VM page bucket hash table if object
happens to not be NULL, leading to page bucket hash table corruption.

The fix is two fold.  First, we add checks for m->busy, (m->flags & PG_BUSY),
m->wire_count, and m->hold_count and do not reuse a page with any of those
set.  We do this for all pages, not just PQ_CACHE pages, though it is
believed that it only needs to be done for PQ_CACHE pages.  Second, we
replace the m->object = NULL assignment with an assertion that it is
already NULL, since it had better be NULL and we cannot just set it to NULL
unconditionally without blowing up the VM page hash table.

Symptoms of the bug include:

    * Filesystem corruption, in particular with slower disk drivers (e.g.
      like the 'twe' driver), or in systems with drivers which use
      contigmalloc() a lot (e.g. require bounce buffers).

      Mangled directory entries, bad indirect blocks (containing data instead
      of indirect block pointers), and files containing other file's data.

    * 'page not found in hash' panic.

This is the last major VM issue in DragonFly, one that has plagued in
particular David Rhodus (who is a heavy user of the 'twe' driver) for over
a year.  I would never have found this bug if not for DR's persistence and
the dozens of kernel cores he was able to provide me over the last year.  We
finally got a core with a 'smoking gun', after having written a program
(/usr/src/test/debug/vmpageinfo.c) to run through all the VM pages and check
their hash table association for correctness it became obvious that pages
were being reused without being removed from the hash table which finally
led to contigmalloc*().

Many thanks to: David Rhodus!  Free gift enclosed!

19 years agoThe min() and max() macros in sys/libkern.h are typed u_int and thus do not
Matthew Dillon [Wed, 10 Nov 2004 08:27:54 +0000 (08:27 +0000)]
The min() and max() macros in sys/libkern.h are typed u_int and thus do not
do the right things when handed negative numbers.  Use MIN and MAX instead.

This was causing renice -N processes to wrap back around to the worst priority
instead of MIN()'ing to the best priority.

19 years agoInstall GNU tar as gtar now in preparation for adding bsdtar.
Joerg Sonnenberger [Wed, 10 Nov 2004 00:01:54 +0000 (00:01 +0000)]
Install GNU tar as gtar now in preparation for adding bsdtar.
/usr/bin/tar is installed as symlink to /usr/bin/gtar, which
gives the current behaviour. Same for the man page. This is disabled,
if WITH_BSDTAR is set.

19 years agoClose .if.
Joerg Sonnenberger [Tue, 9 Nov 2004 22:44:06 +0000 (22:44 +0000)]
Close .if.

Reported-by: esmith
19 years agoAdd SA_LEN patch for client.c, too
Joerg Sonnenberger [Tue, 9 Nov 2004 22:06:54 +0000 (22:06 +0000)]
Add SA_LEN patch for client.c, too

19 years agovmpageinfo is a program which runs through the vm_page_array and the
Matthew Dillon [Tue, 9 Nov 2004 21:50:12 +0000 (21:50 +0000)]
vmpageinfo is a program which runs through the vm_page_array and the
vm_page_buckets hash table and validates the hash table association for
all VM pages which have objects associated with them.  This is primarily
intended for post-mortem checks of kernel cores.

19 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
Merge from vendor branch NTPD:
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

19 years agoAfter another look at the current changes, switch directly to the in-tree
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

19 years agoAfter another look at the current changes, switch directly to the in-tree
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

19 years agoSwitch to gdb 6.2.1 and wait for new problem reports.
Joerg Sonnenberger [Tue, 9 Nov 2004 21:08:16 +0000 (21:08 +0000)]
Switch to gdb 6.2.1 and wait for new problem reports.

19 years agoImport OpenNTPD 3.6 (the OpenBSD version, not the portable).
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

19 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Merge from vendor branch NTPD:
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

19 years agoImport OpenNTPD 3.6 (the OpenBSD version, not the portable).
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

19 years agoUse the speedup patches, too
Joerg Sonnenberger [Tue, 9 Nov 2004 19:31:14 +0000 (19:31 +0000)]
Use the speedup patches, too

19 years agoDefine IOV_MAX for userland too and make it available via sysctl and
Joerg Sonnenberger [Tue, 9 Nov 2004 17:52:45 +0000 (17:52 +0000)]
Define IOV_MAX for userland too and make it available via sysctl and
getconf/sysconf. This is kind of a hack, but too much code wants it.

Obtained-from: FreeBSD

19 years agoAdd lockcountnb() - a non-blocking version of lockcount() to be used only
Matthew Dillon [Tue, 9 Nov 2004 17:41:30 +0000 (17:41 +0000)]
Add lockcountnb() - a non-blocking version of lockcount() to be used only
for assertions when the lock state is supposedly stable.

19 years agoCreate a non-blocking version of BUF_REFCNT() called BUF_REFCNTNB() to be
Matthew Dillon [Tue, 9 Nov 2004 17:36:42 +0000 (17:36 +0000)]
Create a non-blocking version of BUF_REFCNT() called BUF_REFCNTNB() to be
used for non-critical KASSERT()'s or in situations where the buffer lock
is in a known state.

This fixes a blocking condition in the ATA interrupt path.  The normal
BUF_REFCNT() calls lockcount() which obtains a token which caused the
interrupt thread to temporarily block in biodone() due to a KASSERT.

Found-from: kernel core provided by David Rhodus.

19 years agoI don't know why I added use_bpf.h, it isn't needed of course.
Joerg Sonnenberger [Tue, 9 Nov 2004 11:10:10 +0000 (11:10 +0000)]
I don't know why I added use_bpf.h, it isn't needed of course.

19 years agoFix the column width for IPv6 to correctly align the fields.
Joerg Sonnenberger [Tue, 9 Nov 2004 09:10:55 +0000 (09:10 +0000)]
Fix the column width for IPv6 to correctly align the fields.

Submitted-by: Pawel Biernacki <kaktus@dragonflybsd.pl>
19 years agoRemove references to sysinstall, it vanished quite some time ago.
Joerg Sonnenberger [Tue, 9 Nov 2004 08:52:46 +0000 (08:52 +0000)]
Remove references to sysinstall, it vanished quite some time ago.

Submitted-by: Tomaz Borstnar <tomaz.borstnar@over.net>
While at it, add a reference for both pw(8) and tzsetup(8) as appropiate.

19 years agoSmall speedups:
Joerg Sonnenberger [Tue, 9 Nov 2004 08:47:36 +0000 (08:47 +0000)]
Small speedups:
- run.c: instead of counting string lenght and using strcpy afterwards anyway,
  use memmove
- tran.c: use strdup instead of malloc + strcpy

Submitted-by: Andreas Hauser <andy@splashground.de>
19 years agoFix another minor bug-a-boo inherited from 4.x sources, the wrong indirdep
Matthew Dillon [Tue, 9 Nov 2004 04:41:47 +0000 (04:41 +0000)]
Fix another minor bug-a-boo inherited from 4.x sources, the wrong indirdep
pointer was being checked in a conditional.  However, it turns out not
to matter operationally.

19 years agovfs_object_create() was being called too early on devvp in the FFS mount
Matthew Dillon [Tue, 9 Nov 2004 04:25:59 +0000 (04:25 +0000)]
vfs_object_create() was being called too early on devvp in the FFS mount
code, causing FFS's devvp to not be VMIO backed.  This also tickled a
softupdates bug which has been separately fixed.

Its nice to know that everything still works without devvp being VMIO backed,
but we really want to back it :-).  This fixes it.

19 years agoCorrect a softupdates bug, an ir_savebp buffer was not being properly
Matthew Dillon [Tue, 9 Nov 2004 04:22:52 +0000 (04:22 +0000)]
Correct a softupdates bug, an ir_savebp buffer was not being properly
disposed of.  This bug is currently only known to effect filesystems
whos block devices are not VMIO backed.  However, it's a fragile situation
at best so its good to have it fixed anyhow.

ir_savebp is stashed copy of the in-memory version of an indirect file block.
It is stashed using (devvp,blkno) (whereas the actual indirect file block
is stored using (vp,-specialblkno).  For VMIO to also tickle this bug would
have required that other unrelated operations also cache (devvp,blkno), a
case which does not (yet) exist.