dragonfly.git
8 years agoem/emx/igb/ix: Increase opackets stats in if_start method
Sepherosa Ziehau [Fri, 24 Apr 2015 12:30:36 +0000 (20:30 +0800)]
em/emx/igb/ix: Increase opackets stats in if_start method

Since these drivers TX interrupt are aggressively aggregated, increasing
opackets at TX interrupt time will make the opackets statistics vastly
inaccurate.

Noticed-by: dillon@
9 years agosys/vfs/hammer: Remove unnecessary if test
Tomohiro Kusumi [Sun, 26 Apr 2015 09:42:06 +0000 (18:42 +0900)]
sys/vfs/hammer: Remove unnecessary if test

- There is the same 'if (error == 0)' for a local variable error
  right before this one which can be combined.

9 years agosys/vfs/hammer: Make hammer_delete_at_cursor() properly set *stat_bytes
Tomohiro Kusumi [Sat, 25 Apr 2015 18:55:01 +0000 (03:55 +0900)]
sys/vfs/hammer: Make hammer_delete_at_cursor() properly set *stat_bytes

- This commit makes hammer_delete_at_cursor() set *stat_bytes arg.
  *stat_bytes has been ignored although it was supposed to set bytes
  physically deleted from the btree.

- hammer prune command expects this function to set above bytes and
  print it after pruning, however it's always 0 because the function
  ignores it.

- Note that the actual size freed from zone address space may differ
  from *stat_bytes (or what the hammer prune command shows), because
  hammer_blockmap_free() may round it up with its alignment size.

  ==========
  example1 - with existing hammer
  # hammer prune ./test
  TID 000000010404e750 - 0000000104071090
  TID 0000000104034060 - 000000010404e750
  TID 0000000104019cb0 - 0000000104034060
  TID 0000000000000001 - 0000000104019cb0
  Prune /HAMMER/: 4 snapshots
  Prune /HAMMER/: objspace 8000000000000000:0000 7fffffffffffffff:ffff pfs_id 0
  Prune /HAMMER/: prune_min is 0d/00:00:00
  Prune /HAMMER/ succeeded
  Pruned 51/769595 records (10 directory entries) and 0 bytes

  example2 - with this commit
  # hammer prune ./test
  TID 000000010404ea10 - 0000000104071390
  TID 0000000104034360 - 000000010404ea10
  TID 0000000104019fb0 - 0000000104034360
  TID 0000000000000001 - 0000000104019fb0
  Prune /HAMMER/: 4 snapshots
  Prune /HAMMER/: objspace 8000000000000000:0000 7fffffffffffffff:ffff pfs_id 0
  Prune /HAMMER/: prune_min is 0d/00:00:00
  Prune /HAMMER/ succeeded
  Pruned 51/769596 records (11 directory entries) and 6710 bytes

9 years agoSync zoneinfo database with tzdata2015d from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Sat, 25 Apr 2015 13:23:09 +0000 (15:23 +0200)]
Sync zoneinfo database with tzdata2015d from ftp://ftp.iana.org/tz/releases

Changes affecting future time stamps

* Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore
    be on Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.
    Similar fixes apply to 2026, 2037, 2043, etc.
    (Thanks to Steffen Thorsen.)

* Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

Changes affecting past time stamps

* The following changes affect some pre-1991 Chile-related time stamps
    in America/Santiago, Antarctica/Palmer, and Pacific/Easter.

      The 1910 transition was January 10, not January 1.

      The 1918 transition was September 10, not September 1.

      The UTC-4 time observed from 1932 to 1942 is now considered to be
      standard time, not year-round DST.

      Santiago observed DST (UTC-3) from 1946-07-15 through 1946-08-31,
      then reverted to standard time, then switched its time zone to
      UTC-5 on 1947-04-01.

      Assume transitions before 1968 were at 00:00, since we have no data
      saying otherwise.

      The spring 1988 transition was 1988-10-09, not 1988-10-02.
      The fall 1990 transition was 1990-03-11, not 1990-03-18.

      Assume no UTC offset change for Pacific/Easter on 1890-01-01,
      and omit all transitions on Pacific/Easter from 1942 through 1946
      since we have no data suggesting that they existed.

    One more zone has been turned into a link, as it differed
    from an existing zone only for older time stamps.  As usual,
    this change affects UTC offsets in pre-1970 time stamps only.
    The affected zone is America/Montreal.

* America/Whitehorse switched from UTC-9 to UTC-8 on 1967-05-28, not
    1966-07-01.  Also, Yukon's time zone history is documented better.
    (Thanks to Brian Inglis and Dennis Ferguson.)

Change affecting past and future time zone abbreviations

* The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.

9 years agodntpd - Fix va_list handling bug crash
Matthew Dillon [Fri, 24 Apr 2015 17:22:02 +0000 (10:22 -0700)]
dntpd - Fix va_list handling bug crash

* Later versions of gcc manipulate va_lists in ways that prevent them from
  being reused, use va_copy() to make a copy in the log code which uses
  the va_list twice.

* Fixes a seg-fault on startup.

9 years agohammer - Allow NFS exports of slaves
Matthew Dillon [Fri, 24 Apr 2015 16:42:09 +0000 (09:42 -0700)]
hammer - Allow NFS exports of slaves

* Allows a SLAVE PFS to be exported.

* WARNING: Clients who mount a SLAVE PFS from a server will only mount a
  snapshot.  The client must unmount and remount the slave to resynchronize
  it.  Also, if the server wipes the history pertaining the snapshot the
  client mounted, the client's mount will become corrupt.

9 years agosound - Get sound working on alternative Acer C720p
Matthew Dillon [Fri, 24 Apr 2015 15:30:46 +0000 (08:30 -0700)]
sound - Get sound working on alternative Acer C720p

* This is a bit of a hack but one of our users had a C720p which had
  a HP vendor id for its chips.  It is possible that this was due to
  a BIOS mixup by Google.

* Add hacks for it so sound works on his device.

9 years agowpa_supplicant - CVE-2015-1863 (dead code in DFly so not an issue)
Matthew Dillon [Thu, 23 Apr 2015 23:56:54 +0000 (16:56 -0700)]
wpa_supplicant - CVE-2015-1863 (dead code in DFly so not an issue)

* Correct buffer overflow from CVE-2015-1863.

