dragonfly.git
9 years agohammer2 - cleanup, add manual page
Matthew Dillon [Fri, 27 Mar 2015 15:48:47 +0000 (08:48 -0700)]
hammer2 - cleanup, add manual page

* Add an initial manual page for hammer2(8).  Note that a multitude of
  features being described have not yet been implemented.

* Add a DUMMY PFS type.

* Cleanup some edge cases.

9 years agosensor: Save OID of sensordev sysctl tree.
Sepherosa Ziehau [Thu, 26 Mar 2015 13:51:13 +0000 (21:51 +0800)]
sensor: Save OID of sensordev sysctl tree.

And allow sensordev sysctl tree registration to fail instead of panic,
e.g. upon duplicated sensordevs.

9 years agosensor: Use sysctl lock
Sepherosa Ziehau [Thu, 26 Mar 2015 13:50:31 +0000 (21:50 +0800)]
sensor: Use sysctl lock

Original devlist lock is not MPSAFE (it's locked find then unlocked
used).  Since sensors are sysctl centric, we could just use sysctl
lock here.

9 years agodmsg - refactor cluster and pfs identifiers
Matthew Dillon [Fri, 27 Mar 2015 03:05:51 +0000 (20:05 -0700)]
dmsg - refactor cluster and pfs identifiers

Cleanup loose ends in the CONN/SPAN messages that prior work has exposed.
DMSG now uses LNK_SPAN exclusively in its graph algorithms, so LNK_CONN
has a different meaning than it used to.

* Change the way cl_id and fs_id work.  Rename cl_id and most cluster fields
  as 'peer' identification fields.

  Reduce complexity and confusion by removing pfs_type and pfs_fsid from
  LNK_CONN.  Also remove pfs_mask and fs_label.  Change cl_label to
  peer_label.  peer_label is now always a human-readonable string identifier
  for the socket connection and no longer performs any connection filtering.
  This allows it to be passed in LNK_SPANs to make the trees more
  human-readable when dumped.

* A LNK_CONN identifies the peer and not necessarily any particular cluster.
  Note that the peer_id in a LNK_CONN is a filter request, not an
  advertisement.

* Make peer_label more meaningful by incorporating the hostname (needs more
  work).

* Rename filesystem identifiers as 'pfs' identifiers.  A LNK_SPAN identifies
  a particular PFS.  Note that the peer_id in a LNK_SPAN is part of the PFS
  { cluster_id, pfs_id } advertisement.

* Pad some in-memory structures for natural alignment (it's a general rule
  for all hammer2 structures, even in-memory structures when appropriate).

9 years agobmake: Fix clobber error, raise WARNS back to 4
John Marino [Thu, 26 Mar 2015 09:00:20 +0000 (10:00 +0100)]
bmake: Fix clobber error, raise WARNS back to 4

9 years agokernel - Fix panic in broken chroot case
Matthew Dillon [Thu, 26 Mar 2015 07:48:14 +0000 (00:48 -0700)]
kernel - Fix panic in broken chroot case

* If a chroot is broken (e.g. by some process outside the chroot renaming
  a parent directory from inside to outside the chroot), and a process
  within the chroot attempts to '..' past the real root, the system will
  panic on an assertion.  Add a check to detect this case and not panic.

* This patch does not detect other chroot break-out cases.

Reported-by: Balazs Bucsay
9 years agoSync zoneinfo database with tzdata2015b from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Tue, 24 Mar 2015 17:25:05 +0000 (18:25 +0100)]
Sync zoneinfo database with tzdata2015b from ftp://ftp.iana.org/tz/releases

Changes affecting future time stamps

* Mongolia will start observing DST again this year, from the last Saturday
  in March at 02:00 to the last Saturday in September at 00:00.
  (Thanks to Ganbold Tsagaankhuu.)

* Palestine will start DST on March 28, not March 27.  Also,
    correct the fall 2014 transition from September 26 to October 24.
    Adjust future predictions accordingly.  (Thanks to Steffen Thorsen.)

Changes affecting past time stamps

* The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
    regression.  (Thanks to Stuart Bishop for reporting the problem.)

* Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    The affected zones are: America/Antigua, America/Cayman,
    Pacific/Midway, and Pacific/Saipan.

Changes affecting time zone abbreviations

* Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD".
    (Thanks to Hank W.)

Changes affecting commentary

* Cite the recent Mexican decree changing Quintana Roo's time zone.
    (Thanks to Carlos Raúl Perasso.)

* Likewise for the recent Chilean decree.  (Thanks to Eduardo Romero Urra.)

* Update info about Mars time.

9 years agosys/vfs/hammer: Fix comment on leaf node elements
Tomohiro Kusumi [Tue, 24 Mar 2015 11:18:05 +0000 (20:18 +0900)]
sys/vfs/hammer: Fix comment on leaf node elements

- This seems to be an obsolete comment from 47197d71.
  There is nothing special about leaf elements now.

9 years agosys/vfs/hammer: Make use of btree_max_elements()
Tomohiro Kusumi [Tue, 24 Mar 2015 11:14:35 +0000 (20:14 +0900)]
sys/vfs/hammer: Make use of btree_max_elements()

