Alan Cox [Thu, 25 Jul 2002 19:09:07 +0000 (19:09 +0000)]
o Remove a vm_page_deactivate() that is immediately followed by a
vm_page_rename() from vm_object_backing_scan(). vm_page_rename()
also performs vm_page_deactivate() on pages in the cache queues,
making the removed vm_page_deactivate() redundant.
Matt Jacob [Thu, 25 Jul 2002 16:02:09 +0000 (16:02 +0000)]
Make sure that if are in fact using 'full SMP', make the interrupt
flags include INTR_MPSAFE. Put the flags in a common place so that
both isp_sbus && isp_pci DTRT.
In isp_mbxdma setup, drop any locks prior to calling things like
bus_dmatag_create. This gets rid of these obnoxious WITNESS messages
about 'sleeping with locks held' blah blah blah blah blah.
Robert Drehmel [Thu, 25 Jul 2002 15:45:41 +0000 (15:45 +0000)]
When parsing the program name from the incoming log message
from a client, accept all printable characters as being part
of the program name, except ':' and '[', because each is a
possible delimiter.
Tim J. Robbins [Thu, 25 Jul 2002 10:57:39 +0000 (10:57 +0000)]
Add a -P/-o physical option which behaves similarly to bash/ksh's options
by the same name. This option makes the cd and pwd builtins behave physically
(as opposed to logically) by default.
Robert Drehmel [Thu, 25 Jul 2002 09:56:37 +0000 (09:56 +0000)]
When reading a program name from the syslog configuration file,
do not stop copying it into a buffer when encountering a
non-alphanumerical character. Only stop at unprintable characters.
This makes syslogd work correctly with executables like `interp.bin',
`httpd_old', etc.
sysctl(NET_RT_IFLIST) up to several (currently 5) times.
This will make the behavior robuster if many addresses are added
after the size estimation of storage at the first sysctl.
Warner Losh [Thu, 25 Jul 2002 00:30:24 +0000 (00:30 +0000)]
Clarify the sizeof(var) rule. This is the result of the consensus in
arch@ between myself, bde and markm. I kept the parts that all of us
agreed to, and omitted some more extensive text that I'd originally
wanted.
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)