Commit Graph

109280 Commits

Author SHA1 Message Date
Yaroslav Tykhiy
6e4b0a55f7 Using off_t to pass a block size is obvious overkill.
The size_t type is better suited for that, particularly because
the "blksize" argument is to be passed to malloc() and read().
On 64-bit archs it's more to a style issue, but the good style
of coding in C is also important.
2004-11-13 13:42:43 +00:00
Yaroslav Tykhiy
e3765043a8 Kill ancient casts to integral types left from the K&R era.
They're unneeded and sometimes erroneous now.
2004-11-13 13:15:47 +00:00
Poul-Henning Kamp
51ac12ab28 Be prepared to accept NULL mountargs as part of root-mounting. 2004-11-13 13:04:31 +00:00
Poul-Henning Kamp
124e4c3be8 Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not
an issue.

The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.
2004-11-13 11:53:02 +00:00
Yaroslav Tykhiy
5512dc5460 Fix off-by-one errors and potential buffer overruns
WRT handling file and link names that reach the allowed
maximum for old tar and ustar archive formats.

PR:		bin/40466
Submitted by:	Cyrille Lefevre <email in the PR> (portions)
Reviewed by:	freebsd-arch (silence)
MFC after:	1 month
2004-11-13 10:56:35 +00:00
Robert Watson
53d0031d37 Correct two incorrectly merged changes introduced in sysv_sem.c:1.71:
return EINVAL rather than setting error, and don't free sops
unconditionally.  The first change was merged accidentally as part of
the larger set of changes to introduce MAC labels and access control,
and potentially lead to continued processing of a request even after
it was determined to be invalid.  The second change was due to changes
in the semaphore code since the original work was performed.