- Implement btree_node_is_full() using btree_max_elements()
  which had been #if0'd at right below this function.

9 years agobmake(1): lower WARNS from 4 to 2
John Marino [Tue, 24 Mar 2015 12:41:41 +0000 (13:41 +0100)]
bmake(1): lower WARNS from 4 to 2

The latest bmake will not build with gcc50 with WARNS of 4:
--- main.o ---
/usr/src/usr.bin/bmake/../../contrib/bmake/main.c: In function 'Cmd_Exec':
/usr/src/usr.bin/bmake/../../contrib/bmake/main.c:1527:10: error: variable
 'savederr' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
     int  savederr; /* saved errno */

9 years agosensor: sensor_task_schedule() should always be locked
Sepherosa Ziehau [Mon, 23 Mar 2015 13:39:34 +0000 (21:39 +0800)]
sensor: sensor_task_schedule() should always be locked

9 years agosysctl: Expose sysctl lock
Sepherosa Ziehau [Mon, 23 Mar 2015 12:07:36 +0000 (20:07 +0800)]
sysctl: Expose sysctl lock

It will also be used by sysctl centric module like sensor.

9 years agohammer2 - Cluster API cleanup
Matthew Dillon [Tue, 24 Mar 2015 01:29:05 +0000 (18:29 -0700)]
hammer2 - Cluster API cleanup

* Simplify hammer2_cluster_copy() to reduce ref count confusion.  It now
  always refs the underlying chains and the cluster.  The follow-up
  hammer2_cluster_lock() op can then be called with HAMMER2_RESOLVE_NOREF
  to avoid double-refs on the cluster and its underlying chains.

* Simplify hammer2_inode_lock_ex() and hammer2_inode_lock_sh().  These
  functions now use hammer2_cluster_lock() instead of rolling their own.

* Focus is now never set until a cluster is locked.  However, continue
  to cache a default focus in the hammer2_inode's embedded cluster.

* Remove some dead code.

9 years agokernel: Adjust netgraph7 for the mtx_init() change.
Sascha Wildner [Mon, 23 Mar 2015 21:50:05 +0000 (22:50 +0100)]
kernel: Adjust netgraph7 for the mtx_init() change.

9 years agomake upgrade: Adjust the files to be removed without WANT_INSTALLER.
Sascha Wildner [Mon, 23 Mar 2015 20:31:13 +0000 (21:31 +0100)]
make upgrade: Adjust the files to be removed without WANT_INSTALLER.

We create /usr/share/installer unconditionally via mtree(8) so we can
only remove the files in it.

9 years agomount_psshfs.8: Fix typo.
Sascha Wildner [Mon, 23 Mar 2015 20:27:21 +0000 (21:27 +0100)]
mount_psshfs.8: Fix typo.

9 years agoln(1): Sync up with FreeBSD.
Sascha Wildner [Mon, 23 Mar 2015 20:09:09 +0000 (21:09 +0100)]
ln(1): Sync up with FreeBSD.

* Adds POSIX.1-2008's -L (hardlinks to symbolic links link to the
  symlink target, which stays our default) and -P (hardlinks to
  symbolic links link to the symlink itself) options.

* Adds -F (if the target is a directory, remove it to make the link
  happen) and -w (warns if the source of a symlink does not exist)
  options.

* Some bug fixes I guess. :)

* It also improves the checks for identical files. Our former checks
  were producing kind of confusing results in conjunction with
  'install -C' (i.e., for libraries and includes, if LINKS is used
  from the Makefile) upon repeated installation.
Reported-by: marino
9 years agokernel/acpi: Only check against ACPI 1.0's FADT size as a minimum.
Sascha Wildner [Mon, 23 Mar 2015 16:32:15 +0000 (17:32 +0100)]
kernel/acpi: Only check against ACPI 1.0's FADT size as a minimum.

Hyper-V's FADT for example is only 129 bytes long.

Discussed-with: sephe

9 years agolibstand: Rework makefile to avoid repeated building
John Marino [Mon, 23 Mar 2015 13:39:27 +0000 (14:39 +0100)]
libstand: Rework makefile to avoid repeated building

The change to use i386 headers for x86_64 was like a sledgehammer.
From my investigation, "cpu" is not needed at all, and only four headers
are needed from "machine".  The "cpu" directory is still created so that
if some attempt to "#include <cpu/xxx>" is made, it will fail.

By adding exact header dependencies, we prevent libstand from building
over and over again in quickworld.

9 years agogdb(1), kgdb(1): Rework makefile to prevent repeated rebuilding
John Marino [Mon, 23 Mar 2015 11:02:51 +0000 (12:02 +0100)]
gdb(1), kgdb(1): Rework makefile to prevent repeated rebuilding

The beforedepends target was done in such a way that caused gdb and
kgdb to rebuild with every quickworld.  This commit rearranges things
so that doesn't happen anymore.

9 years agogcc50: Switch final specs to set DT_RUNPATH tag
John Marino [Mon, 23 Mar 2015 08:32:54 +0000 (09:32 +0100)]
gcc50: Switch final specs to set DT_RUNPATH tag