* Note that this code is NOT compiled into DragonFly's wpa_supplicant anyway,
  so the security advisory is not applicable to DragonFly.  Fix the code
  anyway so it isn't accidently enabled with the security hole before the
  next vendor update.

9 years agosys/vfs/hammer: Make comments up-to-date
Tomohiro Kusumi [Thu, 23 Apr 2015 12:55:05 +0000 (21:55 +0900)]
sys/vfs/hammer: Make comments up-to-date

- There was no 'if (dip)' when the .. comment was added in 5a930e66,
  but ea434b6f needed 'if (dip)' and was added.

9 years agoRevert "sbin/hammer: Print key_end.lo instead of key_beg.lo on reblock"
Tomohiro Kusumi [Thu, 23 Apr 2015 10:41:44 +0000 (19:41 +0900)]
Revert "sbin/hammer: Print key_end.lo instead of key_beg.lo on reblock"

This reverts commit d58869bda15ddc5e96c1c053196fcd3e56e340c6.

- According to the hammer rebalance (cmd_rebalance.c) which has
  a similar printf, this printf was probably intended to show
  localization type('s lower limit) when btree iteration starts,
  rather than localization types to look for during the iteration.
  Then it was right to print 0x0 (key_beg.localization) for %04x.

9 years agoemx: Add errata workaround for multiple TX queues
Sepherosa Ziehau [Thu, 23 Apr 2015 12:21:58 +0000 (20:21 +0800)]
emx: Add errata workaround for multiple TX queues

This makes multiple TX queues work on 82574.

Information-from: Sean Bruno <sbruno@ignoranthack.me>
Tested-with: 82571, 82574, I217

9 years agoSet gcc50 as the primary compiler, gcc47 as secondary
John Marino [Sun, 19 Apr 2015 06:14:37 +0000 (08:14 +0200)]
Set gcc50 as the primary compiler, gcc47 as secondary

Per request, rather than define NO_GCC47 to prevent the building of the
secondary compiler, the new variable is called NO_ALTCOMPILER.  This
will avoid some disruption in the future where the actual version is not
important, only the desire to avoid the secondary compiler.

9 years agogcc50: Update to release version 5.1.0 => 5.1.1
John Marino [Wed, 22 Apr 2015 09:19:58 +0000 (11:19 +0200)]
gcc50: Update to release version 5.1.0 => 5.1.1

Immediately after the release was tagged, another commit was added that
changed the version to 5.1.1.  Other than the version differing by 0.0.1,
this version is identical to what the GCC just released.

9 years agoMerge branch 'vendor/GCC50'
John Marino [Wed, 22 Apr 2015 19:43:22 +0000 (21:43 +0200)]
Merge branch 'vendor/GCC50'

9 years agoUpdate gcc-50 to SVN version 222321 (gcc-5-branch)
John Marino [Wed, 22 Apr 2015 09:15:19 +0000 (11:15 +0200)]
Update gcc-50 to SVN version 222321 (gcc-5-branch)

This is equivalent to the GCC 5.1 release plus 1 commit that changes
the version from 5.1.0 to 5.1.1 to reopen the release branch.

Last Changed Date: 2015-04-22 12:45:39 +0200 (Wed, 22 Apr 2015)

9 years agosbin/hammer: Print key_end.lo instead of key_beg.lo on reblock
Tomohiro Kusumi [Tue, 21 Apr 2015 15:15:21 +0000 (00:15 +0900)]
sbin/hammer: Print key_end.lo instead of key_beg.lo on reblock

- Print reblock.key_end.localization when reblock starts instead of
  reblock.key_beg.localization.

- hammer reblock printing 0000 while reblock-inodes printing 0001
  and reblock-data|dirs printing 0002 seems strange because reblock
  covers all localization types ranging from MIN(0000) to MAX(ffff)
  on btree iteration (which obviously includes existing two types
  for inode and misc). Printing end localization should make better
  sense here.

9 years agosbin/hammer: Print big block size on reblock
Tomohiro Kusumi [Tue, 21 Apr 2015 14:20:04 +0000 (23:20 +0900)]
sbin/hammer: Print big block size on reblock

- Print free_level/big_block_size when reblock starts instead of
  just free_level.

- The meaning of 'fill_percentage' arg is easier to understand
  this way because the big block size is not obvious for most users
  while this arg is about selecting which big block to defrag.

9 years agosys/vfs/hammer: Cleanup cursor initialization code on reblock
Tomohiro Kusumi [Tue, 21 Apr 2015 12:08:56 +0000 (21:08 +0900)]
sys/vfs/hammer: Cleanup cursor initialization code on reblock

- Just make things a bit more clear.

- The rule is the ioctl caller sets localization type to reblock,
  and the ioctl code adds up ip localization to initialize cursor.

9 years agosys/vfs/hammer: Make hammer_blockmap_getfree() clear *curp on error case
Tomohiro Kusumi [Tue, 21 Apr 2015 12:04:38 +0000 (21:04 +0900)]
sys/vfs/hammer: Make hammer_blockmap_getfree() clear *curp on error case

- Set *curp to either 0 or 1 regardless of *errorp.
  The previous return(0); case does this then all should do this.

9 years agosys/vfs/hammer: Fix comment
Tomohiro Kusumi [Tue, 21 Apr 2015 12:02:47 +0000 (21:02 +0900)]
sys/vfs/hammer: Fix comment

- Sync a comment with what's written in reblock_usage().

9 years agosys/vfs/hammer: Cleanup sanity checks
Tomohiro Kusumi [Tue, 21 Apr 2015 12:01:00 +0000 (21:01 +0900)]
sys/vfs/hammer: Cleanup sanity checks

- Move sanity checks to the beginning of the function.

- Check 'free_level > HAMMER_BIGBLOCK_SIZE'.
  free_level is somewhere between 0 and 8MB (inclusive).

9 years agosbin/hammer: Remove irrelevant if(S_ISLNK()) case
Tomohiro Kusumi [Sun, 19 Apr 2015 10:51:41 +0000 (19:51 +0900)]
sbin/hammer: Remove irrelevant if(S_ISLNK()) case

- Remove if(S_ISLNK()) case for hammer snap since it never matches.

- Also note it shouldn't be matching S_ISLNK() in the first place.
  If it does match hammer snap|snaplo|snapq commands will remove
  a symlink to the existing snapshot and relink to the new snapshot
  which results losing a reference to the old snapshot (although
  the old snapshot is still accessible as HAMMER's snapshot is just
  a pointer to the filesystem as of certain tid that is resolved
  when accessed).

9 years agosbin/hammer: Add missing snapshots related free(3)
Tomohiro Kusumi [Sun, 19 Apr 2015 10:17:36 +0000 (19:17 +0900)]
sbin/hammer: Add missing snapshots related free(3)

- Call free(3) after asprintf(3)

9 years agosys/vfs/hammer: Fix off-by-one for snapshot index
Tomohiro Kusumi [Sat, 18 Apr 2015 18:42:43 +0000 (03:42 +0900)]
sys/vfs/hammer: Fix off-by-one for snapshot index

- The index starts from 0 so these ioctls should test 'index >= count'.

9 years agosbin/hammer: Remove redundant exit(3)
Tomohiro Kusumi [Sat, 18 Apr 2015 18:24:43 +0000 (03:24 +0900)]
sbin/hammer: Remove redundant exit(3)

- snapshot_usage(1); does exit(1); as the comment implies.

9 years agosshlockout - minor cleanup
Matthew Dillon [Sat, 18 Apr 2015 19:05:03 +0000 (12:05 -0700)]
sshlockout - minor cleanup

* If ac >= 2 then av[1] will not be NULL.

9 years agosound - Fix default & unit specs for /dev/dsp and /dev/mixer (2)
Matthew Dillon [Sat, 18 Apr 2015 19:04:06 +0000 (12:04 -0700)]
sound - Fix default & unit specs for /dev/dsp and /dev/mixer (2)

* Cleanup a debugging kprintf().

* Cleanup incorrect dev reference and remove some unnecessary locking.

9 years agosbin/hammer: Make hammer mirror-dump print localization
Tomohiro Kusumi [Sat, 18 Apr 2015 05:10:35 +0000 (14:10 +0900)]
sbin/hammer: Make hammer mirror-dump print localization

- Add printf for localiazation in addition to other
  struct hammer_base_elm fields.

9 years agosys/vfs/hammer: Try to fix hammer_ioc_pfs_iterate() [2/2]
Tomohiro Kusumi [Sat, 18 Apr 2015 10:18:30 +0000 (19:18 +0900)]
sys/vfs/hammer: Try to fix hammer_ioc_pfs_iterate() [2/2]

- The ioctl HAMMERIOC_PFS_ITERATE added in commit 29d31c2d has
  several design issues. This commit and the previous try to fix
  them. Since it's been exposed to userspace, some of them are
  left as it is with comments.

- Move hammer_ioc_pfs_iterate() to sys/vfs/hammer/hammer_pfs.c
  and rename it to hammer_ioc_iterate_pseudofs().

- struct hammer_ioc_pfs_iterate was not necessary. The existing
  struct hammer_ioc_pseudofs_rw which is being used by all other
  pfs ioctls has everything HAMMERIOC_PFS_ITERATE needs given
  that hammer_ioc_pfs_iterate::pos is just used as a pfs id.
  Using the unique struct requires hammer_ioc_iterate_pseudofs()
  extra conversion in order to make this ioctl behave like other
  pfs ioctls using autodetect.

9 years agosys/vfs/hammer: Try to fix hammer_ioc_pfs_iterate() [1/2]
Tomohiro Kusumi [Wed, 15 Apr 2015 14:21:38 +0000 (23:21 +0900)]
sys/vfs/hammer: Try to fix hammer_ioc_pfs_iterate() [1/2]

- The ioctl HAMMERIOC_PFS_ITERATE added in commit 29d31c2d has
  several design issues. This commit and the next one try to fix
  them. Since it's been exposed to userspace, some of them are
  left as it is with comments.

- The name hammer_ioc_pfs_iterate::pos (pi->pos) is misleading.
  It should have been 'pfs_id'. Users will have no idea what
  the 'pos' is supposed to be.

- pi->pos is unsigned.

- Don't shift pi->pos (Don't ip localize pi->pos). Copy it to a
  local variable and then shift that.

