dragonfly.git
7 years agokernel: Remove useless if (...).
Sascha Wildner [Tue, 30 Aug 2016 17:36:45 +0000 (19:36 +0200)]
kernel: Remove useless if (...).

7 years agokernel - More threaded core dump fixes
Matthew Dillon [Tue, 30 Aug 2016 17:25:59 +0000 (10:25 -0700)]
kernel - More threaded core dump fixes

* Try to make a more comprehensive fix for this, fixing an endless cpu
  loop in the kernel in the process due to mismatched tests.  Incorporate
  the LWP_MP_WEXIT flag into a new test, STOPLWP().

* tsleep() is now more consistent in setting lwp_stat.

* lwpsignal() needs to allow SIGKILL through during the exit sequence
  in order to wakeup any PCATCH tsleep()s.

* Fix bug in the panic coredump code where the dump_stop_usertds variable
  could cause an endless tstop() loop.

Reported-by: zrj
7 years agobinutils 2.25 linkers: Set default interpreter to valid path
John Marino [Mon, 29 Aug 2016 19:10:42 +0000 (14:10 -0500)]
binutils 2.25 linkers: Set default interpreter to valid path

I originally thought these interpreter definitions didn't affect anything,
but they may explain random stderr messages during building.  In any case,
it doesn't hurt to correct the definitions and this was also done for
devel/binutils in dports.

7 years agoless(1): Upgrade from 471 to 481
John Marino [Mon, 29 Aug 2016 19:48:07 +0000 (14:48 -0500)]
less(1): Upgrade from 471 to 481

7 years agoMerge branch 'vendor/LESS'
John Marino [Mon, 29 Aug 2016 15:28:00 +0000 (10:28 -0500)]
Merge branch 'vendor/LESS'

7 years agoif_iwm - Fix off-by-one check in iwm_read_firmware().
Imre Vadász [Mon, 29 Aug 2016 20:11:09 +0000 (22:11 +0200)]
if_iwm - Fix off-by-one check in iwm_read_firmware().

* Fixes a potential buffer overrun, which was reported by Coverty Scan
  in FreeBSD.

7 years agoUpdate less from version 471 to 481
John Marino [Mon, 29 Aug 2016 19:19:49 +0000 (14:19 -0500)]
Update less from version 471 to 481

7 years agobmake: upgrade version 20141111 => 20160818
John Marino [Mon, 29 Aug 2016 17:25:19 +0000 (12:25 -0500)]
bmake: upgrade version 20141111 => 20160818

This restores the two local modifications reverted prior to the vendor
branch merge, and adds a couple of more to annotate unused variables.

7 years agoMerge branch 'vendor/BMAKE'
John Marino [Mon, 29 Aug 2016 13:21:47 +0000 (08:21 -0500)]
Merge branch 'vendor/BMAKE'

7 years agocontrib/bmake: remove 2 local modifications to prepare for merge
John Marino [Mon, 29 Aug 2016 17:10:29 +0000 (12:10 -0500)]
contrib/bmake: remove 2 local modifications to prepare for merge

7 years agokernel - Fix coredump race with threaded processes
Matthew Dillon [Mon, 29 Aug 2016 18:15:51 +0000 (11:15 -0700)]
kernel - Fix coredump race with threaded processes

* Fix an issue where a threaded process trying to coredump could race
  and cause some threads to get stuck in tstop() when the main thread
  is trying to finally exit.  This creates an unkillable blocked process.

Reported-by: zrj, marino
7 years agokernel - Remove coredump spew on console
Matthew Dillon [Mon, 29 Aug 2016 17:43:14 +0000 (10:43 -0700)]
kernel - Remove coredump spew on console

* Remove coredump warnings on the console when descriptors cannot be
  converted to file-handles in the coredump (NFS related descriptors
  typ).

7 years agokernel - Attempt to fix panic during shutdown from tmpfs
Matthew Dillon [Mon, 29 Aug 2016 17:27:57 +0000 (10:27 -0700)]
kernel - Attempt to fix panic during shutdown from tmpfs

* When doing a forced-unmount on tmpfs an active vnode may wind up
  staying on the mount's dirty worklist, resulting in an assertion.

