Commit Graph

118713 Commits

Author SHA1 Message Date
rwatson
0106e151c3 Acquire Giant in uprintf() and tprintf() rather than asserting it. In
the vast majority of cases, these functions are called without mutexes
held, meaning that in all but two cases, there will be no ordering
issues with doing this, and it will eliminate the need for changes in
the caller.  In two cases, mutexes are held, so Giant must be acquired
before those mutexes such that uprintf() and tprintf() recurse Giant
rather than generating a lock order reversal.

Suggested by:	bde
2005-09-26 08:02:24 +00:00
njl
88a1a84601 Fix order and style(9) to match surrounding defs. 2005-09-26 07:45:35 +00:00
keramida
5b312e287b minor style.Makefile(5) fixes:
- WARNS before CFLAGS
- CFLAGS -DXXX before -IXXX

Approved by:	ru
2005-09-26 06:23:43 +00:00
sobomax
8d8767b58c Add dummy support for ifmedia subsystem. This allows devd to see cdce as an
ethernet device and configure IP etc.

Submitted by:	Craig Boston <craig@tobuj.gank.org>
2005-09-26 05:29:46 +00:00
imp
add8494ccf Remove the kernel portion of OLDCARD. I'm working on a replacement
for pccardc dumpcis, but until I'm done with that, I'm leaving pccardc
in place.  As such, I'm leaving the .h files in place for the moment.
2005-09-25 21:29:32 +00:00
imp
7844c35474 Remove references to OLDCARD. 2005-09-25 21:26:09 +00:00
imp
5bc61bad5f OLDCARD is being removed from the tree, so remove it from here.
# the snc pccard entry might be able to be moved to files
2005-09-25 21:24:06 +00:00
phk
58b495a6f0 Correct filesystem mountpoint 2005-09-25 21:23:19 +00:00
cognet
c29db74a1d Fix multiple abuses of __RMAN_RESOURCE_VISIBLE in the arm code.
Spotted out by:	phk
2005-09-25 21:06:50 +00:00
phk
8f15910404 __RMAN_RESOURCE_VISIBLE not necessary. 2005-09-25 20:21:48 +00:00
phk
1a9cbea53c __RMAN_RESOURCE_VISIBLE not needed. 2005-09-25 20:21:14 +00:00
phk
bf3c3b1eb9 Replace __RMAN_RESOURCE_VISIBLE with calls to public entry points
in rman module.
2005-09-25 20:12:30 +00:00
phk
4b78e0f816 Add rman_is_region_manager() for the benefit of an alpha hack. 2005-09-25 20:10:10 +00:00
phk
bfc2f12141 __RMAN_RESOURCE_VISIBLE is not actually needed. 2005-09-25 20:03:41 +00:00
rwatson
c9044f078d Lock the read socket receive buffer when frobbing the sb_state flag on
that socket during open, not the write socket receive buffer.  This
might explain clearing of the sb_state SB_LOCK flag seen occasionally
in soreceive() on fifos.

MFC after:	3 days
Spotted by:	ups
2005-09-25 19:52:09 +00:00
phk
9b57d498db Substitute rman_get_start() for __RMAN_RESOURCE_VISIBLE 2005-09-25 19:48:51 +00:00
phk
65daebb7d8 This file never needed to see what is in the internal struct resource,
all it needed was a call to rman_get_start().
2005-09-25 19:34:54 +00:00
scottl
7279f0e888 Overhaul error handling in the IPS driver. Don't use a magic value for
driver-induced errors, instead be better about propagating error status
upwards.  Add more error definitions, courtesy of the linux driver.  Fix
a command leak in the ioctl handler.  Re-arrange some of the command handlers
to localize error handling.

MFC After: 3 days
2005-09-25 17:12:41 +00:00
imp
20b5ed6860 Remove OLDCARD vestiges from here 2005-09-25 01:39:04 +00:00
imp
d3a04605bc Fix comment 2005-09-25 01:38:02 +00:00
csjp
2c840e0d4e Implement new world order in VFS locking for extended attributes. This will
remove the unconditional acquisition of Giant for extended attribute related
operations. If the file system is set as being MP safe and debug.mpsafevfs is
1, do not pickup Giant.

Mark the following system calls as being MP safe so we no longer pickup Giant
in the system call handler:

o extattrctl
o extattr_set_file
o extattr_get_file
o extattr_delete_file
o extattr_set_fd
o extattr_get_fd
o extattr_delete_fd
o extattr_set_link
o extattr_get_link
o extattr_delete_link
o extattr_list_file
o extattr_list_link
o extattr_list_fd

