dragonfly.git
8 years agomoused: Read more than 1 byte at a time from the mouse device.
Imre Vadasz [Thu, 24 Dec 2015 11:54:39 +0000 (12:54 +0100)]
moused: Read more than 1 byte at a time from the mouse device.

8 years agomoused: Omit superfluous gettimeofday calls when mouse only moves
Imre Vadasz [Thu, 24 Dec 2015 11:50:37 +0000 (12:50 +0100)]
moused: Omit superfluous gettimeofday calls when mouse only moves

The gettimeofday() is only needed when a mouse button state changed.

8 years agodrm: Fix ww mutex crtc locking
François Tigeot [Thu, 24 Dec 2015 08:56:57 +0000 (09:56 +0100)]
drm: Fix ww mutex crtc locking

* The original code had many problems:
  - the ctx wasn't available to drm_modeset_unlock().
  - 'struct list_head' was used for both the list head AND the list entry
  It's like it was coded to create maximum confusion on top of maximum pain

* drm_modeset_acquire_ctx structure needs a second list which we add
  kmalloc()'d entries to to track the extra locks in the EALREADY case

* Replace the reference from the modeset_lock structure with a pointer
  to an intermediate (kmalloc'd) structure that references both and turn
  the list entry in the lock into a list head

Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
8 years agokernel/acpi: Save a newline.
Sascha Wildner [Thu, 24 Dec 2015 02:51:43 +0000 (03:51 +0100)]
kernel/acpi: Save a newline.

8 years agosbin/hammer: Remove vol_alloc from volume_info
Tomohiro Kusumi [Mon, 21 Dec 2015 13:14:08 +0000 (22:14 +0900)]
sbin/hammer: Remove vol_alloc from volume_info

vol_alloc is a fixed sized space before boot/mem/buf area
that the filesystem doesn't recognize once initialized.
(This area is currently used for nothing)

8 years agosbin/newfs_hammer: Remove total size arg from format_volume()
Tomohiro Kusumi [Mon, 21 Dec 2015 12:56:32 +0000 (21:56 +0900)]
sbin/newfs_hammer: Remove total size arg from format_volume()

Each HAMMER volume doesn't recognize total filesystem size,
so this unused arg isn't necessary when formatting a volume.

8 years agosbin/hammer: Remove global variable NumVolumes
Tomohiro Kusumi [Wed, 23 Dec 2015 07:06:53 +0000 (16:06 +0900)]
sbin/hammer: Remove global variable NumVolumes

Only newfs_hammer uses this, but doesn't need to be global.

(Keeping a number of volumes isn't that important either,
because it can be retrieved directly from volume headers or
by counting the number of elements in the volume_info list)

8 years agosys/vfs/hammer: Add sanity check to volume-del
Tomohiro Kusumi [Wed, 16 Dec 2015 14:07:43 +0000 (23:07 +0900)]
sys/vfs/hammer: Add sanity check to volume-del

8 years agokernel/hpt27xx: Move two files to better names (like hptrr).
Sascha Wildner [Tue, 22 Dec 2015 10:19:51 +0000 (11:19 +0100)]
kernel/hpt27xx: Move two files to better names (like hptrr).

8 years agokernel/igb: Fix build with either IGB_RSS_DEBUG or IGB_TSS_DEBUG.
Sascha Wildner [Tue, 22 Dec 2015 10:15:41 +0000 (11:15 +0100)]
kernel/igb: Fix build with either IGB_RSS_DEBUG or IGB_TSS_DEBUG.

8 years agolibc - fix makecontext build issues
Matthew Dillon [Tue, 22 Dec 2015 01:10:10 +0000 (17:10 -0800)]
libc - fix makecontext build issues

* Enhance makecontext_quick manual page code example.

* Remove mcontext.S (old get_mcontext and set_mcontext calls) from build.

8 years agolibc - Add quick version for the context management functions.
Matthew Dillon [Mon, 21 Dec 2015 20:17:36 +0000 (12:17 -0800)]
libc - Add quick version for the context management functions.

* Add makecontext_quick(), setcontext_quick(), and swapcontext_quick().
  These functions work similarly to the non-quick versions but are designed
  for fast synchronous switching.  These functions do not mess with the
  signal mask or stack at all and do not save or restore scratch registers.

* These functions make no system calls.  Switching time can be as low as
  ~5 nanoseconds.

* These functions also provide optimizations for coroutine fall-through
  linkages.

* Note that the coroutine / start-function callback arguments are somewhat
  different.  Start functions are called back as cofunc(ucp, arg).  Var-args
  are not supported and the stack is minimally aligned and initialized.

* Remove the old internal set_mcontext() and get_mcontext() routines.

8 years agolibc - Fix bugs in getcontext(), setcontext(), and swapcontext()
Matthew Dillon [Mon, 21 Dec 2015 08:33:54 +0000 (00:33 -0800)]
libc - Fix bugs in getcontext(), setcontext(), and swapcontext()

* Fix multiple bugs revealed by qemu's use of these functions.  Most of
  these fixes are accomplished by calling sigreturn(uctx) to restore the
  state instead of trying to roll our own in userland.  This won't be much
  slower (if at all) because we had to save and restore the signal state
  in the userland code anyway, so we could not avoid making at least one
  system call.

  Using sigreturn() handles the signal mask atomicy for us so we don't have
  to deal with it and fixes numerous other issues.  Along with this change,
  adjust getcontext() and makecontext() to fill out additional important
  fields in the ucontext that sigreturn() inspects.

* Fixes two stack corruption bugs. First, getcontext() was calling
  get_mcontext() and get_mcontext() was setting up the setcontext return
  state to return 1 ... from get_mcontext(), NOT from getcontext().  If
  normal operations or signals mess with the stack, the double return
  will not work.  Oops.

  Secondly, getcontext scribbled over the red-zone in a way that is not
  permitted.

* setcontext() was restoring the context as saved by makecontext() or
  getcontext(), but setcontext() can also be called with the ucontext
  from the signal handler which requires a full restore.  setcontext()
  was not restoring FPU or scratch registers or rflags.

* Fixes signal restoration bug and corruption that can mess up emulation
  in qemu.

* Fixes issues with qemu related to SMP startup and lack of preemption.

Reported-by: ivadasz
8 years agoMakefile.usr - Allow /usr/src to pre-exist
Matthew Dillon [Mon, 21 Dec 2015 08:31:53 +0000 (00:31 -0800)]
Makefile.usr - Allow /usr/src to pre-exist

* Check for /usr/src/.git instead of /usr/src when generating warnings.

8 years agotty_pty - The tty_token isn't needed in ptckqfilter().
Imre Vadasz [Mon, 21 Dec 2015 21:38:10 +0000 (22:38 +0100)]
tty_pty - The tty_token isn't needed in ptckqfilter().

8 years agokernel - Mark sig_filtops kqueue filter as mpsafe.
Imre Vadasz [Mon, 21 Dec 2015 21:30:13 +0000 (22:30 +0100)]
kernel - Mark sig_filtops kqueue filter as mpsafe.

8 years agodrm: Mark drmfiltops mpsafe, remove unneeded locking in kqueue handlers.
Imre Vadasz [Mon, 21 Dec 2015 21:24:19 +0000 (22:24 +0100)]
drm: Mark drmfiltops mpsafe, remove unneeded locking in kqueue handlers.

8 years ago<sys/param.h>: Bump __DragonFly_version for the unionfs removal.
Sascha Wildner [Mon, 21 Dec 2015 20:48:18 +0000 (21:48 +0100)]
<sys/param.h>: Bump __DragonFly_version for the unionfs removal.

Some public headers were touched.

8 years agokernel: Remove VT_UNION.
Sascha Wildner [Mon, 21 Dec 2015 20:43:58 +0000 (21:43 +0100)]
kernel: Remove VT_UNION.

8 years agokernel: Adjust some comments to the unionfs removal.
Sascha Wildner [Mon, 21 Dec 2015 20:43:05 +0000 (21:43 +0100)]
kernel: Adjust some comments to the unionfs removal.

8 years agokernel: Remove the old unionfs that was unhooked from the build since 2004.
Sascha Wildner [Mon, 21 Dec 2015 20:33:03 +0000 (21:33 +0100)]
kernel: Remove the old unionfs that was unhooked from the build since 2004.

Approved-by: dillon
8 years agoigb.4: Update according to the recent TX/RX MSI-X handling work
Sepherosa Ziehau [Mon, 21 Dec 2015 12:35:12 +0000 (20:35 +0800)]
igb.4: Update according to the recent TX/RX MSI-X handling work

8 years agoig_hal/igb: Merge Intel igb-2.4.3
Sepherosa Ziehau [Sat, 19 Dec 2015 01:50:30 +0000 (09:50 +0800)]
ig_hal/igb: Merge Intel igb-2.4.3

- Add one more device
- Fix settings for i354

Tested-by: dillon@ (I354, I217[emx]) me (I350, 82580, 82576, 82575)
8 years agoigb: Optimize the aggregated TX/RX MSI-X handler a bit
Sepherosa Ziehau [Mon, 21 Dec 2015 11:22:19 +0000 (19:22 +0800)]
igb: Optimize the aggregated TX/RX MSI-X handler a bit

By checking whether there are any TX descs to collect or not, before
holding the TX ring serializer.

This requires that igb_txeof() is only called in interrupt handler,
thus we remove the igb_txeof() from igb_start(), which does nothing
most of the time.  Removal of igb_txeof() from igb_start() also allows
us to simplify the TX ring OACTIVE detection, so several unused water
marks are also removed.

8 years agoigb: Partly rework MSI-X support to bypass one serializer
Sepherosa Ziehau [Mon, 14 Dec 2015 03:04:06 +0000 (11:04 +0800)]
igb: Partly rework MSI-X support to bypass one serializer

For aggregated TX/RX MSI-X handler, there is no need to use
an independent serializer; using RX ring's serializer just
works (well, this driver's MSI-X support was added when we
still lacked of experience about how to serialize aggregated
TX/RX MSI-X handler).

Enable aggregated TX/RX MSI-X handling by default to avoid
extra TX interrupt (though its pretty low for TCP streams).

8 years agokernel/pci: Remove old compatibility shims.
Sascha Wildner [Sun, 20 Dec 2015 22:45:39 +0000 (23:45 +0100)]
kernel/pci: Remove old compatibility shims.

The last drivers using this were removed in d69d461d812.

8 years agokqueue/ufs: Remove unnecessary klist cast
Sepherosa Ziehau [Sun, 20 Dec 2015 10:26:12 +0000 (18:26 +0800)]
kqueue/ufs: Remove unnecessary klist cast

8 years agosocket: Don't use NOTE_OOB as hint for KNOTE upon OOB
Sepherosa Ziehau [Sun, 20 Dec 2015 10:19:07 +0000 (18:19 +0800)]
socket: Don't use NOTE_OOB as hint for KNOTE upon OOB

It is not necessary, and would cause penalty if there was knote
processing contention.  Add comment about it.

8 years agokqueue: Hint is not used by socket filters
Sepherosa Ziehau [Sun, 20 Dec 2015 10:02:40 +0000 (18:02 +0800)]
kqueue: Hint is not used by socket filters

8 years agokqueue: Remove unapplied comment
Sepherosa Ziehau [Sun, 20 Dec 2015 09:47:01 +0000 (17:47 +0800)]
kqueue: Remove unapplied comment

8 years agokqueue: Minor style changes
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:59 +0000 (17:35 +0800)]
kqueue: Minor style changes

