Commit Graph

158238 Commits

Author SHA1 Message Date
David Xu
e5c66a0d9e inline testcancel() into thr_cancel_leave(), because cancel_pending is
almost false, this makes a slight better branch predicting.
2010-09-24 13:01:01 +00:00
Marius Strobl
04ebad3842 Make WARNS=6 clean.
MFC after:	1 week
2010-09-24 10:40:17 +00:00
David Xu
295fbd498e Now userland POSIX semaphore is based on umtx. The kernel module
is only used to support binary compatible, if want to run old
binary, you need to kldload the module.
2010-09-24 09:04:16 +00:00
Andrey V. Elsukov
6305a96c20 Implement "force" (-F) option for gpart destroy verb.
This option doesn't passed to kernel and handled in user-space.
With -F option gpart creates new "delete" request for each
partition in table. Each request has flags="X" that disables
auto-commit feature. Last request is the original "destroy" request.
It has own flags and can have disabled or enabled auto-commit feature.
If error is occurred when deleting partitions, then new "undo" request
is created and all changes will be rolled back.

Approved by:	kib (mentor)
2010-09-24 08:40:43 +00:00
David Xu
93ea4a71bf In most cases, cancel_point and cancel_async needn't be checked again,
because cancellation is almostly checked at cancellation points.
2010-09-24 07:52:07 +00:00
Alexander Motin
433d4558c1 Add missing le32toh(), same as recently done in ata-siliconimage.c. 2010-09-24 07:14:14 +00:00
Oleksandr Tymoshenko
ea14ae7aed - Do not place variables to memory allocated by busdma. pre/post ops
might invalidate cache and hence effectively void validity of values
2010-09-24 04:46:46 +00:00
Juli Mallett
a4f7e65822 o) Add bus_teardown_intr for pci and ciu. This allows the Promise SATA
driver to try to switch interrupt handlers at setup.  It's not a very
   good implementation of bus_teardown_intr, though.
o) Set cache line size and latency timers for PCI devices per Linux.
2010-09-24 02:41:52 +00:00
Juli Mallett
3032f6daa2 Flesh out PCI bus support some:
o) Reset and configure the bus from scratch rather than expecting U-Boot to
   do it for us.  Values and configuration from Linux, U-Boot and comments
   in the Cavium Simple Executive sources.
o) Do a resource assignment and bus numbering pass in the absence of a PCI
   BIOS or firmware that will do it for us.
   XXX This has to be the third or fourth instance of this in FreeBSD and
       it would be nice to have it become part of the PCI bus driver itself,
       like it is on Linux.
o) Fix interrupt mapping for and adjust bus configuration for the Lanner
   MR-955, based on information provided by Lanner.
2010-09-24 00:14:24 +00:00
Pyun YongHyeon
1432824670 Always show asic/chip revision in device attach phase. There are
too many bge(4) controllers there and model name does not
necessarily match asic/chip revision. Relying on VPD string made
it hard to identify exact asic/chip revision so the first step to
debug bge(4) was getting exact asic/chip information with verbose
boot which may not be available on production server.
2010-09-23 18:55:54 +00:00
Ed Maste
d370b81fd9 Remove unnecessary weak reference that was apparently copied from the
version of this function in lib/libc/inet/inet_pton.c

MFC after:     1 week
2010-09-23 17:47:46 +00:00
Warner Losh
1400f514d3 Clean up stray line in 213077 2010-09-23 17:29:59 +00:00
Warner Losh
b26f77e5dc Simplify how we find the kernel source. Rather than depending on sys,
or some variation in the path, the new version assumes that $0 is
newvers.sh path, and that dirname $0/.. is the same as $S aka $SYSDIR.
It also removes knowledge of ${MACHINE} and ${MACHINE_ARCH}, which is
also good.

# I've had this in my tree for about 6 months now, which is why I
# didn't notice that I broke it in r209510 and that was fixed in
# r212954.  This should finally resolve the issues people had with
# r204824 as well as address the issues that motivated r204824.
2010-09-23 17:12:47 +00:00
Marius Strobl
e865ab086c Try to adhere to style.Makefile(5).
MFC after:	3 days
2010-09-23 14:06:15 +00:00
Pawel Jakub Dawidek
7157a8ad7d - Simplify code by using g_*() API.
- Don't use u_char and u_int in userland.
- Change 'unsigned' to 'unsigned int'.
- Update copyright years.

