]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 years agoTHe log message for the previous commit should have said:
bde [Fri, 12 Mar 2004 12:05:38 +0000 (12:05 +0000)]
THe log message for the previous commit should have said:

Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
PR: standards/56906

20 years agoReplace a manual check of a VMIO candidate with vn_canvmio(). This
des [Fri, 12 Mar 2004 12:02:12 +0000 (12:02 +0000)]
Replace a manual check of a VMIO candidate with vn_canvmio().  This
silences an annoying warning in getblk() when VMIO'ing on a directory
vnode, which can happen when vfs.vmiodirenable is 1.

Bring the warning message in line with reality at the same time.

Submitted by: hmp

20 years agoInitial support for C99's (or is it POSIX.1-2001's?) MATH_ERRNO,
bde [Fri, 12 Mar 2004 12:02:03 +0000 (12:02 +0000)]
Initial support for C99's (or is it POSIX.1-2001's?) MATH_ERRNO,
MATH_ERREXCEPTION and math_errhandling, so that C99 applications at
least have the possibility of determining that errno is not set for
math functions.  Set math_errhandling to the non-standard-conforming
value of 0 for now to indicate that we don't support either method
of reporting errors.  We intentionally don't support MATH_ERRNO
because errno is a mistake, and we are missing support for
MATH_ERREXCEPTION (<fenv.h>, compiler support for <fenv.h>, and
actually setting the exception flags correctly).

20 years agoDo not print a warning about net.inet.pim.stats if errno is
des [Fri, 12 Mar 2004 11:22:50 +0000 (11:22 +0000)]
Do not print a warning about net.inet.pim.stats if errno is
ENOENT, because that means we do not have PIM in the kernel.

Submitted by: hmp
MFC after: 1 week

20 years agoFix copy&paste-o.
phk [Fri, 12 Mar 2004 06:51:21 +0000 (06:51 +0000)]
Fix copy&paste-o.

Spotted by: iedowse

20 years agoIf /conf/diskless_remount exists, use it to remount the entire /conf
brooks [Fri, 12 Mar 2004 04:40:16 +0000 (04:40 +0000)]
If /conf/diskless_remount exists, use it to remount the entire /conf
directory.  This allows multiple roots (say for different architectures)
to share the same set of /conf files.

20 years agoUse 'pw groupshow' instead of 'id -g' to see if a group exists.
gshapiro [Fri, 12 Mar 2004 03:46:15 +0000 (03:46 +0000)]
Use 'pw groupshow' instead of 'id -g' to see if a group exists.

PR: 64073
Submitted by: jhb
MFC after: 5 days

20 years agoPart 2 of rev 1.68. Update comment to match reality now that vm_endcopy
peter [Fri, 12 Mar 2004 00:16:48 +0000 (00:16 +0000)]
Part 2 of rev 1.68.  Update comment to match reality now that vm_endcopy
exists and we no longer copy to the end of the struct.

Forgotten by:  alfred and green

20 years agomdoc(7): New sentence should start on new line.
pjd [Thu, 11 Mar 2004 22:22:03 +0000 (22:22 +0000)]
mdoc(7): New sentence should start on new line.

Pointed out by: hmp

20 years agoTurn on logging for tftpd.
des [Thu, 11 Mar 2004 22:15:28 +0000 (22:15 +0000)]
Turn on logging for tftpd.

20 years agoDon't run fsck if there's no /etc/fstab.
kientzle [Thu, 11 Mar 2004 20:00:10 +0000 (20:00 +0000)]
Don't run fsck if there's no /etc/fstab.

In particular, this allows a "virgin" system installed from
source (installworld, installkernel, cd etc && make distribution)
to boot correctly and modestly simplifies the creation
of single-partition network/cdrom/CF bootable images.

20 years agoAdd reference to the g_access(9) manual page.
pjd [Thu, 11 Mar 2004 19:53:22 +0000 (19:53 +0000)]
Add reference to the g_access(9) manual page.

20 years agoConnect g_access(9) to the build.
pjd [Thu, 11 Mar 2004 19:51:14 +0000 (19:51 +0000)]
Connect g_access(9) to the build.

20 years agoAdd manual page for g_access(9) GEOM function.
pjd [Thu, 11 Mar 2004 19:23:48 +0000 (19:23 +0000)]
Add manual page for g_access(9) GEOM function.

20 years agoWhen I was a kid my work table was one cluttered mess an cleaning it up
phk [Thu, 11 Mar 2004 18:50:33 +0000 (18:50 +0000)]
When I was a kid my work table was one cluttered mess an cleaning it up
were a rather overwhelming task.  I soon learned that if you don't know
where you're going to store something, at least try to pile it next to
something slightly related in the hope that a pattern emerges.