The system dynamic binaries have always been built with DT_RPATH set
by the linker.  A few years ago the dynamic linker gained DT_RUNPATH
capability but it hasn't been used in base.

How it works is that when the linker is given the -rpath switch, it
will always set DT_RPATH, but if the --enable-new-dtags switch is present,
the linker will also set DT_RUNPATH tag.  The dynamic linker reacts
differently when DT_RUNPATH is present; it will check LD_LIBRARY_PATH
before the rpath in that case.

This change (to gcc50 only) builds the system with the -rpath flag alone
by for the ctools compiler, but the final compiler's specs include the
--enable-new-dtags switch as well, which affects the building of ports and
all non-system use of the compiler.

9 years agohammer2 - structuralize the cluster's chain array
Matthew Dillon [Mon, 23 Mar 2015 05:11:44 +0000 (22:11 -0700)]
hammer2 - structuralize the cluster's chain array

* Structuralize hammer2_cluster's chain array, implementing a new
  sub-structure called hammer2_cluster_item.

  This structure represents one of N elements in a cluster node representing
  the same location at each target.  It will also be used to track cache
  coherency state, async locks, and other things.

9 years agohammer2 - locking revamp (2)
Matthew Dillon [Mon, 23 Mar 2015 04:54:32 +0000 (21:54 -0700)]
hammer2 - locking revamp (2)

* Update mutex lock calls to not pass the ident.

9 years agohammer2 - locking revamp
Matthew Dillon [Mon, 23 Mar 2015 03:26:08 +0000 (20:26 -0700)]
hammer2 - locking revamp

* Temporarily remove hammer2_ccms.c from the build and remove the ccms
  container.  The CCMS container will be used again when we get cache
  coherent in, but for now it isn't needed.

* Replace the ccms state lock with a mtx lock and move
  into hammer2_chain_core.

  Note that the mtx lock being used here has abort and async locking
  support and these features will be required by HAMMER2.

* Replace the ccms spin lock with a normal spin lock and move
  into hammer2_chain_core.

* Refactor the OS locking interface to use hammer2_* prefixes for easier
  porting.

* Use a shared spin lock for the ONFLUSH bit update instead of an exclusive
  spin lock.

9 years agokernel - Major mtx lock cleanup
Matthew Dillon [Mon, 23 Mar 2015 03:23:52 +0000 (20:23 -0700)]
kernel - Major mtx lock cleanup

* Integrate the ident into the mtx structure, remove the ident parameter from
  all locking calls.

* Rename some of the functions, shortening them.

* Add a few new functions which hammer2 will use.

9 years agosensor: Allocate task w/ M_WAITOK
Sepherosa Ziehau [Sun, 22 Mar 2015 12:52:35 +0000 (20:52 +0800)]
sensor: Allocate task w/ M_WAITOK

And now sensor_task_register() will not fail.

9 years agosensor: Create task thread through SYSINIT
Sepherosa Ziehau [Sun, 22 Mar 2015 12:32:56 +0000 (20:32 +0800)]
sensor: Create task thread through SYSINIT

9 years agosensor: Function renaming and remove unnecessary comment.
Sepherosa Ziehau [Sat, 21 Mar 2015 14:26:22 +0000 (22:26 +0800)]
sensor: Function renaming and remove unnecessary comment.

9 years agosensor: Remove the NOSYSCTL8HACK ifndef test
Sepherosa Ziehau [Sat, 21 Mar 2015 14:25:53 +0000 (22:25 +0800)]
sensor: Remove the NOSYSCTL8HACK ifndef test

NOSYSCTL8HACK is always not defined on DragonFly.

9 years agosensor: Staticize internal global variables
Sepherosa Ziehau [Sat, 21 Mar 2015 14:25:26 +0000 (22:25 +0800)]
sensor: Staticize internal global variables

9 years agosensor: volatile is unnecessary for running
Sepherosa Ziehau [Sat, 21 Mar 2015 14:24:56 +0000 (22:24 +0800)]
sensor: volatile is unnecessary for running

This fields are changed/checked w/ lock held.

9 years agosensors: Staticize internal functions
Sepherosa Ziehau [Sat, 21 Mar 2015 14:24:07 +0000 (22:24 +0800)]
sensors: Staticize internal functions

9 years agosensor: Utilize LOCK_INITIALIZER
Sepherosa Ziehau [Sat, 21 Mar 2015 14:23:42 +0000 (22:23 +0800)]
sensor: Utilize LOCK_INITIALIZER

The cmpset for lock initialization is _not_ safe (it requires at least
3 states and a spin loop, which is obviously an overkill when compared
w/ LOCK_INITIALIZER).

9 years agolock: Add LOCK_INITIALIZER
Sepherosa Ziehau [Sat, 21 Mar 2015 14:23:15 +0000 (22:23 +0800)]
lock: Add LOCK_INITIALIZER

9 years agogcc50: Update to 22 Mar 2015 snapshot (SVN 221572)
John Marino [Sun, 22 Mar 2015 19:13:59 +0000 (20:13 +0100)]
gcc50: Update to 22 Mar 2015 snapshot (SVN 221572)