MFC after:	1 week
2010-09-23 12:04:12 +00:00
Pawel Jakub Dawidek
cdf8ab6198 Update copyright years.
MFC after:	1 week
2010-09-23 12:02:42 +00:00
Pawel Jakub Dawidek
9839c97b4d Update copyright years.
MFC after:	1 week
2010-09-23 12:02:08 +00:00
Pawel Jakub Dawidek
07f1d01429 Document AES-XTS.
MFC after:	1 week
2010-09-23 12:00:40 +00:00
Pawel Jakub Dawidek
9a5a1d1e1e Add support for AES-XTS. This will be the default now.
MFC after:	1 week
2010-09-23 11:58:36 +00:00
Pawel Jakub Dawidek
ac970319ff Add support for CRYPTO_AES_XTS.
MFC after:	1 week
2010-09-23 11:57:25 +00:00
Pawel Jakub Dawidek
d295bdee07 Add support for AES-XTS.
Obtained from:	OpenBSD
MFC after:	1 week
2010-09-23 11:52:32 +00:00
Pawel Jakub Dawidek
c6a26d4c88 Implement switching of data encryption key every 2^20 blocks.
This ensures the same encryption key won't be used for more than
2^20 blocks (sectors). This will be the default now.

MFC after:	1 week
2010-09-23 11:49:47 +00:00
Pawel Jakub Dawidek
30bd3bb07b Add support for CRD_F_KEY_EXPLICIT flag.
MFC after:	1 week
2010-09-23 11:46:53 +00:00
Pawel Jakub Dawidek
b428e6ca90 Remove redundant space.
MFC after:	1 week
2010-09-23 11:33:29 +00:00
Pawel Jakub Dawidek
745eb0ccb6 Simplify code a bit.
MFC after:	1 week
2010-09-23 11:26:38 +00:00
Pawel Jakub Dawidek
1f0fb66f30 Make the code similar to the code in g_eli_integrity.c.
MFC after:	1 week
2010-09-23 11:23:10 +00:00
Pawel Jakub Dawidek
b35bfe7e10 Define default overwrite count, so that userland can use it.
MFC after:	1 week
2010-09-23 11:19:48 +00:00
Gavin Atkinson
6c4ea40813 Various changes from various sources:
- Add "children" [1]
- Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2]
- Add "near", "antidisestablishmentarianism" and "Persephone" [2]
- "Transvaal" should be capitalized [2]
- Correct spelling of "structurelessness" and "Athena" [2]
- Add missing atomic elements [3]
- Add various words from "word of the day" lists [3]

PR:		conf/149756 [1]
Submitted by:	Nick Johnson <freebsd spatula.net> [1]
Obtained from:	NetBSD [2], OpenBSD [3]
MFC after:	1 week
2010-09-23 11:19:03 +00:00
Pawel Jakub Dawidek
d2ac2ff105 - When trashing metadata, repeat overwrite kern.geom.eli.overwrites times.
- Flush write cache after each write.

MFC after:	1 week
2010-09-23 11:18:02 +00:00
Pawel Jakub Dawidek
488186c304 - Use g_*() API when doing backups.
- fsync() created filed.

MFC after:	1 week
2010-09-23 11:04:50 +00:00
Pawel Jakub Dawidek
2ecb2a01e7 Because we first write metadata into new place and then trash old place we
don't want situation where old size is equal to new size, as we will trash
newly written metadata.

MFC after:	1 week
2010-09-23 10:58:13 +00:00
Pawel Jakub Dawidek
429cf66400 - Make use of g_*() API.
- Flush cache after writing metadata.

MFC after:	1 week
2010-09-23 10:55:45 +00:00
Pawel Jakub Dawidek
5cd61a1fb7 Simplify code a bit by using g_*() API from libgeom.
MFC after:	1 week
2010-09-23 10:50:17 +00:00
Pawel Jakub Dawidek
5e6dce4bf0 When trashing metadata, flush after each write.
MFC after:	1 week
2010-09-23 10:43:37 +00:00
Marius Strobl
ce7704b610 Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.

