]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoAdd Rene Ladan, as well as my relationship towards Rene.
remko [Tue, 4 Nov 2008 19:20:19 +0000 (19:20 +0000)]
Add Rene Ladan, as well as my relationship towards Rene.

15 years agostyle(9): mostly avoiding line wrap by not indenting cases. No obj change.
mlaier [Tue, 4 Nov 2008 19:17:32 +0000 (19:17 +0000)]
style(9): mostly avoiding line wrap by not indenting cases.  No obj change.

15 years agoDon't bother calling setrunnable() and clearing the sleeping flag in
jhb [Tue, 4 Nov 2008 19:13:53 +0000 (19:13 +0000)]
Don't bother calling setrunnable() and clearing the sleeping flag in
sleepq_resume_thread() if the thread isn't asleep.

15 years agoRemove unnecessary locking around vn_fullpath(). The vnode lock for the
jhb [Tue, 4 Nov 2008 19:04:01 +0000 (19:04 +0000)]
Remove unnecessary locking around vn_fullpath().  The vnode lock for the
vnode in question does not need to be held.  All the data structures used
during the name lookup are protected by the global name cache lock.
Instead, the caller merely needs to ensure a reference is held on the
vnode (such as vhold()) to keep it from being freed.

In the case of procfs' <pid>/file entry, grab the process lock while we
gain a new reference (via vhold()) on p_textvp to fully close races with
execve(2).

For the kern.proc.vmmap sysctl handler, use a shared vnode lock around
the call to VOP_GETATTR() rather than an exclusive lock.

MFC after: 1 month

15 years agoQuiet a WITNESS warning with the dirhash sx locks by setting the DUPOK
jhb [Tue, 4 Nov 2008 18:56:12 +0000 (18:56 +0000)]
Quiet a WITNESS warning with the dirhash sx locks by setting the DUPOK
flag.  Specifically, if two threads race to create a dirhash for a
directory, then one might already have created a private dirhash
structure (and locked it) when it realizes the directory now has a
structure and tries to lock that one.

15 years agoDon't pass WANTPARENT to the pathname lookup of the mount point for a
jhb [Tue, 4 Nov 2008 18:54:44 +0000 (18:54 +0000)]
Don't pass WANTPARENT to the pathname lookup of the mount point for a
unionfs mount just so we can immediately drop the reference on the parent
directory vnode without using it.

15 years agoDon't leak a reference on the /compat/linux vnode everytime
jhb [Tue, 4 Nov 2008 18:53:33 +0000 (18:53 +0000)]
Don't leak a reference on the /compat/linux vnode everytime
the linprocfs 'mtab' file is read.

MFC after: 1 month

15 years agoFix comment typo that managed to sneak in when I copy pasted some
keramida [Tue, 4 Nov 2008 18:20:54 +0000 (18:20 +0000)]
Fix comment typo that managed to sneak in when I copy pasted some
comments & code from iostat.

15 years agoRepeat vmstat header after window.rows instead of a hardcoded 20.
keramida [Tue, 4 Nov 2008 18:02:35 +0000 (18:02 +0000)]
Repeat vmstat header after window.rows instead of a hardcoded 20.

Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes.  Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.

Inspired by: svn change 175562 (same feature for iostat)
Reviewed by: ru (who fixed some of my bugs too)
MFC after: 1 week

15 years agoInclude <sys/eventhandler.h>.
dfr [Tue, 4 Nov 2008 16:43:02 +0000 (16:43 +0000)]
Include <sys/eventhandler.h>.

15 years agoWhitespace and style fixes, build at WARNS level 6.
des [Tue, 4 Nov 2008 14:17:49 +0000 (14:17 +0000)]
Whitespace and style fixes, build at WARNS level 6.

MFC after: 3 weeks

15 years agolibutil now builds at WARNS level 6.
des [Tue, 4 Nov 2008 13:51:15 +0000 (13:51 +0000)]
libutil now builds at WARNS level 6.

MFC after: 3 weeks

15 years agoAdd missing header.
des [Tue, 4 Nov 2008 13:50:50 +0000 (13:50 +0000)]
Add missing header.

15 years agoAvoid assigning a const char * to a char *.
des [Tue, 4 Nov 2008 13:49:53 +0000 (13:49 +0000)]
Avoid assigning a const char * to a char *.

MFC after: 3 weeks

15 years agoIn UFS, when reading EA that contains ACL fails for some reason, include
trasz [Tue, 4 Nov 2008 12:30:31 +0000 (12:30 +0000)]
In UFS, when reading EA that contains ACL fails for some reason, include
inode number and filesystem name, so the administrator can fix the problem.

Approved by: rwatson (mentor)

15 years agoAdd support for Asus A8Sr notebooks.
rpaulo [Tue, 4 Nov 2008 11:52:50 +0000 (11:52 +0000)]
Add support for Asus A8Sr notebooks.

PR: 128553
Submitted by: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Reviewed by: philip
MFC after: 2 months

15 years agoRemove redundant return value tests.
ed [Tue, 4 Nov 2008 10:58:02 +0000 (10:58 +0000)]
Remove redundant return value tests.