- cursor.key_end fields are necessary only when iterating btree.
  This function has 'iterate' in its name but all it does is
  a single btree lookup.

- Don't |= HAMMER_PFSD_DELETED with pi->head.flags. pi->head.flags
  is for HAMMER_IOC_XXX macros, but not for ondisk pfs status
  (it was lucky PFSD_DELETED does not conflict with those values).
  Users get pfs status from cursor.data->pfsd.mirror_flags copied
  to userspace. libhammer code that is based on this wrong flag
  checking is fixed accordingly.

- Check if pi->ondisk is allocated.

- Copy ondisk pfs data regardless of ondisk pfs delete flag bit.
  The delete flag doesn't mean the data is gone.

9 years agosbin/hammer: Add missing free(3) and relpfs()
Tomohiro Kusumi [Tue, 14 Apr 2015 14:48:30 +0000 (23:48 +0900)]
sbin/hammer: Add missing free(3) and relpfs()

- Add missing free(3) for mirror buffer and relpfs() to release pfs.

9 years agosbin/hammer: Add missing free(3)
Tomohiro Kusumi [Tue, 14 Apr 2015 14:30:40 +0000 (23:30 +0900)]
sbin/hammer: Add missing free(3)

- Add missing free(3) for a return value of read_mrecord().

9 years agosbin/hammer: Remove unnecessary strndup(3)
Tomohiro Kusumi [Tue, 14 Apr 2015 13:42:21 +0000 (22:42 +0900)]
sbin/hammer: Remove unnecessary strndup(3)

- user string is relative to host string, not filesystem string.

9 years agosys/vfs/hammer: Add comments on ip localization of @@PFS symlink
Tomohiro Kusumi [Tue, 14 Apr 2015 10:06:24 +0000 (19:06 +0900)]
sys/vfs/hammer: Add comments on ip localization of @@PFS symlink

- The userspace hammer command shows "You are attempting to access
  a PFS softlink from a PFS..." and exit(1) whenever one tries to
  make a PFS from non root fs directory.

- This restriction by userspace ensures @@PFS symlinks always belong
  to the root fs, in other words ip localization of those symlinks
  are always 0. HAMMER's kernel code doesn't impose this restriction
  on pfs, but userspace does.