9 years agoMerge branch 'vendor/GCC50'
John Marino [Sun, 22 Mar 2015 20:53:42 +0000 (21:53 +0100)]
Merge branch 'vendor/GCC50'

9 years agobmake(1): complete update to version 20141111
John Marino [Sun, 22 Mar 2015 19:00:55 +0000 (20:00 +0100)]
bmake(1): complete update to version 20141111

The local modification to job.c was returned, but it may no longer be
necessary.  Until that's determined, leave the current behavior in place
though.

9 years agoMerge branch 'vendor/BMAKE'
John Marino [Sun, 22 Mar 2015 20:53:06 +0000 (21:53 +0100)]
Merge branch 'vendor/BMAKE'

9 years agomake(1): Remove local mods to parse.c and job.c
John Marino [Sun, 22 Mar 2015 18:35:10 +0000 (19:35 +0100)]
make(1): Remove local mods to parse.c and job.c

This is in preparation for an upgrade to bmake.
The modification to job.c will return after the merge.
The modification to parse.c has been incorporated upstream

9 years agoUpdate gcc-50 to SVN version 221572
John Marino [Sun, 22 Mar 2015 19:10:23 +0000 (20:10 +0100)]
Update gcc-50 to SVN version 221572

Last Changed Date: 2015-03-22 19:42:52 +0100 (Sun, 22 Mar 2015)

9 years agoUpdate to bmake-20141111 on the vendor branch
John Marino [Sun, 22 Mar 2015 18:39:45 +0000 (19:39 +0100)]
Update to bmake-20141111 on the vendor branch

9 years agosbin/hammer: Expand hammer show directive to lo:objid:rectype:key:tid
Tomohiro Kusumi [Sat, 21 Mar 2015 15:58:50 +0000 (00:58 +0900)]
sbin/hammer: Expand hammer show directive to lo:objid:rectype:key:tid

- Make hammer show command take rectype:key:tid as an optional part
  of the search directive in addition to the existing part lo:objid.

- Unspecified fields are handled as wildcard.