Pointed out by:	truckman
2004-11-13 08:06:40 +00:00
Marcel Moolenaar
6c377348e6 For create and migrate, remove the `.Op Fl f' introduced in the
previous two commits and combine them with the existing flags
that were already there.

Pointed out by: ru@
2004-11-13 08:01:48 +00:00
Marcel Moolenaar
9e57e1869c Add an -f option (for force) to the migrate command. Normally an MBR
with unknown partitions is not migrated. By specifying the -f option
migration will happen and unknown partitions will be lost.
2004-11-13 05:44:02 +00:00
Marcel Moolenaar
597c201050 Add an -f option (for force) to the create command. The -f option
allows the user to force the creation of a GPT even when there's a
MBR on the device. The MBR is simply wiped and any partitions
described by it are lost. Without the -f option one cannot create
a GPT when there's a MBR.
2004-11-13 05:13:33 +00:00
Marcel Moolenaar
8b6fc67a49 Fix the MDIOCDETACH ioctl() for md(4). Now that the md_file field in
the mdio structure is an array and not a pointer, we cannot test for
it to be NULL. It never is. Instead, test for md_file[0] to be '\0'.
2004-11-13 05:00:12 +00:00
Jordan K. Hubbard
de3abdfaf4 UNIX conformance: If -r -f on non-existent directory, don't emit error. 2004-11-13 04:07:01 +00:00
Philip Paeps
413efd9141 With the addition of a proper prototype, this is now WARNS=6 clean. 2004-11-13 01:54:22 +00:00
Philip Paeps
9599d206a4 Two uint32_t casts crept in where they shouldn't have.
ACPI_TYPE_INTEGER can be 64 bits wide in acpi v2.
2004-11-13 01:49:22 +00:00
Philip Paeps
e18d08c9b0 Change some formats and add some casts to make this
WARNS=2 clean, and mark it as such.

PR:		71672 (partly)
Reviewed by:	njl
2004-11-13 01:34:51 +00:00
Philip Paeps
118fd13167 Reflect the cuaa->cuad namechange in documentation.
Might as well do them all while I'm at it :-)

Submitted by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2004-11-13 00:09:19 +00:00
Philip Paeps
d0139887c9 Update moused(8) and mouse(4) to reflect the cuaa->cuad name change.
Submitted by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2004-11-12 23:59:24 +00:00
Philip Paeps
078080c965 o Change the strcmp() to a strncmp() to allow us to attach to 'E'
models of laptops, which are essentially the same as the normal
   ones, as far as acpi_asus is concerned[1]

 o Use the above as an excuse to reshuffle the mess I made of the
   probe function when I originally wrote it.

Reported by:	    Soeren Larsen <soeren@whiteswan.dk>
2004-11-12 23:21:19 +00:00
Philip Paeps
03cbfbc51a Minor whitespace nitpicking to reduce my diffs of Real Changes[tm] 2004-11-12 23:06:13 +00:00
Gleb Smirnoff
ea0bd57615 Fix ng_ksocket(4) operation as a divert socket, which is pretty useful
and has been broken twice:

- in the beginning of div_output() replace KASSERT with assignment, as
  it was in rev. 1.83. [1] [to be MFCed]
- refactor changes introduced in rev. 1.100: do not prepend a new tag
  unconditionally. Before doing this check whether we have one. [2]

A small note for all hacking in this area:
when divert socket is not a real userland, but ng_ksocket(4), we receive
_the same_ mbufs, that we transmitted to socket. These mbufs have rcvif,
the tags we've put on them. And we should treat them correctly.

Discussed with:	mlaier [1]
Silence from:	green [2]
Reviewed by:	maxim
Approved by:	julian (mentor)
MFC after:	1 week
2004-11-12 22:17:42 +00:00
Olivier Houchard
8e10380a9f Implement interrupt counting, so that vmstat -i work. 2004-11-12 21:49:05 +00:00
Max Laier
48321abefe Change the way we automatically add prefix routes when adding a new address.
This makes it possible to have more than one address with the same prefix.
The first address added is used for the route. On deletion of an address
with IFA_ROUTE set, we try to find a "fallback" address and hand over the
route if possible.
I plan to MFC this in 4 weeks, hence I keep the - now obsolete - argument to
in_ifscrub as it must be considered KAPI as it is not static in in.c. I will
clean this after the MFC.

Discussed on:	arch, net
Tested by:	many testers of the CARP patches
Nits from:	ru, Andrea Campi <andrea+freebsd_arch webcom it>
Obtained from:	WIDE via OpenBSD
MFC after:	1 month
2004-11-12 20:53:51 +00:00
Ruslan Ermilov
7e25cd95ff Ports aren't generally ready for parallel make.
Pointed by:	Ben Mesander
2004-11-12 20:44:51 +00:00
Poul-Henning Kamp
112807ca28 If -B is specified to get compat mode (as opposed to just not giving
a -j arg which does the same thing), remove the MAKE_JOBS_FIFO
environment variable so we decouple any resulting sub-makes from
the token pool.
2004-11-12 20:37:27 +00:00
Peter Wemm
b7c3f3a9d5 Catch a few more autofs references.
Submitted by:  obrien
2004-11-12 19:44:30 +00:00
John Baldwin
90baa95fad Spell _KERNEL correctly so that UP kernels are actually optimized again.
Submitted by:	pjd
2004-11-12 19:18:46 +00:00
John Baldwin
bd2ed154a1 - Use the SMP style ops for atomic_load/store() in userland so that
libraries and binaries will work on both UP and SMP machines.
- Remove unnecessary gcc memory barrier from the UP atomic_store() op.

Submitted by:	bde
2004-11-12 18:40:22 +00:00
Christian Brueffer
12beeca875 sf(4) supports altq
MFC after:	2 weeks
2004-11-12 18:13:54 +00:00
Christian Brueffer
a62ba928f7 Add altq support.
Patch by mlaier.

Approved by:	mlaier
MFC after:	2 weeks
2004-11-12 18:12:04 +00:00
John Baldwin
2939195e46 Remove these unused files before any other archs include the same bogus
file.
2004-11-12 18:05:30 +00:00
Robert Watson
75d6abdb7e third of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Make the "ipcs" tool, which grubs around in kernel memory to report
status relating to System V IPC, use the _kernel variants on the
System V IPC data structures.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:33:55 +00:00
Ruslan Ermilov
2f841e1a7b Use a relative symlinking so that "tar" also works in /stand. 2004-11-12 13:28:42 +00:00
Ruslan Ermilov
e631c74b1d Pass the "?" command output through the pager.
(This doesn't quite work as this command is overridden by Forth,
and some Forth commands are appended to the output.)
2004-11-12 13:27:49 +00:00
Ruslan Ermilov
212acbef3a Install precious programs with -S. 2004-11-12 13:24:34 +00:00
Robert Watson
921d05b90d Second of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Use _kernel variants on _ds structures for System V sempahores, message
queues, and shared memory.  When interfacing with userspace, export
only the _ds subsets of the _kernel data structures.  A lot of search
and replace.

Define the message structure in the _KERNEL portion of msg.h so that it
can be used by other kernel consumers, but not exposed to user space.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:23:47 +00:00
Ruslan Ermilov
0931d0a9f8 Show stray files during "cvs update". 2004-11-12 13:22:22 +00:00
Robert Watson
b37d625c7c First of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Define _kernel wrapper data structures for the user-exposed data
structures that current server as the internal data structures for
the implementation:

- struct msqid_kernel wraps struct msqid_ds.
- struct semid_kernel wraps truct semid_ds.
- struct shmid_kernel wraps struct shmid_ds.
- Don't expose extern definition 'shmsegs' outside of sysv_shm.c.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:21:39 +00:00
Ceri Davies
f4422f46b8 Wrap a comment properly. 2004-11-12 13:14:56 +00:00
Robert Watson
16142b2b03 Correct a bug in the if_em driver relating to the use of vlans with
promiscuous mode introduced in 1.45, which programs the em card not
to strip or prepend tags when in promiscuous mode without also
modifying behavior to manually prepend a vlan header in the event
that the card isn't doing it on transmit.  Due to a feature of card
operation, if the global VLAN prepend/strip register isn't set,
setting the VLAN tag flag on individual packet descriptors will
cause the packet to be transmitted using ISL encapsulation rather
than 802.1Q VLAN encapsulation.

This fix causes em_encap() to prepend the header by tracking whether
the card is configured to temporarily disable prepending/stripping
due to promiscuous mode.  As a result, entering promiscuous mode on
the parent em interface no longer causes vlans to appear to "wedge"
or transmit ISL-encapsulated frames, which typically will not be
configured/spoken by the other endpoints on the VLAN trunk.  This
bug may also exist in other drivers, and the additional vlan
encapsulation logic should be abstracted and centralized in
if_vlan.c if so.

RELENG_5_3 candidate.

MFC after:	1 week
Tested by:	pjd, rwatson
Reported by:	astesin at ukrtelecom dot net
Reported by:	Mike Tancsa <mike at sentex dot net>
Reported by:	Iasen Kostov <tbyte at OTEL dot net>
2004-11-12 11:03:07 +00:00
Poul-Henning Kamp
cf5e414960 Put back the vfs_object_create() calls, they do make a difference when
my test-setup does what I want it to instead of what I ask it to.

Pointed out by:	tegge
2004-11-12 10:27:14 +00:00
Jens Schweikhardt
cc00e79feb s/Here about/Hear about/ and sort accordingly. 2004-11-12 10:15:43 +00:00
Poul-Henning Kamp
1d66b1beec Add code to enforce the paralleism count (-j N) for the entire tree
of submakes spawned during processing.

We create a fifo and stuff one character into it for each job we are
allowed to run.  The name of the fifo is passed to child processes
in the MAKE_JOBS_FIFO environment variable.

A make which finds this variable on startup will open the fifo and
only spawn jobs when it managed to read a token from the fifo.
When the job completes a token is writen back to the fifo.

Slave make processes get one token for free: the one their parent
make got in order to run them.  This makes the make processes
themselves invisible in the process counts.

The net effect is that "make -j 12 -s buildworld" will start at
most 12 jobs at the same time, instead of as previously up to
65 jobs would get started.
2004-11-12 08:58:07 +00:00
Hartmut Brandt
4253bd82b6 Fix a (very) long standing bug in make (this has been there probably
from the beginning). Make used to handle all its interrupt-time stuff
directly from the signal handler, including calls to printf, accessing
global data and so on. This is of course wrong and could provoke a core
dump when interrupting make. Just set a flag in the signal handler and
do everything else from the main thread.

PR:		bin/29103
2004-11-12 07:57:17 +00:00
Warner Losh
8280421a43 Doh! This one crept in two commits ago and didn't get weeded out on
the last commit.  Sorry gang.

Conical Hat: imp
2004-11-12 04:48:24 +00:00
Marcel Moolenaar
b8bd838882 Fix a braino: the partition size in the PMBR is in sectors, not bytes
and 'mediasz' is in bytes. As it so happens, we define 'last' as the
sector number of the last sector on the medium which also is the size
of the PMBR partition. Therefore, use 'last' instead of 'mediasz'.

Submitted by: Dan Markarian <markarian at apple dot com>
2004-11-12 04:34:46 +00:00
Ian Dowse
b044e17063 Put back usb_uncallout_drain(), as it is now also used by umass.c. 2004-11-12 03:24:12 +00:00
Ian Dowse
85b8134e51 Back out my recent changes for timeout races, as there have been
reports of problems. The bug is probably that there are cases where
`xfer->timeout && !sc->sc_bus.use_polling' is not a suitable test
for an active timeout callout, so an explicit flag will be necessary.
Apologies for the breakage.
2004-11-12 02:57:35 +00:00
Warner Losh
0d85601316 Various whitespace nits.
Noticed by: njl
2004-11-12 02:18:42 +00:00
Warner Losh
4e08cdc5f5 Don't use aha after calling aha_free. 2004-11-12 00:46:52 +00:00
Warner Losh
cf1f7ce2f1 Document PORTS_MODULES variable. 2004-11-12 00:01:07 +00:00
Warner Losh
1fd4bb62ef PORTS_MODULES: a list of ports to build with this kernel.
# I directly use the targets for building this, but it was suggested
# to use portupgrade.  I couldn't fit that into the target model, so I
# punted.
2004-11-11 23:58:14 +00:00