8 years agokqueue: Avoid duplicate KN_PROCESSING clearing
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:17 +0000 (17:35 +0800)]
kqueue: Avoid duplicate KN_PROCESSING clearing

8 years agokqueue: knote_alloc will never fail
Sepherosa Ziehau [Sun, 20 Dec 2015 02:17:19 +0000 (10:17 +0800)]
kqueue: knote_alloc will never fail

8 years agokqueue: Fix description for kern.kq_checkloop
Sepherosa Ziehau [Sun, 20 Dec 2015 02:10:11 +0000 (10:10 +0800)]
kqueue: Fix description for kern.kq_checkloop

8 years agokernel - Reduce lwp_signotify() latency
Matthew Dillon [Sat, 19 Dec 2015 21:05:55 +0000 (13:05 -0800)]
kernel - Reduce lwp_signotify() latency

* lwp_signotify() was not issuing an IPI to another cpu if the target
  thread was in a run state, preventing that thread from seeing the
  signal for roughly one scheduler tick.

* This interferes with programs like qemu which depend on signaling
  between threads for the timer tick and numerous other things,
  causing timers to behave poorly.

* Fix by issuing the necessary IPI.

Reported-by: Imre Vadasz
Testing-by: Imre Vadasz (+ a bug fix to the original patch)
8 years agosyscons: Remove leftover CDEV_MAJOR #define from sysmouse.c
Imre Vadasz [Sat, 19 Dec 2015 16:54:20 +0000 (17:54 +0100)]
syscons: Remove leftover CDEV_MAJOR #define from sysmouse.c

