Peter Wemm [Wed, 24 Jul 2002 22:27:35 +0000 (22:27 +0000)]
Fully exterminate nfsd_srvargs and nfsd_cargs. They were either unused
or giant NOP's. There was a credential in srvargs that was giving
rwatson some heartburn. :-)
Fake a resume method for this chip via calling detach/attach. This lets
ThinkPads using this chip to have sound after a suspend/resume sequence
without resorting to kldunload/kldload.
When single threading a multithreaded program, awaken the
'single threading thread' when the last other thread suspends.
I had this code in there before but it seems to have been
accidentally deleted somewhere along the way. This would only affect
multithreaded processes.
- ntohs() returns unsigned value.
- use strlcpy.
- snprintf can return negative value, so cope with it.
- tweak interface index on interface locals (ff01::/16).
- removed unused macros.
- removed a macro that uses only once (in a trivial context).
- explicitly say goodbye to ENI_xxx.
- constify struct afd.
Robert Drehmel [Wed, 24 Jul 2002 18:37:22 +0000 (18:37 +0000)]
- Add a COMPATIBILITY section explaining that the default
behaviour of obtaining the affected terminal has changed.
- Refer to the user's terminal instead of the current
terminal session.
- Tell the reader what the utility does when it is invoked
without arguments.
Robert Watson [Wed, 24 Jul 2002 15:42:22 +0000 (15:42 +0000)]
Under #ifdef DIAGNOSTIC, NULL out componentname pointers if we free the
pnbuf to increase the chances of detecting use of a free'd name buffer
if SAVENAME or SAVESTART wasn't passed in. Curiously, running with these
changes doesn't panic the kernel, and should.
Remove the outdated casts to "char *" from the setsockopt(2),
write(2), and getipnodebyaddr(3) calls. Now all the above functions
accept "void *" in that arguments and have prototypes. Thus, the
casts are useless under the normal circumstances (and would be harmful
if the functions had no prototypes.)
Move m_freem() from uipc_mbuf.c to subr_mbuf.c so it can take advantage
of the inlines, like its cousin, m_free(). Also, make a small (first
step?) optimisation of m_free() to use the MBP_PERSIST{,ENT} interface
to hold the lock across frees when possible. The thing is that right
now, we can only do this easily for at most across one mbuf + one
cluster free, as the comment mentions (it also explains why). Anyway,
some basic tests revealed a 5-10% overall improvement. Some of the
results can be found here:
http://people.freebsd.org/~bmilekic/code/measure.txt
Clean up the syslog(3) messages on the setsockopt(2) errors:
o Always check a setsockopt(2) return value
o Use a consistent message format
o Don't abort if the failed setsockopt(2) was actually not vital
o Use LOG_WARNING, not LOG_ERR, in non-fatal cases
Robert Watson [Wed, 24 Jul 2002 14:24:16 +0000 (14:24 +0000)]
Stick a dark comment in about the fact that the NFS server code allocates
a ucred by itself as part of an nfs descriptor, then bzero's the ucred,
fails to initialize the mutex, etc. This is very bad, but I don't have
time to fix it right now. nfsd should instead hold a cred pointer,
and the credential should be properly initialized, probably from a
descendent of a kernel process credential.
John Polstra [Wed, 24 Jul 2002 03:02:43 +0000 (03:02 +0000)]
Widen struct sockbuf's sb_timeo member to int from short. With
non-default but reasonable values of hz this member overflowed,
breaking NFS over UDP.
Also, as long as I'm plowing up struct sockbuf ... Change certain
members from u_long/long to u_int/int in order to reduce wasted
space on 64-bit machines. This change was requested by Andrew
Gallatin.
Netstat and systat need to be rebuilt. I am incrementing
__FreeBSD_version in case any ports need to change.
Tim J. Robbins [Wed, 24 Jul 2002 02:06:07 +0000 (02:06 +0000)]
Avoid calling el_resize() from a signal handler, even though libedit
itself does that if you set EL_SIGNAL. Instead, set a flag and check it
before calling el_gets(). This is safer, but slower to respond to changes.
Introduce mb_free() to the MBP_PERSIST{,ENT} interface. What this means
is that grouped frees will be done as most often as possible without
dropping the cache lock in between. So, for the most part, they'll be
done without the lock being dropped. This is particularly true if you
have something that does a grouped m_getm() or m_getcl() (a cluster and
mbuf at the same time) - most likely getting the buffers from the
same per-CPU cache - and then frees them with m_free{,m}(). Unless
the buffers' underlying buckets were moved, the free will be done without
the lock getting dropped in between. So far, only m_free() has been
shown how to do this, and m_freem() will shortly follow.
Since I'm here, I also fixed a small (but mostly harmless) type-mismatch
introduced in the last commit.
Alexander Kabaev [Tue, 23 Jul 2002 14:50:51 +0000 (14:50 +0000)]
Fix the sound driver vchan support to work when hw.snd.maxautovchans
has been specified through /boot/loader.conf as opposed to setting it
in /etc/sysctl.conf. Only PCMDIR_PLAY channel can be used as a parent
of virtual channel. Do not initialize a new vchan for a given physical
channel if other physical channel already has one created.
Alexander Kabaev [Tue, 23 Jul 2002 14:30:27 +0000 (14:30 +0000)]
Fix DIOCGMEDIASIZE and DIOCGSECTORSIZE ioctls to work for all
disk devices. This fixes the problem with these ioctls returning
EINVAL for plain slice devices with no disklabel on them.
The patch incorporates improvements and style fixes from BDE.
Robert Watson [Tue, 23 Jul 2002 13:16:36 +0000 (13:16 +0000)]
Mention SAVENAME and SAVESTART in the namei(9) operation flag description
since apparently people were missing that you aren't supposed to access
the name buffer following namei() unless you specify one of these flags.
Pointed out by: green
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Tue, 23 Jul 2002 13:09:24 +0000 (13:09 +0000)]
Update ucred.9 to talk a bit more about correct use of credentials,
including documenting that ucreds must not be pulled out of thin air,
when to use td_cred vs. p_ucred, how to avoid race conditions in
credential updates, and why to use p_ucred when targetting a thread
or process in an access control operation involving two processes.
Juli Mallett [Tue, 23 Jul 2002 12:28:16 +0000 (12:28 +0000)]
Turn on emacs line editing mode by default, as this is what most shells do
these days, and the average user expects ^A and arrow keys to work, however
if they know nothing of editing modes, they will think sh(1) just sucks. It
is likely that because of defaults on most systems and with most shells that
anyone who actually wants vi(1) editing mode will have 'set -o vi'. This
won't affect existing accounts, this way, of course. Only accounts with
.shrc from new etc/skel will be affected. This is much better than making
the change in sh(1).
Tim J. Robbins [Tue, 23 Jul 2002 11:50:53 +0000 (11:50 +0000)]
Add a `bind' builtin command, which is simply a wrapper around libedit's
builtin command of the same name. This allows the key bindings for the
shell's line editor to be changed.
Peter Wemm [Tue, 23 Jul 2002 06:31:45 +0000 (06:31 +0000)]
Minimal tweak to not depend on NPCI, but still maintain portability
to 4.x which still does need it (since pci_if.h isn't generated without
pci being present)
Andrew R. Reiter [Tue, 23 Jul 2002 01:09:34 +0000 (01:09 +0000)]
- Make use of the VM_ALLOC_WIRED flag in the call to vm_page_alloc() in
do_sendfile(). This allows us to rearrange an if statement in order to
avoid doing an unnecesary call to vm_page_lock_queues(), and an attempt
at re-wiring the pages (which were wired in the vm_page_alloc() call).
Bill Fenner [Tue, 23 Jul 2002 00:56:52 +0000 (00:56 +0000)]
Add '+FreeBSD' to the version string, to reflect that this program
bears little relationship to the one from LBL with the same
name and version number.
Warner Losh [Mon, 22 Jul 2002 21:28:46 +0000 (21:28 +0000)]
integrate from p4 repo:
o Honor NE2000DVF_{AX88190,DL10019} flags by setting the ED_FLAGS_xxxx
flag.
o Mark linksys combo_ecard as ax88190
o Set the type_str to AX88190 for the ax88190 cards.
This fixes ax88190 based cards, for the most part, but doesn't seem to fix
the mii based dl10019 cards (aka linksys cards).
Warner Losh [Mon, 22 Jul 2002 21:24:12 +0000 (21:24 +0000)]
Three minor changes:
1) Add support for compaq cpq 10/100 card (a rebadged ce3)
2) Minor protection for failure on vendor lookup
3) Minor style(9) nits.