]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
11 years agoMFC r239027
jhibbits [Thu, 30 Aug 2012 23:50:11 +0000 (23:50 +0000)]
MFC r239027

Add backlight support for nVidia-based PowerBooks/iBooks/iMacs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 239128:
jhb [Thu, 30 Aug 2012 20:42:42 +0000 (20:42 +0000)]
MFC 239128:
Don't try to stop the IPMI watchdog timer if it is not running.
Starting or stopping the IPMI watchdog is rather expensive with the
current implementation as all IPMI requests are bounced via thread.
This is not viable during shutdown or dumps, and this avoids headache
in the common case that the watchdog is not enabled.  The IPMI watchdog
should probably be reworked to not use a separate thread to fix this
in the case when the watchdog timer is enabled.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 239103:
jhb [Thu, 30 Aug 2012 19:46:38 +0000 (19:46 +0000)]
MFC 239103:
Explicitly enable busmastering on PCI-PCI bridges.  Transactions initiated
on the secondary side of a bridge will not be propagated to the primary
bus unless this is enabled.  Busmastering is not enabled by default (we
have relied on firmware to set this bit to date).  The OS needs to set it
for any bridges not configured by system firmware.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239917 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238424:
jhb [Thu, 30 Aug 2012 18:29:49 +0000 (18:29 +0000)]
MFC 238424:
Make the interval timings for EVFILT_TIMER more accurate.  tvtohz() always
adds an extra tick to account for the current partial clock tick.  However,
that is not appropriate for a repeating timer when the exact tvtohz() value
should be used for subsequent intervals.  Fix repeating callouts for
EVFILT_TIMER by subtracting 1 tick from the tvtohz() result similar to the
fix used in realitexpire() for interval timers.

While here, update a few comments to note that if the EVFILT_TIMER code
were to move out of kern_event.c, it should move to kern_time.c (where the
interval timer code it mimics lives) rather than kern_timeout.c.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238311:
jhb [Thu, 30 Aug 2012 18:03:03 +0000 (18:03 +0000)]
MFC 238311:
Add a clts() wrapper around the 'clts' instruction to <machine/cpufunc.h>
on x86 and use that to implement stop_emulating() in the fpu/npx code.
Reimplement start_emulating() in the non-XEN case by using load_cr0() and
rcr0() instead of the 'lmsw' and 'smsw' instructions.  Intel explicitly
discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in
the description of these instructions in Volume 2 of the ADM.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239914 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238972:
kib [Thu, 30 Aug 2012 10:38:41 +0000 (10:38 +0000)]
MFC r238972:
Add lfence().

git-svn-id: svn://svn.freebsd.org/base/stable/9@239902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238703:
kib [Thu, 30 Aug 2012 10:23:27 +0000 (10:23 +0000)]
MFC r238703:
Put struct ostat and struct nstat under #ifdef _KERNEL. The
compatibility definitions are only needed for implementation of the
syscalls, they cause namespace pollution and are not useful for
applications.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238687:
kib [Thu, 30 Aug 2012 10:18:55 +0000 (10:18 +0000)]
MFC r238687:
Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct
sysentvec .sv_minuser. Also improve style.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238667:
kib [Thu, 30 Aug 2012 10:12:40 +0000 (10:12 +0000)]
MFC r238667:
Fixes for symbols visibility issues and style in fcntl.h.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238180:
kib [Thu, 30 Aug 2012 08:37:06 +0000 (08:37 +0000)]
MFC r238180:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239897 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230644: preserve argv[0] to use it later in usage().
maxim [Thu, 30 Aug 2012 07:45:25 +0000 (07:45 +0000)]
MFC r230644: preserve argv[0] to use it later in usage().

git-svn-id: svn://svn.freebsd.org/base/stable/9@239894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r232004: use ISO 3166 county code for Sweden.
maxim [Thu, 30 Aug 2012 07:38:24 +0000 (07:38 +0000)]
MFC r232004: use ISO 3166 county code for Sweden.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239893 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r237697: restore -u <username> getopt(3) flag.
maxim [Thu, 30 Aug 2012 07:34:25 +0000 (07:34 +0000)]
MFC r237697: restore -u <username> getopt(3) flag.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230584 by glebius: remove casts from inet6 address testing macros,
maxim [Thu, 30 Aug 2012 07:25:17 +0000 (07:25 +0000)]
MFC r230584 by glebius: remove casts from inet6 address testing macros,
thus preserving qualifier from original argument.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239891 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238142,238179:
jhb [Wed, 29 Aug 2012 21:12:19 +0000 (21:12 +0000)]
MFC 238142,238179:
Now that our assembler supports the xsave family of instructions, use them
natively rather than hand-assembled versions.  For xgetbv/xsetbv, add a
wrapper API to deal with xcr* registers: rxcr() and load_xcr().