8 years agoRevert "Sync ACPICA with Intel's version 20151218."
Sascha Wildner [Sat, 19 Dec 2015 19:27:39 +0000 (20:27 +0100)]
Revert "Sync ACPICA with Intel's version 20151218."

This reverts commit 2762423991074ed996c5c4488491cb3ef18c25ea.

It caused a panic on one box and enabling module-level code grouping
again didn't fix that, so it needs further investigation first.

8 years agosys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag
Tomohiro Kusumi [Sat, 19 Dec 2015 14:04:50 +0000 (23:04 +0900)]
sys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag

Spotted-by: swildner
8 years agokernel/acpica: In notify handlers, always report on unknown notifies.
Sascha Wildner [Sat, 19 Dec 2015 11:49:35 +0000 (12:49 +0100)]
kernel/acpica: In notify handlers, always report on unknown notifies.

Also, make the messages more uniform.

8 years agoRevert "drm: Stop using a taskqueue to restore syscons content"
François Tigeot [Sat, 19 Dec 2015 10:47:24 +0000 (11:47 +0100)]
Revert "drm: Stop using a taskqueue to restore syscons content"

This reverts commit 3018b28f1911f36e342118d9a446488cbcdaf118.

It causes instants reboot when VT switching on some systems.

Noticed-by: YRabbit
8 years agoSync ACPICA with Intel's version 20151218.
Sascha Wildner [Sat, 19 Dec 2015 10:41:00 +0000 (11:41 +0100)]
Sync ACPICA with Intel's version 20151218.