9 years agogcc50: Upgrade to GCC 5.1 release candidate plus
John Marino [Fri, 17 Apr 2015 08:06:03 +0000 (10:06 +0200)]
gcc50: Upgrade to GCC 5.1 release candidate plus

while here:
  * remove 4+ Mb of unused texi files from contrib
  * update the 3 man pages from Release candidate
  * Change makefiles to not take man pages from contrib directory

After thinking about it, I've decided to continue to update GCC from
Subversion sources rather than limit updates to designated releases.  This
is the reason the man pages are not taken from contrib; they are only
present in actual releases and not the SVN repository.  The plan is to
only update the man pages when GCC minor version is released.

This is the first (and likely only) release candidate for GCC5.  It will
be known as gcc 5.1.0, but CCVER will remain at "gcc50" regardless if the
version of gcc is 5.1.1 or 5.4.2.  This includes changes up to SVN 222168
(April 17).

9 years agoMerge branch 'vendor/GCC50'
John Marino [Fri, 17 Apr 2015 10:57:20 +0000 (12:57 +0200)]
Merge branch 'vendor/GCC50'

9 years agoUpdate gcc-50 to SVN version 222168 (gcc-5-branch)
John Marino [Fri, 17 Apr 2015 07:45:38 +0000 (09:45 +0200)]
Update gcc-50 to SVN version 222168 (gcc-5-branch)

Last Changed Date: 2015-04-17 09:45:46 +0200 (Fri, 17 Apr 2015)

9 years agosysperf - Adjust syscall tests
Matthew Dillon [Thu, 16 Apr 2015 16:39:01 +0000 (09:39 -0700)]
sysperf - Adjust syscall tests

* Remove getuid_msg.c, no longer used.

* Adjust syscall1.c to be more verbose.

* Refactor syscall2.c to test on all threads in a somewhat more
  sophisticated manner.  The test expects the scheduler to move
  the threads to their own cpus (and it should).

9 years agosound - Fix default & unit specs for /dev/dsp and /dev/mixer
Matthew Dillon [Thu, 16 Apr 2015 16:20:54 +0000 (09:20 -0700)]
sound - Fix default & unit specs for /dev/dsp and /dev/mixer

* /dev/dsp{0,1} was overriding the unit number and forcing the currently
  set default dsp unit, so it didn't matter if you specified /dev/dsp0 or 1,
  it still used hw.snd.default_unit.

* Get rid of the devfs aliasing for /dev/dsp and /dev/mixer.  Instead, use
  the cloner code to lookup the default dsp and default mixer when /dev/dsp
  or /dev/mixer is opened.

  This simplifies default handling significantly.

9 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 15 Apr 2015 09:07:46 +0000 (11:07 +0200)]
Update the pciconf(8) database.

April 14, 2015 snapshot from http://pciids.sourceforge.net/

9 years agodrm: linux/spin.h: Implement assert_spin_locked()
François Tigeot [Mon, 13 Apr 2015 21:32:36 +0000 (22:32 +0100)]
drm: linux/spin.h: Implement assert_spin_locked()

9 years agocoretemp: Add package level thermal sensor support
Sepherosa Ziehau [Fri, 10 Apr 2015 13:48:35 +0000 (21:48 +0800)]
coretemp: Add package level thermal sensor support

The temperature extracted from CPU package level thermal sensors are
exposed through sensor sysctl hw.sensors.cpu_nodeX.temp0 nodes.

9 years agosbin/hammer: Allow pfs commands directly handle pfs
Tomohiro Kusumi [Fri, 10 Apr 2015 20:32:18 +0000 (05:32 +0900)]
sbin/hammer: Allow pfs commands directly handle pfs

- pfs commands can handle a link to pfs, but not the pfs itself.
  This commit allows pfs commands to directly handle pfs node,
  in addition to doing it via link. Being able to execute them
  only via link is strange behavior and should be able to do via
  both ways.

- This commit basically makes both link and non-link path go through
  scanpfsid() which scans pfs id and returns fd of its parent dir.
  In the existing code only link path goes through pfs id scan code,
  so pfs commands are unable to directly handle non-link pfs node
  itself (even if one wants to do so).

  ==========
  example1 - using existing /sbin/hammer

  # ls -l ./test1
  lrwxr-xr-x  1 root  wheel  10 Apr  8 05:52 ./test1 -> @@-1:00001
  # hammer pfs-downgrade @@-1:00001
  pfs-downgrade of PFS#1 () failed: Directory not empty
  # hammer pfs-destroy ./@@-1:00001
  You have requested that PFS#1 () be destroyed
  <snip>
  Destroying PFS #1 () in  5 4 3 2 1.. starting destruction pass
  pfs-destroy of PFS#1 failed: Directory not empty

  ==========
  example2 - using this commit to directly destroy pfs

  # hammer pfs-destroy ./@@-1:00001
  You have requested that PFS#1 () be destroyed
  <snip>
  Destroying PFS #1 () in  5 4 3 2 1.. starting destruction pass
  pfs-destroy of PFS#1 succeeded!
  # hammer pfs-status ./test1
  Cannot access PFS ./test1: No such file or directory

  The only case that breaks current behavior is when there is a
  regular directory whose format matches (not existing) pfs name,
  although this is not likely to happen in the real world. This
  is inevitable since stat(2) also recognizes pfs as a directory
  (also see hammer_mkroot_pseudofs()).

  # mkdir ./@@-1:00005
  # hammer pfs-status ./@@-1:00005
  Cannot access PFS ./@@-1:00005: No such file or directory

  ==========
  example3 - another example using this commit.

  Actually location of the pfs link doesn't matter as the pfs node
  represents the root inode of pfs, but not a subdirectory of where
  the pfs link is made in the root filesystem. This is confusing
  though when there are more than 1 HAMMER filesystems in a single
  system as "@@-1:00001" could indicate different pfs-es depending
  on where/how commands are executed. Having access to pfs-es via
  symlinks (created by pfs-master|slave) is usually a clearer way.

  # mkdir -p a/b/c/d/e
  # cd a/b/c/d/e
  # hammer pfs-master test2 > /dev/null
  # ls -l ./test2
  lrwxr-xr-x  1 root  wheel  10 Apr 10 04:12 ./test2 -> @@-1:00001
  # cd ../../../../..
  # hammer pfs-destroy @@-1:00001
  You have requested that PFS#1 () be destroyed
  <snip>
  Destroying PFS #1 () in  5 4 3 2 1.. starting destruction pass
  pfs-destroy of PFS#1 succeeded!

  # hammer pfs-slave test3 > /dev/null
  # ls -l ./test3
  lrwxr-xr-x  1 root  wheel  10 Apr 12 16:30 ./test3 -> @@0x0000000000000001:00001
  # hammer pfs-destroy a/b/c/d/e/@@0x0000000000000001:00001
  You have requested that PFS#1 () be destroyed
  <snip>
  Destroying PFS #1 () in  5 4 3 2 1.. starting destruction pass
  pfs-destroy of PFS#1 succeeded!