Apply the same principle to the ffs/snapshot/softupdates code which have
leaked into specfs:  Add yet a buf-quasi-method and call it from the
only two places I can see it can make a difference and implement the
magic in ffs_softdep.c where it belongs.

It's not pretty, but at least it's one less layer violated.

20 years agoRemove unused variables.
jhb [Thu, 11 Mar 2004 18:50:05 +0000 (18:50 +0000)]
Remove unused variables.

20 years ago- Use variable names instead of numbers for the script arguments to
simon [Thu, 11 Mar 2004 18:12:48 +0000 (18:12 +0000)]
- Use variable names instead of numbers for the script arguments to
  improve readability.
- Use mktemp to create the temporary files and directory.
- Mount temporary md(4) backed file system on a temporary directory,
  instead of /mnt.

Approved by: phk

20 years agoThis commit was generated by cvs2svn to compensate for changes in r126854,
des [Thu, 11 Mar 2004 18:04:03 +0000 (18:04 +0000)]
This commit was generated by cvs2svn to compensate for changes in r126854,
which included commits to RCS files with non-trunk default branches.

20 years agoMFP4 (#47094): avoid bogus NULL pointer warnings when building with -DDEBUG.
des [Thu, 11 Mar 2004 18:04:03 +0000 (18:04 +0000)]
MFP4 (#47094): avoid bogus NULL pointer warnings when building with -DDEBUG.

20 years agoProperly vector all bwrite() and BUF_WRITE() calls through the same path
phk [Thu, 11 Mar 2004 18:02:36 +0000 (18:02 +0000)]
Properly vector all bwrite() and BUF_WRITE() calls through the same path
and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().

20 years agoRemove unused mnt_reservedvnlist field.
phk [Thu, 11 Mar 2004 16:59:57 +0000 (16:59 +0000)]
Remove unused mnt_reservedvnlist field.

20 years agoRemove unused second arg to vfinddev().
phk [Thu, 11 Mar 2004 16:33:11 +0000 (16:33 +0000)]
Remove unused second arg to vfinddev().
Don't call addaliasu() on VBLK nodes.

20 years agoProperly count references of our dev_t to avoid triggering a KASSERT in
le [Thu, 11 Mar 2004 14:11:08 +0000 (14:11 +0000)]
Properly count references of our dev_t to avoid triggering a KASSERT in
dev_strategy().

Submitted by:   dwmalone
Approved by:    grog (mentor)

20 years agoCorrectly account for extra bits in unit numbers when looking for
phk [Thu, 11 Mar 2004 14:11:02 +0000 (14:11 +0000)]
Correctly account for extra bits in unit numbers when looking for
next free unit.

20 years agoAdd yet another VIA pci id.
sos [Thu, 11 Mar 2004 14:08:11 +0000 (14:08 +0000)]
Add yet another VIA pci id.

20 years agoStop setting ifp->if_output to ether_output() since ether_ifattach()
mux [Thu, 11 Mar 2004 14:04:59 +0000 (14:04 +0000)]
Stop setting ifp->if_output to ether_output() since ether_ifattach()
does it for us already.

20 years agoDon't implement anything in the ffs family in <machine/cpufunc.h>
bde [Thu, 11 Mar 2004 13:38:54 +0000 (13:38 +0000)]
Don't implement anything in the ffs family in <machine/cpufunc.h>
in the non-_KERNEL case.  This "fixes" applications that include
this "kernel-only" header and also include <strings.h> (or get
<strings.h> via the default _BSD_VISIBLE pollution in <string.h>.
In C++ there was a fatal error: the declaration specifies C linkage
but the implementation gives C++ linkage.  In C there was only a
static/extern mismatch if the headers were included in a certain order
order, and a partially redundant declaration for all include orders;
gcc emits incomplete or wrong diagnostics for these, but only for
compiling with -Wsystem-headers and certain other warning options, so
the problem was usually not seen for C.

Ports breakage reported by: kris

20 years agoAdd clone_setup() function rather than rely on lazy initialization.
phk [Thu, 11 Mar 2004 12:58:55 +0000 (12:58 +0000)]
Add clone_setup() function rather than rely on lazy initialization.

Requested by: rwatson

20 years agoFixed assorted misuses of NULL in integer context.
bde [Thu, 11 Mar 2004 11:58:16 +0000 (11:58 +0000)]
Fixed assorted misuses of NULL in integer context.

20 years agoFixed mispellings of '\0' as NULL.
bde [Thu, 11 Mar 2004 11:41:54 +0000 (11:41 +0000)]
Fixed mispellings of '\0' as NULL.

20 years agoFixed a misspelling of 0 as NULL.
bde [Thu, 11 Mar 2004 11:30:57 +0000 (11:30 +0000)]
Fixed a misspelling of 0 as NULL.

Fixed a nearby bug.  The "play it safe" code in dosysctl() was unsafe
because it overran the buffer by 1 if sysctl() filled all of the buffer.

Fixed a nearby style bug in output.  Not just 1, but 2 extra newlines
were printed at the end by "vmstat -m" and "vmstat -z".  Don't print
any newlines explicitly.  This depends on 2 of the many formatting
bugs in the corresponding sysctls.  First, the sysctls return an extra
newline at the end of the strings.  This also messes up output from
sysctl(8).  Second, the sysctls return an extra newline at the beginning
of the strings.  This is good for separating the 2 tables output by
"vmstat -mz" and for starting the header on a new line in plain sysctl
output, but gives a bogus extra newline at the beginning for "vm -[m | z]"
and "sysctl -n [kern.malloc | vm.zone]".

Fixed some nearby style bugs in the source code:
- the same line that misspelled 0 as NULL also spelled NULL as 0.
- the size was doubled twice in the realloc loop.
- the "play it safe" comment was misleading.  Terminating the buffer
  is bogus because dosysctl() is only meant to work with sysctls that
  return strings and the terminator is part of a string.  However, the
  kern.malloc sysctl has more than style bugs.  It also doesn't return
  a string.  Termination is needed to work around this bug.

20 years agoReplace <iostream.h> with <iostream> to remove annoying warning
josef [Thu, 11 Mar 2004 10:43:35 +0000 (10:43 +0000)]
Replace <iostream.h> with <iostream> to remove annoying warning
of using deprecated header.

Approved by:    dwhite, simon(mentor)
Reviewed by:    mlaier
Submitted by:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:             bin/63781

20 years agoFixed a misspelling of '\0' as NULL.
bde [Thu, 11 Mar 2004 10:22:25 +0000 (10:22 +0000)]
Fixed a misspelling of '\0' as NULL.

20 years agoFixed misspellings of 0 as NULL.
bde [Thu, 11 Mar 2004 10:19:45 +0000 (10:19 +0000)]
Fixed misspellings of 0 as NULL.

20 years agoFixed misspellings of '\0' as NULL.
bde [Thu, 11 Mar 2004 10:12:05 +0000 (10:12 +0000)]
Fixed misspellings of '\0' as NULL.

20 years agoFixed a misspelling of 0 as NULL.
bde [Thu, 11 Mar 2004 10:09:01 +0000 (10:09 +0000)]
Fixed a misspelling of 0 as NULL.

20 years agoFixed misspellings of 0 as NULL.
bde [Thu, 11 Mar 2004 10:01:12 +0000 (10:01 +0000)]
Fixed misspellings of 0 as NULL.

20 years agoFixed misspellings of 0 as NULL.
bde [Thu, 11 Mar 2004 09:56:04 +0000 (09:56 +0000)]
Fixed misspellings of 0 as NULL.

20 years agoFix mind-o: sanity check in ndis_disable_ndis() is not sane.
wpaul [Thu, 11 Mar 2004 09:50:00 +0000 (09:50 +0000)]
Fix mind-o: sanity check in ndis_disable_ndis() is not sane.

20 years agoFix the problem with the Cisco Aironet 340 PCMCIA card. Most newer drivers
wpaul [Thu, 11 Mar 2004 09:40:00 +0000 (09:40 +0000)]
Fix the problem with the Cisco Aironet 340 PCMCIA card. Most newer drivers
for Windows are deserialized miniports. Such drivers maintain their own
queues and do their own locking. This particular driver is not deserialized
though, and we need special support to handle it correctly.

Typically, in the ndis_rxeof() handler, we pass all incoming packets
directly to (*ifp->if_input)(). This in turn may cause another thread
to run and preempt us, and the packet may actually be processed and
then released before we even exit the ndis_rxeof() routine. The
problem with this is that releasing a packet calls the ndis_return_packet()
function, which hands the packet and its buffers back to the driver.
Calling ndis_return_packet() before ndis_rxeof() returns will screw
up the driver's internal queues since, not being deserialized,
it does no locking.

To avoid this problem, if we detect a serialized driver (by checking
the attribute flags passed to NdisSetAttributesEx(), we use an alternate
ndis_rxeof() handler, ndis_rxeof_serial(), which puts the call to
(*ifp->if_input)() on the NDIS SWI work queue. This guarantees the
packet won't be processed until after ndis_rxeof_serial() returns.

Note that another approach is to always copy the packet data into
another mbuf and just let the driver retain ownership of the ndis_packet
structure (ndis_return_packet() never needs to be called in this
case). I'm not sure which method is faster.

20 years agoBe more insistent on destroying geoms at unload time. Still not perfect,
phk [Thu, 11 Mar 2004 08:16:23 +0000 (08:16 +0000)]
Be more insistent on destroying geoms at unload time.  Still not perfect,
but it will do (better) for now.

KASSERT that to have providers a class must have an access method.

Tag the new_provider event with the geom as well.

20 years agoAdd a newsyslog.conf manual page. This follows suit with the other utilities
trhodes [Thu, 11 Mar 2004 04:35:08 +0000 (04:35 +0000)]
Add a newsyslog.conf manual page.  This follows suit with the other utilities
which have configuration files.  This is just a cut-paste from newsyslog.8
with the following changes:

o Kill hard sentence breaks.
o Markup fixes.
o Wordsmithing.

20 years agoRemove information about the configuration file.
trhodes [Thu, 11 Mar 2004 04:32:16 +0000 (04:32 +0000)]
Remove information about the configuration file.
Add an Xref to newsyslog.conf.5 and bzip2.1.

20 years agoBack out id -g checks as they are wrong (sendmail group untouched).
mlaier [Thu, 11 Mar 2004 00:22:04 +0000 (00:22 +0000)]
Back out id -g checks as they are wrong (sendmail group untouched).

Requested by: dwhite
Approve by: dwhite

20 years agoRemove stale or broken call to kdb_trap() and protected by the non-
marcel [Thu, 11 Mar 2004 00:17:45 +0000 (00:17 +0000)]
Remove stale or broken call to kdb_trap() and protected by the non-
option KDB. Besides being wrong, it also interferes with ongoing
work.

20 years agoGive xterm-basic the le entry. bs should be avoided.
schweikh [Wed, 10 Mar 2004 22:38:32 +0000 (22:38 +0000)]
Give xterm-basic the le entry. bs should be avoided.
This is a prerequisite to fix

PR: bin/48679
Discussed with: Thomas Dickey (xterm termcap maintainer)
MFC after: 2 weeks

20 years agoA manpage for ng_eiface(4).
ru [Wed, 10 Mar 2004 22:25:25 +0000 (22:25 +0000)]
A manpage for ng_eiface(4).

Submitted by: Gleb Smirnoff

20 years agoIdentify the Deerfield processor. Deerfield is a low-voltage variant
marcel [Wed, 10 Mar 2004 22:23:20 +0000 (22:23 +0000)]
Identify the Deerfield processor. Deerfield is a low-voltage variant
based on the Madison core and targeting the low end of the spectrum.
Its clock frequency is 1Ghz, whereas Madison starts at 1.3Ghz. Since
the CPUID information is the same for Madison and Deerfield, we use
the clock frequency to identify the processor.
Supposedly the Deerfield only uses 62W, which seems to be less than
modern Xeon processors (about 70W) and about half what a Madison would
need.

20 years agoReworked the fix to print the useful line number on error in
ru [Wed, 10 Mar 2004 21:51:06 +0000 (21:51 +0000)]
Reworked the fix to print the useful line number on error in
the .for loop:

- Replaced four global variables in parse.c with one.
- Made Parse_FromString() accept the "lineno" as an argument.
- Fixed line numbering when there are escaped newlines in the
  body of the .for loop.

Adopted from: NetBSD

20 years agoDon't call devsw() more than we need to, and in particular do not expose
phk [Wed, 10 Mar 2004 20:56:28 +0000 (20:56 +0000)]
Don't call devsw() more than we need to, and in particular do not expose
ourselves to device removal by not checking for it the second time.

Use count_dev(dev) rather than vcount(vp)

20 years agoMake the extern for adv_mcode match the reality: it's u_int8_t, but
phk [Wed, 10 Mar 2004 20:52:47 +0000 (20:52 +0000)]
Make the extern for adv_mcode match the reality: it's u_int8_t, but
probably unendiansafely used as u_int16_t.

20 years agoFix a long-standing deadlock issue with vnode backed md(4) devices:
phk [Wed, 10 Mar 2004 20:41:09 +0000 (20:41 +0000)]
Fix a long-standing deadlock issue with vnode backed md(4) devices:

On vnode backed md(4) devices over a certain, currently undetermined
size relative to the buffer cache our "lemming-syncer" can provoke
a buffer starvation which puts the md thread to sleep on wdrain.

This generally tends to grind the entire system to a stop because the
event that is supposed to wake up the thread will not happen until a fair
bit of the piled up I/O requests in the system finish, and since a lot
of those are on a md(4) vnode backed device which is currently waiting
on wdrain until a fair amount of the piled up ... you get the picture.

The cure is to issue all VOP_WRITES on the vnode backing the device
with IO_SYNC.

In addition to more closely emulating a real disk device with a
non-lying write-cache, this makes the writes exempt from rate-limited
(there to avoid starving the buffer cache) and consequently prevents
the deadlock.

Unfortunately performance takes a hit.

Add "async" option to give people who know what they are doing the
old behaviour.

20 years agoAdd an option to write collected data to file in binary format. This
phk [Wed, 10 Mar 2004 20:30:19 +0000 (20:30 +0000)]
Add an option to write collected data to file in binary format.  This
is very useful for collecting test-data for trial runs.

20 years agoUndo the previous commit, which was just plain wrong, and then correctly
gad [Wed, 10 Mar 2004 19:47:57 +0000 (19:47 +0000)]
Undo the previous commit, which was just plain wrong, and then correctly
increase _FreeBSD_version to reflect the 64-bTT change on sparc64.

Noticed by: kris
Pointy hat to: gad

20 years agoIncrease __FreeBSD_version to reflect the transition from 32-bit to
gad [Wed, 10 Mar 2004 17:40:55 +0000 (17:40 +0000)]
Increase __FreeBSD_version to reflect the transition from 32-bit to
64-bit time_t on the FreeBSD/sparc64 architecture.

20 years agoChange time_t from a 32-bit value to a 64-bit value, on FreeBSD/sparc64
gad [Wed, 10 Mar 2004 17:39:05 +0000 (17:39 +0000)]
Change time_t from a 32-bit value to a 64-bit value, on FreeBSD/sparc64
only.  This is a  MAJOR  incompatible change for the sparc64 platform,
but will not effect FreeBSD on other architectures.

Reviewed by: imp for UPDATING, freebsd-sparc for the change itself.

20 years agoEliminate multiple __FBSDID and sys/cdefs.h.
bms [Wed, 10 Mar 2004 17:03:27 +0000 (17:03 +0000)]
Eliminate multiple __FBSDID and sys/cdefs.h.

20 years agoAdd installcheck for proxy:proxy and authpf.
mlaier [Wed, 10 Mar 2004 16:34:11 +0000 (16:34 +0000)]
Add installcheck for proxy:proxy and authpf.

Suggested by: ru
Approved by: bms(mentor)

20 years ago- Document cv_broadcastpri().
jhb [Wed, 10 Mar 2004 15:57:25 +0000 (15:57 +0000)]
- Document cv_broadcastpri().
- Remove references to cv_waitq_*() as they no longer exist.

20 years agoRemove `$Name$' leftovers from the port version reporting.
mlaier [Wed, 10 Mar 2004 15:08:21 +0000 (15:08 +0000)]
Remove `$Name$' leftovers from the port version reporting.

Noticed by: Craig Rodrigues
Approved by: bms(mentor)

20 years agoftp-proxy no longer lives in /usr/local/...
mlaier [Wed, 10 Mar 2004 15:06:17 +0000 (15:06 +0000)]
ftp-proxy no longer lives in /usr/local/...

Noticed by: Pyun YongHyeon
Approved by: bms(mentor)

20 years agoAdd trailing collon
mlaier [Wed, 10 Mar 2004 15:04:29 +0000 (15:04 +0000)]
Add trailing collon

Noticed by: dwhite
Approved by: bms(mentor)

20 years agoSet stream orientation in ungetc() instead of __ungetc(). This avoids
tjr [Wed, 10 Mar 2004 12:41:11 +0000 (12:41 +0000)]
Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.

20 years agoRemove duplicate check for EOF from ungetc(); __ungetc() already checks.
tjr [Wed, 10 Mar 2004 11:13:23 +0000 (11:13 +0000)]
Remove duplicate check for EOF from ungetc(); __ungetc() already checks.

20 years agoWe don't retain 'x' bits in CVS so explicity use sh to run script.
phk [Wed, 10 Mar 2004 11:11:58 +0000 (11:11 +0000)]
We don't retain 'x' bits in CVS so explicity use sh to run script.

20 years agoCall __sputc() directly in fputc() instead of taking an expensive
tjr [Wed, 10 Mar 2004 10:49:45 +0000 (10:49 +0000)]
Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().

20 years agoAdd first cut at "nanobsd":
phk [Wed, 10 Mar 2004 10:28:33 +0000 (10:28 +0000)]
Add first cut at "nanobsd":

Nanobsd should make it very simple for people to create (CF-)disk images
for embedded us of FreeBSD.

Currently only works for 256MB disks.  More agrressive shaving of the
build image can reduce that much further.

20 years agoCall __sgetc() directly in getchar() instead of taking an expensive
tjr [Wed, 10 Mar 2004 10:24:15 +0000 (10:24 +0000)]
Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().

20 years agoUse the external clock input for our PLL.
phk [Wed, 10 Mar 2004 10:10:46 +0000 (10:10 +0000)]
Use the external clock input for our PLL.

This may not be a generally valid configuration, but neither is relying
on the PCI clock to be stable.

The only currently known and supported hardware is the VPN14x1 from
Soekris, and since it has external clock, we fail safe(r) by using
it.

Unfortunately there is no way to probe this reliably.

20 years agoSet the stream orientation explicitly in fgetln() instead of relying on
tjr [Wed, 10 Mar 2004 09:28:38 +0000 (09:28 +0000)]
Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.

20 years agoRemove the /* 1.2 */ comment which was orphaned by previous commit.
phk [Wed, 10 Mar 2004 09:23:27 +0000 (09:23 +0000)]
Remove the /* 1.2 */ comment which was orphaned by previous commit.

20 years agoSet stream orientation in puts().
tjr [Wed, 10 Mar 2004 09:15:38 +0000 (09:15 +0000)]
Set stream orientation in puts().

20 years agoPut libypclnt behind NO_YP_LIBC
phk [Wed, 10 Mar 2004 08:58:06 +0000 (08:58 +0000)]
Put libypclnt behind NO_YP_LIBC

20 years agoRearrange some of the GEOM debugging tools to be more structured.
phk [Wed, 10 Mar 2004 08:49:08 +0000 (08:49 +0000)]
Rearrange some of the GEOM debugging tools to be more structured.

  Retire g_sanity() and corresponding debugflag (0x8)

  Retire g_{stall,release}_events().

  Under #ifdef DIAGNOSTIC:

    Make g_valid_obj() an official function and have it return an an
    non-zero integer which indicates the kind of object when found.

    Implement G_VALID_{CLASS,GEOM,CONSUMER,PROVIDER}() macros based
    on g_valid_obj().

    Sprinkle calls to these macros liberally over the infrastructure.

    Always check that we do not free a live object.

20 years agoFixed a misspelling of 0 as NULL.
bde [Wed, 10 Mar 2004 08:46:39 +0000 (08:46 +0000)]
Fixed a misspelling of 0 as NULL.

20 years agoFix handling of tap/vmnet flag in relation to cloning and properly enforce
phk [Wed, 10 Mar 2004 08:02:29 +0000 (08:02 +0000)]
Fix handling of tap/vmnet flag in relation to cloning and properly enforce
largest supported unit number for this device driver.

Reported by: Kaho Toshikazu <kaho@easy.es.tuat.ac.jp>

20 years agoFix several issues related to the KeInitializeTimer() etc... API stuff
wpaul [Wed, 10 Mar 2004 07:43:11 +0000 (07:43 +0000)]
Fix several issues related to the KeInitializeTimer() etc... API stuff
that I added recently:

- When a periodic timer fires, it's automatically re-armed. We must
  make sure to re-arm the timer _before_ invoking any caller-supplied
  defered procedure call: the DPC may choose to call KeCancelTimer(),
  and re-arming the timer after the DPC un-does the effect of the
  cancel.

- Fix similar issue with periodic timers in subr_ndis.c.

- When calling KeSetTimer() or KeSetTimerEx(), if the timer is
  already pending, untimeout() it first before timeout()ing
  it again.

- The old Atheros driver for the 5211 seems to use KeSetTimerEx()
  incorrectly, or at the very least in a very strange way that
  doesn't quite follow the Microsoft documentation. In one case,
  it calls KeSetTimerEx() with a duetime of 0 and a period of 5000.
  The Microsoft documentation says that negative duetime values
  are relative to the current time and positive values are absolute.
  But it doesn't say what's supposed to happen with positive values
  that less than the current time, i.e. absolute values that are
  in the past.

  Lacking any further information, I have decided that timers with
  positive duetimes that are in the past should fire right away (or
  in our case, after only 1 tick). This also takes care of the other
  strange usage in the Atheros driver, where the duetime is
  specified as 500000 and the period is 50. I think someone may
  have meant to use -500000 and misinterpreted the documentation.

- Also modified KeWaitForSingleObject() and KeWaitForMultipleObjects()
  to make the same duetime adjustment, since they have the same rules
  regarding timeout values.

- Cosmetic: change name of 'timeout' variable in KeWaitForSingleObject()
  and KeWaitForMultipleObjects() to 'duetime' to avoid senseless
  (though harmless) overlap with timeout() function name.

With these fixes, I can get the 5211 card to associate properly with
my adhoc net using driver AR5211.SYS version 2.4.1.6.

20 years agoMove the AH algorithm list from a static local function variable to
rwatson [Wed, 10 Mar 2004 04:56:54 +0000 (04:56 +0000)]
Move the AH algorithm list from a static local function variable to
a static const global variable in ah_core.c.  This makes it more clear
that this array does not require synchronization, as well as
synchronizing the layout to the ESP algorithm list.  This is the
version of my patch that Itojun committed to the KAME tree.

Obtained from: me, via KAME

20 years ago - Make the acquisition of Giant in vm_fault_unwire() conditional on the
alc [Wed, 10 Mar 2004 04:44:43 +0000 (04:44 +0000)]
 - Make the acquisition of Giant in vm_fault_unwire() conditional on the
   pmap.  For the kernel pmap, Giant is not required.  In general, for
   other pmaps, Giant is required by i386's pmap_pte() implementation.
   Specifically, the use of PMAP2/PADDR2 is synchronized by Giant.
   Note: In principle, updates to the kernel pmap's wired count could be
   lost without Giant.  However, in practice, we never use the kernel
   pmap's wired count.  This will be resolved when pmap locking appears.
 - With the above change, cpu_thread_clean() and uma_large_free() need
   not acquire Giant.  (The first case is simply the revival of
   i386/i386/vm_machdep.c's revision 1.226 by peter.)

20 years agoLock down IP-layer encapsulation library:
rwatson [Wed, 10 Mar 2004 02:48:50 +0000 (02:48 +0000)]
Lock down IP-layer encapsulation library:

 - Add encapmtx to protect ip_encap.c global variables (encapsulation
   list).
 - Unifdef #ifdef 0 pieces of encap_init() which was (and now really
   is) basically a no-op.
 - Lock encapmtx when walking encaptab, modifying it, comparing
   entries, etc.
 - Remove spl's.

Note that currently there's no facilite to make sure outstanding
use of encapsulation methods on a table entry have drained bfore
we allow a table entry to be removed.  As such, it's currently the
caller's responsibility to make sure that draining takes place.

Reviewed by: mlaier

20 years agoScrub unused variable zeroin_addr.
rwatson [Wed, 10 Mar 2004 01:01:04 +0000 (01:01 +0000)]
Scrub unused variable zeroin_addr.

20 years agomake sure we had the filedesc lock when calling fdinit when RFCFDG is set
jmg [Wed, 10 Mar 2004 00:27:36 +0000 (00:27 +0000)]
make sure we had the filedesc lock when calling fdinit when RFCFDG is set
on call to rfork.

Submitted by: Brian Buchanan
Semi-Reviewed by: rwatson

20 years agoAnother April Fool signs up.
peadar [Wed, 10 Mar 2004 00:06:01 +0000 (00:06 +0000)]
Another April Fool signs up.

20 years agoConst-poison ethernet and FDDI broadcast address constants, as they
rwatson [Tue, 9 Mar 2004 23:55:59 +0000 (23:55 +0000)]
Const-poison ethernet and FDDI broadcast address constants, as they
are accessed read-only.

20 years agoMake this file more generally usable:
phk [Tue, 9 Mar 2004 23:06:50 +0000 (23:06 +0000)]
Make this file more generally usable:

Trigger not only on diskless booting sysctls being set, but also
on the existence of the file "/etc/diskless".  But do not try to
extract IP# related keywords in that case.

Add a general "remount" facility to allow non-NFS remounting.

20 years agoMake libgeom usable by C++ programs:
jhb [Tue, 9 Mar 2004 21:14:18 +0000 (21:14 +0000)]
Make libgeom usable by C++ programs:
- Add DECL wrappers to libgeom.h.
- Rename structure members in libgeom.h to use a lg_ prefix for member
  names.  This is required because a few structures had members named
  'class' which made g++ very unhappy.
- Catch gstat(8) and gconcat(8) up to these API changes.

Reviewed by: phk

20 years agoRemove duplicate code.
jb [Tue, 9 Mar 2004 20:53:01 +0000 (20:53 +0000)]
Remove duplicate code.

Requested by: bde

20 years agoTrim unneeded includes from if_ndis_pccard.c and if_ndis_pci.c. Also removed
wpaul [Tue, 9 Mar 2004 20:29:21 +0000 (20:29 +0000)]
Trim unneeded includes from if_ndis_pccard.c and if_ndis_pci.c. Also removed
unused variables from if_ndis_pccard.c

20 years agoIntroduce stf_mtx to protect global softc list in if_stf. Add
rwatson [Tue, 9 Mar 2004 20:29:19 +0000 (20:29 +0000)]
Introduce stf_mtx to protect global softc list in if_stf.  Add
stf_destroy() to handle the common softc destruction path for the
two destruction sources: interface cloning destroy, and module
unload.

NOTE: sc_ro, the cached route for stf conversion, is not synchronized
against concurrent access in this change, that will follow in a future
change.

Reviewed by: pjd

20 years agoMany fixes.
kientzle [Tue, 9 Mar 2004 19:50:41 +0000 (19:50 +0000)]
Many fixes.

Portability: Thanks to Juergen Lock, libarchive now compiles cleanly
on Linux.  Along the way, I cleaned up a lot of error return codes and
reorganized some code to simplify conditional compilation of certain
sections.

Bug fixes:
  * pax format now actually stores filenames that are 101-154
    characters long.
  * pax format now allows newline characters in extended attributes
    (this fixes a long-standing bug in ACL handling)
  * mtime/atime are now restored for directories
  * directory list is now sorted prior to fix-up to permit
    correct restore of non-writable dir heirarchies

20 years agoIntroduce faith_mtx to protect the if_faith global softc list.
rwatson [Tue, 9 Mar 2004 19:23:06 +0000 (19:23 +0000)]
Introduce faith_mtx to protect the if_faith global softc list.
Push if_faith softc destruction logic into faith_destroy() so that
it can be called after softc list removal in both the clone destroy
and module unload paths.

20 years agoIf the resource listing obtained from BUS_GET_RESOURCE_LIST() in
wpaul [Tue, 9 Mar 2004 18:39:40 +0000 (18:39 +0000)]
If the resource listing obtained from BUS_GET_RESOURCE_LIST() in
ndis_probe_pci() doesn't contain an entry for an IRQ resource, try to
force one to be routed to us anyway by adding an extra call to
bus_alloc_resource(). If this fails, then we have to abort the attach.

Patch provided by jhb, tweaked by me.

20 years agoMake it possible to ``.undef ${VAR}'' (expanding VAR to get
ru [Tue, 9 Mar 2004 17:36:55 +0000 (17:36 +0000)]
Make it possible to ``.undef ${VAR}'' (expanding VAR to get
the variable name to undef).

Submitted by: Cyrille Lefevre

20 years agoIntroduce lo_mtx to protect the global loopback softc list. I'm not
rwatson [Tue, 9 Mar 2004 17:27:48 +0000 (17:27 +0000)]
Introduce lo_mtx to protect the global loopback softc list.  I'm not
really sure why we have a softc list for if_loop, given that it
can't be unloaded, but that's an issue to revisit in the future as
corrupting the softc list would still cause panics.

Reviewed by: benno

20 years agoIntroduce disc_mtx to protect the global softc list in if_disc.
rwatson [Tue, 9 Mar 2004 16:31:19 +0000 (16:31 +0000)]
Introduce disc_mtx to protect the global softc list in if_disc.

Since there are two destroy paths for if_disc interfaces --
module unload and cloan interface destroy, create a new utility
function disc_destroy(), which is callded on a softc after it
has been removed from the global softc list; the cloaner and
module unload entry paths will both remove it before calling
disc_destroy().

Reviewed by: pjd

20 years agoFix an integer overflow when dealing with very large volumes. This bug
le [Tue, 9 Mar 2004 12:45:43 +0000 (12:45 +0000)]
Fix an integer overflow when dealing with very large volumes.  This bug
prevented newfs to work on volumes that are larger than 1TB.

PR:             63577
Submitted by:   Masaki Takakashi <mtakahashi@se.gtd.cosmo.co.jp>
Approved by:    grog (mentor), bde

20 years agoFix the easy warnings:
dwmalone [Tue, 9 Mar 2004 11:57:28 +0000 (11:57 +0000)]
Fix the easy warnings:

1) Avoid shadowing index.
2) Constness.
3) Missing prototype for ifcmd.
4) Missing include of string.h.
5) Avoid shadowing error function.
6) ANSI definition for main.

20 years agoMisc fixes brought to light by WARNS=6:
dwmalone [Tue, 9 Mar 2004 11:35:43 +0000 (11:35 +0000)]
Misc fixes brought to light by WARNS=6:

1) Constness, unusedness and size_tness.
2) Don't clobber the value returned by hid_report_size in the daemon case.
3) Don't misspell "sizeof buf" as 100.
4) Don't run off the end of a buffer if the pid is about a google.
5) Avoid shadowing the usage function.

20 years ago- Don't take sectorsize from first disk. Calculate it by finding
pjd [Tue, 9 Mar 2004 11:18:53 +0000 (11:18 +0000)]
- Don't take sectorsize from first disk. Calculate it by finding
  least common multiple of all disks sector sizes.
  This will allow to safely concatenate disks with different sector sizes.
- Mark unused function arguments.
- Other minor cleanups.

20 years agoPrint a space character between string given as a macro argument and
pjd [Tue, 9 Mar 2004 11:00:24 +0000 (11:00 +0000)]
Print a space character between string given as a macro argument and
bio description.