- rectype:key:tid all have lower priority than existing lo:objid
  (in actual filesystem's btree implementation) so these new fields
  give hammer show command extra conditions on btree search given
  that higher priority fields lo:objid do match.

9 years agokernel/iwn: Properly build 3 missing firmwares (100, 105, 135).
Sascha Wildner [Sun, 22 Mar 2015 01:21:12 +0000 (02:21 +0100)]
kernel/iwn: Properly build 3 missing firmwares (100, 105, 135).

9 years agoAdd sa_family_t definitions to <netinet/in.h> and <sys/un.h> too.
Sascha Wildner [Sun, 22 Mar 2015 00:35:03 +0000 (01:35 +0100)]
Add sa_family_t definitions to <netinet/in.h> and <sys/un.h> too.

As required by POSIX.

Also use sa_family_t in structs sockaddr_un, sockaddr_in and
sockaddr_in6.

9 years agokernel/acpi: Use ACPI_FULL_INITIALIZATION (no functional change).
Sascha Wildner [Sun, 22 Mar 2015 00:15:16 +0000 (01:15 +0100)]
kernel/acpi: Use ACPI_FULL_INITIALIZATION (no functional change).

9 years agodrm/i915: Sync i915_gem_phys_pwrite() with Linux 3.11
François Tigeot [Sat, 21 Mar 2015 21:09:37 +0000 (22:09 +0100)]
drm/i915: Sync i915_gem_phys_pwrite() with Linux 3.11

9 years agodrm/i915: Sync i915_gem_object_put_pages_gtt() with Linux 3.11
François Tigeot [Sat, 21 Mar 2015 16:03:03 +0000 (17:03 +0100)]
drm/i915: Sync i915_gem_object_put_pages_gtt() with Linux 3.11

9 years agodrm: Implement set_page_dirty()
François Tigeot [Sat, 21 Mar 2015 15:52:02 +0000 (16:52 +0100)]
drm: Implement set_page_dirty()

9 years agosbin/hammer: Add filter mode when lo:objid directive is used
Tomohiro Kusumi [Sat, 21 Mar 2015 13:11:33 +0000 (22:11 +0900)]
sbin/hammer: Add filter mode when lo:objid directive is used

- This commit is expansion to the commit e7f926a5 and edcc8136.
  These commits make hammer show command search and print btree
  elements that match lo:objid using '*' mark, but go back to
  normal iteration once it hits matched elements. This commit
  gives options to the way it filters unmatched elements.

- Using the arg "filter" after the directive makes it continue
  filtering without going back to normal iteration. This makes
  it only show nodes that have matched elements.

- Using the arg "nofilter" after the directive makes it not to
  filter from the beginning (same as when lo:objid directive is
  not specified except that this does print '*' for those that
  match lo:objid).

- Not specifying any arg after the directive works the same as
  it did before.

9 years agodrm/i915: Sync i915_gem_shmem_pread() with Linux 3.11
François Tigeot [Sat, 21 Mar 2015 10:39:46 +0000 (11:39 +0100)]
drm/i915: Sync i915_gem_shmem_pread() with Linux 3.11

9 years agodrm: Add linux/swap.h
François Tigeot [Sat, 21 Mar 2015 09:56:31 +0000 (10:56 +0100)]
drm: Add linux/swap.h

9 years agosensor: Minor white space and style cleanup
Sepherosa Ziehau [Fri, 20 Mar 2015 14:23:00 +0000 (22:23 +0800)]
sensor: Minor white space and style cleanup

9 years agosbin/hammer: Make hammer show properly print '*' for elements that match directive
Tomohiro Kusumi [Fri, 20 Mar 2015 13:09:51 +0000 (22:09 +0900)]
sbin/hammer: Make hammer show properly print '*' for elements that match directive

- hammer show command (running with lo:objid directive specified)
  goes back to normal iteration once it matches the directive as
  explained in e7f926a5, however it should not do 'search = NULL;'.
  This commit adds a field btree_search::normal to do it right.

- The problem with 'search = NULL;' is that when there are many files
  in a directory (e.g. dragonfly bsd source), different leaf nodes
  of the same depth could happen to have inodes and dirents with the
  same lo:objid. In this case it prints '*' only for matched records
  located under the first leaf node because by the time it comes to
  the second leaf node the pointer has been set to NULL and
  NULL won't print '*' (see line 169 and 174 of cmd_show.c).

- In the following example it is expected that both leaf node 29
  and 30 print '*' for its records that match 00000001:00000001036af6f7,
  but the result is it only prints for those under leaf node 29.
  This commit does that right.

  show 800000005b14d000 lo 00000001 obj_id 00000001036af6f7 depth 0
  <snip>
       NODE 800000005b04e000 cnt=37 p=800000005b14e000 type=I depth=2 mirror 00000001040192b0 fill=z8:182=92% {
  G------ ELM  0 L lo=00000001 obj=000000010354f711 rt=01 key=0000000000000000 ot=00
  <snip>
  G------ ELM 29 L lo=00000001 obj=00000001036af6e9 rt=01 key=0000000000000000 ot=00
                   tids 0000000104018910:0000000000000000 suboff=8000000020fb1000 mirror 0000000104018a50  *
  G------ ELM 30 L lo=00000001 obj=00000001036af6f7 rt=11 key=66ea1f6ab72c0000 ot=00
                   tids 0000000104018a50:0000000000000000 suboff=800000005b079000 mirror 0000000104018a50  *

9 years agosbin/hammer: Add missing free(3)
Tomohiro Kusumi [Thu, 19 Mar 2015 14:58:04 +0000 (23:58 +0900)]
sbin/hammer: Add missing free(3)

- Free results of strdup(3) and getdevpath(3).

9 years agoetc/sendmail: Fix installation of the /etc/mail/Makefile.
Sascha Wildner [Fri, 20 Mar 2015 11:01:18 +0000 (12:01 +0100)]
etc/sendmail: Fix installation of the /etc/mail/Makefile.

The way this was done led to problems when doing 'make install' and
'make clean' from etc/mail. The generated Makefile would overwrite
the shipped Makefile (upon install) or the shipped Makefile would
delete itself (upon clean).

Use FILESNAME_... which is meant for this kind of stuff.

Reported-by: tkusumi
9 years ago<sys/unistd.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.
Sascha Wildner [Fri, 20 Mar 2015 10:46:22 +0000 (11:46 +0100)]
<sys/unistd.h>: Use __BSD_VISIBLE instead of !_POSIX_SOURCE.

9 years agoopenssl: In the README.DRAGONFLY, note that the date needs updating too.
Sascha Wildner [Thu, 19 Mar 2015 19:18:41 +0000 (20:18 +0100)]
openssl: In the README.DRAGONFLY, note that the date needs updating too.

9 years agoopenssl: Adjust manual pages for 1.0.1m.
Sascha Wildner [Thu, 19 Mar 2015 19:18:10 +0000 (20:18 +0100)]
openssl: Adjust manual pages for 1.0.1m.

9 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Thu, 19 Mar 2015 20:06:51 +0000 (21:06 +0100)]
Merge branch 'vendor/OPENSSL'

9 years agoImport OpenSSL 1.0.1m.
Sascha Wildner [Thu, 19 Mar 2015 20:01:12 +0000 (21:01 +0100)]
Import OpenSSL 1.0.1m.

Fixes CVE-2015-0286, CVE-2015-0287, CVE-2015-0289, CVE-2015-0293,
CVE-2015-0209, and CVE-2015-0288.

9 years ago<stdio.h>: Adjust comment about UT_NAMESIZE.
Sascha Wildner [Thu, 19 Mar 2015 11:40:09 +0000 (12:40 +0100)]
<stdio.h>: Adjust comment about UT_NAMESIZE.

9 years agorepquota(8): Use MAXLOGNAME instead of UT_NAMESIZE.
Sascha Wildner [Thu, 19 Mar 2015 11:35:20 +0000 (12:35 +0100)]
repquota(8): Use MAXLOGNAME instead of UT_NAMESIZE.

9 years agoatrun(8): Use MAXLOGNAME instead of UT_NAMESIZE.
Sascha Wildner [Thu, 19 Mar 2015 11:34:38 +0000 (12:34 +0100)]
atrun(8): Use MAXLOGNAME instead of UT_NAMESIZE.

9 years agolibposix1e: Use MAXLOGNAME instead of UT_NAMESIZE.
Sascha Wildner [Thu, 19 Mar 2015 11:33:49 +0000 (12:33 +0100)]
libposix1e: Use MAXLOGNAME instead of UT_NAMESIZE.

9 years agomutex.9: Adjust a bit to current source.
Sascha Wildner [Thu, 19 Mar 2015 11:15:57 +0000 (12:15 +0100)]
mutex.9: Adjust a bit to current source.

9 years agogcc50: Fix parallel build issue with libstdc++
John Marino [Thu, 19 Mar 2015 08:54:30 +0000 (01:54 -0700)]
gcc50: Fix parallel build issue with libstdc++

The "beforedepends" target apparently is not serial.  I found out that
a header got copied into bits directory before bits directory was created.
This modification should prevent that in the future.

9 years agolibc/realpath: Better POSIX conformance regarding ENOENT and ENOTDIR.
Sascha Wildner [Wed, 18 Mar 2015 18:32:04 +0000 (19:32 +0100)]
libc/realpath: Better POSIX conformance regarding ENOENT and ENOTDIR.

This fixes the "Test keywords with arguments" test of pkg(8), too.

Reported-by: Robin Hahling <robin.hahling@gw-computing.net>
Fix-pointed-out-by: bapt@freebsd
Taken-from:         FreeBSD

9 years agosbin/hammer: Fix assertion to accept undo zone
Tomohiro Kusumi [Wed, 18 Mar 2015 16:05:40 +0000 (01:05 +0900)]
sbin/hammer: Fix assertion to accept undo zone

- hammer checkmap now supports undo zone after d2bf3c30 so this
  assertion needs to accept undo zone, although nothing changes
  since AssertOnFailure is set to 0 by default for this command
  for now.

9 years agosbin/hammer: Implement checkmap collects using rbtree
Tomohiro Kusumi [Wed, 18 Mar 2015 15:45:46 +0000 (00:45 +0900)]
sbin/hammer: Implement checkmap collects using rbtree

- Replace hash table for collects using rbtree.

- Using hash table can't dump collects' -v info in the right order
  since hash index value and collect entries linked to hash table
  entries do not reflect collect::phys_offset value.

- If the amount of filesystem data is less than approximately 4TB
  nothing will change because there is only one collect entry,
  which makes no difference whether the data structure is rbtree
  or hash table.

9 years agosbin/hammer: Add some comments
Tomohiro Kusumi [Wed, 18 Mar 2015 15:45:06 +0000 (00:45 +0900)]
sbin/hammer: Add some comments

- Add some comments on hammer checkmap's collects data structure.

9 years agosbin/hammer: Add assertions
Tomohiro Kusumi [Wed, 18 Mar 2015 15:44:22 +0000 (00:44 +0900)]
sbin/hammer: Add assertions

- Add assertions for invalid node type and undo header type.

9 years agox86_64: Take advantage of ACPI/CPU specific C-state mapping
Sepherosa Ziehau [Tue, 17 Mar 2015 11:58:47 +0000 (19:58 +0800)]
x86_64: Take advantage of ACPI/CPU specific C-state mapping

If BIOS maps shallow ACPI C-state (<C3) to deep CPU specific C-state
(>=C3), it implies no bus mastering operations are needed before
entering deep CPU specific C-states.

9 years agoRevert "acpi/cstate: Detect and fix duplicated C-states"
Sepherosa Ziehau [Mon, 16 Mar 2015 14:37:32 +0000 (22:37 +0800)]
Revert "acpi/cstate: Detect and fix duplicated C-states"

This reverts commit 4221f7280cb32cbd2292001d52653e01a71872c9.

Looks like it is intentional to avoid bus mastering register
accessing, cache flush, and changing interrupt timer, which
is required for C3.

9 years agoacpi/cstate: Match C-states of the hyperthreads on the same core
Sepherosa Ziehau [Mon, 16 Mar 2015 14:23:06 +0000 (22:23 +0800)]
acpi/cstate: Match C-states of the hyperthreads on the same core

Some stupid BIOSes set different C-states for hyperthreads on the same
core, which prevents the core from entering deep C-states, since not
all hyperthreads of the core are in the deep C-states.

We fix this by using same number of C-states for hyperthreads on the
same core; the hyperthread w/ more C-states is taken as master.

9 years agoip: Don't generate IP ID for DF IP datagrams (part of RFC6864)
Sepherosa Ziehau [Mon, 16 Mar 2015 13:22:31 +0000 (21:22 +0800)]
ip: Don't generate IP ID for DF IP datagrams (part of RFC6864)

9 years agokernel/acpi: Reduce code duplication with ACPICA (second attempt).
Sascha Wildner [Tue, 17 Mar 2015 22:33:14 +0000 (23:33 +0100)]
kernel/acpi: Reduce code duplication with ACPICA (second attempt).

Use the types which the ACPICA framework provides whereever possible in
our acpi_fadt and acpi_madt code. Since we do not use any actual ACPICA
functions here, this is no problem even for code which (so far) runs
before ACPICA is initialized.

Compared to the previous attempt which I pushed (and reverted again)
this commit has the following additional fixes:

* Compare the FADT length to the length of the ACPI 2.0 (up to 4.0)
  version of the table (which is 24 bytes shorter than the ACPI 5.0
  version).

* Doesn't shift again an already shifted value.

Discussed-with-and-approved-by: sephe
Tested-by: Robin Hahling <robin.hahling@gw-computing.net>
9 years agoclock_gettime.2: Update and document various clock_ids.
Robin Hahling [Tue, 17 Mar 2015 07:40:27 +0000 (08:40 +0100)]
clock_gettime.2: Update and document various clock_ids.

    * clock_id may take many more values than what was previously
      suggested.

    * Document some clock_ids that take advantage of upmap/kpmap in case
      of many repetitive calls.

    * Inform about some clock_ids that are FreeBSD extensions.

9 years ago<utmpx.h>: Mark RUN_LVL as being non POSIX.
Sascha Wildner [Tue, 17 Mar 2015 19:51:33 +0000 (20:51 +0100)]
<utmpx.h>: Mark RUN_LVL as being non POSIX.

9 years agosbin/hammer: Make some checkmap functions inline
Tomohiro Kusumi [Tue, 17 Mar 2015 16:16:30 +0000 (01:16 +0900)]
sbin/hammer: Make some checkmap functions inline

- Make collect_xxx functions inline.

9 years agosbin/hammer: Make hammer checkmap command support undo zone
Tomohiro Kusumi [Tue, 17 Mar 2015 16:06:33 +0000 (01:06 +0900)]
sbin/hammer: Make hammer checkmap command support undo zone

- Make hammer checkmap command support undo zone by scanning
  undo fifo, in addition to btree zone support added in 6cf258d.

9 years agosbin/hammer: Move COLLECT_XXX macros to cmd_blockmap.c
Tomohiro Kusumi [Tue, 17 Mar 2015 10:49:48 +0000 (19:49 +0900)]
sbin/hammer: Move COLLECT_XXX macros to cmd_blockmap.c

- These macros are magic numbers locally used by checkmap.
  Library users don't need to know collects' hash table size.

9 years agosbin/hammer: Make hammer checkmap command use tailq
Tomohiro Kusumi [Tue, 17 Mar 2015 10:47:13 +0000 (19:47 +0900)]
sbin/hammer: Make hammer checkmap command use tailq

- Embed "TAILQ_ENTRY(collect) entry;" in struct collect instead of
  having a pointer of the same type.

9 years agoRevert "kernel/acpi: Reduce code duplication with ACPICA."
Sascha Wildner [Mon, 16 Mar 2015 23:10:43 +0000 (00:10 +0100)]
Revert "kernel/acpi: Reduce code duplication with ACPICA."

This reverts commit fc673eaa749a01e148fc5f0b6e81587531576344.

I did some mistakes here, one of which I found already. But
there are more. So let's revert it for now (since it causes
rather nasty issues) until the issues are all found.