9 years agosbin/hammer: Remove strtrl()
Tomohiro Kusumi [Fri, 10 Apr 2015 20:40:07 +0000 (05:40 +0900)]
sbin/hammer: Remove strtrl()

- (see previous 3 commits)

9 years agosbin/hammer: Make strtrl() api right [3/3]
Tomohiro Kusumi [Fri, 10 Apr 2015 20:32:18 +0000 (05:32 +0900)]
sbin/hammer: Make strtrl() api right [3/3]

- Fix changes made by commit 3c10747d.

- while (p-- > s && *p == '/')
  is very obscure and not even sure if this code is portable.
  Make it explicit.

9 years agosbin/hammer: Make strtrl() api right [2/3]
Tomohiro Kusumi [Fri, 10 Apr 2015 20:32:18 +0000 (05:32 +0900)]
sbin/hammer: Make strtrl() api right [2/3]

- Fix changes made by commit 3c10747d.

- Not sure what the return value of strtrl() is trying to do, but
  checking ==NULL here doesn't mean anything unless 'path' is NULL.
  (The only case that had meaning was when 'path' was NULL, but
  it's pretty obvious callers were not passing NULL)

- Change strnlen() to strlen(). It's better to use strlen() when
  we know the input (argv[i]) is a C string. Also note that in
  this case non NULL terminated char[] of length 'size_t maxlen'
  is useless and does no good anyway.

9 years agosbin/hammer: Make strtrl() api right [1/3]
Tomohiro Kusumi [Fri, 10 Apr 2015 20:32:17 +0000 (05:32 +0900)]
sbin/hammer: Make strtrl() api right [1/3]

- Fix changes made by commit 3c10747d.

- There shouldn't be any reason to take char** for the first arg,
  but char* is enough.

- The second arg len can be calculated inside the function given
  that the 'path' is a C string.

9 years agosbin/hammer: Remove redundant printf for slave pfs info
Tomohiro Kusumi [Fri, 10 Apr 2015 20:32:17 +0000 (05:32 +0900)]
sbin/hammer: Remove redundant printf for slave pfs info

- hammer pfs-status does show "operating as a SLAVE" if the pfs
  is a slave, so no need to print another line that shows the
  same thing. Also removing this line doesn't seem to break any
  existing userspace.

9 years agovirtio: Bring in SVN r251769 from FreeBSD.
Nuno Antunes [Sun, 12 Apr 2015 08:47:56 +0000 (09:47 +0100)]
virtio: Bring in SVN r251769 from FreeBSD.

* Fixes the following occasional log message when booting:
"vtnet0: error setting host MAC filter table"

* Original FreeBSD commit message below.

QEMU 1.4 made the descriptor requirement stricter - the size of buffer
descriptor must exactly match the number of MAC addresses provided.

Reported-by: nans_nans1@yahoo.de
Fix-pointed-out-by: Brian Venteicher <bryanv@daemoninthecloset.org>
9 years agokernel: APM was only supported on i386, remove unused x86_64 files.
Sascha Wildner [Sun, 12 Apr 2015 08:35:39 +0000 (10:35 +0200)]
kernel: APM was only supported on i386, remove unused x86_64 files.

This is due to our x86_64 not supporting VM86 BIOS calls. This
code was never hooked in.

This does not affect ACPI's APM "emulation" (it supports some
APM ioctls) which is available on x86_64 too.

9 years agoSync the de(4) manual page with FreeBSD.
Sascha Wildner [Sat, 11 Apr 2015 10:26:08 +0000 (12:26 +0200)]
Sync the de(4) manual page with FreeBSD.

9 years agoif_de: Sync with current FreeBSD version (r271849). Now works with >4G ram.
Imre Vadasz [Sat, 11 Apr 2015 11:53:55 +0000 (13:53 +0200)]
if_de: Sync with current FreeBSD version (r271849). Now works with >4G ram.

* if_de now uses the bus_dma api for DMA memory handling. This makes the
  driver work on systems with more than 4G of ram.

* Remove currently unused code for the TULIP_DO_GPR_SENSE option.

* Keeps most original modifications relative to the code from FreeBSD.

9 years agoacpidump(8): Fix /dev/mem access.
Sascha Wildner [Fri, 10 Apr 2015 21:49:40 +0000 (23:49 +0200)]
acpidump(8): Fix /dev/mem access.

I accidentally removed it in the ACPICA 20150408 upgrade.

9 years agoboot/acpi: Use ACPICA constants instead of magic addresses.
Sascha Wildner [Thu, 9 Apr 2015 22:53:26 +0000 (00:53 +0200)]
boot/acpi: Use ACPICA constants instead of magic addresses.

While here, also adjust a comment to match the latest ACPI specification.

No functional change.

9 years agoSync ACPICA with Intel's version 20150410.
Sascha Wildner [Fri, 10 Apr 2015 17:31:29 +0000 (19:31 +0200)]
Sync ACPICA with Intel's version 20150410.

The only difference to 20150408 is reverting a change that caused
regressions in the disassembler.

9 years agokernel: Fix two typos.
Sascha Wildner [Fri, 10 Apr 2015 14:41:47 +0000 (16:41 +0200)]
kernel: Fix two typos.

9 years agomutex.9: Adjust for latest changes (ident was moved to mtx_init()).
Sascha Wildner [Fri, 10 Apr 2015 12:28:03 +0000 (14:28 +0200)]
mutex.9: Adjust for latest changes (ident was moved to mtx_init()).