MFC after:	3 days
2010-09-23 10:03:03 +00:00
Jayachandran C.
68e53e7549 Add MIPS platform, this will make bsdlabel(8) work on MIPS (when invoked
without a -m option. -m mips is still not supported)
2010-09-23 05:24:50 +00:00
Jayachandran C.
831826341b Add missing byteswap, works on big endian systems now (tested on Netlogic
XLS MIPS processor).

Submitted by:	Sreekanth M. S. <kanthms at netlogicmicro dot com>
Reviewed by:	mav
2010-09-23 05:17:36 +00:00
Xin LI
fb2924e4ac In the past gunzip(1) write()'s after each inflate return. This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by:	iXsystems, Inc.
Reported by:	jpaetzel
MFC after:	2 weeks
2010-09-23 01:24:33 +00:00
Maksim Yevmenkin
ff7e67ac1c Add the following Linux BlueZ compatibility macros: htobs(), htobl(),
btohs() and btohl()

PR:		kern/136386
Submitted by:	Monty Hall < kungfu_disciple at sbcglobal dot net >
MFC after:	1 week
2010-09-22 23:41:02 +00:00
Edwin Groothuis
e160180ef7 And now the 2nd part of the patch: Also fix the year.
PR:		150504
Submitted by:	Douglas Berry <bitnix@bitnix.ca>
2010-09-22 21:14:18 +00:00
Edwin Groothuis
778efe6079 Fix location of the Battle of the Plains of Abraham
PR:		150504
Submitted by:	Douglas Berry <bitnix@bitnix.ca>
MFC after:	1 week
2010-09-22 21:10:45 +00:00
John Baldwin
24f481fde2 - Expand scope of tun/tap softc locks to cover more softc fields and
driver-maintained ifnet fields (such as if_drv_flags).
- Use soft locks as the mutex that protects each interface's knote list
  rather than using the global knote list lock.  Also, use the softc
  for kn_hook instead of the cdev.
- Use mtx_sleep() instead of tsleep() when blocking in the read routines.
  This fixes a lost wakeup race.
- Remove D_NEEDGIANT now that the cdevsw routines use the softc lock
  where locking is needed.
- Lock IFQ when calculating the result for FIONREAD in tap(4).  tun(4)
  already did this.
- Remove remaining spl calls.

Submitted by:	Marcin Cieslak  saper of saper|info (3)
MFC after:	2 weeks
2010-09-22 21:02:43 +00:00
Ed Maste
d290883447 Move test for zero bufp or size before rseq and wseq calculation. This
avoids spinning in an infinite loop for some (possibly corrupt?) core
files at work.
2010-09-22 19:41:01 +00:00
Ed Maste
ce026da7e5 Correct sort order. 2010-09-22 19:26:41 +00:00
Pawel Jakub Dawidek
9dd5a6cb0f Switch to sigprocmask(2) API also in the main process and secondary process.
This way the primary process inherits signal mask from the main process,
which fixes a race where signal is delivered to the primary process before
configuring signal mask.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-09-22 19:08:11 +00:00
Pawel Jakub Dawidek
196abd3518 Assert that descriptor numbers are sane.
MFC after:	3 days
2010-09-22 19:05:54 +00:00
Pawel Jakub Dawidek
8b70e6ae9c Fix possible deadlock where worker process sends an event to the main process
while the main process sends control message to the worker process, but worker
process hasn't started control thread yet, because it waits for reply from the
main process.

The fix is to start the control thread before sending any events.

Reported and fix suggested by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-09-22 19:03:11 +00:00
Pawel Jakub Dawidek
0c24d8e2a1 Fix descriptor leaks: when child exits, we have to close control and event
socket pairs. We did that only in one case out of three.

MFC after:	3 days
2010-09-22 18:57:06 +00:00
Doug Barton
6d7fe90938 Eliminate the --disable-ipv6 string which while technically correct in
terms of the arguments that configure was called with is misleading because
if IPv6 support is present on the system it will be present in BIND.
2010-09-22 18:46:17 +00:00
Pawel Jakub Dawidek
c56cf19ebf If we are unable to receive control message is most likely because the main
process died. Instead of entering infinite loop, terminate.

MFC after:	3 days
2010-09-22 18:39:43 +00:00