Reported-by: Robin Hahling <robin.hahling@gw-computing.net>
9 years agokernel/acpi_thermal: If the _TMP can't be evaluated, increase the interval.
Sascha Wildner [Mon, 16 Mar 2015 23:09:45 +0000 (00:09 +0100)]
kernel/acpi_thermal: If the _TMP can't be evaluated, increase the interval.

If _TMP evaluation fails two times, switch to trying every two hours.
I think eventually we should move to stop reading the sensor at all
(it is usually a bug in the AML and won't spring to life again all
of a sudden), but for now, this lowers the burden on log files.

Submitted-by: dillon
9 years agopam_passwdqc: Raise WARNS to 3 and fix a number of warnings.
Sascha Wildner [Mon, 16 Mar 2015 19:36:36 +0000 (20:36 +0100)]
pam_passwdqc: Raise WARNS to 3 and fix a number of warnings.

* Define _XOPEN_SOURCE correctly for DragonFly.

* Change macro functions into inline functions.

* Cast a const char * to char *.

9 years agosbin/hammer: Fix printf format for bad node
Tomohiro Kusumi [Mon, 16 Mar 2015 16:42:04 +0000 (01:42 +0900)]
sbin/hammer: Fix printf format for bad node

- Remove "{" since there is no "}" unlike hammer show command.