git-svn-id: svn://svn.freebsd.org/base/stable/9@239882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238310:
jhb [Wed, 29 Aug 2012 20:49:36 +0000 (20:49 +0000)]
MFC 238310:
Partially revert r217515 so that the mem_range_softc variable is always
present on x86 kernels.  This fixes the build of kernels that include
'device acpi' but do not include 'device mem'.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239880 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238109,238166:
jhb [Wed, 29 Aug 2012 19:47:19 +0000 (19:47 +0000)]
MFC 238109,238166:
Several fixes to the amd64 disassembler:
- Decode the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', 'xsetbv', and
  'rdtscp' instructions.
- Add generic support for opcodes that are escape bytes used for
  multi-byte opcodes (such as the 0x0f prefix).  Use this to replace
  the hard-coded 0x0f special case and add support for three-byte
  opcodes that use the 0x0f38 prefix.
- Decode all Intel VMX instructions.  invept and invvpid in particular are
  three-byte opcodes that use the 0x0f38 escape prefix.
- Rework how the special 'SDEP' size flag works such that the default
  instruction name (i_name) is the instruction when the data size
  prefix (0x66) is not specified, and the alternate name in i_extra is
  used when the prefix is included.
- Add a new 'ADEP' size flag similar to 'SDEP' except that it chooses
  between i_name and i_extra based on the address size prefix (0x67).
  Use this to fix the decoding for jrcxz vs jecxz which is determined
  by the address size prefix, not the operand size prefix.  Also, jcxz
  is not possible in 64-bit mode, but jrcxz is the default instruction
  for that opcode.
- Add support for handling instructions that have a mandatory 'rep'
  prefix (this means not outputting the 'repe ' prefix until determining
  if it is used as part of an opcode).  Make 'pause' less of a special
  case this way.
- Decode 'cmpxchg16b' and 'cdqe' which are variants of other instructions
  but with a REX.W prefix.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238123,238167:
jhb [Wed, 29 Aug 2012 19:34:46 +0000 (19:34 +0000)]
MFC 238123,238167:
- Add support for the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', and 'xsetbv'
  instructions.  I reimplemented this from scratch based on the Intel
  manuals and the existing support for handling the fxsave and fxrstor
  instructions.
- Add support for the 'invept' and 'invvpid' instructions.  Beyond simply
  adding appropriate table entries, the assembler had to be adjusted as
  these are the first non-SSE instructions to use a 3-byte opcode (and a
  mandatory prefix to boot).

git-svn-id: svn://svn.freebsd.org/base/stable/9@239878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238024:
jhb [Wed, 29 Aug 2012 19:17:29 +0000 (19:17 +0000)]
MFC 238024:
Add a one second sleep before touching the spool directory.  If the touch
occurs in the same second as the earlier operations to create the temporary
file and the cron(8) daemon is rescans the spool directory during that
second, then the daemon may miss a cron edit and not properly update its
internal database.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239876 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238000,239584:
jhb [Wed, 29 Aug 2012 19:12:33 +0000 (19:12 +0000)]
MFC 238000,239584:
Honor db_pager_quit in 'show malloc', 'show uma', and 'show witness'.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238077:
jhb [Wed, 29 Aug 2012 17:36:12 +0000 (17:36 +0000)]
MFC 238077:
Fix panics triggered by older mfiutil binaries run on the new mfi(4) driver.
The new driver changed the size of the mfi_dcmd_frame structure in such a
way that a MFI_IOC_PASSTHRU ioctl from an old amd64 binary is treated as an
MFI_IOC_PASSTHRU32 ioctl in the new driver.  As a result, the user pointer
is treated as the buffer length.  mfi_user_command() doesn't have a bounds
check on the buffer length, so it passes a really big value to malloc()
which panics when it tries to exhaust the kmem_map.  Fix this two ways:
- Only honor MFI_IOC_PASSTHRU32 if the binary has the SV_ILP32 flag set,
  otherwise treat it as an unknown ioctl.
- Add a bounds check on the buffer length passed by the user.  For now
  it fails any user attempts to use a buffer larger than 1MB.

