Commit Graph

142520 Commits

Author SHA1 Message Date
Maxim Konovalov
7922d6f987 o Replace Xr to gpt(8) which is gone by gpart(8). 2008-11-05 09:27:13 +00:00
Tim Kientzle
025b20f6e5 When comparing, cast to the larger size, off_t in this case.
Once we know which one is smaller, then we cast to the smaller size.

Thanks to Xin Li (delphij@)
Pointy hat: /me
2008-11-05 06:40:53 +00:00
Tim Kientzle
f4e24c4e7a Fix compile warnings building on amd64. This is modified slightly
from Jaakko's original patch: I have misgivings about the portability
of the 'z' printf modifier so opted to cast the arguments to (int)
instead.

PR:		bin/128561
Submitted by:	Jaakko Heinonen
MFC after:	30 days
2008-11-05 05:26:11 +00:00
David Xu
7b4a950a7d Revert rev 184216 and 184199, due to the way the thread_lock works,
it may cause a lockup.

Noticed by: peter, jhb
2008-11-05 03:01:23 +00:00
Xin LI
cef3930d7c Correct a typo that prevented my laptop from starting
devd.
2008-11-04 23:03:36 +00:00
John Baldwin
927edcc9ba Use shared vnode locks for auditing vnode arguments as auditing only
does a VOP_GETATTR() which does not require an exclusive lock.

Reviewed by:	csjp, rwatson
2008-11-04 22:31:04 +00:00
John Baldwin
16da60664d Don't lock the vnode around calls to vn_fullpath().
Reviewed by:	csjp, rwatson
2008-11-04 22:30:24 +00:00
Rink Springer
203b82c842 Even though the previous commit was functionally equivalent with the code it replaced, it was wrong: le16toh should have been used.
Note that these changes will not make the driver work on powerpc, but it should fix at least the i386/amd64 cases.

Obtained from:	//depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#20
Noticed by:	jeli, ed
2008-11-04 20:57:39 +00:00
Rink Springer
9fbaa8e74d Fix the build (on at least powerpc) by moving the htole16() from the case(x) expression directly to the switch(x) itself.
Reviewed by:	imp@
2008-11-04 19:28:19 +00:00
Max Laier
0551897af2 Declare functions and variables static and save a few byte. This is a
style(9)-change, too.  Separate commit as it changes the object.
2008-11-04 19:23:48 +00:00
Remko Lodder
07d214248b Add Rene Ladan, as well as my relationship towards Rene. 2008-11-04 19:20:19 +00:00
Max Laier
40850176c9 style(9): mostly avoiding line wrap by not indenting cases. No obj change. 2008-11-04 19:17:32 +00:00
John Baldwin
0caf1ab15a Don't bother calling setrunnable() and clearing the sleeping flag in
sleepq_resume_thread() if the thread isn't asleep.
2008-11-04 19:13:53 +00:00
John Baldwin
2ff47c5f18 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
2008-11-04 19:04:01 +00:00
John Baldwin
2ef42c06d6 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.
2008-11-04 18:56:12 +00:00
John Baldwin
7265164f53 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.
2008-11-04 18:54:44 +00:00
John Baldwin
b1b3a8653d Don't leak a reference on the /compat/linux vnode everytime
the linprocfs 'mtab' file is read.

MFC after:	1 month
2008-11-04 18:53:33 +00:00
Giorgos Keramidas
e9d8f84b73 Fix comment typo that managed to sneak in when I copy pasted some
comments & code from iostat.
2008-11-04 18:20:54 +00:00
Giorgos Keramidas
4fb6032f19 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
2008-11-04 18:02:35 +00:00
Doug Rabson
a720ad3450 Include <sys/eventhandler.h>. 2008-11-04 16:43:02 +00:00
Dag-Erling Smørgrav
3ebc694460 Whitespace and style fixes, build at WARNS level 6.
MFC after:	3 weeks
2008-11-04 14:17:49 +00:00
Dag-Erling Smørgrav
5e1a74e82f libutil now builds at WARNS level 6.
MFC after:	3 weeks
2008-11-04 13:51:15 +00:00
Dag-Erling Smørgrav
b4d2cfd941 Add missing header. 2008-11-04 13:50:50 +00:00
Dag-Erling Smørgrav
b8a5cd86e3 Avoid assigning a const char * to a char *.
MFC after:	3 weeks
2008-11-04 13:49:53 +00:00
Edward Tomasz Napierala
4a4f18ed37 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)
2008-11-04 12:30:31 +00:00
Rui Paulo
31fb990621 Add support for Asus A8Sr notebooks.
PR:		128553
Submitted by:	Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Reviewed by:	philip
MFC after:	2 months
2008-11-04 11:52:50 +00:00
Ed Schouten
394e94079c 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.
2008-11-04 10:58:02 +00:00
Alfred Perlstein
c63c25015a add usb2_if.m to mfiles to unbreak build of modules. 2008-11-04 03:42:01 +00:00
Alfred Perlstein
eabe30fc9c 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
2008-11-04 02:31:03 +00:00
Warner Losh
68b2399298 Replace the non-standard disclaimer with the standard one from /COPYRIGHT
Approved by:	jedgar@
2008-11-04 00:20:43 +00:00
Warner Losh
09988d1e9a Use more standardized license language
Approved by:	Thomas Quinot
2008-11-03 22:43:37 +00:00
Nick Hibma
92ad2cd779 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).
2008-11-03 22:09:27 +00:00
Nick Hibma
bcde061b22 uaa->ifaces contains pointers so set its entry to NULL not 0. 2008-11-03 22:05:44 +00:00
Jason Evans
b74d3e0c37 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
2008-11-03 21:17:18 +00:00
John Baldwin
4482f952b1 Adjust the license statement to more closely match a standard 3-clause BSD
license.

MFC after:	3 days
2008-11-03 21:17:02 +00:00
John Baldwin
21fc02d271 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
2008-11-03 20:31:00 +00:00
Attilio Rao
30f60d8c31 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
2008-11-03 20:00:35 +00:00
John Baldwin
c439bdd86f 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.
2008-11-03 19:57:40 +00:00
John Baldwin
0f54f8c2b3 A few style nits. 2008-11-03 19:33:20 +00:00
Alexander Motin
9325b9b23b Remove " + 1".
Thread ID can't be zero anyway while increment may give owerflow.
2008-11-03 18:28:12 +00:00
Edward Tomasz Napierala
ea49f15447 Fix few missed accmode changes in coda.
Approved by:	rwatson (mentor)
2008-11-03 16:36:23 +00:00
Warner Losh
8481e37b53 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.
2008-11-03 15:38:45 +00:00
Robert Watson
339f72c730 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
2008-11-03 14:23:15 +00:00
Doug Rabson
45e6ab7f81 Regen. 2008-11-03 10:39:35 +00:00
Doug Rabson
a9148abd9d 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
2008-11-03 10:38:00 +00:00
Konstantin Belousov
4a723bd20c 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
2008-11-03 10:22:19 +00:00
Konstantin Belousov
6f41f432e1 Fix style. 2008-11-03 10:14:47 +00:00
Warner Losh
714cb2219c 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.
2008-11-03 06:37:59 +00:00
Warner Losh
89558ee870 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
2008-11-03 06:06:22 +00:00
Warner Losh
6e39a203de 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.
2008-11-03 05:52:43 +00:00