* Execute "module-level code" as ACPI tables are loaded into the
  namespace during initialization and install the default operation
  region handlers for the SystemMemory, SystemIO and PCI_Config
  address spaces before any ACPI tables are loaded (in order to
  enable module-level code to access these address spaces). Also,
  several changes to the internal _REG support and to utilities
  in conjunction with these changes.

* Various other fixes and features.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

8 years agodrm: Stop using a taskqueue to restore syscons content
François Tigeot [Sat, 19 Dec 2015 07:48:41 +0000 (08:48 +0100)]
drm: Stop using a taskqueue to restore syscons content

A regular function is perfectly fine

8 years agokernel/drm: Clean up include search path situation in Makefiles.
Sascha Wildner [Fri, 18 Dec 2015 21:47:33 +0000 (22:47 +0100)]
kernel/drm: Clean up include search path situation in Makefiles.

8 years agoipfw3: fix for kernel build
Bill Yuan [Fri, 18 Dec 2015 01:10:04 +0000 (01:10 +0000)]
ipfw3: fix for kernel build

8 years agoipfw3: logging feature
Bill Yuan [Thu, 17 Dec 2015 09:06:54 +0000 (09:06 +0000)]
ipfw3: logging feature

ifconfig ipfw0 create
ipfw3 add allow log 0 icmp

support max=9 pseudo ipfw interfaces.
the logged packets header will be 0x41 & 0x42.
the logged frames can keep the original MAC.

8 years agocrunch: Raise WARNS to 3.
Sascha Wildner [Wed, 16 Dec 2015 02:06:19 +0000 (03:06 +0100)]
crunch: Raise WARNS to 3.

8 years agomountd/crunchgen: Remove some unused variables.
Sascha Wildner [Wed, 16 Dec 2015 02:06:00 +0000 (03:06 +0100)]
mountd/crunchgen: Remove some unused variables.

8 years agoi915 - Add delay after attach to avoid console/X races
Matthew Dillon [Wed, 16 Dec 2015 01:17:44 +0000 (17:17 -0800)]
i915 - Add delay after attach to avoid console/X races

* Add a delay in the i915 attach to give the kms_console time to
  initialize before X starts to muck around with the gpu.

* Appears to avoid deadlock-on-startup problems when X itself loads
  the i915 driver (verses it being preloaed).

8 years agonrelease - Change target from /usr/release to /usr/obj/release
Matthew Dillon [Tue, 15 Dec 2015 20:17:47 +0000 (12:17 -0800)]
nrelease - Change target from /usr/release to /usr/obj/release

* Change the nrelease build target from /usr/release to /usr/obj/release.
  This is to help cleanup the root mount.  Most people don't need to
  backup the release build target.

8 years agokernel - Improve kernel trap message
Matthew Dillon [Tue, 15 Dec 2015 20:11:31 +0000 (12:11 -0800)]
kernel - Improve kernel trap message

* Improve the 'kernel trap with interrupts disabled' message.  Include
  the thread td_comm and %rip.  This way if the trap gets into a loop
  and fails to panic or dump we may be able to track it down from the
  dmesg buffer retained after a reset.

8 years agokernel - Change where dump context is saved
Matthew Dillon [Tue, 15 Dec 2015 20:10:00 +0000 (12:10 -0800)]
kernel - Change where dump context is saved

* Save the dump context a little earlier in the panic to improve
  chances that post-morten kgdb can print the stack backtrace.

* Use a function union for variable arguments calls from ddb>

8 years agomtree: Use spaces for indenting.
Sascha Wildner [Tue, 15 Dec 2015 16:40:59 +0000 (17:40 +0100)]
mtree: Use spaces for indenting.

8 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Dec 2015 10:33:35 +0000 (11:33 +0100)]
Update the pciconf(8) database.

December 10, 2015 snapshot from http://pciids.sourceforge.net/

8 years agosys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION
Tomohiro Kusumi [Mon, 14 Dec 2015 13:22:36 +0000 (22:22 +0900)]
sys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION

for ip localization of root PFS instead of 0.