While here, fix a few other nits:
- Remove an unnecessary check for a NULL return from malloc(M_WAITOK).
- Use the ENOTTY errno for invalid ioctl commands instead of ENOENT.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238835:
kib [Wed, 29 Aug 2012 16:26:41 +0000 (16:26 +0000)]
MFC r238835:
Document F_DUP2FD_CLOEXEC.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239859 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238615:
kib [Wed, 29 Aug 2012 16:25:33 +0000 (16:25 +0000)]
MFC r238615:
Document F_DUPFD_CLOEXEC.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239858 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238834:
kib [Wed, 29 Aug 2012 16:23:29 +0000 (16:23 +0000)]
MFC r238834:
Add F_DUP2FD_CLOEXEC.

PR: standards/169962

git-svn-id: svn://svn.freebsd.org/base/stable/9@239857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238614:
kib [Wed, 29 Aug 2012 16:17:02 +0000 (16:17 +0000)]
MFC r238614:
Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4.

MFC r238627:
Remove line which was accidentally kept in r238614.

PR: standards/169962

git-svn-id: svn://svn.freebsd.org/base/stable/9@239856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239601:
jamie [Wed, 29 Aug 2012 16:11:03 +0000 (16:11 +0000)]
MFC r239601:

 Remember that I'm using length-defined strings in parameters:

  Remove a bogus null terminator when stripping the netmask from
  IP addresses.  This was causing later addresses in a comma-separated
  string to disappear.

  Use memcpy instead of strcpy.  This could just cause Bad Things.

MFC r239602:

 Pre-separate IP addresses passed on the command line, so they can be
 properly parsed for interface prefixes and netmask suffixes.  This was
 already done for the old-style (fixed) command line, but missed for
 the new-style.

MFC r239621:

 Partially roll back r239601 - keep parameter strings both length-delimited
 and null-terminated at the same time, because they're later passed to
 libjail as null-terminated.  That means I also need to add a nul byte when
 comma-combining array parameters.

PR: 170832

git-svn-id: svn://svn.freebsd.org/base/stable/9@239854 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238374:
kib [Wed, 29 Aug 2012 16:00:26 +0000 (16:00 +0000)]
MFC r238374:
Add a test program, written by Stephan Uphoff, which demonstrates the
deadlock due to i/o performed over the buffers backed by file mappings.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r237367:
kib [Wed, 29 Aug 2012 15:58:44 +0000 (15:58 +0000)]
MFC r237367:
Enable deadlock avoidance code for NFS client.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239852 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236322:
kib [Wed, 29 Aug 2012 15:56:13 +0000 (15:56 +0000)]
MFC r236322:
Enable vn_io_fault() lock avoidance for UFS.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r237987:
kib [Wed, 29 Aug 2012 15:53:27 +0000 (15:53 +0000)]
MFC r237987:
Do not override an error from uiomove() with (non-)error result from
bwrite().

git-svn-id: svn://svn.freebsd.org/base/stable/9@239848 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236687:
kib [Wed, 29 Aug 2012 15:50:09 +0000 (15:50 +0000)]
MFC r236687:
Improve handling of uiomove(9) errors for the NFS client.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238029:
kib [Wed, 29 Aug 2012 15:45:58 +0000 (15:45 +0000)]
MFC r238029:
Extend the KPI to lock and unlock f_offset member of struct file.  It
now fully encapsulates all accesses to f_offset, and extends f_offset
locking to other consumers that need it, in particular, to lseek() and
variants of getdirentries().

git-svn-id: svn://svn.freebsd.org/base/stable/9@239843 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r237365:
kib [Wed, 29 Aug 2012 15:41:17 +0000 (15:41 +0000)]
MFC r237365:
Fix locking for f_offset, vn_read() and vn_write() cases only.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239699:
gjb [Wed, 29 Aug 2012 15:38:18 +0000 (15:38 +0000)]
MFC r239699:

 - Grammar fix: s/NIC's/NICs/

git-svn-id: svn://svn.freebsd.org/base/stable/9@239841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236517:
kib [Wed, 29 Aug 2012 15:34:26 +0000 (15:34 +0000)]
MFC r236517:
Add a knob to disable vn_io_fault.