-Pass MPSAFE flags to namei(9) lookup and introduce vfslocked variable which
 will keep track of any Giant acquisitions.
-Wrap any fd operations which manipulate vnodes in VFS_{UN}LOCK_GIANT
-Drop VFS_ASSERT_GIANT into function which operate on vnodes to ensure that
 we are sufficiently protected.

I've tested these changes with various TrustedBSD MAC policies which use
extended attribute a lot on SMP and UP systems (thanks to Scott Long for
making some SMP hardware available to me for testing).

Discussed with:	jeff
Requested by:	jhb, rwatson
2005-09-24 23:47:04 +00:00
krion
3b94f1f114 Do not bitch about bsdpan modules not having origin.
Based on PR:	bin/82269
Submitted by:	Steven Hartland <killing at multiplay dot co dot uk>
MFC after:	3 days
2005-09-24 21:41:47 +00:00
kientzle
4168ea6d08 Fix -u with absolute paths (e.g., "tar -uf foo.tar /bar") by handling
pathname edits before comparing pathnames on disk to those in the archive.

Thanks to: Gareth Bailey, Lowell Gilbert
2005-09-24 21:19:57 +00:00
kientzle
163e4801c5 Detect Mac OS X's broken ACL library.
Thanks to: Diego "Flameeyes" Petten?
2005-09-24 21:17:47 +00:00
kientzle
7326792e21 signed/unsigned fixes (thanks to GCC4) and a few related minor style corrections. 2005-09-24 21:15:00 +00:00
phk
3c81bee51e Use the new bus_space/resource convenience functions. 2005-09-24 20:46:02 +00:00
phk
07f333af67 Use new bus_space/resource convenience functions.
Pretend the 10-bit I/O ISA addressing is not our problem.
2005-09-24 20:44:55 +00:00
phk
81a425948b Add convenience macros for bus_space usage that doesn't require specification
of bus tag+handle.

Instead of
	bus_space_write_1(sc->tag, sc->handle, ...)
this macros offer
	bus_write_1(sc->resource, ...)

The name+argument transformation is constant and the the macros are
generated (by hand) by the script in tools/bus_macro.sh.
2005-09-24 20:11:07 +00:00
phk
8d364c8c58 Split struct resource in an external and internal part.
The external part is still called 'struct resource' but the contents
is now visible to drivers etc.  This makes it part of the device
driver ABI so it not be changed lightly.  A comment to this effect
is in place.

The internal part is called 'struct resource_i' and contain its external
counterpart as one field.

Move the bus_space tag+handle into the external struct resource, this
removes the need for device drivers to even know about these fields
in order to use bus_space to access hardware. (More in following commit).
2005-09-24 20:07:03 +00:00
krion
b3b9e441ec Remove '\n' since it's redundant in case if file doesn't exist while
running 'pkg_info -g'

Based on PR:	bin/42609
Submitted by:	Jeff King <peff-freebsd at peff dot net>
MFC after:	3 days
2005-09-24 19:41:56 +00:00
phk
538e3ae81d Add two convenience functions for device drivers: bus_alloc_resources()
and bus_free_resources().  These functions take a list of resources
and handle them all in one go.  A flag makes it possible to mark
a resource as optional.

A typical device driver can save 10-30 lines of code by using these.

Usage examples will follow RSN.

MFC:	A good idea, eventually.
2005-09-24 19:31:10 +00:00
imp
c5182c8c5e I have confirmed with my Epson EEN10B that it needs to look at the
attribute memory at 0xff0 to find its MAC address.  This is another
instance of the IBM ethercard II from all apperances (short of popping
the lid).  Update the entry to document which cards we support
actually need this functionality.
2005-09-24 17:36:43 +00:00
imp
16f660ed10 Remove unnecessary Dlink de650 entry 2005-09-24 17:32:57 +00:00
imp
18d24b9f81 The DLink DE650 has the same ID as Linksys EthernetCard, so we don't
need a sperate entry for it.
2005-09-24 17:32:20 +00:00
wilko
6d71624abe Try to avoid crashes during kernel startup by limiting the # of EISA
slots to probe.  Problems have been reported in this area, lets hope this
bandaid helps.

!! Owners of EISA-equipped Alpha machines are requested to at least
!! boot-test a 6-BETA build and report back to the Alpha list. Thanks!

Approved by: re (scottl)
Suggested by: ticso
2005-09-24 16:47:34 +00:00
pjd
264e350e93 Simplify the code by making use of 'kldstat -q -m <mod>'.
No objections from:	mlaier
2005-09-24 15:57:17 +00:00
netchild
479d185b1e This part of the struct isn't needed on FreeBSD:
---snip---
FYI this bit isn't needed for FreeBSD - I think it came from either
OpenBSD or NetBSD where arc4random() wasn't available during cold
boot.
---snip---