There is no need to test whether the return value is non-zero here. Just
return the error number directly.

15 years agoadd usb2_if.m to mfiles to unbreak build of modules.
alfred [Tue, 4 Nov 2008 03:42:01 +0000 (03:42 +0000)]
add usb2_if.m to mfiles to unbreak build of modules.

15 years agoBring in USB4BSD, Hans Petter Selasky rework of the USB stack
alfred [Tue, 4 Nov 2008 02:31:03 +0000 (02:31 +0000)]
Bring in USB4BSD, Hans Petter Selasky rework of the USB stack
that includes significant features and SMP safety.

This commit includes a more or less complete rewrite of the *BSD USB
stack, including Host Controller and Device Controller drivers and
updating all existing USB drivers to use the new USB API:

1) A brief feature list:

  - A new and mutex enabled USB API.

  - Many USB drivers are now running Giant free.

  - Linux USB kernel compatibility layer.

  - New UGEN backend and libusb library, finally solves the "driver
    unloading" problem. The new BSD licensed libusb20 library is fully
    compatible with libusb-0.1.12 from sourceforge.

  - New "usbconfig" utility, for easy configuration of USB.

  - Full support for Split transactions, which means you can use your
    full speed USB audio device on a high speed USB HUB.

  - Full support for HS ISOC transactions, which makes writing drivers
    for various HS webcams possible, for example.

  - Full support for USB on embedded platforms, mostly cache flushing
    and buffer invalidating stuff.

  - Safer parsing of USB descriptors.

  - Autodetect of annoying USB install disks.

  - Support for USB device side mode, also called USB gadget mode,
    using the same API like the USB host side. In other words the new
    USB stack is symmetric with regard to host and device side.

  - Support for USB transfers like I/O vectors, means more throughput
    and less interrupts.

  - ... see the FreeBSD quarterly status reports under "USB project"

2) To enable the driver in the default kernel build:

2.a) Remove all existing USB device options from your kernel config
file.

2.b) Add the following USB device options to your kernel configuration
file:

# USB core support
device          usb2_core

# USB controller support
device usb2_controller
device usb2_controller_ehci
device usb2_controller_ohci
device usb2_controller_uhci

# USB mass storage support
device usb2_storage
device usb2_storage_mass

# USB ethernet support, requires miibus
device usb2_ethernet
device usb2_ethernet_aue
device usb2_ethernet_axe
device usb2_ethernet_cdce
device usb2_ethernet_cue
device usb2_ethernet_kue
device usb2_ethernet_rue
device usb2_ethernet_dav

# USB wireless LAN support
device usb2_wlan
device usb2_wlan_rum
device usb2_wlan_ral
device usb2_wlan_zyd

# USB serial device support
device usb2_serial
device usb2_serial_ark
device usb2_serial_bsa
device usb2_serial_bser
device usb2_serial_chcom
device usb2_serial_cycom
device usb2_serial_foma
device usb2_serial_ftdi
device usb2_serial_gensa
device usb2_serial_ipaq
device usb2_serial_lpt
device usb2_serial_mct
device usb2_serial_modem
device usb2_serial_moscom
device usb2_serial_plcom
device usb2_serial_visor
device usb2_serial_vscom

# USB bluetooth support
device usb2_bluetooth
device usb2_bluetooth_ng

# USB input device support
device usb2_input
device usb2_input_hid
device usb2_input_kbd
device usb2_input_ms

# USB sound and MIDI device support
device usb2_sound

2) To enable the driver at runtime:

2.a) Unload all existing USB modules. If USB is compiled into the
kernel then you might have to build a new kernel.

2.b) Load the "usb2_xxx.ko" modules under /boot/kernel having the same
base name like the kernel device option.

Submitted by: Hans Petter Selasky hselasky at c2i dot net
Reviewed by: imp, alfred

15 years agoReplace the non-standard disclaimer with the standard one from /COPYRIGHT
imp [Tue, 4 Nov 2008 00:20:43 +0000 (00:20 +0000)]
Replace the non-standard disclaimer with the standard one from /COPYRIGHT

Approved by: jedgar@

15 years agoUse more standardized license language
imp [Mon, 3 Nov 2008 22:43:37 +0000 (22:43 +0000)]
Use more standardized license language

Approved by: Thomas Quinot

15 years agoBugfix: Cut&paste error from the NetBSD code.
n_hibma [Mon, 3 Nov 2008 22:09:27 +0000 (22:09 +0000)]
Bugfix: Cut&paste error from the NetBSD code.

Also: Change the initialisation of the command string to a static
initialiser. Verify it against the output of umass.c when being sent a
command using 'camcontrol eject da0' to a Bulk-Only device.

This should make those devices work that need a SCSI eject command to
switch to modem mode (Novatel 950D and others).

15 years agouaa->ifaces contains pointers so set its entry to NULL not 0.
n_hibma [Mon, 3 Nov 2008 22:05:44 +0000 (22:05 +0000)]
uaa->ifaces contains pointers so set its entry to NULL not 0.