MFC note: by default, vn_io_fault for stable/9 is disabled.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236516:
kib [Wed, 29 Aug 2012 15:28:38 +0000 (15:28 +0000)]
MFC r236516:
Count and export the number of prefaulting happen.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236321:
kib [Wed, 29 Aug 2012 15:21:27 +0000 (15:21 +0000)]
MFC r236321:
Add vn_io_fault(), which is a facility to prevent page faults while
filesystems perform copyin/copyout of the file data into the usermode
buffer.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239837 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r236317:
kib [Wed, 29 Aug 2012 15:13:13 +0000 (15:13 +0000)]
MFC r236317:
Add a rangelock implementation, intended to be used to range-locking
the i/o regions of the vnode data space. The implementation is quite
simple-minded, it uses the list of the lock requests, ordered by
arrival time. Each request may be for read or for write. The
implementation is fair FIFO.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238813 from HEAD:
issyl0 [Wed, 29 Aug 2012 14:06:58 +0000 (14:06 +0000)]
MFC r238813 from HEAD:
  - The ad(4) driver no longer exists in FreeBSD CURRENT or 9, so change
    the references to it in gsched(8) to the existing ada(4) driver.

PR: docs/170085
Approved by: gjb (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@239834 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238781, r238919 from HEAD:
issyl0 [Wed, 29 Aug 2012 13:28:25 +0000 (13:28 +0000)]
MFC r238781, r238919 from HEAD:

  r238781:
    - Add a new man page containing details of new locale-specific functions
      for wctype.h, iswalnum_l(3).  Add it and its functions to the Makefile.

  r238919:
    - Add more locale-specific functions to the relevant man pages and
      Makefile:
      - lib/libc/locale/islower.3
      - lib/libc/locale/ispunct.3
      - lib/libc/locale/nl_langinfo.3
      - lib/libc/locale/isgraph.3
      - lib/libc/locale/isspace.3

Approved by: gjb (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@239833 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238960:
bz [Wed, 29 Aug 2012 13:19:27 +0000 (13:19 +0000)]
MFC r238960:

  In case of IPsec he have to do delayed checksum calculations before
  adding any extension header, or rather before calling into IPsec
  processing as we may send the packet and not return to IPv6 output
  processing here.

PR: kern/170116

git-svn-id: svn://svn.freebsd.org/base/stable/9@239832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238935:
bz [Wed, 29 Aug 2012 13:14:39 +0000 (13:14 +0000)]
MFC r238935:

  Properly apply #ifdef INET and leave a comment that we are (will) apply
  delayed IPv6 checksum processing in ip6_output.c when doing IPsec.

PR: kern/170116

git-svn-id: svn://svn.freebsd.org/base/stable/9@239831 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 238934:
bz [Wed, 29 Aug 2012 13:10:34 +0000 (13:10 +0000)]
MFC 238934:

  Improve the should-never-hit printf to ease debugging in case we'd ever hit
  it again when doing the delayed IPv6 checksum calculations.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239830 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r239037,239050 from head:
gavin [Wed, 29 Aug 2012 12:46:53 +0000 (12:46 +0000)]
Merge r239037,239050 from head:
  Support multiple interface devices.  The driver had previously hardcoded
  support for only the first port, but the CP2105 can have multiple ports.
  Although without this change the the first port mostly worked on multi
  port devices, there could still be issues with this arrangement.

  Update the man page to reflect support for both ports and the CP2105.

  Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK
  dev board for testing.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238878:
bz [Wed, 29 Aug 2012 12:44:13 +0000 (12:44 +0000)]
MFC r238878:

  For consistency put the IPsec comment iside the #fidef section.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 237338:
jhb [Wed, 29 Aug 2012 12:34:43 +0000 (12:34 +0000)]
MFC 237338:
Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl).  The kernel linker allows such
modules, so the boot loader should not reject them.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239821 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r238803, r238804 from head:
gavin [Wed, 29 Aug 2012 11:23:20 +0000 (11:23 +0000)]
Merge r238803, r238804 from head:

  Add support for more devices to uslcom(4).  This commit syncronises the
  list of supported devices with the union of:

  NetBSD  src/sys/dev/usb/uslsa.c 1.18
  OpenBSD src/sys/dev/usb/uslcom.c 1.24
  Linux   source/drivers/usb/serial/cp210x.c HEAD

  Remove duplicate JABLOTRON PC60B entry.

  Note that some of the devices added here are multi-port devices.  The
  uslcom(4) driver currently only supports the first port on such devices.

  Update the man page to reflect the full list of supported devices.
  Remove two caveats from the CAVEATS section, as both listed caveats no
  longer apply.  Add a caveat about multi-port devices.

  Improve descriptions for several devices supported by uslcom(4).
  Correct the spelling of the company Telegesis.
  Move MpMan to the correct location alphabetically.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239817 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238229: acpi_cpu: we are able to handle _CST change notifications
avg [Wed, 29 Aug 2012 09:00:57 +0000 (09:00 +0000)]
MFC r238229:  acpi_cpu: we are able to handle _CST change notifications

git-svn-id: svn://svn.freebsd.org/base/stable/9@239815 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238194: acpi_cpu_generic_cx_probe: for consistency set cpu_non_c3
avg [Wed, 29 Aug 2012 08:58:10 +0000 (08:58 +0000)]
MFC r238194: acpi_cpu_generic_cx_probe: for consistency set cpu_non_c3
here too

git-svn-id: svn://svn.freebsd.org/base/stable/9@239813 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238193: acpi_cpu_cx_list: there is no need to re-evaluate
avg [Wed, 29 Aug 2012 08:47:43 +0000 (08:47 +0000)]
MFC r238193: acpi_cpu_cx_list: there is no need to re-evaluate
cpu_non_c3 here

git-svn-id: svn://svn.freebsd.org/base/stable/9@239812 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238192: acpi_cpu_cx_cst: consistently use cpu_cx_count during state
avg [Wed, 29 Aug 2012 08:39:58 +0000 (08:39 +0000)]
MFC r238192: acpi_cpu_cx_cst: consistently use cpu_cx_count during state
enumeration

git-svn-id: svn://svn.freebsd.org/base/stable/9@239809 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238418: acpi_cpu: separate a notion of current deepest
avg [Wed, 29 Aug 2012 08:14:16 +0000 (08:14 +0000)]
MFC r238418: acpi_cpu: separate a notion of current deepest
allowed+available Cx level from a user-set persistent limit on the said level

git-svn-id: svn://svn.freebsd.org/base/stable/9@239807 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239591:
jimharris [Wed, 29 Aug 2012 01:04:12 +0000 (01:04 +0000)]
MFC r239591:

Remove unncessary atomic operation when reading process flags in
PMC_PROC_IS_USING_PMCS macro.

Invocations of this macro are not synchronized with setting/clearing
of P_HWPMC flag, so the atomic operation here isn't needed.  Removing
the atomic operation provides noticeable improvement (5-6%) on
some scheduler-intensive workloads with HWPMC_HOOKS enabled on an
8C Sandy Bridge Xeon system.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@239798 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239723:
pluknet [Tue, 28 Aug 2012 19:23:04 +0000 (19:23 +0000)]
MFC r239723:
  Typo in previous change: print half the theoretical maximum as maximum
  recommended amount.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 230782,237274:
jhb [Tue, 28 Aug 2012 18:44:56 +0000 (18:44 +0000)]
MFC 230782,237274:
Refine the implementation of POSIX_FADV_NOREUSE to perform
POSIX_FADV_DONTNEED requests on the currently accessed portion of the
file on each read(2) or write(2) rather than using direct I/O.  This
gives much better performance including read-ahead and write clustering
similar to normal read(2) and write(2) calls.

If subsequent read(2) and write(2) calls are sequential, then the
POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed
range.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r238933
fjoe [Tue, 28 Aug 2012 17:08:47 +0000 (17:08 +0000)]
MFC: r238933

- Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg".
- Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f

Approved by: re (kib)

git-svn-id: svn://svn.freebsd.org/base/stable/9@239783 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239500:
dteske [Tue, 28 Aug 2012 15:45:37 +0000 (15:45 +0000)]
MFC r239500:
Fix "unexpected operator" error when passed multi-word first-argument
containing whitespace. Also make other changes to support multi-word
arguments.

PR: bin/170759
Submitted by: dteske
Reviewed by: emaste (mentor)
Approved by: emaste (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@239782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238877:
bz [Tue, 28 Aug 2012 12:56:23 +0000 (12:56 +0000)]
MFC r238877:

  Fix a comment that we do not have an SA yet but need to acquire one.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239513:
dim [Tue, 28 Aug 2012 06:49:33 +0000 (06:49 +0000)]
MFC r239513:

When WITH_CLANG_EXTRAS is enabled, avoid needlessly building the llvm
and clang extras in the cross-tools stage.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239509:
dim [Tue, 28 Aug 2012 06:47:21 +0000 (06:47 +0000)]
MFC r239509:

Support the WITH_SHARED_TOOLCHAIN setting that was introduced in r234782
for the clang executable.  Build it statically by default, like the gcc
executables, which should improve performance a little bit.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239766 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239588:
kib [Mon, 27 Aug 2012 20:25:26 +0000 (20:25 +0000)]
MFC r239588:
Provide some compat32 shims for sysctl vfs.conflist. It is required
for getvfsbyname(3) operation when called from 32bit process, and
getvfsbyname(3) is used by recent bsdtar import.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239374:
kib [Mon, 27 Aug 2012 20:23:03 +0000 (20:23 +0000)]
MFC r239374:
Deliver SIGSYS to the guilty thread, not to the process.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 237646,237656,238020:
jhb [Mon, 27 Aug 2012 19:55:19 +0000 (19:55 +0000)]
MFC 237646,237656,238020:
- Add a new line to top that provides a brief summary of the ZFS ARC memory
  usage on hosts using ZFS.  The new line displays the total amount of RAM
  used by the ARC along with the size of MFU, MRU, anonymous (in flight),
  headers, and other (miscellaneous) sub-categories.  The line is not
  displayed on systems that are not using ZFS.
- Clarify that the cached file data pages included in the "Wired" count
  in top are the BIO-level cached data (i.e. "Buf"), since the previous
  phrase was a bit ambiguous with the "Cache" count.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239750 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 233040,233198,233870,234183:
jhb [Mon, 27 Aug 2012 19:37:02 +0000 (19:37 +0000)]
MFC 233040,233198,233870,234183:
Add OFED and the associated options and drivers to x86 LINT builds:
- Fix build with INET6 disabled.
- Fix build of OFED bits with debugging options enabled.
- Fix build on i386.
- Mark 'sdp' as requiring 'inet'.
- Always include "opt_inet.h" and "opt_inet6.h" and modify the IB
  driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options
  to determine what should be enabled during a module build.
- Fix the mlxen(4) driver and the core IB code to compile without
  if INET is disabled (including when both INET and INET6 are disabled).

git-svn-id: svn://svn.freebsd.org/base/stable/9@239748 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239655:
jimharris [Mon, 27 Aug 2012 15:57:33 +0000 (15:57 +0000)]
MFC r239655:

Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local
variable when determining various sizes related to SCSI UNMAP block
descriptor lists.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@239737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239545, r239665:
jimharris [Mon, 27 Aug 2012 15:47:46 +0000 (15:47 +0000)]
MFC r239545, r239665:

Fix/add support for SCSI UNMAP to ATA DSM translation.

This addresses kernel panic observed when sending SCSI UNMAP
commands to SATA disks attached to isci(4).

1) Flesh out callback routines to allocate/free buffers needed for
translating SCSI UNMAP data to ATA DSM data.
2) Add controller-level pool for storing buffers previously allocated
for UNMAP translation, to lessen chance of no buffer available
under memory pressure.
3) Ensure driver properly handles case where buffer pool is empty
and contigmalloc returns NULL.
4) Clear freeze bit in isci_remote_device_release_lun_queue() before
calling xpt_release_devq to ensure that any ccbs which immediately
start during the call to xpt_release_devq() see an accurate picture
of the frozen_lun_mask.  This code path is extensively exercised
when tagged read/write commands mix with non-tagged DSM commands.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@239734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r238778 from head:
gavin [Mon, 27 Aug 2012 14:44:40 +0000 (14:44 +0000)]
Merge r238778 from head:

  The baud rate on CP1201/2/3 devices can be set in one of two ways:
   - The USLCOM_SET_BAUD_DIV command (0x01)
   - The USLCOM_SET_BAUD_RATE command (0x13)

  Devices based on the CP1204 will only accept the latter command, and ignore
  the former.  As the latter command works on all chips that this driver
  supports, switch to always using it.

  A slight confusion here is that the previously used command was incorrectly
  named USLCOM_BAUD_RATE - even though we no longer use it, rename it to
  USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet.

  This change reflects a similar change made in the Linux driver, which was
  submitted by preston.fick at silabs.com, and has been tested on all of the
  uslcom(4) devices I have to hand.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239732 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r238396 from head:
gavin [Mon, 27 Aug 2012 13:04:45 +0000 (13:04 +0000)]
Merge r238396 from head:

  Update to reflect new core team.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r236101, r236102 from head:
gavin [Mon, 27 Aug 2012 12:58:54 +0000 (12:58 +0000)]
Merge r236101, r236102 from head:

  Update to reflect various src and doc commit bits taken into
  safekeeping.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge r238766, r238774 from head:
gavin [Mon, 27 Aug 2012 12:40:40 +0000 (12:40 +0000)]
Merge r238766, r238774 from head:
  Update the list of devices supported by uplcom.  Although this only adds
  one device (support for Motorola cables), this syncronises us with:

  OpenBSD src/sys/dev/usb/uplcom.c 1.56
  NetBSD  src/sys/dev/usb/uplcom.c 1.73
  Linux   kernel.org HEAD

git-svn-id: svn://svn.freebsd.org/base/stable/9@239725 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239636:
pfg [Mon, 27 Aug 2012 02:56:58 +0000 (02:56 +0000)]
MFC r239636:

Add some basic definitions for a future htree implementation.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239468:
pluknet [Sun, 26 Aug 2012 12:07:23 +0000 (12:07 +0000)]
MFC r239468:
 Avoid segfault in the 'smpphylist' subcommand.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239714 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239614:
dim [Sun, 26 Aug 2012 10:30:01 +0000 (10:30 +0000)]
MFC r239614:

Sprinkle a bit of style.Makefile(5) across various clang Makefiles.  No
functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239711 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239477
ache [Sun, 26 Aug 2012 05:20:32 +0000 (05:20 +0000)]
MFC r239477

According to resolvconf.conf(5) manpage and sources, there is no
'nameservers' option which used in examples in resolvconf.conf(5),
it spelled 'name_servers', so fix examples.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 233872:
jhb [Fri, 24 Aug 2012 20:41:31 +0000 (20:41 +0000)]
MFC 233872:
Add descriptions after the 'device' line for several NICs to match the
existing style.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239662 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239649:
bschmidt [Fri, 24 Aug 2012 14:11:54 +0000 (14:11 +0000)]
MFC r239649:
Document update of 802.11s IE identifiers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFH (r238968): restore a piece of BSD history
des [Fri, 24 Aug 2012 13:11:30 +0000 (13:11 +0000)]
MFH (r238968): restore a piece of BSD history

git-svn-id: svn://svn.freebsd.org/base/stable/9@239648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFH (r238102, r238605): automatically name jails.
des [Fri, 24 Aug 2012 11:44:47 +0000 (11:44 +0000)]
MFH (r238102, r238605): automatically name jails.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239647 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFH (r236226): pass filename to libarchive rather than descriptor
des [Fri, 24 Aug 2012 10:09:34 +0000 (10:09 +0000)]
MFH (r236226): pass filename to libarchive rather than descriptor

