phk [Wed, 16 Mar 2005 07:35:06 +0000 (07:35 +0000)]
Add mnt_hashseed to struct mount and initialize it witn PRNG bits, use
it to get better hashing in vfs_hash.
In case of an insert collision in vfs_hash_insert(), put the loosing vnode
on a special list so that vfs_hash_remove() can just assume that it is on
a list.
iedowse [Wed, 16 Mar 2005 02:34:50 +0000 (02:34 +0000)]
Enable ehci by default on i386 and amd64. It had got to the stage
where having this disabled was actually hurting us, since so many
BIOSes include legacy USB emulation that takes control of all usb
ports and only the ehci driver knows how to disable it.
imp [Tue, 15 Mar 2005 23:58:55 +0000 (23:58 +0000)]
Clarify that the end argument meaning for rman_reserve_resource_bound
is the highest acceptable value for the ending of the resource being
allocated. One could also believe that it is the highest starting
value of the resource. The code definitely expects the former, but I
could find no documentation of this apart from TFSC.
imp [Tue, 15 Mar 2005 20:28:51 +0000 (20:28 +0000)]
Sometimes, when asked to return region A..C, we'd return A+N..C+N
instead of failing.
When looking for a region to allocate, we used to check to see if the
start address was < end. In the case where A..B is allocated already,
and one wants to allocate A..C (B < C), then this test would
improperly fail (which means we'd examine that region as a possible
one), and we'd return the region B+1..C+(B-A+1) rather than NULL.
Since C+(B-A+1) is necessarily larger than C (end argument), this is
incorrect behavior for rman_reserve_resource_bound().
The fix is to exclude those regions where r->r_start + count - 1 > end
rather than r->r_start > end. This bug has been in this code for a
very long time. I believe that all other tests against end are
correctly done.
This is why sio0 generated a message about interrupts not being
enabled properly for the device. When fdc had a bug that allocated
from 0x3f7 to 0x3fb, sio0 was then given 0x3fc-0x404 rather than the
0x3f8-0x3ff that it wanted. Now when fdc has the same bug, sio0 fails
to allocate its ports, which is the proper behavior. Since the probe
failed, we never saw the messed up resources reported.
I suspect that there are other places in the tree that have weird
looping or other odd work arounds to try to cope with the observed
weirdness this bug can introduce. These workarounds should be located
and eliminated.
Minor debug write fix to match the above test done as well.
imp [Tue, 15 Mar 2005 20:15:15 +0000 (20:15 +0000)]
Fix a debugging printf. The order of start/end was inconsistant with
all the other start/end debugs, causing momentary confusion when the
output was examined.
obrien [Tue, 15 Mar 2005 18:43:36 +0000 (18:43 +0000)]
Ensure GCC does not use FP registers in integer code.
I think all we really need is -fno-sse2.
I really don't like cluttering up the compiler invocation,
but this bigger hammer will fix reported problems for now.
das [Tue, 15 Mar 2005 15:53:39 +0000 (15:53 +0000)]
Remove fpsetsticky(). This was added for SysV compatibility, but due
to mistakes from day 1, it has always had semantics inconsistent with
SVR4 and its successors. In particular, given argument M:
- On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags
and *sets* the new flag word to M. (NetBSD, too?)
- On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M
and leaves the remaining flags unchanged (modulo a small bug on amd64.)
- On FreeBSD/ia64, it is not implemented.
There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps
and apps ported from other operating systems, so the best approach
seems to be to kill the function and fix any apps that break. I
couldn't find any ports that use it, and any such ports would already
be broken on FreeBSD/ia64 and Linux anyway.
By the way, the routine has always been undocumented in FreeBSD,
except for an MLINK to a manpage that doesn't describe it. This
manpage has stated since 5.3-RELEASE that the functions it describes
are deprecated, so that must mean that functions that it is *supposed*
to describe but doesn't are even *more* deprecated. ;-)
Note that fpresetsticky() has been retained on FreeBSD/i386. As far
as I can tell, no other operating systems or ports of FreeBSD
implement it, so there's nothing for it to be inconsistent with.
harti [Tue, 15 Mar 2005 14:52:10 +0000 (14:52 +0000)]
Style: Move a variable from a local scope up to the begin of the function.
Rename result variable so common code becomes more visible.
Rename freePtr to freeResult to make clear what pointer must be freed.
jeff [Tue, 15 Mar 2005 14:38:16 +0000 (14:38 +0000)]
- Now that there are no external users of vfree() make it static.
- Move VSHOULDBUSY, VSHOULDFREE, and VTRYRECYCLE into vfs_subr.c so
no one else attempts to grow a dependency on them.
- Now that objects with pages hold the vnode we don't have to do unlocked
checks for the page count in the vm object in VSHOULDFREE. These three
macros could simply check for holdcnt state transitions to determine
whether the vnode is on the free list already, but the extra safety
the flag affords us is probably worth the minimal cost.
- The leafonly sysctl and code have been dead for several years now,
remove the sysctl and the code that employed it from vtryrecycle().
- vtryrecycle() also no longer has to check the object's page count as
the object holds the vnode until it reaches 0.
harti [Tue, 15 Mar 2005 14:27:29 +0000 (14:27 +0000)]
VarParseLong: move the detection of the modifier separator ':' into
the loop. Add a comment why the 'consumed' variable is updated.
Rename lengthPtr to consumed.
harti [Tue, 15 Mar 2005 14:25:24 +0000 (14:25 +0000)]
Yet another version of passing the last line to ParseFinishLine().
It turns out that some ports use the obscure feature of spreading
a dependency block across multiple include files. While this seems
bad style, allow it for now and call said function only at end of
all input to process the really last line of everything.
jeff [Tue, 15 Mar 2005 14:14:09 +0000 (14:14 +0000)]
- In vm_page_insert() hold the backing vnode when the first page
is inserted.
- In vm_page_remove() drop the backing vnode when the last page
is removed.
- Don't check the vnode to see if it must be reclaimed on every
call to vm_page_free_toq() as we only check it now when it is
actually required. This saves us two lock operations per call.
jeff [Tue, 15 Mar 2005 13:49:33 +0000 (13:49 +0000)]
- Assume that all lower filesystems now support proper locking. Assert
that they set v->v_vnlock. This is true for all filesystems in the
tree.
- Remove all uses of LK_THISLAYER. If the lower layer is locked, the
null layer is locked. We only use vget() to get a reference now.
null essentially does no locking. This fixes LOOKUP_SHARED with
nullfs.
- Remove the special LK_DRAIN considerations, I do not believe this is
needed now as LK_DRAIN doesn't destroy the lower vnode's lock, and
it's hardly used anymore.
- Add one well commented hack to prevent the lowervp from going away
while we're in it's VOP_LOCK routine. This can only happen if we're
forcibly unmounted while some callers are waiting in the lock. In
this case the lowervp could be recycled after we drop our last ref
in null_reclaim(). Prevent this with a vhold().
phk [Tue, 15 Mar 2005 12:39:30 +0000 (12:39 +0000)]
Disable two users of findcdev. They do the wrong thing now and will
need to be fixed. In both cases the API should be reengineered to do
something (more) sensible.
philip [Tue, 15 Mar 2005 10:45:42 +0000 (10:45 +0000)]
Cast time_t to uintmax_t so they can be printed as %ju without breaking on
various architectures. This should appease tinderbox on alpha and not break
it anywhere else.
imp [Tue, 15 Mar 2005 08:02:47 +0000 (08:02 +0000)]
If we fail a sanity check for the resources just allocated, make sure
that we free that resource. All the other resources are freed in
their own routine, but since we haven't saved a pointer to this one,
it is leaked. This is the failure case that lead to the sio ports
that weren't working, I think.
jeff [Tue, 15 Mar 2005 01:42:58 +0000 (01:42 +0000)]
- Destroy the vnode object earlier in VOP_RECLAIM as we need more of
the vnode valid before the vm flushes pages.
- Get rid of some extraneous uses of the vnode interlock.
philip [Mon, 14 Mar 2005 22:16:39 +0000 (22:16 +0000)]
Add snmp_pf, a bsnmpd module for monitoring (not managing!) pf firewalls.
Currently implemented are most things related to states and interfaces, todo
are address tables and altq. I've tried to keep this roughly in sync with a
project implementing this for net-snmpd.
rwatson [Mon, 14 Mar 2005 22:15:14 +0000 (22:15 +0000)]
In tcp_usr_send(), broaden coverage of the socket buffer lock in the
non-OOB case so that the sbspace() check is performed under the same
lock instance as the append to the send socket buffer.
imp [Mon, 14 Mar 2005 19:09:29 +0000 (19:09 +0000)]
Only allocate 1 port for non-zero rids. Either we'll get the proper
length form the enumeration mechanism, or we're dealing with the FDCTL
register, which is only 1 port long.
harti [Mon, 14 Mar 2005 17:32:16 +0000 (17:32 +0000)]
Finish repo-copy of lib/libbsnmp/modules to usr.sbin/bsnmpd/modules.
These modules are modules for the daemon, not for the library so
they should be where the daemon is.
harti [Mon, 14 Mar 2005 17:03:34 +0000 (17:03 +0000)]
ParseModifier(): rename rw_str to value and reindent cleanup section.
ParseRestModifier() and ParseRestEnd(): move advancement of ptr to remove
a confusing calculation.
VarParseLong(): cleanup calculation of consumed.
scottl [Mon, 14 Mar 2005 16:46:28 +0000 (16:46 +0000)]
Refactor the bus_dma header files so that the interface is described in
sys/bus_dma.h instead of being copied in every single arch. This slightly
reorders a flag that was specific to AXP and thus changes the ABI there.
The interface still relies on bus_space definitions found in <machine/bus.h>
so it cannot be included on its own yet, but that will be fixed at a later
date. Add an MD <machine/bus_dma.h> for ever arch for consistency and to
allow for future MD augmentation of the API. sparc64 makes heavy use of
this right now due to its different bus_dma implemenation.
des [Mon, 14 Mar 2005 16:21:32 +0000 (16:21 +0000)]
Fix two long-standing bugs in pfs_readdir():
Since we used an sbuf of size resid to accumulate dirents, we would end
up returning one byte short when we had enough dirents to fill or exceed
the size of the sbuf (the last byte being lost to bogus NUL termination)
causing the next call to return EINVAL due to an unaligned offset. This
went undetected for a long time because I did most of my testing in
single-user mode, where there are rarely enough processes to fill the
4096-byte buffer ls(1) uses. The most common symptom of this bug is that
tab completion of /proc or /compat/linux/proc does not work properly when
many processes are running.
Also, a check near the top would return EINVAL if resid was smaller than
PFS_DELEN, even if it was 0, which is frequently the case and perfectly
allowable. Change the test so that it returns 0 if resid is 0.
pjd [Mon, 14 Mar 2005 14:24:46 +0000 (14:24 +0000)]
- Add gc_usage field to g_command structure. This will allow to define
usage for a subcommand, so no 'usage' function has to be implemented
in class library.
- Bump version number as it breaks ABI, but don't provide backward
compatibility, because there are probably no external consumers of this
geom(8).
This allows to print more precise usage for standard commands and simplify
class libraries a bit.