15 years agoRevert to preferring mmap(2) over sbrk(2) when mapping memory, due to
jasone [Mon, 3 Nov 2008 21:17:18 +0000 (21:17 +0000)]
Revert to preferring mmap(2) over sbrk(2) when mapping memory, due to
potential extreme contention in the kernel for multi-threaded applications
on SMP systems.

Reported by: kris

15 years agoAdjust the license statement to more closely match a standard 3-clause BSD
jhb [Mon, 3 Nov 2008 21:17:02 +0000 (21:17 +0000)]
Adjust the license statement to more closely match a standard 3-clause BSD
license.

MFC after: 3 days

15 years agoUse shared vnode locks instead of exclusive vnode locks for the access(),
jhb [Mon, 3 Nov 2008 20:31:00 +0000 (20:31 +0000)]
Use shared vnode locks instead of exclusive vnode locks for the access(),
chdir(), chroot(), eaccess(), fpathconf(), fstat(), fstatfs(), lseek()
(when figuring out the current size of the file in the SEEK_END case),
pathconf(), readlink(), and statfs() system calls.

Submitted by: ups (mostly)
Tested by: pho
MFC after: 1 month

15 years agoRemove the mnt_holdcnt and mnt_holdcntwaiters because they are useless.
attilio [Mon, 3 Nov 2008 20:00:35 +0000 (20:00 +0000)]
Remove the mnt_holdcnt and mnt_holdcntwaiters because they are useless.
Really, the concept of holdcnt in the struct mount is rappresented by
the mnt_ref (which prevents the type-stable structure from being
"recycled) handled through vfs_ref() and vfs_rel().
On this optic, switch the holdcnt acquisition into an emulated vfs_ref()
(and subsequent release into vfs_rel()).

Discussed with: kib
Tested by: pho

15 years agoRemove some unused and broken code that attempted to not invoke locking
jhb [Mon, 3 Nov 2008 19:57:40 +0000 (19:57 +0000)]
Remove some unused and broken code that attempted to not invoke locking
asserts on NULL vnode pointers.  All the vnode assertion routines already
check for NULL vnode pointers.

15 years agoA few style nits.
jhb [Mon, 3 Nov 2008 19:33:20 +0000 (19:33 +0000)]
A few style nits.

15 years agoRemove " + 1".
mav [Mon, 3 Nov 2008 18:28:12 +0000 (18:28 +0000)]
Remove " + 1".
Thread ID can't be zero anyway while increment may give owerflow.

15 years agoFix few missed accmode changes in coda.
trasz [Mon, 3 Nov 2008 16:36:23 +0000 (16:36 +0000)]
Fix few missed accmode changes in coda.

Approved by: rwatson (mentor)

15 years agoNit: Add a few leading zeros to make this match other mask constants
imp [Mon, 3 Nov 2008 15:38:45 +0000 (15:38 +0000)]
Nit: Add a few leading zeros to make this match other mask constants
in this file.  Also to make sure that I got other ASI constants right.

15 years agoImplement device cloning for /dev/nsmb, the netsmb control pseudo-device.
rwatson [Mon, 3 Nov 2008 14:23:15 +0000 (14:23 +0000)]
Implement device cloning for /dev/nsmb, the netsmb control pseudo-device.
The smb library in userspace already knows how to deal with this type of
cloning.

This also corrects a leak in which the netsmb kernel module could not be
unloaded if device nodes had been stat'd but not open'd.

Discussed with: kib

15 years agoRegen.
dfr [Mon, 3 Nov 2008 10:39:35 +0000 (10:39 +0000)]
Regen.

15 years agoImplement support for RPCSEC_GSS authentication to both the NFS client
dfr [Mon, 3 Nov 2008 10:38:00 +0000 (10:38 +0000)]
Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager.  I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.

The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.

To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.

As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.

Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.

The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.

Sponsored by: Isilon Systems
MFC after: 1 month

15 years agoAdd the ffsll and flsll functions. These are ffs and fls operating
kib [Mon, 3 Nov 2008 10:22:19 +0000 (10:22 +0000)]
Add the ffsll and flsll functions. These are ffs and fls operating
on long long arguments.

Reviewed by: bde (previous version, that included asm implementation
for all ffs and fls functions on i386 and amd64)
MFC after: 2 weeks

15 years agoFix style.
kib [Mon, 3 Nov 2008 10:14:47 +0000 (10:14 +0000)]
Fix style.

15 years agoTurns out this isn't even used at all... The bogon that I was tracing was
imp [Mon, 3 Nov 2008 06:37:59 +0000 (06:37 +0000)]
Turns out this isn't even used at all...  The bogon that I was tracing was
in code from my p4 tree, not -current.  Delete it here.

15 years agoUse child (the card) in preference to cbdev (the bridge) when
imp [Mon, 3 Nov 2008 06:06:22 +0000 (06:06 +0000)]
Use child (the card) in preference to cbdev (the bridge) when
allocating resources to read the CIS.  I'm not sure when this changed,
but it is totally wrong.  Also, add a minor improvement to the
debugging.

This should help everybody trying to run dumpcis on atheros wireless
card as well.

MFC after: 2 days

15 years agoWe can't mask out the higher order bits and have the size come out
imp [Mon, 3 Nov 2008 05:52:43 +0000 (05:52 +0000)]
We can't mask out the higher order bits and have the size come out
right...  Good thing the size was ignored...

Where this macro is used, there's no reason to do it anyway.  There
seems to have been some old-time confusion between the CIS pointer
definition, and the BAR definitions at the base of this bug.

15 years agoSync with OpenBSD's dirname(3) - license change, avoid strcpy() over
delphij [Mon, 3 Nov 2008 05:19:45 +0000 (05:19 +0000)]
Sync with OpenBSD's dirname(3) - license change, avoid strcpy() over
string constant, use memcpy() instead of strncpy() and improve code
readibility.  No functional change.

15 years agoAdd amr_cam module directory that was missed in the previous commit.
scottl [Mon, 3 Nov 2008 04:13:27 +0000 (04:13 +0000)]
Add amr_cam module directory that was missed in the previous commit.

15 years agoMove the CAM passthrough code into a true module so that it doesn't have to be
scottl [Mon, 3 Nov 2008 00:53:54 +0000 (00:53 +0000)]
Move the CAM passthrough code into a true module so that it doesn't have to be
compiled into the main AMR driver.  It's code that is nice to have but not
required for normal operation, and it is reported to cause problems for some
people.

15 years agoCatch up with netsmb locking: explicit thread arguments no longer required.
rwatson [Sun, 2 Nov 2008 23:20:27 +0000 (23:20 +0000)]
Catch up with netsmb locking: explicit thread arguments no longer required.

15 years agoCatch up internal locking routines in netsmb with lockmgr changes --
rwatson [Sun, 2 Nov 2008 23:15:32 +0000 (23:15 +0000)]
Catch up internal locking routines in netsmb with lockmgr changes --
explicit thread arguments are no longer required in many places.

15 years agoIncrease the initial sbuf size for CPU topology dump to something more
ivoras [Sun, 2 Nov 2008 23:11:20 +0000 (23:11 +0000)]
Increase the initial sbuf size for CPU topology dump to something more
usable for newer CPUs. The new value allows 2 x quad core configuration
dumps to fit within the initial buffer without reallocations.

Approved by: gnn (mentor) (older version)
Pointed out by: rdivacky

15 years agosmb_vc_put() requires that the passed vcp be locked, so lock it before
rwatson [Sun, 2 Nov 2008 20:22:24 +0000 (20:22 +0000)]
smb_vc_put() requires that the passed vcp be locked, so lock it before
dropping the connection when the requested service isn't available, or
we may try to release a lock that isn't locked.

This prevents an assertion failure when trying to mount a non-present
share using smbfs with INVARIANTS; a lock order reversal warning that
immediately follows is not yet fixed.

Reported by: attilio
MFC after: 3 days

15 years agoWhen encoding an smb name, truncate one byte earlier in order than we did
rwatson [Sun, 2 Nov 2008 19:48:15 +0000 (19:48 +0000)]
When encoding an smb name, truncate one byte earlier in order than we did
previously in order to ensure it fit properly in the bufer when encoded.
This prevents a debugging printf from firing if a source or destination
host name for an smb mount exceeds 15 characters.

MFC after: 3 days
Obtained from: Apple, Inc.

15 years agoRevert r184516. Option RL_TWISTER_ENABLE is no more after it became
kib [Sun, 2 Nov 2008 19:40:24 +0000 (19:40 +0000)]
Revert r184516. Option RL_TWISTER_ENABLE is no more after it became
loader tunable.

Pointy hat to: me

15 years agoMake the touch pad on my PowerBook G4 12" a little more usable.
ed [Sun, 2 Nov 2008 19:08:10 +0000 (19:08 +0000)]
Make the touch pad on my PowerBook G4 12" a little more usable.

For an unknown reason the touch pad of my PowerBook generates button 5
events when you operate it. This causes the adb_mouse code to convert
them to button 2 events, which is not what we want.

Add a new flag, AMS_TOUCHPAD, which is used to distinguish the touch
pad. When set, don't convert button events of unknown buttons to the
last button.

There are still three problems left with respect to user input:

- The mouse button events are not properly processed when the touch pad
  isn't touched.

- The arrow keys on the keyboard don't work inside X11.

- The power button isn't handled by the kernel, similar to the ACPI
  power button on i386/amd64.

Approved by: nwhitehorn

15 years agoMFp4:
imp [Sun, 2 Nov 2008 18:48:54 +0000 (18:48 +0000)]
MFp4:

Make the ISA bus keep track of more PNP details.  Plus a minor style
fix while I'm here.  More could be done here, but except for some SBCs
that don't have ACPI, there's limited value to anybody in doing so.

15 years agoMake the no driver stuff an ifdef.
imp [Sun, 2 Nov 2008 17:35:15 +0000 (17:35 +0000)]
Make the no driver stuff an ifdef.

15 years agoMove mn over. One of the last stragglers in sys/pci. There's no
imp [Sun, 2 Nov 2008 17:04:54 +0000 (17:04 +0000)]
Move mn over.  One of the last stragglers in sys/pci.  There's no
module built for this hardware, so no changes needed.

15 years agoDocument a few sysctls in the NFS client and server code.
trhodes [Sun, 2 Nov 2008 17:00:23 +0000 (17:00 +0000)]
Document a few sysctls in the NFS client and server code.
Minor style(9) where applicable.

Approved by: alfred (slightly older version)

15 years agoDocument dev.rl.%unit.twister_enable sysctl/tunable.
imp [Sun, 2 Nov 2008 16:51:57 +0000 (16:51 +0000)]
Document dev.rl.%unit.twister_enable sysctl/tunable.

Submitted by: Kostik Belousov

15 years agoMake RL_TWISTER_ENABLE a tunable/sysctl. Eliminate it as an option.
imp [Sun, 2 Nov 2008 16:50:57 +0000 (16:50 +0000)]
Make RL_TWISTER_ENABLE a tunable/sysctl.  Eliminate it as an option.
Fix module build.

Submitted by: Kostik Belousov

15 years agoAs soon as we have several threads per process now, it is not correct to
mav [Sun, 2 Nov 2008 12:50:16 +0000 (12:50 +0000)]
As soon as we have several threads per process now, it is not correct to
use process ID as ACPI thread ID. Concurrent requests with equal thread
IDs broke ACPI mutexes operation causing unpredictable errors including
AE_AML_MUTEX_NOT_ACQUIRED that I have seen.

Use kernel thread ID instead of process ID for ACPI thread.

15 years agoRemove the call to getinoquota() from ntfs_access. How did it get there?!
trasz [Sun, 2 Nov 2008 11:49:19 +0000 (11:49 +0000)]
Remove the call to getinoquota() from ntfs_access.  How did it get there?!

Approved by: rwatson (mentor)

15 years agoReflect changes for the vfs_busy() prototype.
attilio [Sun, 2 Nov 2008 10:33:57 +0000 (10:33 +0000)]
Reflect changes for the vfs_busy() prototype.

15 years agoBump __FreeBSD_version in order to reflect vfs_busy() prototype changing
attilio [Sun, 2 Nov 2008 10:20:18 +0000 (10:20 +0000)]
Bump __FreeBSD_version in order to reflect vfs_busy() prototype changing
and its flags (MBF_NOWAIT, MBF_MNTLSTLOCK) introduction.

15 years agoImprove VFS locking:
attilio [Sun, 2 Nov 2008 10:15:42 +0000 (10:15 +0000)]
Improve VFS locking:
- Implement real draining for vfs consumers by not relying on the
  mnt_lock and using instead a refcount in order to keep track of lock
  requesters.
- Due to the change above, remove the mnt_lock lockmgr because it is now
  useless.
- Due to the change above, vfs_busy() is no more linked to a lockmgr.
  Change so its KPI by removing the interlock argument and defining 2 new
  flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the
  old version (which was unlinked from the lockmgr alredy) and
  MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx
  once the mnt interlock is held (ability still desired by most consumers).
- The stub used into vfs_mount_destroy(), that allows to override the
  mnt_ref if running for more than 3 seconds, make it totally useless.
  Remove it as it was thought to work into older versions.
  If a problem of "refcount held never going away" should appear, we will
  need to fix properly instead than trust on such hackish solution.
- Fix a bug where returning (with an error) from dounmount() was still
  leaving the MNTK_MWAIT flag on even if it the waiters were actually
  woken up. Just a place in vfs_mount_destroy() is left because it is
  going to recycle the structure in any case, so it doesn't matter.
- Remove the markercnt refcount as it is useless.

This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and
__FreeBSD_version will be modified accordingly.

Discussed with: kib
Tested by: pho

15 years agoAdd support for reading Tivo Series 1 partitioning. This likely needs
imp [Sun, 2 Nov 2008 03:02:56 +0000 (03:02 +0000)]
Add support for reading Tivo Series 1 partitioning.  This likely needs
a little refinement, but is good enough to commit as is.

# Should look to see if I should move swab(3) into the kernel or just
# provide the unoptimized routine here.

Reviewed by: marcel@

15 years agoMerge some minor deltas from p4 newcard tree:
imp [Sun, 2 Nov 2008 03:00:36 +0000 (03:00 +0000)]
Merge some minor deltas from p4 newcard tree:
(1) Belkin F5D7050_V4000 was also sold as 'Ativa 802.11g wireless card'
(document)
(2) Add HP Office Jet 4215

15 years agoRemove cardbus attachment. It likely was a cut-n-paste left over from
imp [Sun, 2 Nov 2008 02:58:24 +0000 (02:58 +0000)]
Remove cardbus attachment.  It likely was a cut-n-paste left over from
whatever template was used to create this driver.  It is not
necessary, and wouldn't work anyway since (a) this device will never
be in a cardbus tin-can and (b) the driver isn't even PCI, but instead
a built-in NIC on the IDT RC32434 on its internal bus.

15 years agoAdd missing END() macros, as per rev 184547 for amd64. The lack of these
peter [Sun, 2 Nov 2008 01:28:47 +0000 (01:28 +0000)]
Add missing END() macros, as per rev 184547 for amd64.  The lack of these
is mostly harmless, but it does upset some of valgrind's functionality.

15 years agoWe've been lax about matching END() macros in asm code for some time. This
peter [Sun, 2 Nov 2008 01:10:54 +0000 (01:10 +0000)]
We've been lax about matching END() macros in asm code for some time.  This
is used to set the ELF size attribute for functions.  It isn't normally
critical but some things can make use of it (gdb for stack traces).
Valgrind needs it so I'm adding it in.  The problem is present on all
branches and on both i386 and amd64.

15 years agoVarious comment nits, and typos.
keramida [Sun, 2 Nov 2008 00:41:26 +0000 (00:41 +0000)]
Various comment nits, and typos.

15 years agoUpdate introductory comment for audit pipes.
rwatson [Sun, 2 Nov 2008 00:25:48 +0000 (00:25 +0000)]
Update introductory comment for audit pipes.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoRemove stale comment about filtering in audit pipe ioctl routine: we do
rwatson [Sun, 2 Nov 2008 00:18:19 +0000 (00:18 +0000)]
Remove stale comment about filtering in audit pipe ioctl routine: we do
support filtering now, although we may want to make it more interesting
in the future.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoAdd comment for per-pipe stats.
rwatson [Sat, 1 Nov 2008 23:05:49 +0000 (23:05 +0000)]
Add comment for per-pipe stats.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoWe only allow a partial read of the first record in an audit pipe
rwatson [Sat, 1 Nov 2008 21:56:45 +0000 (21:56 +0000)]
We only allow a partial read of the first record in an audit pipe
record queue, so move the offset field from the per-record
audit_pipe_entry structure to the audit_pipe structure.

Now that we support reading more than one record at a time, add a
new summary field to audit_pipe, ap_qbyteslen, which tracks the
total number of bytes present in a pipe, and return that (minus
the current offset) via FIONREAD and kqueue's data variable for
the pending byte count rather than the number of bytes remaining
in only the first record.

Add a number of asserts to confirm that these counts and offsets
following the expected rules.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoAllow a single read(2) system call on an audit pipe to retrieve data from
rwatson [Sat, 1 Nov 2008 21:16:09 +0000 (21:16 +0000)]
Allow a single read(2) system call on an audit pipe to retrieve data from
more than one audit record at a time in order to improve efficiency.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoCorrect the documented declaration of the archive_write_callback to
kientzle [Sat, 1 Nov 2008 19:11:21 +0000 (19:11 +0000)]
Correct the documented declaration of the archive_write_callback to
match the code.

PR: docs/128089
Submitted by: Mel
MFC after: 3 days

15 years agoRemove obsolete pseudocode from VOP_ACCESS.9, replacing it with something
trasz [Sat, 1 Nov 2008 19:02:05 +0000 (19:02 +0000)]
Remove obsolete pseudocode from VOP_ACCESS.9, replacing it with something
closer to reality.

Approved by: rwatson (mentor)

15 years agoFix a few typos/spelling errors in my comments from the last commit,
imp [Sat, 1 Nov 2008 17:02:01 +0000 (17:02 +0000)]
Fix a few typos/spelling errors in my comments from the last commit,
plus a few others that had lingered in this driver...

Submitted by: "b." bf2006a att yahoo KIBO com

15 years ago- Add one more supported adapter (1)
brueffer [Sat, 1 Nov 2008 14:19:55 +0000 (14:19 +0000)]
- Add one more supported adapter (1)
- Fix a couple of typos

Submitted by: Horvath Andras (1)

15 years agoClamp the values of t_column to 5 digits in `pstat -t' and `show all ttys'.
ed [Sat, 1 Nov 2008 13:40:46 +0000 (13:40 +0000)]
Clamp the values of t_column to 5 digits in `pstat -t' and `show all ttys'.

We often run into these very high column numbers when we run curses
applications, because they don't print any newlines. This messes up the
table output of `pstat -t'. If these numbers get really high, they
aren't of any use to the reader anyway. Convert them to `99999' when
they run out of bounds.

15 years agoReimplement the /dev/console device node.
ed [Sat, 1 Nov 2008 08:35:28 +0000 (08:35 +0000)]
Reimplement the /dev/console device node.

One of the pieces of code that I had left alone during the development
of the MPSAFE TTY layer, was tty_cons.c. This file actually has two
different functions:

- It contains low-level console input/output routines (cnputc(), etc).

- It creates /dev/console and wraps all its cdevsw calls to the
  appropriate TTY.

This commit reimplements the second set of functions by moving it
directly into the TTY layer. /dev/console is now a character device node
that's basically a regular TTY, but does a lookup of `si_drv1' each time
you open it. d_write has also been changed to call log_console().
d_close() is not present, because we must make sure we don't revoke the
TTY after writing a log message to it.

Even though I'm not convinced this is in line with the future directions
of our console code, it is a good move for now. It removes recursive
locking from the top half of the TTY layer. The previous implementation
called into the TTY layer with Giant held.

I'm renaming tty_cons.c to kern_cons.c now. The code hardly contains any
TTY related bits, so we'd better give it a less misleading name.

Tested by: Andrzej Tobola <ato iem pw edu pl>,
Carlos A.M. dos Santos <unixmania gmail com>,
Eygene Ryabinkin <rea-fbsd codelabs ru>

15 years agoAllow a read() on /dev/ams[0-9] to be interrupted.
ed [Sat, 1 Nov 2008 08:07:02 +0000 (08:07 +0000)]
Allow a read() on /dev/ams[0-9] to be interrupted.

Right now ams_read() uses cv_wait() to wait for new data to arrive on
the mouse device. This means that when you run `cat /dev/ams0', it
cannot be interrupted directly. After you press ^C, you first need to
move the mouse before cat will quit. Make this function use
cv_wait_sig(), which allows it to be interrupted directly.

Reviewed by: nwhitehorn

15 years agoo OpenBSD 4.4 added.
maxim [Sat, 1 Nov 2008 06:48:28 +0000 (06:48 +0000)]
o OpenBSD 4.4 added.

15 years agoAdd RL_TWISTER_ENABLE.
imp [Sat, 1 Nov 2008 00:28:44 +0000 (00:28 +0000)]
Add RL_TWISTER_ENABLE.

15 years agoAdd RL_TWISTER_ENABLE option. This enables the magic bits to do long
imp [Fri, 31 Oct 2008 23:24:13 +0000 (23:24 +0000)]
Add RL_TWISTER_ENABLE option.  This enables the magic bits to do long
cable tuning.  This has helped in some installations for hardware
deployed by a former employer.  Made optional because the lists aren't
full of complaints about these cards... even when they were wildly
popular.

Reviewed by: attilio@, jhb@, trhodes@ (all an older version of the patch)

15 years agoIn example use of err(3) and errx(3), use sysexits(3) constants.
rwatson [Fri, 31 Oct 2008 15:14:40 +0000 (15:14 +0000)]
In example use of err(3) and errx(3), use sysexits(3) constants.

MFC after: 3 days
Submitted by: Bruce Cran <bruce at cran dot org dot uk>

15 years agoSince there is no longer the opportunity for record truncation, just
rwatson [Fri, 31 Oct 2008 15:11:01 +0000 (15:11 +0000)]
Since there is no longer the opportunity for record truncation, just
return 0 if the truncation counter is queried on an audit pipe.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoIn style(9) examples of err() and errx(), use sysexits(3) errors rather
rwatson [Fri, 31 Oct 2008 14:47:15 +0000 (14:47 +0000)]
In style(9) examples of err() and errx(), use sysexits(3) errors rather
than returning 1.

Submitted by: Bruce Cran <bruce at cran dot org dot uk>
MFC after: 3 days

15 years agoHistorically, /dev/auditpipe has allows only whole records to be read via
rwatson [Fri, 31 Oct 2008 14:40:21 +0000 (14:40 +0000)]
Historically, /dev/auditpipe has allows only whole records to be read via
read(2), which meant that records longer than the buffer passed to read(2)
were dropped.  Instead take the approach of allowing partial reads to be
continued across multiple system calls more in the style of streaming
character device.

This means retaining a record on the per-pipe queue in a partially read
state, so maintain a current offset into the record.  Keep the record on
the queue during a read, so add a new lock, ap_sx, to serialize removal
of records from the queue by either read(2) or ioctl(2) requesting a pipe
flush.  Modify the kqueue handler to return bytes left in the current
record rather than simply the size of the current record.

It is now possible to use praudit, which used the standard FILE * buffer
sizes, to track much larger record sizes from /dev/auditpipe, such as
very long command lines to execve(2).

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoThe code in linux_proc_exit() contains a race when multiple linux based
kib [Fri, 31 Oct 2008 10:38:30 +0000 (10:38 +0000)]
The code in linux_proc_exit() contains a race when multiple linux based
processes exits at the same time.  The linux_emuldata structure is freed
but p->p_emuldata is left as a dangling pointer to the just freed memory.

The check for W_EXIT in the loop scanning the child processes isn't safe
since the state of the child process can change right afterwards. Lock
the process and check the W_EXIT before delivering signal.

Submitted by: tegge
Reviewed by: davidxu
MFC after: 1 week

15 years agoThe file was inadvertently excluded from r184499.
kib [Fri, 31 Oct 2008 10:14:28 +0000 (10:14 +0000)]
The file was inadvertently excluded from r184499.

15 years agoRevert r184136. Instead, push the check for crashdumpmap overflow into the
kib [Fri, 31 Oct 2008 10:11:35 +0000 (10:11 +0000)]
Revert r184136. Instead, push the check for crashdumpmap overflow into the
MD i386 and amd64 dump code.

Requested by: jhb
Retested by: pho
MFC after: 3 days (+ 176304 + 184136)

15 years agoAdd three extra to the kinfo_proc_vmmap data. kve_offset - the offset
peter [Fri, 31 Oct 2008 05:43:19 +0000 (05:43 +0000)]
Add three extra to the kinfo_proc_vmmap data.  kve_offset - the offset
within an object that a mapping refers to.  fileid and fsid are inode/dev
for vnodes.  (Linux procfs has these and valgrind is really unhappy
without them.)  I believe I didn't change the size of the struct.

15 years agoModify our boot block to pick an output device, without which boot1 will fail
nwhitehorn [Fri, 31 Oct 2008 00:52:31 +0000 (00:52 +0000)]
Modify our boot block to pick an output device, without which boot1 will fail
on G4 machines. On the assumption that most people using FreeBSD on Apple
hardware are not using serial consoles, set boot1's output to screen. This
should be revisited. While here, reduce verbosity of boot1.

15 years agoWhen we drop an audit record going to and audit pipe because the audit
rwatson [Thu, 30 Oct 2008 23:09:19 +0000 (23:09 +0000)]
When we drop an audit record going to and audit pipe because the audit
pipe has overflowed, drop the newest, rather than oldest, record.  This
makes overflow drop behavior consistent with memory allocation failure
leading to drop, avoids touching the consumer end of the queue from a
producer, and lowers the CPU overhead of dropping a record by dropping
before memory allocation and copying.

Obtained from: Apple, Inc.
MFC after: 2 months

15 years agoBreak out single audit_pipe_mtx into two types of locks: a global rwlock
rwatson [Thu, 30 Oct 2008 21:58:39 +0000 (21:58 +0000)]
Break out single audit_pipe_mtx into two types of locks: a global rwlock
protecting the list of audit pipes, and a per-pipe mutex protecting the
queue.

Likewise, replace the single global condition variable used to signal
delivery of a record to one or more pipes, and add a per-pipe condition
variable to avoid spurious wakeups when event subscriptions differ
across multiple pipes.

This slightly increases the cost of delivering to audit pipes, but should
reduce lock contention in the presence of multiple readers as only the
per-pipe lock is required to read from a pipe, as well as avoid
overheading when different pipes are used in different ways.

MFC after: 2 months
Sponsored by: Apple, Inc.

15 years agoMake it possible to compile kernel with KTR but without DDB.
sobomax [Thu, 30 Oct 2008 21:48:28 +0000 (21:48 +0000)]
Make it possible to compile kernel with KTR but without DDB.

15 years agoFix compilation in the case when kernel doesn't have KDB ebabled.
sobomax [Thu, 30 Oct 2008 21:02:00 +0000 (21:02 +0000)]
Fix compilation in the case when kernel doesn't have KDB ebabled.
subr_kdb.c still references breakpoint() in this case.

15 years agoifconfig(8) can take only one interface at a time.
pjd [Thu, 30 Oct 2008 20:24:25 +0000 (20:24 +0000)]
ifconfig(8) can take only one interface at a time.

15 years agoWhen running a "chio return" operation using a physical source unit
joerg [Thu, 30 Oct 2008 19:51:02 +0000 (19:51 +0000)]
When running a "chio return" operation using a physical source unit
rather than a voltag name, do not set the CESR_VOLTAGS flags in the
CHIOGSTATUS command requesting the current status.  As voltags are an
optional feature that must be handled as "reserved" by media changers
not implementing the feature, always setting CESR_VOLTAGS resulted in
the command being aborted with an `Invalid field in CDB', and
consequently the "chio return" failed, for media changers that do not
support voltags.

MFC after: 1 week

15 years agoAdd quirk to set GPIO2 to enable internal speaker on Dell Vostro 1400.
mav [Thu, 30 Oct 2008 17:54:20 +0000 (17:54 +0000)]
Add quirk to set GPIO2 to enable internal speaker on Dell Vostro 1400.

Tested by: Sergio Veloso

15 years agoProtect the event->class lookup database using an rwlock instead of a
rwatson [Thu, 30 Oct 2008 17:47:57 +0000 (17:47 +0000)]
Protect the event->class lookup database using an rwlock instead of a
mutex, as it's rarely changed but frequently accessed read-only from
multiple threads, so a potentially significant source of contention.

MFC after: 1 month
Sponsored by: Apple, Inc.

15 years agoFix checks for fast frames negotiation. ni_ath_flags holds the
sam [Thu, 30 Oct 2008 16:22:04 +0000 (16:22 +0000)]
Fix checks for fast frames negotiation.  ni_ath_flags holds the
capabilities reported by the ap.  These need to be cross-checked
against the local configuration in the vap.  Previously we were
only checking the ap capabilities which meant that if an ap reported
it was ff-capable but we were not setup to use them we'd try to do
ff aggregation and drop the frame.

There are a number of problems to be fixed here but applying this
fix immediately as the problem causes all traffic to stop (and has
not workaround).

Reported by: Ashish Shukla