git-svn-id: svn://svn.freebsd.org/base/stable/9@239646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFH (r239327): warn when too much swap is configured, and avoid flooding
des [Fri, 24 Aug 2012 09:58:14 +0000 (09:58 +0000)]
MFH (r239327): warn when too much swap is configured, and avoid flooding
the console when running out of space for metadata.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239645 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r231187:
bschmidt [Thu, 23 Aug 2012 17:09:52 +0000 (17:09 +0000)]
MFC r231187:
Update the 802.11s IE numbers to represent the latest 802.11 amendment
standard.

This update breaks compatibility with older mesh setups but is necessary as
the previous IDs are used by another amendment leading to unexpected results
when trying to associate with an accesspoint using the affected IDs.

Discussed with: re
Tested by: honestqiao at gmail dot com

git-svn-id: svn://svn.freebsd.org/base/stable/9@239615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239464:
delphij [Thu, 23 Aug 2012 00:39:08 +0000 (00:39 +0000)]
MFC r239464:

As of r232844 we no longer need the maxpoll 9 workaround.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239600 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238178, 238624, 238810:
pfg [Wed, 22 Aug 2012 20:06:59 +0000 (20:06 +0000)]
MFC r238178, 238624, 238810:

Re-merge a couple of changes from NetBSD libedit.

bin/sh has been taught about el_gets setting the count to -1
on error, so now we can partially revert r238173 to reduce
differences with NetBSD's implementation.

Also fix some warnings to be more in sync with NetBSD.

Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@239589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239302:
kib [Wed, 22 Aug 2012 19:56:41 +0000 (19:56 +0000)]
MFC r239302:
Add a short man page describing how to run a.out binaries on the
current kernels.

MFC r239305 (by joel):
Minor mdoc fixes and language tweaks.

MFC r239306:
Small tweaks.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239583 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239301:
kib [Wed, 22 Aug 2012 19:53:33 +0000 (19:53 +0000)]
MFC r239301:
Add a sysctl kern.pid_max, which limits the maximum pid the system is
allowed to allocate, and corresponding tunable with the same
name. Note that existing processes with higher pids are left intact.

MFC r239328:
Fix grammar.

MFC r239329:
As a safety measure, disable lowering pid_max too much.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoRegen.
kib [Wed, 22 Aug 2012 19:45:18 +0000 (19:45 +0000)]
Regen.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239581 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239296:
kib [Wed, 22 Aug 2012 19:43:46 +0000 (19:43 +0000)]
MFC r239296:
Provide 32bit compat for old truncate(2) and ftruncate(2).