(see localization arg of hammer_get_inode() for the root inode
of root PFS, which is eventually set to ip->obj_localization,
it doesn't use 0)

8 years agosbin/hammer: Check existence of PFS#0 when creating PFS
Tomohiro Kusumi [Sun, 13 Dec 2015 15:35:28 +0000 (00:35 +0900)]
sbin/hammer: Check existence of PFS#0 when creating PFS

hammer_cmd_pseudofs_create() checks from PFS#0 to PFS#0xffff
to find available PFS#, but PFS#0 must always exist.

8 years agosys/vfs/hammer: Add HAMMER_ROOT_PFSID macro
Tomohiro Kusumi [Sun, 13 Dec 2015 15:15:08 +0000 (00:15 +0900)]
sys/vfs/hammer: Add HAMMER_ROOT_PFSID macro

Explicitly show PFS#0 is root PFS.

8 years agoinstaller - use a more modern mount setup for UFS and HAMMER (2)
Matthew Dillon [Mon, 14 Dec 2015 07:29:02 +0000 (23:29 -0800)]
installer - use a more modern mount setup for UFS and HAMMER (2)

* Fix bugs last commit.  Muffed up fstab generation and forgot to
  remove an if (hammer) from the loader.conf crypto setup.  Also
  had to mkdir /dev on the target.

* Fixes boot tested w/fresh installs.

8 years agoinstaller - use a more modern mount setup for UFS and HAMMER.
Matthew Dillon [Mon, 14 Dec 2015 03:18:47 +0000 (19:18 -0800)]
installer - use a more modern mount setup for UFS and HAMMER.

* Rewrite a large chunk of the disklabeling and mount point code.
  UFS now gains a separate /boot partition, avoiding issues with
  the boot loader if the user desires to install a large UFS root on
  a drive.

* Normalize the mount mechanics for both UFS and HAMMER.  Instead of
  using PFSs on HAMMER, we create two large partitions by default:
  One is the root partition, the other is /build.

  The /build partition holds major elements of the system which would
  normally not have to be backed up:

/var/tmp (from /build/var.tmp)
/var/cache (from /build/var.cache)
/var/crash (from /build/var.crash)
/var/spool (from /build/var.spool)
/var/log (from /build/var.log)
/usr/obj (from /build/usr.obj)

  The root partition holds all remaining major directories, including the
  base /var.

  There are several reasons for this.  Generally speaking, stuff in /home,
  /usr and most of the stuff in /var is critical to system operation and
  user happiness, and it makes little sense to separate it out from the root
  mount.

  We pick-out the less critical directories and place them on /build,
  using NULL mounts to mount them in their expected locations.

* Users can easily make adjustments post-install without having to mess
  around with PFSs, and can make simple adjustments pre-install.

* Drives smaller than around 40GB will not create a separate /build
  partition by default, but will still create a /build directory in the
  root partition and generate the same nullfs mounts.  This makes it easier
  for the user to adjust to a larger configuration later on if desired.

* This also improves crash recovery mechanics, increasing the chance that
  the root partition will be able to mount with minimal recovery work.

* We now use a tmpfs filesystem for /tmp by default.  /var/tmp is mounted
  from storage.  Again, the user can change this easily post-install.

* Calculate better values for swap, root, and /build, based on the size
  of the slice being installed to.  The /build directory will cap-out
  at around 20GB leaving.  Swap will be made smaller if the root partition
  seems to small, and so forth.

  Some swap is always configured.  Swap is a very useful thing to have,
  even if you have tons of memory, because there will always be a certain
  number of always-idle pages from idle services laying around.

* Remove /dev from sources.conf, it is no longer appropriate to try to
  cpdup /dev.  Fixes a cpdup error.

* UFS root can now be encrypted (it couldn't before), because the UFS
  install now splits out a separate /boot partition.

* Tested w/non-crypto UFS and HAMMER install, crypto UFS and HAMMER install,
  and with small and large drives.

8 years agoinet/mcast: Don't free inp_moptions in ip_setmoptions()
Sepherosa Ziehau [Sat, 12 Dec 2015 12:09:13 +0000 (20:09 +0800)]
inet/mcast: Don't free inp_moptions in ip_setmoptions()

This memory foot print optimization does not save much memory for
us, but it could cause a lot of trouble for in_pcbladdr_find().

8 years agosys/vfs/hammer: Rename resv->flush_group to flg_no
Tomohiro Kusumi [Sun, 13 Dec 2015 13:17:45 +0000 (22:17 +0900)]
sys/vfs/hammer: Rename resv->flush_group to flg_no

Not using flush_group; for int is grep friendly since hammer
mostly uses flush_group; for hammer_flush_group_t variables.

8 years agosys/vfs/hammer: Remove unnecessary casts
Tomohiro Kusumi [Sat, 12 Dec 2015 14:33:39 +0000 (23:33 +0900)]
sys/vfs/hammer: Remove unnecessary casts

These are all int minus int where both ints are flush group #.

8 years agosys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS
Tomohiro Kusumi [Sun, 13 Dec 2015 10:49:30 +0000 (19:49 +0900)]
sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

hammer pfs-master|slave have been preventing users from creating
a PFS in non-root PFS, but since kernel HAMMER code also assumes
the parent inode of (non-root)PFS root inode has 0 for ip localization,
ioctl(HAMMERIOC_SET_PSEUDOFS) itself should avoid that too.

This commit doesn't affect HAMMER userspace commands because
hammer pfs-master|slave prevent creating a PFS in PFS prior to
calling ioctl(HAMMERIOC_SET_PSEUDOFS). It just makes better sense
to have this check in kernel space as well since one could write
its own userspace program that directly calls ioctl without using
hammer userspace code.

Also see 5b4785a6.

8 years agosbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c
Tomohiro Kusumi [Sun, 13 Dec 2015 10:30:49 +0000 (19:30 +0900)]
sbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c

The kernel side of PFS code that implements ioctl is called
sys/vfs/hammer/hammer_pfs.c, and all hammer pfs commands are
pfs-xxx. It's more natural to have cmd_pfs.c.
(HAMMER2 has sbin/hammer2/cmd_pfs.c)

The names of functions remain pseudofs since that's the way
functions are named in the kernel too.

8 years agokernel/sound: Add back intr_config_hook descriptions.
Sascha Wildner [Sun, 13 Dec 2015 13:30:30 +0000 (14:30 +0100)]
kernel/sound: Add back intr_config_hook descriptions.

8 years agokernel/iwm: Add intr_config_hook description.
Sascha Wildner [Sun, 13 Dec 2015 13:21:01 +0000 (14:21 +0100)]
kernel/iwm: Add intr_config_hook description.

8 years agovirtio_blk: Use contigmalloc/contigfree for vtblk_request allocations.
Imre Vadasz [Sun, 13 Dec 2015 00:24:23 +0000 (01:24 +0100)]
virtio_blk: Use contigmalloc/contigfree for vtblk_request allocations.

This should fix the "panic: header spanned multiple segments: 2" panic
occuring for some users when running in qemu.

Reported-By: Jim B.
8 years agodrm: Add linux/vmalloc.h
François Tigeot [Sat, 12 Dec 2015 20:00:24 +0000 (21:00 +0100)]
drm: Add linux/vmalloc.h

8 years agodrm: Add linux/fence.h
François Tigeot [Sat, 12 Dec 2015 19:56:48 +0000 (20:56 +0100)]
drm: Add linux/fence.h

8 years agolinux/time.h: Add NSEC_PER_MSEC
François Tigeot [Sat, 12 Dec 2015 19:50:44 +0000 (20:50 +0100)]
linux/time.h: Add NSEC_PER_MSEC

8 years agosys/vfs/hammer: Remove unused count field from hammer_flusher_info
Tomohiro Kusumi [Sat, 12 Dec 2015 07:40:56 +0000 (16:40 +0900)]
sys/vfs/hammer: Remove unused count field from hammer_flusher_info

8 years agodrm/i915: Drop AGP driver requirement
François Tigeot [Fri, 11 Dec 2015 20:15:42 +0000 (21:15 +0100)]
drm/i915: Drop AGP driver requirement

8 years agodrm/i915/gem: Remove useless vm_object unlock/relock sequences
François Tigeot [Fri, 11 Dec 2015 19:36:07 +0000 (20:36 +0100)]
drm/i915/gem: Remove useless vm_object unlock/relock sequences

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (3/3)
François Tigeot [Fri, 11 Dec 2015 19:21:33 +0000 (20:21 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (3/3)

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (2/3)
François Tigeot [Fri, 11 Dec 2015 19:19:55 +0000 (20:19 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (2/3)

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (1/3)
François Tigeot [Fri, 11 Dec 2015 19:06:38 +0000 (20:06 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (1/3)

8 years agosbin/hammer: Make show print symlink[24] if inode is symlink
Tomohiro Kusumi [Fri, 11 Dec 2015 09:57:03 +0000 (18:57 +0900)]
sbin/hammer: Make show print symlink[24] if inode is symlink

Since now that parent_obj_localization part of the union
inode.ext is gone. It's either a symlink string or not used.

8 years agosys/vfs/hammer: Fix wrong parent localization for PFS root
Tomohiro Kusumi [Thu, 10 Dec 2015 15:11:44 +0000 (00:11 +0900)]
sys/vfs/hammer: Fix wrong parent localization for PFS root

The idea of PFS root inode having ip localization value of its
parent directory's inode has been #if0'd after ea434b6f in 2008.

(Since then parent_obj_localization field of ondisk inode seems
to be always 0 because the field is never touched after it's
first allocated, unless it's a symlink which uses symlink[24]
part of union)

Since the field is now deprecated, using this as a localization
value of inode's parent is wrong when the inode is PFS root. It
should use a proper localization value HAMMER_DEF_LOCALIZATION
which is also 0.

Note that HAMMER userspace doesn't allow creating a PFS in PFS
unless the parent PFS is PFS0 (see hammer_cmd_pseudofs_create()),
so it doesn't need to consider the parent inode's localization
value other than the default localization value. If that's allowed,
there seems to be no easy way to tell the localization value.

Also remove parent_obj_localization field of ondisk inode since
it's no longer used after this commit.

8 years agosys/vfs/hammer: Use hammer_find_inode()
Tomohiro Kusumi [Thu, 10 Dec 2015 10:51:12 +0000 (19:51 +0900)]
sys/vfs/hammer: Use hammer_find_inode()

Add __hammer_find_inode() and make hammer_get_*inode() use this.
__hammer_find_inode() is no-ref version of hammer_find_inode()
directly called by hammer_find_inode().

Neither three function arguments obj_id, asof, localization nor
three fields of struct hammer_inode_info are modified in
hammer_get_inode() and hammer_get_dummy_inode(), so getting rid
of hammer_inode_info initialization placed before loop: is ok.

8 years agosys/vfs/hammer: Cleanup
Tomohiro Kusumi [Thu, 10 Dec 2015 09:11:11 +0000 (18:11 +0900)]
sys/vfs/hammer: Cleanup

8 years agoif: Bandaid ifa_ifwithnet() for ifaddrs w/ same netmask
Sepherosa Ziehau [Fri, 11 Dec 2015 07:39:03 +0000 (15:39 +0800)]
if: Bandaid ifa_ifwithnet() for ifaddrs w/ same netmask

The original ifaddr selection logic would cause trouble for
SO_DONTROUTE sockets, if following stuffs happened:
ifconfig drv0 inet a.b.c.1
ifconfig drv0 down
ifconfig drv1 inet a.b.c.2

The original ifaddr selection logic in ifa_ifwithnet() will
select a.b.c.1@drv0, which is down.  Instead, a.b.c.2@drv1
should be selected.

We thus prefer ifaddr w/ IFF_UP interface or is routable.

Same bandaid probably should be applied to ifa_ifwithdstaddr(),
ifa_ifwithaddr() [broadcast part], and ifaof_ifpforaddr() too.

8 years agolibc/stdtime: Fix two cases where a NULL pointer could have been free()'d.
Sascha Wildner [Thu, 10 Dec 2015 20:40:41 +0000 (21:40 +0100)]
libc/stdtime: Fix two cases where a NULL pointer could have been free()'d.

Also, make the rest of error returns more consistent.

8 years agolibcompat: Clean up a bit, fix warnings and raise WARNS to 2.
Sascha Wildner [Thu, 10 Dec 2015 18:16:09 +0000 (19:16 +0100)]
libcompat: Clean up a bit, fix warnings and raise WARNS to 2.

* Remove K&R definitions for non-__STDC__ case.

* Add two defines to rexec.c which afaict were forgotten when the
  RFC 3542 support was added back in 2008 (5aa41e7ced). Or perhaps
  they were present somewhere else which has been removed since.

* Add braces.

* Remove unneeded CFLAGS.

8 years agobtxld(8): Fix some warnings and raise WARNS to 6.
Sascha Wildner [Thu, 10 Dec 2015 18:12:24 +0000 (19:12 +0100)]
btxld(8): Fix some warnings and raise WARNS to 6.

8 years agosys/vfs/hammer: Add hammer_xlate_to_phys()
Tomohiro Kusumi [Wed, 9 Dec 2015 13:21:35 +0000 (22:21 +0900)]
sys/vfs/hammer: Add hammer_xlate_to_phys()

This macro is zone2 --> physical offset version of
hammer_xlate_to_zone2() and hammer_xlate_to_zoneX().

8 years agosys/vfs/hammer: Cleanup assertion for zone
Tomohiro Kusumi [Wed, 9 Dec 2015 12:41:36 +0000 (21:41 +0900)]
sys/vfs/hammer: Cleanup assertion for zone

Don't hardcode ZONE_BTREE (zone-8).

Alhough it requires slightly more calculation than just >ZONE_BTREE,
this is what blockmap does on every allocation/reservation/etc.

8 years agosys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()
Tomohiro Kusumi [Wed, 9 Dec 2015 09:38:52 +0000 (18:38 +0900)]
sys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()

Remove _hammer_bnew() since _hammer_bread() and _hammer_bnew()
are the exact same except for isnew arg of hammer_get_buffer().

hammer_bnew*() use isnew=1 to only allocate ondisk buffer with
no disk i/o at the moment.

8 years agosys/vfs/hammer: Remove unused waitfor field from vsyncscan data
Tomohiro Kusumi [Wed, 9 Dec 2015 07:11:06 +0000 (16:11 +0900)]
sys/vfs/hammer: Remove unused waitfor field from vsyncscan data

Only error field is used.

8 years agosys/vfs/hammer: Make struct hammer_sync_info file local
Tomohiro Kusumi [Wed, 9 Dec 2015 06:57:49 +0000 (15:57 +0900)]
sys/vfs/hammer: Make struct hammer_sync_info file local

This should be a file local struct as no one else needs this
at this point. This struct is for *data part of vsyncscan().

8 years agosys/vfs/hammer: Remove unused lock free_lock
Tomohiro Kusumi [Wed, 9 Dec 2015 06:52:51 +0000 (15:52 +0900)]
sys/vfs/hammer: Remove unused lock free_lock

This was only used in the early stage of hammer development
when hammer_freemap.c had some code.

8 years agobsd-family-tree: Sync with FreeBSD (for DragonFly 4.4.1).
Sascha Wildner [Wed, 9 Dec 2015 08:00:18 +0000 (09:00 +0100)]
bsd-family-tree: Sync with FreeBSD (for DragonFly 4.4.1).

8 years agoinpcb: Split portinfo token into tokens for porthash head
Sepherosa Ziehau [Mon, 7 Dec 2015 06:33:51 +0000 (14:33 +0800)]
inpcb: Split portinfo token into tokens for porthash head

And use pooled token for porthash head.  This avoids another 10K/s
~20K/s contention during local port selection.

8 years agols(1): Fix sort-by-size bug
John Marino [Tue, 8 Dec 2015 22:41:22 +0000 (23:41 +0100)]
ls(1): Fix sort-by-size bug

For a reason that escapes me, in order to sort files by size using ls(1),
one had to pass both the size sort switch (-S) and the time sort switch
(-t), otherwise the -S flag would be ignored.  This hacky workaround was
documented in the man page as well.

Let's fix this with code taken from FreeBSD.  The -t and -S switches are
now mutually exclusive.  If someone uses them together, then the last
one wins (e.g. ls -st sorts by mod. time and -ts sorts by file size)

8 years agow(1): Limit affect of locale change
John Marino [Tue, 8 Dec 2015 21:40:03 +0000 (22:40 +0100)]
w(1): Limit affect of locale change

In essence, w(1) is not designed to be locale sensitive.  The majority
of the outputted text is exclusively English.  However, it does check
the locale for the AM/PM setting (12 hour vs 24 hour clock) and the
decimal separator.

Given that w(1) is designed for English, it only provides enough space
to accommodate "AM" or "PM".  When other locales are used
(e.g. de_DE.UTF-8) the output is simply truncated and confusing.

Let's keep the 12-hour clock labels in the same language as the rest
of the program by forcing strftime to use the C/POSIX locale.  Using
locales still affects am/pm presence and the decimal separator as
originally intended.

8 years agosys/vfs/hammer: Make offset kprintf message explicit
Tomohiro Kusumi [Tue, 8 Dec 2015 17:06:42 +0000 (02:06 +0900)]
sys/vfs/hammer: Make offset kprintf message explicit

bp->b_bio2.bio_offset (bp->b_bio_array[1].bio_offset)
is zone2 offset, so make it print "zone2_offset" instead of "doff".

8 years agosys/vfs/hammer: Make hammer_io_flush_mark() inline
Tomohiro Kusumi [Tue, 8 Dec 2015 09:18:43 +0000 (18:18 +0900)]
sys/vfs/hammer: Make hammer_io_flush_mark() inline

8 years agosys/vfs/hammer: Use HAMMER_ENCODE() for hammer_mod_rb_compare()
Tomohiro Kusumi [Tue, 8 Dec 2015 07:55:09 +0000 (16:55 +0900)]
sys/vfs/hammer: Use HAMMER_ENCODE() for hammer_mod_rb_compare()

Try not to hardcode 8 for volume fields.

The 60 bits offset format changes, but the change doesn't affect
RB-Tree's elements comparison. It works as long as it has volume
bits and 52 bits offset within that volume. Whether HAMMER_ENCODE()
is used or not, io[12]_offset are not valid offsets anyway.
These offset values just need to be unique for physical locations.

(A) before this commit
----oooooooooooooooooooooooooooooooooooooooooooooooooooovvvvvvvv
(B) this commit
----vvvvvvvvoooooooooooooooooooooooooooooooooooooooooooooooooooo

8 years agosys/vfs/hammer: Fix wrong comment on zone2 offset
Tomohiro Kusumi [Tue, 8 Dec 2015 07:35:49 +0000 (16:35 +0900)]
sys/vfs/hammer: Fix wrong comment on zone2 offset

This isn't zone2 offset.

A bug fixed by 41a8e517 in 2012 was based on the wrong assumption
that this offset was zone2 offset, so this comment should be fixed
as well.

8 years agokernel: Silence two unused variables warnings without INET{,6}.
Sascha Wildner [Tue, 8 Dec 2015 17:52:59 +0000 (18:52 +0100)]
kernel: Silence two unused variables warnings without INET{,6}.

Unlikely that someone will compile a kernel without both INET and INET6
but it helps my testing of other, really optional, stuff.

8 years agosys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL
Tomohiro Kusumi [Tue, 8 Dec 2015 06:51:50 +0000 (15:51 +0900)]
sys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL

usr.bin/fstat/hammer.c
includes in-kernel structures and KKASSERT results in compile time error.

8 years agosys/vfs/hammer: Make bio ops static
Tomohiro Kusumi [Tue, 8 Dec 2015 06:26:47 +0000 (15:26 +0900)]
sys/vfs/hammer: Make bio ops static

Only functions that initialize bios need to see this.