9 years agosensor_attach.9: sensor_task_register() no longer can return failure.
Sascha Wildner [Fri, 10 Apr 2015 12:04:02 +0000 (14:04 +0200)]
sensor_attach.9: sensor_task_register() no longer can return failure.

9 years agocoretemp: CORE_LEVEL node contains 0 children, if hyperthread is not enabled
Sepherosa Ziehau [Fri, 10 Apr 2015 03:53:58 +0000 (11:53 +0800)]
coretemp: CORE_LEVEL node contains 0 children, if hyperthread is not enabled

Reported-by: YRabbit
9 years agoACPICA: Remove no longer needed file.
Sascha Wildner [Thu, 9 Apr 2015 20:38:13 +0000 (22:38 +0200)]
ACPICA: Remove no longer needed file.

9 years agousb4bsd: Use ifq_set_oactive, update stat counters
Markus Pfeiffer [Thu, 9 Apr 2015 20:09:22 +0000 (20:09 +0000)]
usb4bsd: Use ifq_set_oactive, update stat counters

* We now use ifq_set_oactive and ifq_clr_oactive on if_urndis
* Also while we are here replace increments of counters
  by use of IFNET_STAT_INC macros

9 years agousb4bsd: Do not start when output is active
Markus Pfeiffer [Thu, 9 Apr 2015 19:50:39 +0000 (19:50 +0000)]
usb4bsd: Do not start when output is active

9 years agoSync ACPICA with Intel's version 20150408.
Sascha Wildner [Thu, 9 Apr 2015 20:01:36 +0000 (22:01 +0200)]
Sync ACPICA with Intel's version 20150408.

General changes:

* First part of upstream DragonFly support. acdragonfly.h and
  acdragonflyex.h are now in the upstream repo. Various needed
  patches to hook them in should be in the next Intel release.

* _REV now permanently returns 2 (as in other ACPI implementations).

* Windows 2015 (aka Windows 10) _OSI string added.

* Various printf issue fixes.

iasl(8) specific changes:

* Constant folding enhanced.

* SLIC table support updated according to Microsoft's latest spec. It
  dumps as hex data block now (proprietary data).
  This issue was actually found by our sephe on his Compaq CQ45.

* MSDM table support added (handled as proprietary data, just like SLIC).

* -Pn option implemented for the table compiler (was only implemented
  for the ASL compiler).

* Better data table disassembly comments.

* -df option to force the disassembler to assume the table contains AML.

* Some fixes in the EFI version of the tools.

* Small miscellaneous fixes.

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

9 years agomtree: Stop creating /usr/share/info.
Sascha Wildner [Thu, 9 Apr 2015 19:58:22 +0000 (21:58 +0200)]
mtree: Stop creating /usr/share/info.

9 years agoActually remove all share/info traces.
Sascha Wildner [Thu, 9 Apr 2015 19:57:56 +0000 (21:57 +0200)]
Actually remove all share/info traces.

9 years agoClean up no longer used NOINFO and NOINFOCOMPRESS make.conf variables.
Sascha Wildner [Thu, 9 Apr 2015 19:57:27 +0000 (21:57 +0200)]
Clean up no longer used NOINFO and NOINFOCOMPRESS make.conf variables.

9 years agoRemove some more old files via 'make upgrade'.
Sascha Wildner [Thu, 9 Apr 2015 19:56:47 +0000 (21:56 +0200)]
Remove some more old files via 'make upgrade'.

9 years agomake upgrade: Remove formatted manual pages automatically.
Sascha Wildner [Thu, 9 Apr 2015 19:56:18 +0000 (21:56 +0200)]
make upgrade: Remove formatted manual pages automatically.

9 years agocoretemp: Indentation
Sepherosa Ziehau [Thu, 9 Apr 2015 12:17:20 +0000 (20:17 +0800)]
coretemp: Indentation

9 years agocoretemp: Avoid magic number
Sepherosa Ziehau [Thu, 9 Apr 2015 12:17:00 +0000 (20:17 +0800)]
coretemp: Avoid magic number

9 years agohammer2 - slave sync adjustments, doc update
Matthew Dillon [Thu, 9 Apr 2015 06:58:54 +0000 (23:58 -0700)]
hammer2 - slave sync adjustments, doc update

* Fix the hammer2_cluster*() API, do not multiply-ref underlying chains
  when a cluster is multiply-ref'd.  Fixes issues when underlying chain
  elements of the cluster are replaced during operations.

* Fix frontend writing issues when multiple slaves are present.

* Adjust documentation a bit.  Get rid of the 256-way split description
  for copyid use, we aren't going to do things that way so the size for
  each physical volume can be up to ~2^64 (maybe ~2^63 to be safe).

* Add a HAMMER2_LOOKUP_NODIRECT flag to prevent recursively returning
  the inode and remove the broken (cluster == cparent) test in the slave-sync
  code.  Doh, cluster structures are independently allocated, test was
  broken.

* Fix several other slave-sync issues when multiple slaves are present.
  (there are still some issues remaining).

* Fix accounting for the number of mounts using a physical device
  (hmp), rename pmp_count to mount_count for clarity.

9 years agocoretemp: Register sensor task for each core instead each HT
Sepherosa Ziehau [Wed, 8 Apr 2015 14:56:45 +0000 (22:56 +0800)]
coretemp: Register sensor task for each core instead each HT

And replicate DTS readout to all HT sensors belonging to the same core.
DTS readout is actually only for cores.

9 years agohammer2 - Retool flushing and use of mirror_tid, more cluster work.
Matthew Dillon [Wed, 8 Apr 2015 05:53:06 +0000 (22:53 -0700)]
hammer2 - Retool flushing and use of mirror_tid, more cluster work.

Now that I'm starting to deal with different PFSs on the same physical
volume some mirror_tid related issues need to be fixed.

* mirror_tid is now per-media, not per-PFS.  This fixes a number of issues
  particularly with the on-mount recovery scan.  Mount, recovery, and flush
  code now no longer has to worry about PFSs when it comes to adjusting
  mirror_tid.

* modify_tid will become per-physical PFS (not quite done in this commit).

* Change where mirror_tid gets set.  Set bref.mirror_tid in
  hammer2_chain_modify() instead of in the flush code.  This takes care
  of most of the flush cases.

* Better separation of the freemap_tid in the volume header.