9 years agosbin/hammer: Make hammer checkmap show number of errors if any
Tomohiro Kusumi [Mon, 16 Mar 2015 16:41:30 +0000 (01:41 +0900)]
sbin/hammer: Make hammer checkmap show number of errors if any

- Make hammer checkmap command print number of inconsistency
  after all collections and verifications.

9 years agosbin/hammer: Disable AssertOnFailure when running hammer checkmap
Tomohiro Kusumi [Mon, 16 Mar 2015 16:36:44 +0000 (01:36 +0900)]
sbin/hammer: Disable AssertOnFailure when running hammer checkmap

- Since the purpose of hammer checkmap command is to find out
  inconsistency between blockmap and btree, it's better to set
  AssertOnFailure to 0 just like hammer show command does.

9 years agosbin/hammer: Add zone-bigblock statistics to hammer checkmap command
Tomohiro Kusumi [Mon, 16 Mar 2015 16:34:40 +0000 (01:34 +0900)]
sbin/hammer: Add zone-bigblock statistics to hammer checkmap command

- Make hammer checkmap command print zone-bigblock statistics when
  -v option is used.

- Note that hammer checkmap command does not take into account all
  zones that are currently used by HAMMER. For example the command
  does not count bigblocks used by undo zone, so zone 3 always has
  0 regardless of actual ondisk undo space.

