jeff [Mon, 24 Jan 2005 10:31:42 +0000 (10:31 +0000)]
- Remove GIANT_REQUIRED where giant is no longer required.
- Protect access to mnt_kern_flag with the mountpoint mutex.
- Use the appropriate nd flags to deal with giant in vn_open_cred().
We currently determine whether the caller is mpsafe by checking
for a valid fdidx. Any caller coming from user-space is now
mpsafe and supplies a valid fd. No kenrel callers have been
converted to mpsafe, so this check is sufficient for now.
- Use VFS_LOCK_GIANT instead of manual giant acquisition where
appropriate.
jeff [Mon, 24 Jan 2005 10:27:05 +0000 (10:27 +0000)]
- Acquire and release Giant as we enter and leave filesystems which
require it.
- Track the status of Giant with the nd flag HASGIANT.
- Release giant on return of namei() callers are not marked MPSAFE as
they already own giant.
jeff [Mon, 24 Jan 2005 10:25:44 +0000 (10:25 +0000)]
- Change all vfs syscalls to use VFS_LOCK_GIANT(), and MPSAFE nds.
- Move Giant acquisition into the few vfs syscalls that weren't already
directly acquiring it.
jeff [Mon, 24 Jan 2005 10:24:12 +0000 (10:24 +0000)]
- Simplify the cache locking. The lock order relationship with the
vnode lock is much simpler than I originally thought it would be.
Now, the cache lock is always acquired before the vnode lock.
- Provide some gotos in __getcwd() to simplify the unlocking a bit.
- Move Giant acquisition down into __getcwd().
jeff [Mon, 24 Jan 2005 10:20:59 +0000 (10:20 +0000)]
- Do not use APAUSE if LK_INTERLOCK is set. We lose synchronization
if the lockmgr interlock is dropped after the caller's interlock
is dropped.
- Change some lockmgr KTRs to be slightly more helpful.
jeff [Mon, 24 Jan 2005 10:18:31 +0000 (10:18 +0000)]
- Convert the global LK lock to a mutex.
- Expand the scope of lk to cover not only interrupt races, but also
top-half races, which includes many new uses over global top-half
only data.
- Get rid of interlocked_sleep() and use msleep or BUF_LOCK where
appropriate.
- Use the lk mutex in place of the various hand rolled semaphores.
- Stop dropping the lk lock before we panic.
- Fix getdirtybuf() callers so that they reacquire access to whatever
softdep datastructure they were inxpecting in the failure/retry
case. Previously, sleeps in getdirtybuf() could leave us with
pointers to bad memory.
- Update handling of ffs to be compatible with ffs locking changes.
jeff [Mon, 24 Jan 2005 10:12:28 +0000 (10:12 +0000)]
- Initialize and destroy the per-filesystem ufs lock where appropriate.
- Use the buffer lock on the superblock buf to serialize calls to
sbupdate.
- Set the MNTK_MPSAFE flag when QUOTA is not defined in the kernel.
jeff [Mon, 24 Jan 2005 10:08:35 +0000 (10:08 +0000)]
- Don't use atomic operations to deal with the active array, instead
it is now quite naturally protected by the ufsmount mutex.
- Use the ufs lock to protect various fields in struct fs, primarily the
cg summary needs protection to avoid allocation races. Several
functions have been slightly re-arranged to reduce the number of
lock operations.
- Adjust several functions (blkfree, freefile, etc.) to accept a
ufsmount as an argument so that we may access the ufs lock.
jeff [Mon, 24 Jan 2005 10:01:10 +0000 (10:01 +0000)]
- Add a mutex to the ufsmount structure. This mutex is used to protect
any per-instance global data that is not already protected by a
buf or vnode lock. Presently, only fields in ffs's struct fs utilize
this lock.
- Sort some ufsmount members so that fields used for quotas are grouped
together. This is in anticipation of quota locking.
jeff [Mon, 24 Jan 2005 09:57:35 +0000 (09:57 +0000)]
- Add two new flags to the nd structure. MPSAFE indicates that the
caller may not be holding Giant, and namei() should acquire it as
necessary. HASGIANT is used to indicate when namei() is returning
with a reference to a vnode that requires giant, and giant is locked.
- Add the macro NDHASGIANT() which can be used in conjunction with
VFS_UNLOCK_GIANT() in callers who have marked the nd with MPSAFE.
jeff [Mon, 24 Jan 2005 09:53:46 +0000 (09:53 +0000)]
- Add the mount flag MNTK_MPSAFE which indicates whether or not Giant
must be held when any vnode owned by the filesystem is manipulated.
- Add VFS_LOCK_GIANT and VFS_UNLOCK_GIANT macros which are used to
conditionally lock and unlock Giant based on a particular mountpoint.
imp [Mon, 24 Jan 2005 06:54:05 +0000 (06:54 +0000)]
Ignore the expected function number.
NetBSD went this route a while ago. FreeBSD originally tried this to
cope with multifunction cards. However, it turns out that we're
better off not worrying about the function number, and instead worry
about the function type for the function. This has worked well in
NetBSD, and all FreeBSD's relevant drivers have been converted.
# I'll rework the macros that specify them shortly, as soon as I can
# come up with a good, compatible way to deal...
das [Sun, 23 Jan 2005 22:05:33 +0000 (22:05 +0000)]
Many changes, including the following major ones:
- Rearrange the list of functions into categories.
- Remove the ulps column. It was appropriate for only some
of the functions in the list, and correct for even fewer
of them.
- Add some new paragraphs, and remove some old ones about
NaNs that may do more harm than good.
- Document precisions other than double-precision.
rwatson [Sun, 23 Jan 2005 21:34:00 +0000 (21:34 +0000)]
Bump the default maximum on nfsd processes from 20 to 256. Real-world
measurements suggest that higher degrees of parallelism for large
numbers of clients help performance substantially.
Submitted by: Eric Anderson <anderson at centtech dot com>
rwatson [Sun, 23 Jan 2005 20:59:19 +0000 (20:59 +0000)]
When retrieving the current per-jails securelevel for a sysctl read,
don't acquire the prison mutex, as it's an integer read and races
here don't make a difference.
iedowse [Sun, 23 Jan 2005 17:42:48 +0000 (17:42 +0000)]
Attempt to describe the race conditions that must be considered
when using the callout subsystem. Show how the callout_pending(),
callout_active() and callout_deactivate() macros can be used to
achieve simpler race-free callout semantics in many situations.
das [Sun, 23 Jan 2005 16:49:49 +0000 (16:49 +0000)]
- Document ldexpf().
- Although ldexp() is in libc for backwards compatibility, ldexpf() is
in its proper place in libm. Document both as being in libm.
- The ldexp() and ldexpf() functions conform to C99.
das [Sun, 23 Jan 2005 16:49:40 +0000 (16:49 +0000)]
- Document frexpf().
- Neither frexp() nor frexpf() set errno.
- Although frexp() is in libc for backwards compatibility, frexpf() is
in its proper place in libm. Document both as being in libm.
- The frexp() and frexpf() functions conform to C99.
pjd [Sun, 23 Jan 2005 16:43:55 +0000 (16:43 +0000)]
We cannot use sed(1), because rc.d/gbde has to be called before
rc.d/mountcritlocal and sed(1) is placed in /usr/bin/. Other useful tools
for this task are also placed in /usr/ (tr(1), awk(1)), so I implemented
local_tr() function which works simlar to tr(1).
Reported by: Amir Shalem <amir@boom.org.il>
MFC after: 1 week
gnn [Sun, 23 Jan 2005 16:02:48 +0000 (16:02 +0000)]
Submitted by: George V. Neville-Neil (gnn at freebsd dot org)
Reviewed by: Kame Project (including Itojun-san, Jinmei-san and Suzuki-san)
Approved by: Robert Watson (robert at freebsd dot org)
Obtained from: Kame Project and OpenBSD
Replace manual pages that may have violated the IETF's Copyright.
All come from the Kame tree.
Several were from OpenBSD except for ip6.4, and the inet6* pages which were
rewritten by me.
All of the text is new and drawn from reading the code and
documentation.
rwatson [Sun, 23 Jan 2005 15:57:07 +0000 (15:57 +0000)]
The final argument to verify_krb_v5_tgt() is the debug flag, not the
ticket forwardable flag, so key generation of debugging output to
"debug" rather than "forwardable".
mjacob [Sun, 23 Jan 2005 06:26:45 +0000 (06:26 +0000)]
Don't set ZIO for 23XX for target mode (use fast posting instead).
Use the correct number of handles for multihandle returns.
Very, very, rarely on some SMP systems we've seen an 'unstable' type
in the response queue. I dunno whether or not it's a bug in our
handling, or whether there's a cache incoherency issue, but
try to guard against it.
imp [Sun, 23 Jan 2005 03:03:58 +0000 (03:03 +0000)]
Protect against wrapping. This appaers to fix some hangs that people
have seen in the isa pnp case where a resource buts up against
0xffffffff. This would only impact when the board was booted without
ACPI.
Submitted by: Ed Maste (freebsd-stable <20050103145720.GA90754@sandvine.com>)
MFC After: 5 days
mjacob [Sat, 22 Jan 2005 22:46:45 +0000 (22:46 +0000)]
This is a somewhat imperfect means to try and bring FreeBSD forward in
its ability to automatically scan and attach luns for modern storage
which has luns in the 0..1000 range, not 0..7.
The correct thing would be to do REPORT LUNS for devices whose LUN0
version shows a version >= SCSI3, but lacking that we should be able
to search higher than LUN 7 if we're >= SCSI3 with no ill effects.
This change keeps all of the QUIRK_HILUNS quirks, obeys the QUIRK_NOLUNS,
and introduces a QUIRK_NOHILUNS which will keep searches above LUN 7
happening for devices that report >= SCSI3 compliance. I doubt the latter
will be needed, but you never know.
This allowed me to randomly scan and attach > 500 disks at a time in
a situation where quirking for QUIRK_HILUNS wasn't practical (the
vendor id and product id changes of the virtualization changes
constantly).
dougb [Sat, 22 Jan 2005 21:34:10 +0000 (21:34 +0000)]
Scot pointed out that the dynamic zone example didn't seem to "flow"
with the rest of the examples, so after discussion with him and gshapiro,
re-sort the examples, and add more comments to make things very obvious.
Also, divide the examples between example.{com|net|org} to make things
even more obvious, and use the same RFC 1918 block for all examples.
Pointed out by: Scot W. Hetzel <hetzels@westbend.net>
bms [Sat, 22 Jan 2005 21:14:46 +0000 (21:14 +0000)]
Add a note about the slot number not necessarily indicating the physical
location of a PCI device in the system chassis.
Remove the note about PAE.
Update document date.
Update my email address.
Update copyright.
rwatson [Sat, 22 Jan 2005 21:14:21 +0000 (21:14 +0000)]
When DDB is not defined, don't implement witness_thread_has_locks() and
witness_proc_has_locks(), as they are unused, which results in a compiler
error. This problem was introduced with the implementation of "show
alllocks".
Spotted by: Artem Kuchin <matrix at itlegion dot ru>
rwatson [Sat, 22 Jan 2005 20:31:29 +0000 (20:31 +0000)]
Update mac_test for MAC Framework policy entry points System V IPC
objects (message queues, semaphores, shared memory), exercising and
validating MAC labels on these objects.
Submitted by: Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from: TrustedBSD Project
Sponsored by: DARPA, SPAWAR, McAfee Research
sam [Sat, 22 Jan 2005 20:12:05 +0000 (20:12 +0000)]
o replace out-of-line copy of FCS w/ a flag that indicates the
frame includes FCS (requires applications to be updated, but since
we weren't doing the out-of-line FCS stuff anyway app changes
were needed already)
o add a flag to indicate padding exists between the 802.11 header and
the payload (e.g. for Atheros cards)
o diff reducation against netbsd
pjd [Sat, 22 Jan 2005 19:56:03 +0000 (19:56 +0000)]
- Don't destroy UMA zone on error in mdcreate_malloc(), because we need it
in mddestroy() to properly free already allocated memory.
This fixes a panic when we want to create too big memory backed device
with preallocate memory (-o reserve).
- Remove redundant { }.
delphij [Sat, 22 Jan 2005 19:35:48 +0000 (19:35 +0000)]
Make sure that we don't define INET6 when NO_INET6 is defined.
Without this change, when running netstat with a kernel without
INET6 built in, you will get a complain at the end of "netstat -s"
output.
das [Sat, 22 Jan 2005 06:03:40 +0000 (06:03 +0000)]
Replace the ldexp() implementation in libc with a renamed copy of the
scalbn() implementation from libm. (The two functions are defined to
be identical, but ldexp() lives in libc for backwards compatibility.)
The old ldexp() implementation...
- was more complicated than this one
- set errno instead of raising FP exceptions
- got some corner cases wrong
(e.g. ldexp(1.0, 2000) in round-to-zero mode)
The new implementation lives in libc/gen instead of
libc/$MACHINE_ARCH/gen, since we don't need N copies of a
machine-independent file. The amd64 and i386 platforms
retain their fast and correct MD implementations and
override this one.
wes [Fri, 21 Jan 2005 22:20:25 +0000 (22:20 +0000)]
Add an option to suppress the creation of the .snap directory in
the new filesystem. This is intended for memory and vnode filesystems
that will never be fsck'ed or dumped.
Obtained from: St. Bernard Software RAPID
MFC after: 2 weeks
wes [Fri, 21 Jan 2005 22:13:25 +0000 (22:13 +0000)]
Improved error checking for existence of a .snap directory to
generate snapshots in when -L is requested. If the .snap directory
does not exist, or is not a directory, issue a warning and revert
to the non- live behavior.