dragonfly.git
7 years agofortune(6): Add FORTUNE_PATH env variable.
zrj [Thu, 1 Sep 2016 07:15:36 +0000 (10:15 +0300)]
fortune(6): Add FORTUNE_PATH env variable.

There was a slight debug logic error in init_prob().
Also search for fortunes in default dports location too.

Taken-from: FreeBSD

7 years agofortune(6): Turn writing to disk a runtime option.
zrj [Thu, 1 Sep 2016 05:17:12 +0000 (08:17 +0300)]
fortune(6): Turn writing to disk a runtime option.

Add FORTUNE_SAVESTATE environment knob.
Using env variable avoids having non compilable code that might
get stale with future updates and/or changes in base system.

Fix -Werror=sign-compare case in this code.

Taken-from: FreeBSD

7 years agofortune(6): Use argc and argv.
zrj [Thu, 1 Sep 2016 04:54:44 +0000 (07:54 +0300)]
fortune(6): Use argc and argv.

While there disable speedup in collate_range_cmp() (recall causes problems).

7 years agofortune(6): Perform some cleanup.
zrj [Wed, 31 Aug 2016 14:44:35 +0000 (17:44 +0300)]
fortune(6): Perform some cleanup.

Mainly use static and fix indentatation.

While there fix NOTES (offensive fortunes are installed by default).

No functional change.

7 years agosbin/hammer: Make use of struct buffer_info::cache at offset 0
Tomohiro Kusumi [Thu, 1 Sep 2016 11:38:36 +0000 (20:38 +0900)]
sbin/hammer: Make use of struct buffer_info::cache at offset 0

No need to hold a pointer to each other.

7 years agosbin/hammer: Make struct volume_info::name const
Tomohiro Kusumi [Thu, 1 Sep 2016 11:27:45 +0000 (20:27 +0900)]
sbin/hammer: Make struct volume_info::name const

7 years agosbin/hammer: Don't expose VolList
Tomohiro Kusumi [Tue, 30 Aug 2016 12:54:29 +0000 (21:54 +0900)]
sbin/hammer: Don't expose VolList

This is just a cleanup to hide a volume list data itself from
each hammer command (actually only hammer recover command).
Use whatever apis provided instead of raw access to data.

Volume initialization part of hammer recover needs to be fixed
anyway. It needs to allow a broken header (at least to certain
extent) given that the purpose of this command is to recover
from a broken filesystem. It currently forces all the sanity
checks on volume header.

7 years agoif_iwm - Fix iwm_poll_bit() error value check in iwm_attach().
Imre Vadász [Wed, 31 Aug 2016 12:43:46 +0000 (14:43 +0200)]
if_iwm - Fix iwm_poll_bit() error value check in iwm_attach().

* The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on
  failure, whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on
  failure.

7 years ago<sys/param.h>: Bump __DragonFly_version for global getline() visibility.
zrj [Wed, 31 Aug 2016 09:00:03 +0000 (12:00 +0300)]
<sys/param.h>: Bump __DragonFly_version for global getline() visibility.

Some world utilities and headers were touched.

7 years agoRemove usage of _WITH_GETLINE and _WITH_DPRINTF.
zrj [Sat, 20 Aug 2016 15:15:18 +0000 (18:15 +0300)]
Remove usage of _WITH_GETLINE and _WITH_DPRINTF.

While there, update RCS tags.

7 years ago<strio.h>: Drop ancient guards from getline() and dprintf().
zrj [Sat, 20 Aug 2016 14:30:54 +0000 (17:30 +0300)]
<strio.h>: Drop ancient guards from getline() and dprintf().

Since FreeBSD in r303524 removed these guards and most of freebsd-ports
are fixed, it is finally safe to do the same on DragonFly and dports.

While there, update manpages and add fix in vfprintf.c too.

Taken-from: FreeBSD

7 years agoRename getline with get_line to avoid collision with getline(3).
zrj [Sat, 20 Aug 2016 17:16:42 +0000 (20:16 +0300)]
Rename getline with get_line to avoid collision with getline(3).