git-svn-id: svn://svn.freebsd.org/base/stable/9@239580 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239252:
kib [Wed, 22 Aug 2012 19:41:36 +0000 (19:41 +0000)]
MFC r239252:
Add a hackish debugging facility to provide a bit of information about
reason for generated trap. The dump of basic signal information and 8
bytes of the faulting instruction are printed on the controlling
terminal of the process, if the machdep.uprintf_signal syscal is
enabled.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239251:
kib [Wed, 22 Aug 2012 19:36:47 +0000 (19:36 +0000)]
MFC r239251:
Real hardware, as opposed to QEMU, does not allow to have a call gate
in long mode which transfers control to 32bit code segment. Unbreak
the lcall $7,$0 implementation on amd64 by putting the 64bit user code
segment' selector into call gate, and execute the 64bit trampoline
which converts the return frame into 32bit format and switches back to
32bit mode for executing int $0x80 trampoline.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239578 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239250:
kib [Wed, 22 Aug 2012 19:34:02 +0000 (19:34 +0000)]
MFC r239250:
For old mmap syscall, when executing on amd64 or ia64, enforce the
PROT_EXEC if prot is non-zero, process is 32bit and
kern.elf32.i386_read_exec syscal is enabled.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoRegen.
kib [Wed, 22 Aug 2012 19:31:28 +0000 (19:31 +0000)]
Regen.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239576 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239248:
kib [Wed, 22 Aug 2012 19:29:22 +0000 (19:29 +0000)]
MFC r239248:
Implement the old mmap syscall for compat32, when COMPAT_43 option is
enabled. The syscall is used by FreeBSD 1.1.5.1 dynamic linker.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239247:
kib [Wed, 22 Aug 2012 19:27:17 +0000 (19:27 +0000)]
MFC r239247:
Adjust the r205536, by allowing a non-zero offset for anonymous
mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD
1.1.5.1 can issue such requests.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238502:
mdf [Wed, 22 Aug 2012 17:13:00 +0000 (17:13 +0000)]
MFC r238502:

Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE.

The code was not taking into account the size of the kernel_map, which
the kmem_map is allocated from, so it could produce a sub-map size too
large to fit.  The simplest solution is to ignore VM_KMEM_MAX entirely
and base the memguard map's size off the kernel_map's size, since this
is always relevant and always smaller.

Found by: Justin Hibbits

git-svn-id: svn://svn.freebsd.org/base/stable/9@239565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239125:
kib [Wed, 22 Aug 2012 05:36:10 +0000 (05:36 +0000)]
MFC r239125:
Do not apply errata 721 workaround when under hypervisor, since
typical hypervisor does not implement access to the required MSR,
causing #GP on boot.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r238984:
kib [Wed, 22 Aug 2012 05:30:51 +0000 (05:30 +0000)]
MFC r238984:
fsck_ffs shall accept the configured journal size, and not refuse to
operate on it if journal size is greater then SUJ_MAX. The later
constant is only to select maximal journal size when user did not
specified size explicitely.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239559 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239038:
kib [Wed, 22 Aug 2012 05:26:54 +0000 (05:26 +0000)]
MFC r239038:
Remove verbose unused commented out debugging printf.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239135:
kib [Wed, 22 Aug 2012 05:18:38 +0000 (05:18 +0000)]
MFC r239135:
Always initialize pl_event.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239040:
kib [Wed, 22 Aug 2012 05:15:21 +0000 (05:15 +0000)]
MFC r239040:
Reduce code duplication and exposure of direct access to struct
vm_page oflags by providing helper function
vm_page_readahead_finish(), which handles completed reads for pages
with indexes other then the requested one, for VOP_GETPAGES().

MFC r239246:
Do not leave invalid pages in the object after the short read for a
network file systems (not only NFS proper). Short reads cause pages
other then the requested one, which were not filled by read response,
to stay invalid.

Change the vm_page_readahead_finish() interface to not take the error
code, but instead to make a decision to free or to (de)activate the
page only by its validity. As result, not requested invalid pages are
freed even if the read RPC indicated success.

git-svn-id: svn://svn.freebsd.org/base/stable/9@239554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r239345:
kevlo [Wed, 22 Aug 2012 00:59:17 +0000 (00:59 +0000)]
MFC r239345:
Make 'junk' volatile so that compilers won't be tempted to optimize

Reviewed by: ache

git-svn-id: svn://svn.freebsd.org/base/stable/9@239549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f