Mohan Srinivasan [Mon, 27 Nov 2006 19:06:43 +0000 (19:06 +0000)]
Fix for a bug caused by a race when 2 threads lookup the same
file. Leave the loser's lock(s) initialized, so the reclaim logic can
unconditionally destroy them when that race occurs (or if the vfs hash
insert happened to fail for some other reason). Thanks to ups@ for a
careful review of the code.
Reported by : Kris Kennaway
Marius Strobl [Mon, 27 Nov 2006 18:39:02 +0000 (18:39 +0000)]
Refine the previous change to only call bus_dmamap_sync() in case of
an URQ_REQUEST when DMA segments are passed to usbd_start_transfer();
when the request doesn't include the optional data buffer the size of
the transfer (xfer->length) is 0, in which case usbd_transfer() won't
create a DMA map but call usbd_start_transfer() with no DMA segments.
With the previous change this could result in the bus_dmamap_sync()
implementation dereferencing the NULL-pointer passed as the DMA map
argument.
While at it fix what appears to be a typo in usbd_start_transfer();
in order to determine wheter usbd_start_transfer() was called with
DMA segments check whether the number of segments is > 0 rather than
the pointer to them being > 0.
- Move mentionings of required drivers to the SYNOPSIS where they belong
- Remove cruft (XiG, sheesh) from the EXAMPLES section and re-arrange things to make
somewhat more sense
- Fix an Xref to manpage from ports to mention the corresponsing port
- Remove commented out HISTORY section header
Yaroslav Tykhiy [Mon, 27 Nov 2006 17:54:28 +0000 (17:54 +0000)]
systat(1) reaches WARNS=6 on i386 and amd64. This is good
for catching general regressions in future. Unfortunately,
it still displays some problems at WARNS=6 on architectures
with stricter alignment requirements, e.g., ia64.
Yaroslav Tykhiy [Mon, 27 Nov 2006 17:34:40 +0000 (17:34 +0000)]
The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible. However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks. So setting them to NULL at the very
beginning won't hurt.
Yaroslav Tykhiy [Mon, 27 Nov 2006 17:24:36 +0000 (17:24 +0000)]
+ WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
not to an empty string.
Ruslan Ermilov [Mon, 27 Nov 2006 16:55:14 +0000 (16:55 +0000)]
Push the detection of threading libs support down to ngctl/Makefile
as the latter can be built without threading (with the loss of line
editing functionality).
Tim Kientzle [Mon, 27 Nov 2006 16:30:32 +0000 (16:30 +0000)]
Improve support for large ISOs:
* Correct a signed/unsigned problem that broke handling of files >2G.
* Implement "skip" support for much faster "tar -t".
Thanks to: Robert Sciuk for sending me a DVD that illustrated the first problem
Yaroslav Tykhiy [Mon, 27 Nov 2006 15:26:26 +0000 (15:26 +0000)]
Allow for large scale factors. C99 warrants that
ULLONG_MAX is not less than 2^64-1; and uintmax_t
cannot be more narrow than unsigned long long.
This allows for scale factors up to Exa inclusively.
Use plain int for the scale index to be consistent
with ifcmds.c and enum.
John Birrell [Mon, 27 Nov 2006 01:35:11 +0000 (01:35 +0000)]
Back out half of my previous change to support parallel makes.
The generated Makefile clashes with the src/bin/sh/Makefile, causing
it to try to use a rule to build something it doesn't need to.
Andrew Thompson [Mon, 27 Nov 2006 00:35:40 +0000 (00:35 +0000)]
Sync with the OpenBSD port of RSTP
- use flags rather than sperate ioctls for edge, p2p
- implement p2p and autop2p flags
- define large pathcost constant as ULL
- show bridgeid and rootid in ifconfig
Sam Leffler [Sun, 26 Nov 2006 22:48:03 +0000 (22:48 +0000)]
Default the rate sets for 802.11 operating modes so drivers aren't
required to. Note this only happens when drivers don't set them
up before calling ieee80211_ifattach so this change is backwards
compatible.
Kip Macy [Sun, 26 Nov 2006 22:31:23 +0000 (22:31 +0000)]
Fix "shutdown -r" and "shutdown -h"
- "shutdown -r" will reset the system
- "shutdown -h" will power off the system
We don't drop into OFW as newer versions of solaris don't do this either
Yaroslav Tykhiy [Sun, 26 Nov 2006 20:08:40 +0000 (20:08 +0000)]
Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb. Could be triggered on arches
where ifdata counters had 64 bits.
Reported by: Miroslav Slavkov on -net
MFC after: 3 days
Yaroslav Tykhiy [Sun, 26 Nov 2006 19:25:10 +0000 (19:25 +0000)]
The real contents of this file were repeated twice.
The repetition was harmless due to a usual #ifndef _FOO_H_ wrapper.
Fortunately, nobody started to hack the second copy,
so just remove it from the file.
Florent Thoumie [Sun, 26 Nov 2006 19:03:19 +0000 (19:03 +0000)]
Remove leading dollar sign in rcvar command output.
There's no dollar use in variable assignment in sh.
Assuming this is can be expected behavior for some
people, this change won't be MFC'ed to RELENG_6.
Tim Kientzle [Sun, 26 Nov 2006 19:00:50 +0000 (19:00 +0000)]
Write-blocking cleanup, largely thanks to Colin Percival (cperciva@).
* If write block size is zero, don't block at all.
This supports the unusual requirement of applications
that need "no-delay" writes.
* Expose _write_finish_entry() to give such applications more
control over write boundaries. (Normal applications do not
need this, as entries are completed automatically.)
* Correct the type of write callbacks; this is a minor API
change that does not affect the ABI.
* Correct the error handling in _write_next_header() around
completing the previous entry.
* Correct the documentation for block-size markers: Remove
docs for the long-defunct _read_set_block_size(); document
all of the write block size manipulators.
Maxim Konovalov [Sun, 26 Nov 2006 18:49:44 +0000 (18:49 +0000)]
o From the submitter: dos2unixchr will convert to lower case if
LCASE_BASE or LCASE_EXT or both are set. But dos2unixfn uses
dos2unixchr separately for the basename and the extension. So if
either LCASE_BASE or LCASE_EXT is set, dos2unixfn will convert both
the basename and extension to lowercase because it is blindly
passing in the state of both flags to dos2unixchr. The bit masks I
used ensure that only the state of LCASE_BASE gets passed to
dos2unixchr when the basename is converted, and only the state of
LCASE_EXT is passed in when the extension is converted.
Andrew Thompson [Sun, 26 Nov 2006 18:43:48 +0000 (18:43 +0000)]
use two stage creation of stp ports, this means that the stp variables can be
set before the port is marked STP and they will no longer be overwrittten
Ruslan Ermilov [Sun, 26 Nov 2006 14:36:34 +0000 (14:36 +0000)]
- When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.
- Don't build ngctl(8) and cached(8) if threading libs aren't built.
- Fix various issues in a cached(8) makefile.
Ariff Abdullah [Sun, 26 Nov 2006 12:24:06 +0000 (12:24 +0000)]
Welcome to Once-a-year Sound Mega-Commit. Enjoy numerous updates and fixes
in every sense.
General
-------
- Multichannel safe, endian safe, format safe
* Large part of critical pcm filters such as vchan.c, feeder_rate.c,
feeder_volume.c, feeder_fmt.c and feeder.c has been rewritten so that
using them does not cause the pcm data to be converted to 16bit little
endian.
* Macrosses for accessing pcm data safely are defined within sound.h in
the form of PCM_READ_* / PCM_WRITE_*
* Currently, most of them are probably limited for mono/stereo handling,
but the future addition of true multichannel will be much easier.
- Low latency operation
* Well, this require lot more works to do not just within sound driver,
but we're heading towards right direction. Buffer/block sizing within
channel.c is rewritten to calculate precise allocation for various
combination of sample/data/rate size. As a result, applying correct
SNDCTL_DSP_POLICY value will achive expected latency behaviour simmilar
to what commercial 4front driver do.
* Signal handling fix. ctrl+c of "cat /dev/zero > /dev/dsp" does not
result long delay.
* Eliminate sound truncation if the sound data is too small.
DIY:
1) Download / extract
http://people.freebsd.org/~ariff/lowlatency/shortfiles.tar.gz
2) Do a comparison between "cat state*.au > /dev/dsp" and
"for x in state*.au ; do cat $x > /dev/dsp ; done"
- there should be no "perceivable" differences.
Double close for PR kern/31445.
CAVEAT: Low latency come with (unbearable) price especially for poorly
written applications. Applications that trying to act smarter
by requesting (wrong) blocksize/blockcount will suffer the most.
Fixup samples/patches can be found at:
http://people.freebsd.org/~ariff/ports/
- Switch minimum/maximum sampling rate limit to "1" and "2016000" (48k * 42)
due to closer compatibility with 4front driver.
Discussed with: marcus@ (long time ago?)
- All driver specific sysctls in the form of "hw.snd.pcm%d.*" have been
moved to their own dev sysctl nodes, notably:
hw.snd.pcm%d.vchans -> dev.pcm.%d.vchans
Bump __FreeBSD_version.
Driver specific
---------------
- Ditto for sysctls.
- snd_atiixp, snd_es137x, snd_via8233, snd_hda
* Numerous cleanups and fixes.
* _EXPERIMENTAL_ polling mode support using simple callout_* mechanisme.
This was intended for pure debugging and latency measurement, but proven
good enough in few unexpected and rare cases (such as problematic shared
IRQ with GIANT devices - USB). Polling can be enabled/disabled through
dev.pcm.0.polling. Disabled by default.
- snd_ich
* Fix possible overflow during speed calibration. Delay final
initialization (pcm_setstatus) after calibration finished.
PR: kern/100169
Tested by: Kevin Overman <oberman@es.net>
* Inverted EAPD for few Nec VersaPro.
PR: kern/104715
Submitted by: KAWATA Masahiko <kawata@mta.biglobe.ne.jp>
Thanks to various people, notably Joel Dahl, Yuriy Tsibizov, Kevin Oberman,
those at #freebsd-azalia @ freenode and others for testing.
Tim Kientzle [Sun, 26 Nov 2006 05:39:28 +0000 (05:39 +0000)]
Unbreak libarchive on arm. Two parts of libarchive relied on a
traditional shortcut of defining on-disk layouts using structures of
character arrays. Unfortunately, as recently discussed on cvs-all@,
this usage is not actually sanctioned by the standards and
specifically fails on GCC/arm (unless your data structures happen to
be "naturally aligned").
The new code defines offsets/sizes for data fields and accesses
them using explicit pointer arithmetic, instead of casting to
a structure and accessing structure fields. In particular,
the new code is now clean with WARNS=6 on arm.
Ruslan Ermilov [Sat, 25 Nov 2006 20:38:56 +0000 (20:38 +0000)]
- In nd6_rtrequest(), when caching an rtentry, don't forget
to add a reference to it; otherwise, we could later access
a freed memory. This is believed to fix panics some users
were observing when running route6d(8), and is similar to
the fix in sys/netinet/if_ether.c,v 1.139 by glebius@.
PR: kern/93910, kern/105437
Testing by: Wojciech Puchar (still ongoing)
- Add rtentry locking to nd6_output() similar to rt_check().
Colin Percival [Sat, 25 Nov 2006 07:30:12 +0000 (07:30 +0000)]
Three minor bug fixes:
1. When downloading metadata files, make sure we only download each
file once; without this fix, "freebsd-update fetch" will fail the first
time it is run if there have been no updates yet for the installed
release.
2. If the FOO kernel is installed in /boot/kernel instead of /boot/FOO
and the /boot/FOO directory does not exist, don't try to update
/boot/FOO. This is an issue only where an update involves adding a new
kernel module.
3. When removing files and directories, operate in reverse
lexographical order, in order to ensure that files are removed before
the directory which contains them.
Make sure we do not sleep while locks are held. Change the malloc(9)
flags from M_WAITOK to M_NOWAIT. This should not cause any problems
since the calling code appears to properly handle failed allocations.
Warner Losh [Fri, 24 Nov 2006 13:10:30 +0000 (13:10 +0000)]
Make it clear that the device name may contain '/' characters to place
a device in a subdirectory. Also explicitly state that the name is
constructed using fmt like printf would print it.
Robert Watson [Fri, 24 Nov 2006 11:53:16 +0000 (11:53 +0000)]
Push Giant a bit further off the NFS server in a number of straight
forward cases by converting from unconditional acquisition of Giant
around vnode operations to conditional acquisition:
- Remove nfsrv_access_withgiant(), and cause nfsrv_access() to now
assert that Giant will be held if it is required for the vnode.
- Add nfsrv_fhtovp_locked(), which will drop the NFS server lock if
required, and modify nfsrv_fhtovp() to conditionally acquire
Giant if required.
- In the VOP's not dealing with more than one vnode at a time (i.e.,
not involving a lookup), conditionally acquire Giant.
This removes Giant use for MPSAFE file systems for a number of quite
important RPCs, including getattr, read, write. It leaves
unconditional Giant acquisitions in vnode operations that interact
with the name space or more than one vnode at a time as these
require further work.
Xin LI [Fri, 24 Nov 2006 09:07:26 +0000 (09:07 +0000)]
Make use of mk/ files from a fresh source tree, rather than
the currently installed ones. This makes it possible to use
the script against Makefiles that uses bsd.own.mk on an old
system.
Tim Kientzle [Fri, 24 Nov 2006 05:48:04 +0000 (05:48 +0000)]
Fill in a couple of missing casts: clarify one narrowing conversion
and correct the use of unary minus with an unsigned value. (The unary
minus here is actually being used as a bitwise operation, which is
unusual enough to deserve a clarifying cast.)