* Try to handle the case by forcefully removing the vnode from the dirty
  worklist in the forced-unmount case.

Reported-by: zrj (Rimvydas Jasinskas)
7 years agokernel - Fix STOP/CONT race
Matthew Dillon [Mon, 29 Aug 2016 17:26:14 +0000 (10:26 -0700)]
kernel - Fix STOP/CONT race

* Normally we should not be in LSSLEEP in the tsleep resume code, but a
  pending signal related to STOP/CONT or TSTOP/TCONT can cause us
  to skip the sleep and an interrupt race can change the lp status from
  STOP to SLEEP.  Make sure we are back in the RUN state.

7 years agoUpdate to bmake-20160818 on the vendor branch
John Marino [Mon, 29 Aug 2016 16:40:03 +0000 (11:40 -0500)]
Update to bmake-20160818 on the vendor branch

7 years agoRemove NO_OPENSSH variable functionality
John Marino [Mon, 29 Aug 2016 08:35:26 +0000 (10:35 +0200)]
Remove NO_OPENSSH variable functionality

There doesn't seem to be a legit use case for building with OpenSSL but
without ssh.  Remove the ability to do so to simplify makefiles which
also has the benefit of reducing the number of make.conf options.

The ssh program and openssh private library only consume about 2Mb.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_inode_data*
Tomohiro Kusumi [Mon, 29 Aug 2016 15:28:02 +0000 (00:28 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_inode_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_snapshot_data*
Tomohiro Kusumi [Mon, 29 Aug 2016 15:25:28 +0000 (00:25 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_snapshot_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Add typedefs for ondisk structures without typedefs
Tomohiro Kusumi [Mon, 29 Aug 2016 15:10:18 +0000 (00:10 +0900)]
sys/vfs/hammer: Add typedefs for ondisk structures without typedefs

Some ondisk data structures have typedefs, but others don't.

7 years agosys/kern: Make struct buf::b_dep a member of union
Tomohiro Kusumi [Mon, 29 Aug 2016 13:13:21 +0000 (22:13 +0900)]
sys/kern: Make struct buf::b_dep a member of union

struct buf::b_dep being a list head is too specific to UFS.
HAMMER or other filesystems want this to be a void* pointer.

It also forces HAMMER or other filesystems to define their own
struct worklist because no such struct is defined outside of
the UFS source which is insane in terms of a kernel structure
for general blk i/o.

Also see 71199586f.

7 years agosbin/hammer: Fix irrelevant comments
Tomohiro Kusumi [Mon, 29 Aug 2016 11:24:14 +0000 (20:24 +0900)]
sbin/hammer: Fix irrelevant comments

7 years agosbin/hammer: Sync zone statistics format with print_blockmap()
Tomohiro Kusumi [Mon, 29 Aug 2016 11:16:39 +0000 (20:16 +0900)]
sbin/hammer: Sync zone statistics format with print_blockmap()

7 years agosbin/hammer: Don't expose softprune specific data structure
Tomohiro Kusumi [Mon, 29 Aug 2016 10:45:37 +0000 (19:45 +0900)]
sbin/hammer: Don't expose softprune specific data structure

Expose softprune function rather than both function and data structure.

7 years agomount_{cd9660,ntfs}(8): Link dynamically to enable -C again.
Sascha Wildner [Sun, 28 Aug 2016 20:38:08 +0000 (22:38 +0200)]
mount_{cd9660,ntfs}(8): Link dynamically to enable -C again.

7 years agomount_cd9660(8): Add -b and -j to usage().
Sascha Wildner [Sun, 28 Aug 2016 20:36:54 +0000 (22:36 +0200)]
mount_cd9660(8): Add -b and -j to usage().

7 years agoif_iwm - Add some pcie device stop code from iwlwifi. Adjust a delay.
Imre Vadász [Sun, 24 Jul 2016 18:54:35 +0000 (20:54 +0200)]
if_iwm - Add some pcie device stop code from iwlwifi. Adjust a delay.

* Make iwm_apm_stop put the device in Uninitialized state, like in iwlwifi.

* Add a device reset from iwlwifi to iwm_apm_stop, and make the DELAY
  after device reset in iwm_apm_init match the duration in iwlwifi.

* Swap iwm_disable_interrupts() and on-board processor reset in
  iwm_stop_device() corresponding to Linux git commit
  03d6c3b0fa4f5f0379cede079ec828a6c999fe43.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Use htole16 for policy field in struct iwm_time_event_cmd_v2.
Imre Vadász [Sun, 28 Aug 2016 15:46:39 +0000 (17:46 +0200)]
if_iwm - Use htole16 for policy field in struct iwm_time_event_cmd_v2.

* This didn't really matter on DragonFly, which currently only runs on a
  little-endian architecture.

7 years agosys/vfs/hammer: Remove unused struct hammer_io_list
Tomohiro Kusumi [Sun, 28 Aug 2016 14:13:11 +0000 (23:13 +0900)]
sys/vfs/hammer: Remove unused struct hammer_io_list

This struct is no longer used after 1afb73cf in 2011.

7 years agosys/vfs/hammer: Use typedef'd for enum hammer_io_type
Tomohiro Kusumi [Sun, 28 Aug 2016 14:08:01 +0000 (23:08 +0900)]
sys/vfs/hammer: Use typedef'd for enum hammer_io_type

7 years agosys/vfs/hammer: Typedef struct on declaration
Tomohiro Kusumi [Sun, 28 Aug 2016 13:27:20 +0000 (22:27 +0900)]
sys/vfs/hammer: Typedef struct on declaration

Most structs in hammer are typedef'd.
Some structs define it on declaration, but others don't.

7 years agoif_iwm - Fix comments and struct definition for struct iwm_sf_cfg_cmd.
Imre Vadász [Sun, 28 Aug 2016 13:29:09 +0000 (15:29 +0200)]
if_iwm - Fix comments and struct definition for struct iwm_sf_cfg_cmd.

* Use uint32_t instead of "enum iwm_sf_state" for the state field in
  struct iwm_sf_cfg_cmd, because that struct is declared __packed.

Taken-From: FreeBSD (the typos in struct iwm_sf_cfg_cmd comments)

7 years agoif_iwm - Remove unused wantresp field in iwm_rx_data struct.
Imre Vadász [Sun, 28 Aug 2016 13:21:14 +0000 (15:21 +0200)]
if_iwm - Remove unused wantresp field in iwm_rx_data struct.

7 years agoif_iwm - Remove two duplicate const qualifiers.
Imre Vadász [Sat, 27 Aug 2016 20:11:59 +0000 (22:11 +0200)]
if_iwm - Remove two duplicate const qualifiers.

7 years agosys/vfs/hammer: Remove prototypes for not existing functions
Tomohiro Kusumi [Sun, 28 Aug 2016 10:23:52 +0000 (19:23 +0900)]
sys/vfs/hammer: Remove prototypes for not existing functions

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_mount*
Tomohiro Kusumi [Sun, 28 Aug 2016 11:06:34 +0000 (20:06 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_mount*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

The last 17 commits including this one don't affect binary.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_node_lock*
Tomohiro Kusumi [Sun, 28 Aug 2016 10:57:03 +0000 (19:57 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_node_lock*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_node*
Tomohiro Kusumi [Sun, 28 Aug 2016 10:54:55 +0000 (19:54 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_node*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_buffer*
Tomohiro Kusumi [Sun, 28 Aug 2016 10:50:24 +0000 (19:50 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_buffer*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_volume*
Tomohiro Kusumi [Sun, 28 Aug 2016 10:22:07 +0000 (19:22 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_volume*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_io*
Tomohiro Kusumi [Sun, 28 Aug 2016 10:14:23 +0000 (19:14 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_io*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_record*
Tomohiro Kusumi [Sun, 28 Aug 2016 09:10:42 +0000 (18:10 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_record*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_inode*
Tomohiro Kusumi [Sun, 28 Aug 2016 09:08:02 +0000 (18:08 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_inode*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_transaction*
Tomohiro Kusumi [Sun, 28 Aug 2016 08:58:23 +0000 (17:58 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_transaction*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_node_ondisk*
Tomohiro Kusumi [Sun, 28 Aug 2016 08:39:50 +0000 (17:39 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_node_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_btree_leaf_elm*
Tomohiro Kusumi [Sun, 28 Aug 2016 08:28:43 +0000 (17:28 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_btree_leaf_elm*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_base_elm*
Tomohiro Kusumi [Sun, 28 Aug 2016 07:57:19 +0000 (16:57 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_base_elm*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for union hammer_data_ondisk*
Tomohiro Kusumi [Sun, 28 Aug 2016 07:50:56 +0000 (16:50 +0900)]
sys/vfs/hammer: Use typedef'd for union hammer_data_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_pseudofs_data*
Tomohiro Kusumi [Sun, 28 Aug 2016 07:48:42 +0000 (16:48 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_pseudofs_data*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Conform to typical hammer code format
Tomohiro Kusumi [Sun, 28 Aug 2016 07:46:09 +0000 (16:46 +0900)]
sys/vfs/hammer: Conform to typical hammer code format

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_volume_ondisk*
Tomohiro Kusumi [Sun, 28 Aug 2016 07:38:55 +0000 (16:38 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_volume_ondisk*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agosys/vfs/hammer: Use typedef'd for struct hammer_blockmap_xxx*
Tomohiro Kusumi [Sun, 28 Aug 2016 07:22:30 +0000 (16:22 +0900)]
sys/vfs/hammer: Use typedef'd for struct hammer_blockmap_xxx*

The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

7 years agoLink mount_msdos(8) dynamically.
Sascha Wildner [Sun, 28 Aug 2016 09:30:24 +0000 (11:30 +0200)]
Link mount_msdos(8) dynamically.

This makes -L and -D work properly.

It used to work statically linked but that code was all overwritten
in 0d5acd7467.

Tested-by: Ivan Bezrodny <ivan.bezrodny@gmail.com>
7 years ago<sys/iconv.h>: Fix typo in a comment (taken from FreeBSD).
Sascha Wildner [Sun, 28 Aug 2016 09:26:41 +0000 (11:26 +0200)]
<sys/iconv.h>: Fix typo in a comment (taken from FreeBSD).

7 years agokernel/libiconv: Sync with FreeBSD.
Sascha Wildner [Sun, 28 Aug 2016 09:25:45 +0000 (11:25 +0200)]
kernel/libiconv: Sync with FreeBSD.

7 years agolibkiconv: Sync a bit with FreeBSD.
Sascha Wildner [Sun, 28 Aug 2016 09:24:17 +0000 (11:24 +0200)]
libkiconv: Sync a bit with FreeBSD.

* Adds kiconv_lookupconv() and kiconv_lookupcs().

* It also moves libkiconv to /lib in preparation for linking various
  mount_*(8) tools which have locale/charset support dynamically.

7 years agolibkiconv: Remove dead code.
Sascha Wildner [Sun, 28 Aug 2016 08:14:34 +0000 (10:14 +0200)]
libkiconv: Remove dead code.

ICONV_DLOPEN is never defined on DragonFly because we build iconv()
into libc by default.

7 years agogcc50: Upgrade version 5.3.1 => 5.4.1 + 3 months
John Marino [Sun, 28 Aug 2016 00:30:07 +0000 (02:30 +0200)]
gcc50: Upgrade version 5.3.1 => 5.4.1 + 3 months

7 years agoMerge branch 'vendor/GCC50'
John Marino [Sat, 27 Aug 2016 20:25:21 +0000 (22:25 +0200)]
Merge branch 'vendor/GCC50'

7 years agoUpdate gcc-50 to SVN version 239798 (gcc-5-branch) vendor/GCC50
John Marino [Sun, 28 Aug 2016 00:05:50 +0000 (02:05 +0200)]
Update gcc-50 to SVN version 239798 (gcc-5-branch)

This is equivalent to the gcc 5.4 release + 3 months

Last Changed Date: 2016-08-27 02:16:05 +0200 (Sat, 27 Aug 2016)

7 years agosbin/hammer: Use . for pfs-status if no arg
Tomohiro Kusumi [Sat, 27 Aug 2016 09:29:45 +0000 (18:29 +0900)]
sbin/hammer: Use . for pfs-status if no arg

hammer pfs-status can take 1 or more args unlike other pfs-xxx,
so allow 0 arg for default ".".

7 years agosys/vfs/hammer: Remove wrong comment
Tomohiro Kusumi [Sat, 27 Aug 2016 03:48:57 +0000 (12:48 +0900)]
sys/vfs/hammer: Remove wrong comment

7 years agosbin/hammer: Use "objid" for inode#
Tomohiro Kusumi [Sat, 27 Aug 2016 02:13:30 +0000 (11:13 +0900)]
sbin/hammer: Use "objid" for inode#

"objid" is a commonly used one in kprintf as well as this command.
so change "obj", "ino" to "objid" which are all inode#.

7 years agosbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data
Tomohiro Kusumi [Thu, 25 Aug 2016 12:40:12 +0000 (21:40 +0900)]
sbin/newfs_hammer: Set HAMMER_OBJTYPE_DIRECTORY for ondisk PFS#0 data

Ondisk PFS data is a record part of the root ip (inode) when
a new PFS is created via ioctl, so it's normal for ondisk PFS
data to have HAMMER_OBJTYPE_DIRECTORY for obj_type. It's
rather insane that PFS#0 (the only PFS created without ioctl)
has 0 (HAMMER_OBJTYPE_UNKNOWN) for obj_type while the root ip
(not PFS root but HAMMER root) is apparently a directory.

Although PFS#0 and the rest of the PFS are a bit different,
PFS ioctls treat all the ondisk PFS data in the same fashion.
Having consistent obj_type value for the same data type is
considered better than not having.

This change does affect 1 byte of ondisk PFS#0 data initially
created by newfs_hammer, but doesn't break compatibility.
Also see hammer_mkroot_pseudofs().

7 years agoacpi: Save I/O ports for I/O ports range, as long as its reasonable.
Sepherosa Ziehau [Wed, 24 Aug 2016 11:36:33 +0000 (19:36 +0800)]
acpi: Save I/O ports for I/O ports range, as long as its reasonable.

Reported-by: karu.pruun <karu.pruun gmail com>
7 years agosbin/hammer: Sync dce7ae2c format with zone statistics
Tomohiro Kusumi [Wed, 24 Aug 2016 10:54:31 +0000 (19:54 +0900)]
sbin/hammer: Sync dce7ae2c format with zone statistics

Add "zone #" and change "next_tid" to "vol0_next_tid".

7 years agoCorrect some spelling mistakes/typos in manual pages.
Sascha Wildner [Wed, 24 Aug 2016 11:51:14 +0000 (13:51 +0200)]
Correct some spelling mistakes/typos in manual pages.

7 years agolib/libhammer: Fix segmentation fault by null dereference
Tomohiro Kusumi [Tue, 23 Aug 2016 14:48:35 +0000 (23:48 +0900)]
lib/libhammer: Fix segmentation fault by null dereference

If libhammer cares about mountpoints of hammer and null,
it needs to care about the case where pfs0 happens to be NULL.
This occurs when a PFS(>#0) is null mounted on the mountpoint of PFS#0.

This commit avoids segmentation fault, but that doesn't mean the
result is correct. It's basically that this library doesn't fully
consider the complexity of ondisk PFS data within HAMMER's B-Tree.

7 years agoAdd/fix some HISTORY sections in bin/ manual pages.
Sascha Wildner [Tue, 23 Aug 2016 13:21:05 +0000 (15:21 +0200)]
Add/fix some HISTORY sections in bin/ manual pages.

Submitted-by: Sevan Janiyan
Dragonfly-bugs: 2937-2945

7 years agosbin/hammer: Don't print mountpoint of PFS
Tomohiro Kusumi [Tue, 23 Aug 2016 10:59:26 +0000 (19:59 +0900)]
sbin/hammer: Don't print mountpoint of PFS

/sbin/hammer should not care if PFS are null mounted or where PFS are
mounted. It has nothing to do with the filesystem itself. PFS is just
a pointer to jump into a subset of HAMMER's B-Tree (clustered by
localization parameter). Just because DragonFly's installer used to
use PFS (not anymore) and null mount by default doesn't mean /sbin
/hammer needs to provide null mount info.

If someone does mount PFS to somewhere and want to know where PFS are
mounted, one needs to just type mount. In fact this is much better
than getting mountpoints info via hammer info command because mount(8)
doesn't use hammer's ioctl which may cause B-Tree lookup, but instead
retrieves mountpoints directly from vfs.

Also note that printing such info gives users wrong assumption that
PFS in HAMMER is something equivalent of ZFS (created out of storage
zpool) which is not true. As mentioned above, PFS is just a pointer to
a subset of a single HAMMER filesystem. These are not independent fs.

Also note that hammer info still has bugs due to bugs from libhammer
and its attached ioctl as mentioned in e0f42079, including things under
investigation now. Whatever it is, hammer info needs to be rewritten
(as a different command like hammer fsinfo) in short and straight
forward code like other commands, without unnecessary abstraction.
I've been fixing and adding missing stuff to this hammer info command,
however hammer info is basically going nowhere because this command is
too tightly attached to libhammer.

7 years agoAllow make.conf to override ssh's xauth location.
Peter Avalos [Mon, 22 Aug 2016 22:09:18 +0000 (15:09 -0700)]
Allow make.conf to override ssh's xauth location.

This allows dports to install xauth based on the make.conf definition,
and was the original reason this functionality was added in eb12d1cc.
Note that this is a slightly different implementation than eb12d1cc.
This centralizes the definition instead of scattering it across multiple
Makefiles. Also, since we're doing this via a Makefile, revert the
change to vendor code in e00185f1.

Requested-by: swildner, marino
7 years agosbin/hammer: Make sizetostr() print B if <1KB
Tomohiro Kusumi [Mon, 22 Aug 2016 12:23:32 +0000 (21:23 +0900)]
sbin/hammer: Make sizetostr() print B if <1KB

7 years agosbin/hammer: Add print_blockmap() for common blockmap output format
Tomohiro Kusumi [Sun, 21 Aug 2016 12:16:19 +0000 (21:16 +0900)]
sbin/hammer: Add print_blockmap() for common blockmap output format

This is for hammer blockmap,checkmap,show,show-undo commands.
These hammer commands print blockmap information prior to checking
whatever filesystem structure they're looking for, with slightly
different format but essentially the same thing.

print_blockmap() defines a common format so that these commands
can print blockmap information in the same format. print_blockmap()
is based on hammer blockmap command's output format since it has
the best readable format.

7 years agosbin/hammer: Make get_buffer() static
Tomohiro Kusumi [Sun, 21 Aug 2016 07:49:54 +0000 (16:49 +0900)]
sbin/hammer: Make get_buffer() static

This is always called via other get functions (but not directly)
from various hammer commands.

7 years agobuildworld - bootstrap compatibility compiling older DragonFly's
zrj [Sun, 21 Aug 2016 08:30:47 +0000 (11:30 +0300)]
buildworld - bootstrap compatibility compiling older DragonFly's

* Fix buildworld issue bootstrapping gencat/uudecode utilities which does not
  expect newer header files (POSIX getline general visibility from <stdio.h>).

Could be MFC'd to DragonFly 4.6 branch for easier switching <-> master.

7 years agolib/libexecinfo: Fix sysctl wrong argument order.
zrj [Sat, 20 Aug 2016 15:10:40 +0000 (18:10 +0300)]
lib/libexecinfo: Fix sysctl wrong argument order.

Not fatal, procfs fallback should still work (provided /proc is mounted).
Thus fix and prefer using the KERN_PROC_PATHNAME variant.

7 years agosed(1): Fix issue with basename()/dirname() invoke.
zrj [Sat, 20 Aug 2016 14:41:23 +0000 (17:41 +0300)]
sed(1): Fix issue with basename()/dirname() invoke.

Use copies when calling these POSIX functions.

Taken-from: FreeBSD r303047

7 years agolibc/readpassphrase: Sync with OpenBSD
zrj [Fri, 19 Aug 2016 11:07:27 +0000 (14:07 +0300)]
libc/readpassphrase: Sync with OpenBSD

Mainly for better terminal and signal handling.
Also include few fixes done by FreeBSD.

Taken-from: FreeBSD

7 years agoSync arc4random() with OpenBSD a bit.
zrj [Fri, 19 Aug 2016 10:39:18 +0000 (13:39 +0300)]
Sync arc4random() with OpenBSD a bit.

Simplify calculation of "2**32 % upper_bound".
While there, perform some stylistic changes.

Taken-from: OpenBSD

7 years agosbin/hammer: Remove unused AssertOnFailure
Tomohiro Kusumi [Sun, 21 Aug 2016 06:45:30 +0000 (15:45 +0900)]
sbin/hammer: Remove unused AssertOnFailure

After the previous commit, AssertOnFailure is no longer needed
as a global variable. It can be removed or replaced with DebugOpt
which is what AssertOnFailure was based on in some commands.

7 years agosbin/hammer: Remove AssertOnFailure assertion in blockmap lookup
Tomohiro Kusumi [Sun, 21 Aug 2016 06:07:30 +0000 (15:07 +0900)]
sbin/hammer: Remove AssertOnFailure assertion in blockmap lookup

This isn't necessary as blockmap_lookup() callers are going to
check returned offset and/or *errorp value. Callers don't want
blockmap_lookup() to kill the process instantly via errx()
especially when the callers are diagnostic commands like hammer
show or blockmap or checkmap.

This is also the only place where AssertOnFailure needs to be
a global variable. Once this gets removed, other ones can be
removed or changed to local variables.

7 years agosbin/hammer: Drop bug fix by 750beaef after 9376f71b
Tomohiro Kusumi [Sun, 21 Aug 2016 02:02:57 +0000 (11:02 +0900)]
sbin/hammer: Drop bug fix by 750beaef after 9376f71b

Since ondisk PFS data is no longer degraded or updated,
a bug fix made by 750beaef in 2015 can be removed.

7 years agosbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS
Tomohiro Kusumi [Thu, 18 Aug 2016 14:00:44 +0000 (23:00 +0900)]
sbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS

This is part 1/2 of what's mentioned in below post.
Two ondisk PFS data (deleted PFS followed by undeleted PFS data) will
still appear with this commit, like what's mentioned in below post.
(This comes from HAMMER's flushing mechanism, so it's basically a bad
idea to try to fix it unless it's possible without touching core part
of HAMMER's flusher code, provided that this extra ondisk PFS data
does nothing bad. This may be fixed in the future as part 2/2 patch.)

http://lists.dragonflybsd.org/pipermail/users/2016-August/313004.html

This part 1/2 patch alone is still effective even without part 2/2.

If the PFS is successfully destroyed, the ondisk PFS data written by
ioctl(HAMMERIOC_SET_PSEUDOFS) prior to destroying (which is the code
removed by this commit) gets shadowed by the one with deleted flag,
so no one is to (or no one needs to) access that.

If failed to destroy the PFS, the original ondisk PFS data is restored
using a copy of the original data, so ioctl(HAMMERIOC_SET_PSEUDOFS)
prior to destroying is still unnecessary. Also see 750beaef.
Restoring part by 750beaef could be removed too since the PFS is not
downgraded or updated anymore.

7 years agosys/vfs/hammer: Add comments on filesystem capacity
Tomohiro Kusumi [Sat, 20 Aug 2016 04:14:54 +0000 (13:14 +0900)]
sys/vfs/hammer: Add comments on filesystem capacity

7 years agosys/vfs/hammer: Integrate ondisk uint32 reserveds into []
Tomohiro Kusumi [Sat, 20 Aug 2016 04:01:56 +0000 (13:01 +0900)]
sys/vfs/hammer: Integrate ondisk uint32 reserveds into []

Reserved field id's aren't in order from 00 to 11, so keeping them
with id's isn't that important, but rather confusing.

Also remove obsolete comment from ddfdf542 in 2008.
The idea of "birth time" was never explained in neither source nor
commit messages.

7 years agokernel/msdosfs: Add pathconf(3) support for FILESIZEBITS.
Sascha Wildner [Thu, 18 Aug 2016 20:10:16 +0000 (22:10 +0200)]
kernel/msdosfs: Add pathconf(3) support for FILESIZEBITS.

7 years agokernel/msdosfs: Sort pathconf cases in msdosfs_pathconf().
Sascha Wildner [Thu, 18 Aug 2016 20:08:12 +0000 (22:08 +0200)]
kernel/msdosfs: Sort pathconf cases in msdosfs_pathconf().

While here, break a long line.

7 years agokernel/vfs: Sort pathconf cases in the default pathconf.
Sascha Wildner [Thu, 18 Aug 2016 20:03:11 +0000 (22:03 +0200)]
kernel/vfs: Sort pathconf cases in the default pathconf.

7 years agosys/vfs/hammer: Remove unused HAMMER_IOC_PFS_XXX macros
Tomohiro Kusumi [Thu, 18 Aug 2016 14:25:11 +0000 (23:25 +0900)]
sys/vfs/hammer: Remove unused HAMMER_IOC_PFS_XXX macros

These were added in 5fa5c92f in 2008, but never used.

7 years agosbin/hammer: Remove if(QuietOpt) conditionals in hammer show/checkmap
Tomohiro Kusumi [Thu, 18 Aug 2016 12:35:39 +0000 (21:35 +0900)]
sbin/hammer: Remove if(QuietOpt) conditionals in hammer show/checkmap

mostly since it doesn't make much difference anyway.

The only QuietOpt conditional left is for print_record(elm) in
print_btree_elm() which makes amount of output text quite diffrent.

7 years agosbin/hammer: Add inode size check to hammer show
Tomohiro Kusumi [Thu, 18 Aug 2016 11:33:58 +0000 (20:33 +0900)]
sbin/hammer: Add inode size check to hammer show

Do the same sanity check as what hammer_crc_set|test_leaf()
do in kernel space.

7 years agosbin/hammer: Minor hammer show cleanups
Tomohiro Kusumi [Thu, 18 Aug 2016 11:28:55 +0000 (20:28 +0900)]
sbin/hammer: Minor hammer show cleanups

7 years agosys/vfs/hammer: Fix wrong comment and unnecessary argument
Tomohiro Kusumi [Wed, 17 Aug 2016 11:08:01 +0000 (20:08 +0900)]
sys/vfs/hammer: Fix wrong comment and unnecessary argument

B-Tree code isn't aware of PFS (or other HAMMER record types built
on top of B-Tree) by design. In fact pfsm argument is unused and
no longer necessary after sometime in 2008.

7 years agosbin/hammer: Fix memory leak
Tomohiro Kusumi [Tue, 16 Aug 2016 11:45:44 +0000 (20:45 +0900)]
sbin/hammer: Fix memory leak

strsep moves * by taking **, so the caller need to keep a pointer to strdup'd address.

7 years agosbin/hammer: Refactoring
Tomohiro Kusumi [Tue, 16 Aug 2016 11:11:46 +0000 (20:11 +0900)]
sbin/hammer: Refactoring

7 years agosbin/newfs_hammer: Add -h option
Tomohiro Kusumi [Mon, 15 Aug 2016 12:11:31 +0000 (21:11 +0900)]
sbin/newfs_hammer: Add -h option

7 years agosbin/newfs_hammer: Add exit_code arg to usage()
Tomohiro Kusumi [Mon, 15 Aug 2016 12:06:14 +0000 (21:06 +0900)]
sbin/newfs_hammer: Add exit_code arg to usage()

7 years agosbin/hammer: Cleanups
Tomohiro Kusumi [Mon, 15 Aug 2016 11:48:37 +0000 (20:48 +0900)]
sbin/hammer: Cleanups

7 years agosbin/newfs_hammer: Add -C option from hammer(8)
Tomohiro Kusumi [Sun, 14 Aug 2016 15:54:05 +0000 (00:54 +0900)]
sbin/newfs_hammer: Add -C option from hammer(8)

Just to support the same options given that these are both based
on the same volume/buffer structure.

7 years agoUpdate the pciconf(8) database.
Sascha Wildner [Mon, 15 Aug 2016 06:45:33 +0000 (08:45 +0200)]
Update the pciconf(8) database.

July 31, 2016 snapshot from http://pciids.sourceforge.net/

7 years agosys/vfs/hammer: Drop redundant error initialization
Tomohiro Kusumi [Sun, 14 Aug 2016 06:37:03 +0000 (15:37 +0900)]
sys/vfs/hammer: Drop redundant error initialization

error is always 0 when it hits here.
(It would have already returned non-zero error otherwise)