- Add zone=%2d info to existing failure/verbose printf which
  corresponds to the statistics.

9 years agosbin/hammer: Make hammer checkmap command support btree zone
Tomohiro Kusumi [Mon, 16 Mar 2015 16:34:40 +0000 (01:34 +0900)]
sbin/hammer: Make hammer checkmap command support btree zone

- Make hammer checkmap command support not only btree leaf elements,
  but also btree internal/leaf nodes.

- collect_get() allocates 8MB chunk for layer2 which covers all
  layer2 entries within a layer1 entry, however existing checkmap
  command only tracks btree leaf elements. This commit adds additional
  collects for btree internal/leaf nodes that belong to btree zone.

9 years agosbin/hammer: Fix and add debug printf on buffer access
Tomohiro Kusumi [Mon, 16 Mar 2015 16:34:40 +0000 (01:34 +0900)]
sbin/hammer: Fix and add debug printf on buffer access

- Fix debug fprintf format when the buffer was newly allocated.

- Add debug fprintf to stderr when the buffer was found in cache.

9 years agosbin/hammer: Properly set counter in cache flushing loop
Tomohiro Kusumi [Mon, 16 Mar 2015 16:34:40 +0000 (01:34 +0900)]
sbin/hammer: Properly set counter in cache flushing loop

- This local variable 'count' being reset to 0 was probably intended
  to be set to 1, because otherwise --count; right after this makes
  it negative (which takes extra count before next CacheMax expansion).
  This makes no difference to results of hammer commands.

9 years agosbin/hammer: Use existing function hammer_cache_used()
Tomohiro Kusumi [Mon, 16 Mar 2015 16:34:20 +0000 (01:34 +0900)]
sbin/hammer: Use existing function hammer_cache_used()

- Use existing function hammer_cache_used() for list operation.

9 years agodrm: Add firmware.h Linux compatiblity layer
Michael Neumann [Mon, 16 Mar 2015 16:50:18 +0000 (17:50 +0100)]
drm: Add firmware.h Linux compatiblity layer

9 years agodrm: Add Linux seq_file equivalent
Michael Neumann [Mon, 16 Mar 2015 11:54:52 +0000 (12:54 +0100)]
drm: Add Linux seq_file equivalent

9 years agodrm: Basic implementation of wound/wait mutexes used by ttm
Michael Neumann [Mon, 16 Mar 2015 11:24:11 +0000 (12:24 +0100)]
drm: Basic implementation of wound/wait mutexes used by ttm

9 years agoif: Remove unused if_ioctl_mtx
Sepherosa Ziehau [Mon, 16 Mar 2015 03:28:36 +0000 (11:28 +0800)]
if: Remove unused if_ioctl_mtx

9 years agoacpi/cstate: Clear saved C-state softc, if attach failed
Sepherosa Ziehau [Sun, 15 Mar 2015 13:36:46 +0000 (21:36 +0800)]
acpi/cstate: Clear saved C-state softc, if attach failed

And install softc during the probe; instead of using (void *)1.

9 years agoacpi/cstate: Detect and fix duplicated C-states
Sepherosa Ziehau [Sun, 15 Mar 2015 11:28:40 +0000 (19:28 +0800)]
acpi/cstate: Detect and fix duplicated C-states

Some buggy BIOSes create two C2 states, however, the latter one is
obviously C3.  Add tunable hw.acpi.cpu.cst.check_duplicated to detect
and fix this bug; it is not enabled by default.

9 years agokernel - Refactor kern_mutex (mtx* functions)
Matthew Dillon [Mon, 16 Mar 2015 01:48:15 +0000 (18:48 -0700)]
kernel - Refactor kern_mutex (mtx* functions)

* Refactor kern_mutex in order to support asynchronous lock requests,
  which hammer2 is going to need.  kern_mutex already supports abortable
  locks.

* Add callback fields to the mtx_link structure.

* Use the mtx_link structure for shared locks in addition to exclusive locks,
  allowing asynchronous callbacks for shared locks and exclusive locks.

* Make the locking flags more deterministic.

* Redo the typedefs to be more like hammer2.  Typedef the structures rather
  than pointers so the typedef names can be used for structural embedding.