Just as it was recently done over at FreeBSD.
While there, perform some style changes too (could not resist that).
Only readline() -> read_line() functional change was intended.

7 years agolibc/net: Rename dprintf() to not conflict with dprintf(3).
zrj [Sat, 20 Aug 2016 15:53:24 +0000 (18:53 +0300)]
libc/net: Rename dprintf() to not conflict with dprintf(3).

NOTE: there seems to be missing patches from NetBSD.
Network bits expert needed.

7 years ago<wchar.h>: Fix namespace pollution from <stdio.h>
zrj [Sat, 20 Aug 2016 12:28:19 +0000 (15:28 +0300)]
<wchar.h>: Fix namespace pollution from <stdio.h>

Quite cleaner way.
TODO: FILE should be only visible SUSv2 and POSIX.1-2001

7 years agoPrevent dports gcc "fixing" the last headers.
zrj [Sat, 20 Aug 2016 12:14:26 +0000 (15:14 +0300)]
Prevent dports gcc "fixing" the last headers.

Just mention _GCC_(PTRDIFF|SIZE|WCHAR)_T in comments to force 'gnu_types'
test to skip and not fix these headers. DragonFly types should be fine.

7 years ago<stdio.h>: Fix va_list visibility.
zrj [Sat, 20 Aug 2016 12:04:41 +0000 (15:04 +0300)]
<stdio.h>: Fix va_list visibility.

Looks like it should be visible only at POSIX.1-2008.
SUSv2 requirement to provide va_list definition makes is harder.
While there, mention __gnuc_va_list in comment and add inclusion of <stdarg.h>
for non __GNUC__ case to prevent dports gcc "fixing" this header.

7 years ago<wchar.h>: Explicitly add va_list definition.
zrj [Sat, 20 Aug 2016 11:35:56 +0000 (14:35 +0300)]
<wchar.h>: Explicitly add va_list definition.

Looks like there are serious namespace pollution going on in wchar.h.
Still this header should provide va_list definition as per POSIX and not
rely on pollution that once gets fixed the defintion would be still there.

While there, add empty #ifdef va_start block to prevent dports gcc compilers
from "fixing" this header and causing header shadowing (current variant is fine).

7 years ago<stdlib.h>: Fix MB_CUR_MAX return type.
zrj [Sat, 20 Aug 2016 11:29:46 +0000 (14:29 +0300)]
<stdlib.h>: Fix MB_CUR_MAX return type.

Looks like per POSIX it should be size_t (currently it was int).
While there, expand visibility for long long types (including _Exit())
for certain c++ implementations.

7 years ago<stdarg.h>: Change visibility of va_copy().
zrj [Sat, 20 Aug 2016 11:22:46 +0000 (14:22 +0300)]
<stdarg.h>: Change visibility of va_copy().

Looks like it should be visible in certain c++ level but not under -ansi.
Last case is taken to match private gcc/clang stdarg.h header variant.

7 years agoPrefer to use data model (like __LP64__) for basic types.
zrj [Sat, 20 Aug 2016 11:05:50 +0000 (14:05 +0300)]
Prefer to use data model (like __LP64__) for basic types.

Using architecture when setting basic data types is a bit misleading.
X86_64 technically could support ILP64 and even LLP64 or SILP64.

7 years agops - Adjust STATUS formatting
Matthew Dillon [Wed, 31 Aug 2016 05:17:28 +0000 (22:17 -0700)]
ps - Adjust STATUS formatting

* Remove the leading space for (%s) command display.  The leading space
  was causing indented output via -R to be incorrectly indented.

* Remove the 'L' STATUS flag, it hasn't been meaningful for a long time.
  The status is more likely to fit in its 6-char slot, which we need now
  that many systems have >= 10 cpus.

7 years agokernel - Fix LOOPMASK debugging for Xinvltlb
Matthew Dillon [Wed, 31 Aug 2016 02:36:53 +0000 (19:36 -0700)]
kernel - Fix LOOPMASK debugging for Xinvltlb

* Fix LOOPMASK debugging for Xinvltlb, the #if 1 can now be set to #if 0
  to turn off the debugging.

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