* fchain (freemap) and vchain (main topology) syncing now works properly.
  The fchain can be flushed independently of vchain, and the recovery code
  can handle any number of vchain flushes occuring without a fchain flush.

  For the moment, both are flushed on sync, fchain first, vchain second.
  This can leave fchain's mirror_tid slightly behind vchain requiring
  recovery on mount if a crash were to occur.

  We now properly update just the fchain mirror_tid on a followup sync if
  no main topology modifications have occurred, allowing the fchain
  mirror_tid to catch-up to the vchain mirror_tid.

  We now properly sync the fchain on unmount so no recovery is required.

* Revamp the recovery code to properly use the fchain-to-vchain mirror_tid
  range in the recovery scan.  This has the general effect of making the
  recovery pass run a whole lot faster and when coupled with the above
  fixes.

  Report whether recovery is needed or not on-mount and the mirror_tid range
  if so.

* Update DESIGN.

* Add CITEM_FEMOD indicating which chains in the hammer2_cluster structure
  can actually be modified and modsync'd by a hammer2_cluster_modify() call.

* CITEM_INVALID now also checks bref.modify_tid as intended, when checking
  whether nodes are synchronized or not (it used to use mirror_tid but with
  the revamping modify_tid takes over this functionality).

* Remove the auto-ref/auto-drop from hammer2_chain_lock(),
  hammer2_chain_unlock(), hammer2_cluster_lock(),
  and hammer2_cluster_unlock().  Separate ref and drop calls are needed if
  the ref-count is not taken care of already.

  This makes the *chain* and *cluster* API basically behave the same way,
  reducing confusion.

  Cleanup related #defines and code infrastructure that is no longer needed
  to handle RESOLVE_NOLOCK.

* Fix a bug when LOOKUP_NOLOCK is used.  Do not assume LOOKUP_SHARED when
  LOOKUP_NOLOCK is used, use the LOOKUP_SHARED flag only to determine the
  locking type.  Otherwise relocking the parent (which has to be locked)
  for the degenerate DIRECTDATA case breaks the parent and causes a
  deadlock or assertion.

* Preliminary adjustments to the slave synchronization code.  In particular,
  add support to hammer2_chain_modify() to suppress modify_tid updates so
  the slave synchronization code can update the field manually.  It must
  NOT update the modify_tid in parent chains in the topology until the
  sub-tree under them is synchronized.

9 years agocoretemp: Clean up identify method
Sepherosa Ziehau [Tue, 7 Apr 2015 15:02:32 +0000 (23:02 +0800)]
coretemp: Clean up identify method

9 years agocoretemp: Set Tj max to 110; 105 is quite common on Ivy Bridge CPUs.
Sepherosa Ziehau [Tue, 7 Apr 2015 14:22:13 +0000 (22:22 +0800)]
coretemp: Set Tj max to 110; 105 is quite common on Ivy Bridge CPUs.

9 years agocoretemp: Set sensor status properly
Sepherosa Ziehau [Tue, 7 Apr 2015 14:15:01 +0000 (22:15 +0800)]
coretemp: Set sensor status properly

9 years agosensor: Stick sensors thread to the last CPU.
Sepherosa Ziehau [Tue, 7 Apr 2015 13:57:09 +0000 (21:57 +0800)]
sensor: Stick sensors thread to the last CPU.

Round-robin CPU assignment could stick the sensors thread to CPU0,
which has many special tasks.

Submitted-by: YRabbit
9 years agocoretemp: Add description for the sensor
Sepherosa Ziehau [Mon, 6 Apr 2015 13:59:28 +0000 (21:59 +0800)]
coretemp: Add description for the sensor

9 years agoclock: Piggyback passive IPIQ processing
Sepherosa Ziehau [Mon, 6 Apr 2015 12:52:28 +0000 (20:52 +0800)]
clock: Piggyback passive IPIQ processing

Passive IPIs will be flushed by the target CPU at clock interrupt.
But we _never_ completely conform to the passive IPI description.

Before we implemented LAPIC interrupt timer, systimers on non-CPU0
were actually IPIQ processing, which processed the passive IPIs;
however, passive IPIQ processing on CPU0 didn't conform to the passive
IPIs description.

After the introduction of LAPIC interrupt timer, none of the systimers
were related to IPIQ processing, thus passive IPIQ processing no longer
conformed to the passive IPI description at all.

As of this commit we piggyback passive IPIQ processing in doreti after
hardclock(), which matches the passive IPI description.

* NOTE:
- We don't piggypack passive IPIQ processing directly in hardclock() to
  avoid introducing extra jitters to system time.
- We choose not to check passive IPIQ in systimer_intr(), since systimer
  rate could be pretty high, e.g. rate set by polling(4).

With-feedback-from: dillon@

9 years agosbin/hammer: Make hammer show-undo indicate positions of tail-chasing fifo
Tomohiro Kusumi [Mon, 6 Apr 2015 15:40:16 +0000 (00:40 +0900)]
sbin/hammer: Make hammer show-undo indicate positions of tail-chasing fifo

- Make hammer show-undo command print '>' for undo zone blockmap's
  first_offset, and '<' for undo zone blockmap's next_offset which
  indicate positions of tail-chasing undo fifo.

9 years agohammer2 - Sync thread work
Matthew Dillon [Mon, 6 Apr 2015 01:04:46 +0000 (18:04 -0700)]
hammer2 - Sync thread work

* Initial syncthread coding, still many issues to resolve, particularly
  with the handling of mirror_tid, but it was able to successfully
  synchronized a MASTER to a SLAVE.

* Add more features to the hammer2_cluster*() API and structures and fix
  a couple of bugs in hammer2_cluster_lookup() and hammer2_cluster_next().

* Add hammer2_cluster_next_single_chain() for advancing one element of
  a cluster structure.  Used to advance past a chain which the sync code
  must delete on a slave.

* Fix a bug in hammer2_chain_lookup() when HAMMER2_LOOKUP_NOLOCK is used.

9 years agosbin/hammer: Don't readahead the base buffer itself
Tomohiro Kusumi [Sun, 5 Apr 2015 16:38:13 +0000 (01:38 +0900)]
sbin/hammer: Don't readahead the base buffer itself

- readahead can be skipped for itself (ri==0) too.