Explained by:	iedowse
2005-09-24 14:49:36 +00:00
stefanf
6dda8fcf04 The function inplace_edit() doesn't exist anymore, remove the prototype.
Submitted by:	Leonardo Chiquitto Filho
2005-09-24 13:18:30 +00:00
simon
b4151b2250 Make it possible to set the NANO_TOOLS variable to a directory outside
of $NANO_SRC, which can e.g. be used if the nanobsd scripts are not in
the source tree being built.

Improved by:	phk
Approved by:	phk
2005-09-24 12:26:59 +00:00
pjd
917f40a3dc Update usage. 2005-09-24 08:20:45 +00:00
brueffer
6a696a6eba Fix typo.
PR:		86522
Submitted by:	Stephen Hurd <shurd@sasktel.net>
MFC after:	3 days
2005-09-24 07:07:55 +00:00
phk
a951e327e6 Make rule zero really magical, that way we don't have to do anything
when we mount and get zero cost if no rules are used in a mountpoint.

Add code to deref rules on unmount.

Switch from SLIST to TAILQ.

Drop SYSINIT, use SX_SYSINIT and static initializer of TAILQ instead.

Drop goto, a break will do.

Reduce double pointers to single pointers.

Combine reaping and destroying rulesets.

Avoid memory leaks in a some error cases.
2005-09-24 07:03:09 +00:00
brian
07adfc3d98 Modify the code path of the ifdef NOTYET part of _kse_single_thread():
o  Don't reinitialise the atfork() handler list in the child.  We
   are meant to call the child handler, and on subsequent fork()s
   should call all three functions as normal.
o  Don't reinitialise the thread specific keyed data in the
   child after a fork.  Applications may require this for context.
o  Reinitialise curthread->tlflags after removing ourselves from
   (and reinitialising) the various internal thread lists.
o  Reinitialise __malloc_lock in the child after fork() (to balance
   our explicitly taking the lock prior to the fork()).

With these changes, it is possible to enable the NOTYET code in
thr_kern.c to allow the use of non-async-safe functions after
fork()ing from a threaded program.

Reviewed by:	Daniel Eischen <deischen@freebsd.org>
[_malloc_lock reinitialisation has since been moved to avoid polluting the
!NOTYET code]
2005-09-24 01:19:53 +00:00
pjd
0b524fa9c8 Simplify the code a bit by using newly added (to kldstat(8) '-q') option. 2005-09-23 23:53:35 +00:00
pjd
7386c52294 Add '-q' option, which (when used with '-m' option) just tells if the given
module is loaded or compiled into the kernel.
This is useful mostly in startup scripts, when module should be loaded only
if it wasn't compiled into the kernel nor already loaded, eg.:

	kldstat -q -m g_eli || kldload geom_eli.ko || err 1 'geom_eli module failed to load.'
2005-09-23 23:52:26 +00:00
imp
899f058291 Remove obsolete include 2005-09-23 21:59:11 +00:00
delphij
9bfa6f6c3e Restore a historical ufs_inactive behavior that has been changed
in rev. 1.40 of ufs_inode.c, which allows an inode being truncated
even when the filesystem itself is marked RDONLY.  A subsequent
call of UFS_TRUNCATE (ffs_truncate) would panic the system as it
asserts that it can only be called when the filesystem is mounted
read-write (same changeset, rev. 1.74 of sys/ufs/ffs/ffs_inode.c).

Because ffs_mount() already takes care of sync'ing the filesystem
to disk before being downgraded to readonly, it appears to be more
desirable that we should not permit this sort of writes to disk.

This change would fix a panic that occours when read-only mounted
a corrupted filesystem and doing some file operations.

MT6/5/4 candidate

Reviewed by:	mckusick
2005-09-23 20:49:57 +00:00
wollman
49e164220d If we're not installing OpenSSH in the base, don't install its startup
file either.  This clears the way for third-party SSH ports to install
an RCng startup script.
2005-09-23 16:54:09 +00:00
mnag
58bbabb9ca Add myself to FreeBSD calendar
Approved by:	pav (mentor)
2005-09-23 13:06:23 +00:00
ru
b4f89a0d63 Fix vgrind(1) indexing I broke in previous revision.
PR:		bin/86343
Submitted by:	Matej Vela <vela@debian.org>
2005-09-23 12:55:22 +00:00