9 years agocoretemp: Keep the previous sensor value, if the IPI does not complete yet
Sepherosa Ziehau [Sun, 5 Apr 2015 15:25:55 +0000 (23:25 +0800)]
coretemp: Keep the previous sensor value, if the IPI does not complete yet

9 years agomake distribution: Remove references to deleted nls dirs
John Marino [Sun, 5 Apr 2015 13:38:06 +0000 (15:38 +0200)]
make distribution: Remove references to deleted nls dirs

reported by: zrj on irc

9 years agocoretemp: Use lwkt_send_ipiq_passive()
Sepherosa Ziehau [Sun, 5 Apr 2015 14:37:27 +0000 (22:37 +0800)]
coretemp: Use lwkt_send_ipiq_passive()

This makes coretemp even more lightweight.

9 years agocoretemp: Use IPI to get temperature on other CPUs
Sepherosa Ziehau [Fri, 3 Apr 2015 15:41:08 +0000 (23:41 +0800)]
coretemp: Use IPI to get temperature on other CPUs

This is more lightweight than CPU migration to run just one instruction.

9 years agodimm: Implement pseudo device driver for DIMM related drivers
Sepherosa Ziehau [Sun, 29 Mar 2015 12:26:36 +0000 (20:26 +0800)]
dimm: Implement pseudo device driver for DIMM related drivers

- This pseudo device driver installs sensor device for DIMM related
  sensors (memtemp(4) and upcoming ecc(4) changes).
- This pseudo device driver keeps DIMM location information.  And
  the location information is exposed through a new sysctl tree,
  hw.dimminfo.  The nodes in this sysctl tree have the same names
  as the sensor devices, so that programatic way could be used to
  report DIMM status.
- This pseudo device implements common sensor update function for
  memtemp(4).  And it keeps configurable temperature thresholds for
  memtemp(4) sensor.
- Utilize this pseudo device driver in memtemp(4).

9 years agohammer2 - update documentation, cleanup
Matthew Dillon [Sun, 5 Apr 2015 02:22:39 +0000 (19:22 -0700)]
hammer2 - update documentation, cleanup

* Update the DESIGN document.

* Cleanup API for hammer2_inode_lock*() and hammer2_inode_unlock*().

* Start work on the synchronization thread framework.

9 years agosbin/hammer: Fix wrong hash value
Tomohiro Kusumi [Fri, 3 Apr 2015 14:17:26 +0000 (23:17 +0900)]
sbin/hammer: Fix wrong hash value

- get_buffer_readahead() scans ondisk buffer using a wrong hash
  value based on raw address. It needs to use zone2 address.

- Using wrong value results unnecessary malloc/free since buf
  is always NULL after TAILQ_FOREACH().

9 years agomake upgrade: Clean out cat1 directory from texinfo pages
John Marino [Fri, 3 Apr 2015 14:49:34 +0000 (16:49 +0200)]
make upgrade: Clean out cat1 directory from texinfo pages

9 years agoRemove unused bsd.info.mk
John Marino [Fri, 3 Apr 2015 13:14:23 +0000 (15:14 +0200)]
Remove unused bsd.info.mk

9 years agoRemove unused texinfo source files from contrib directory
John Marino [Fri, 3 Apr 2015 13:12:00 +0000 (15:12 +0200)]
Remove unused texinfo source files from contrib directory

9 years agoRemove texinfo from base
John Marino [Fri, 3 Apr 2015 13:09:08 +0000 (15:09 +0200)]
Remove texinfo from base

At this point, the only info files left in DragonFly are from texinfo
itself.  Due to a similar effort on FreeBSD 11, the ports are already
prepared for the lack of texinfo utilities in base.

9 years agogroff: Remove info page
John Marino [Fri, 3 Apr 2015 12:45:00 +0000 (14:45 +0200)]
groff: Remove info page

Initially I converted the groff info page until groff.7, but then I
realized that groff.7 already existed and serves as an adequate
alternative to the groff info page.  Thus, this commit simply removes
the installation of the info page (one of the last in base)

9 years agoam-utils: Convert info page to "man 7 am-utils"
John Marino [Fri, 3 Apr 2015 12:21:17 +0000 (14:21 +0200)]
am-utils: Convert info page to "man 7 am-utils"

Each automounter tool had a man page, but the group of utilities was
covered by an info page.  This unique information was converted to
am-utils.7 and the info page has been removed.

9 years agocom_err: convert info page to com_err.7
John Marino [Fri, 3 Apr 2015 12:05:31 +0000 (14:05 +0200)]
com_err: convert info page to com_err.7

The was already a com_err.1 man page, but it was significantly shorter
than the com_err info page.  The info page was converted to man 7 com_err
and then removed.

9 years agogdb: Remove ~2Mb of doc files from contrib (texi)
John Marino [Fri, 3 Apr 2015 10:56:33 +0000 (12:56 +0200)]
gdb: Remove ~2Mb of doc files from contrib (texi)

These texi files are no longer used in the build and they've got
equivalent man pages in most cases.

9 years agogdb: Remove 4 info pages (2 converted to man pages)
John Marino [Fri, 3 Apr 2015 10:41:32 +0000 (12:41 +0200)]
gdb: Remove 4 info pages (2 converted to man pages)

GDB had four info pages: gdb, gdbint, stabs, and annotate.  They have been
removed.

  * gdb.info      : There has always been a man page gdb.1 which is an
                    adequate replacement for gdb.info
  * stabs.info    : This has been converted to stabs.7 with info2man
  * gdbint.info   : This has been converted to gdbint.7 with info2man
  * annotate.info : This was always obsolete[1], so it was not replaced

[1] From annotate info page: This document describes the obsolete level
    two annotation interface implemented in older GDB versions.

9 years agodiffutils: Remove redundant info page
John Marino [Fri, 3 Apr 2015 10:09:16 +0000 (12:09 +0200)]
diffutils: Remove redundant info page

The three diff binaries all have their own man pages, so the
diffutils.info file is redundant.  For now a copy of it remains in
contrib/diffutils/doc, but it is being removed from the base system.

9 years agogrep: remove "redundant" info page
John Marino [Fri, 3 Apr 2015 08:26:46 +0000 (10:26 +0200)]
grep: remove "redundant" info page

Grep already has an adequate man page, so we can remove info page without
losing much.