dragonfly.git
14 years agoAMD64 - AUDIT RUN - Fix format strings, size_t, and other issues
Matthew Dillon [Fri, 21 Aug 2009 10:41:09 +0000 (03:41 -0700)]
AMD64 - AUDIT RUN - Fix format strings, size_t, and other issues

14 years agoAMD64 - yp functions take pointers to int, not pointers to size_t.
Matthew Dillon [Fri, 21 Aug 2009 06:47:48 +0000 (23:47 -0700)]
AMD64 - yp functions take pointers to int, not pointers to size_t.

* yp functions were inconsistent.  Fix numerous compiler warnings.
  Note: FreeBSD made the same changes.

14 years agoAMD64 - Fix compiler warnings
Matthew Dillon [Fri, 21 Aug 2009 06:01:47 +0000 (23:01 -0700)]
AMD64 - Fix compiler warnings

* Also change i_size, which is used with pointer arithmatic, mmap(), and
  munmap(), from off_t to size_t.

14 years agoFix mplock mismatch.
YONETANI Tomokazu [Fri, 21 Aug 2009 02:56:08 +0000 (11:56 +0900)]
Fix mplock mismatch.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 20 Aug 2009 22:31:13 +0000 (15:31 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAMD64 - Get buildworld working again.
Matthew Dillon [Thu, 20 Aug 2009 22:31:02 +0000 (15:31 -0700)]
AMD64 - Get buildworld working again.

14 years agoacpidump: fix interaction with iasl
Simon Schubert [Thu, 20 Aug 2009 19:56:56 +0000 (21:56 +0200)]
acpidump: fix interaction with iasl

Seems the new iasl puts the disassembly at a different place, so adjust
the way we access its output.

Obtained-from: FreeBSD

14 years agoprintf(1): don't use getopt, second take
Simon Schubert [Thu, 20 Aug 2009 18:21:26 +0000 (20:21 +0200)]
printf(1): don't use getopt, second take

printf must not use getopt, since any passed string is
valid, also strings starting with -, i.e.
printf -f%s oo
has to print "-foo" and not error out with
"illegal option".

However, if printf is passed "--" as an argument separator, we have to
discard it and may not print it.

14 years agoFix numerous compiler warnings and format conversion specifiers.
Matthew Dillon [Thu, 20 Aug 2009 17:24:58 +0000 (10:24 -0700)]
Fix numerous compiler warnings and format conversion specifiers.

14 years agoINET6 - Fix broken call to ip6_notify_pmtu()
Matthew Dillon [Thu, 20 Aug 2009 17:18:44 +0000 (10:18 -0700)]
INET6 - Fix broken call to ip6_notify_pmtu()

14 years agoVKERNEL - fix procedure argument to match prototype.
Matthew Dillon [Thu, 20 Aug 2009 16:32:45 +0000 (09:32 -0700)]
VKERNEL - fix procedure argument to match prototype.

14 years agoRevert "printf(1): don't use getopt"
Matthew Dillon [Thu, 20 Aug 2009 16:28:56 +0000 (09:28 -0700)]
Revert "printf(1): don't use getopt"

This reverts commit 8a65ba3d8f8a805773a99458f6f18f034ad84d57.

printf.c is included by /bin/sh, and the internalized version is
used by apropos which passes it '-- fmt ...'.  FreeBSD and NetBSD
and probably others use getopt().  We have to too or we break --
use.

14 years agodistrib-dirs: replace symlink if it is dangling
Simon Schubert [Thu, 20 Aug 2009 13:02:32 +0000 (15:02 +0200)]
distrib-dirs: replace symlink if it is dangling

The previous version wouldn't work right if a sys symlink existed, but
its target wouldn't.

14 years agolibc: fix declaration: use size_t instead of vm_size_t
Simon Schubert [Thu, 20 Aug 2009 10:51:27 +0000 (12:51 +0200)]
libc: fix declaration: use size_t instead of vm_size_t

14 years agoFinish revert "size_t/ssize_t - change to [unsigned] long"
Simon Schubert [Thu, 20 Aug 2009 08:49:29 +0000 (10:49 +0200)]
Finish revert "size_t/ssize_t - change to [unsigned] long"

- use __uint64_t instead of unsigned long in amd64 for symmetry with i386
- revert ptrdiff_t as well to int, that's what the rest of the world uses

14 years agorc.d/mixer: save state for all /dev/mixer*
Simon Schubert [Thu, 20 Aug 2009 00:41:19 +0000 (02:41 +0200)]
rc.d/mixer: save state for all /dev/mixer*

Recent devfs changes created numbered mixers in /dev.  This commit
allows to save the state of all mixers and also restores them correctly.

14 years agoxargs: error out if argument to -L is no valid number
Simon Schubert [Thu, 20 Aug 2009 00:40:30 +0000 (02:40 +0200)]
xargs: error out if argument to -L is no valid number

14 years agoprintf(1): don't use getopt
Simon Schubert [Thu, 20 Aug 2009 00:24:41 +0000 (02:24 +0200)]
printf(1): don't use getopt

printf must not use getopt, since any passed string is valid, also
strings starting with -, i.e.
printf -f%s oo
has to print "-foo" and not error out with "illegal option".

14 years agoRevert size_t/ssize_t 1e8087d481c6bfecf14ce6eddc5c722031742332
Matthew Dillon [Thu, 20 Aug 2009 08:53:08 +0000 (01:53 -0700)]
Revert size_t/ssize_t 1e8087d481c6bfecf14ce6eddc5c722031742332

Ok, too many issues for i386, we'll go back to using an unsigned int and int
equivalent.

14 years agoHAMMER - Massively improve performance
Matthew Dillon [Thu, 20 Aug 2009 06:30:42 +0000 (23:30 -0700)]
HAMMER - Massively improve performance

* Now that write pipelining is controlled by ip->rsv_recs and now
  that we have write bursting in the BIOQ subsystem, we do not
  actually want to use bawrite() or cluster_write() because the bio
  could end up waiting for the disk for a long time, and it is locked
  for that entire period.  So go back to using bdwrite().

  This seriously improves HAMMER's ability to access files that were
  just written without having to wait for I/O to complete.

* Reclaim (destroy) buffer cache buffers related to UNDO data, except
  for the UNDO block we will be needing again for the next flush.  We
  don't need to keep old undo buffers in the cache!  This improves
  HAMMER's memory footprint.

14 years agoBIOQ - Create a more sophisticated bursting mechanic for writes.
Matthew Dillon [Thu, 20 Aug 2009 06:27:58 +0000 (23:27 -0700)]
BIOQ - Create a more sophisticated bursting mechanic for writes.

* Add sysctls:

  vfs.bioq_reorder_minor_interval
  vfs.bioq_reorder_minor_bytes

  vfs.bioq_reorder_burst_interval
  vfs.bioq_reorder_burst_bytes

* Reads are prioritized over writes.  Every N (minor_interval) reads
  up to (minor_bytes) worth of writes are allowed in order to avoid
  complete write starvation (which is just as bad as complete read
  starvation).

* If a large amount of write data is queued to devices the related
  buffer cache buffers will be locked.  This is not a good place to
  be as any readers trying to access those buffers will then also
  block.

  When the amount of data is excessive the (burst_interval) and
  (burst_bytes) comes into play.  This primarily helps HAMMER
  flush cycles.

* Try to keep vfs.hirunningspace reasonably bounded.  We do not want
  too large a value because of the above buffer locking issue.  On
  the flip side, we can have large numbers of delayed-write dirty buffers
  sitting around because they aren't locked.

* When the buffer cache is hitting hidirtybufspace the buffer daemons
  now try to keep the vfs.runningbufspace at hirunningspace levels
  instead of lorunningspace levels in order to trigger the bioq's
  bursting mode.

14 years agodisklabel64 - Fix DIOCSDINFO64, DIOCWDINFO64 bugs
Matthew Dillon [Thu, 20 Aug 2009 00:22:43 +0000 (17:22 -0700)]
disklabel64 - Fix DIOCSDINFO64, DIOCWDINFO64 bugs

* A loop iterator was using the wrong variable, causing the disklabel
  operation to fail and potentially also (on 64-bit boxes) crashing the
  box.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 20 Aug 2009 00:14:36 +0000 (17:14 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoNATA - Convert sysctls to globals to make NATA compile ok
Matthew Dillon [Thu, 20 Aug 2009 00:14:17 +0000 (17:14 -0700)]
NATA - Convert sysctls to globals to make NATA compile ok

14 years agonewvers.sh: shorten version string
Simon Schubert [Wed, 19 Aug 2009 23:58:31 +0000 (01:58 +0200)]
newvers.sh: shorten version string

The inclusion of the git revision made the version string exceed a
single line, and also mostly duplicated the output.  If we have a git
revision available, use it instead of the standard version string.

Requested-by: dillon@
14 years agogitrev.sh: disable dirty-tree check
Simon Schubert [Wed, 19 Aug 2009 23:38:11 +0000 (01:38 +0200)]
gitrev.sh: disable dirty-tree check

The dirty tree check takes quite long on non-local systems, so disable
it until somebody comes up with a nice solution.

Requested-by: dillon@
14 years agoRemove dev_ops_release() and two more stale prototypes.
Sascha Wildner [Wed, 19 Aug 2009 22:03:28 +0000 (00:03 +0200)]
Remove dev_ops_release() and two more stale prototypes.

Discussed-with: alexh

14 years agoNATA - Replace the queuing algorithm with the one used by bioq.
Matthew Dillon [Wed, 19 Aug 2009 21:49:14 +0000 (14:49 -0700)]
NATA - Replace the queuing algorithm with the one used by bioq.

* NATA doesn't use bioq yet, but I replicated the algorithm to fix the
  read starvation issue.

* Interesting note: Because NATA does not have NCQ reads appear to be
  prioritized even more then they are on AHCI.

14 years agobioqdisksort - refactor I/O queueing to fix read starvation issues.
Matthew Dillon [Wed, 19 Aug 2009 20:59:39 +0000 (13:59 -0700)]
bioqdisksort - refactor I/O queueing to fix read starvation issues.

It is possible to queue several hundred megabytes worth of write I/O's
all at once.  When this occurs, whether we sort the queue or not, reads
wind up getting seriously starved.

Refactor bioqdisksort() to prioritize reads over writes and to also allow
writes to 'leak' into the read space every so often to prevent write
starvation.  The new code is designed to make best use of drive zone caches.

14 years agoHAMMER - Rework write pipelining
Matthew Dillon [Wed, 19 Aug 2009 20:54:29 +0000 (13:54 -0700)]
HAMMER - Rework write pipelining

* Rework write pipelining so it is based on pending direct writes on an
  inode-by-inode basis.  ip->rsv_recs and hmp->rsv_recs are now
  decremented after the direct has completed rather then when the sync
  code has processed the record.

  This fixes serious buffer cache overloading when doing linear writes.

* Implement write clustering or bawrite() calls based on a filesystem
  block getting filled up instead of relying on the buffer cache's bdwrite()
  to keep ahead of the mark.

* vfs.hammer.cluster_enable now effects both read and write clustering.

14 years agoMerge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly
Matthias Schmidt [Wed, 19 Aug 2009 17:16:41 +0000 (19:16 +0200)]
Merge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly

14 years agopkg_search: Change URLs and honor possible mirror settings
Matthias Schmidt [Wed, 19 Aug 2009 17:12:57 +0000 (19:12 +0200)]
pkg_search: Change URLs and honor possible mirror settings

- Change the version variable to match latest changes on avalon (2.2 ->
  2.2.0)
- If the user uses $BINPKG_SITES or /etc/settings.conf (like with
  pkg_radd) try to download the summary file from a mirror first.  If
  that fails, fall back to default aka avalon

NOTE: If someone changes the directory layout on avalon, please update
the pkg_* tools in base as well.

14 years agoAHCI - Fix interrupt enablement sequencing
Matthew Dillon [Wed, 19 Aug 2009 17:10:41 +0000 (10:10 -0700)]
AHCI - Fix interrupt enablement sequencing

* Interrupt enablement could race port initialization, causing the AHCI
  probe to fail and/or assert.

  Wait for basic port hardware initialization to complete (which is done by
  the port helper threads) before enabling interrupt processing on the chip.

Testing-by: Alexander Polakov <polachok@gmail.com>
14 years agoHAMMER Util - Refactor mount list scan and other fixes
Matthew Dillon [Wed, 19 Aug 2009 15:30:38 +0000 (08:30 -0700)]
HAMMER Util - Refactor mount list scan and other fixes

    * MOUNTCTL - Fix a problem with user mount flags parsing in HAMMER.

    * User mount flags for HAMMER FS was not properly handled. Now
      function vfs_flagstostr() is able to append to the passed buf.

    * Refactor the mountlist scan for info / cleanup commands.

Submitted-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
14 years agoHAMMER rebalance - Fix propogation race.
Matthew Dillon [Wed, 19 Aug 2009 15:26:26 +0000 (08:26 -0700)]
HAMMER rebalance - Fix propogation race.

* It is possible for the mirror_tid in the b-tree node to not be entirely
  updated at the point where a rebalance operation acquires the locks.

14 years agoHAMMER mirroring - Multiple adjustments to support better incremental ops
Matthew Dillon [Wed, 19 Aug 2009 15:23:02 +0000 (08:23 -0700)]
HAMMER mirroring - Multiple adjustments to support better incremental ops

* Read side - Ignore records created after the end point, reducing
  network bandwidth for incremental operations.

* Read side - Generate PASS for records created prior to tid_beg, instead
  of pushing the whole record, reducting network bandwidth for incremental
  operations.

* Write side - Ensure that deletions are end-exclusive.

* Write side - Do not delete records created >= end point, supporting
  incremental operations.

14 years agoahci.4: Fix tunable name (reported by hasso).
Sascha Wildner [Wed, 19 Aug 2009 13:45:41 +0000 (15:45 +0200)]
ahci.4: Fix tunable name (reported by hasso).

14 years agoFix some WARNS fallout from the recent (s)size_t changes.
Sascha Wildner [Wed, 19 Aug 2009 13:38:24 +0000 (15:38 +0200)]
Fix some WARNS fallout from the recent (s)size_t changes.

14 years agosound: add cloning with devfs
Simon Schubert [Wed, 19 Aug 2009 12:12:51 +0000 (14:12 +0200)]
sound: add cloning with devfs

14 years agosys/sys/conf.h - Add GID_TTY #define
Alex Hornung [Wed, 19 Aug 2009 07:41:38 +0000 (08:41 +0100)]
sys/sys/conf.h - Add GID_TTY #define

* Add GID_TTY #define to be able to use GID_TTY comfortably where needed

14 years agoDEVFS - avoid ENOENT on fstat of open vnode; cleanup warning
Alex Hornung [Wed, 19 Aug 2009 10:23:14 +0000 (11:23 +0100)]
DEVFS - avoid ENOENT on fstat of open vnode; cleanup warning

* cleanup warning related to unused variable

* remove accessibility check from getattr() so fstat doesn't
  return ENOENT.

14 years agodistrib-dirs: invert logic
Simon Schubert [Tue, 18 Aug 2009 16:16:50 +0000 (18:16 +0200)]
distrib-dirs: invert logic

If test ! -e sys fails, no ln will be called, but also the return value
of the whole command will be non-zero.  In this make will abort.  Fix
this by inverting the logic, either returning zero from the successful
test -e sys, or returning the return value of the ln -s.

14 years agoKernel - Check cd8/cd9 for root mount (USB)
Matthew Dillon [Wed, 19 Aug 2009 07:34:01 +0000 (00:34 -0700)]
Kernel - Check cd8/cd9 for root mount (USB)

* USB attached CD or DVD drives will attach starting at cd8.  Add cd8 and
  cd9 to the root mount checks when booting -C (which is how CD's boot
  the kernel).

14 years agoAHCI - Fix bricking issue with older chipsets on boot.
Matthew Dillon [Wed, 19 Aug 2009 07:11:31 +0000 (00:11 -0700)]
AHCI - Fix bricking issue with older chipsets on boot.

* It looks like the use of AHCI_PREG_SCTL_DET_DISABLE, which turns off
  the phy on port, can brick the AHCI chip and even take out the entire
  machine.  This seems to effect Intel chips the most.

  Stop using it entirely.

Reports-from: Rumko, Alexander Polakov

14 years agoDEVFS - Avoid clearing of hides that don't come from rules
Alex Hornung [Wed, 19 Aug 2009 07:09:43 +0000 (08:09 +0100)]
DEVFS - Avoid clearing of hides that don't come from rules

* Avoid clearing hides that didn't come from rules by introducing a
  new node flag, DEVFS_RULE_HIDDEN.

* Reactivate hiding of ptm/ and all its contents for cleaner unix98
  ptys.

14 years agoDEVFS - fix possible panic on devfs_release_ops
Alex Hornung [Tue, 18 Aug 2009 22:24:42 +0000 (23:24 +0100)]
DEVFS - fix possible panic on devfs_release_ops

* under certain conditions on unloading a module it could happen that
  the memory containing the dev_ops was released before devfs_release_
  ops could happen due to the asynchronous nature of destroy_dev.
  Fix this saving only a pointer to the ops and not using it to store
  anything but rather use a local tailq for reference counting the
  dev_ops.

14 years agoAMD64 - Pipes now support 64 bit size_t for uio_resid.
Matthew Dillon [Wed, 19 Aug 2009 04:36:25 +0000 (21:36 -0700)]
AMD64 - Pipes now support 64 bit size_t for uio_resid.

* Fix bugs on 64-bit kernels related to reads and writes on pipes
  which specify IO sizes in excess of 2G.

* Add a signal check and break in the loop for any pipe read or write
  greater then 10MB.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 19 Aug 2009 04:07:27 +0000 (21:07 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER - break atomicy for huge reads and writes.
Matthew Dillon [Wed, 19 Aug 2009 04:06:23 +0000 (21:06 -0700)]
HAMMER - break atomicy for huge reads and writes.

* Allow reads or writes in excess of 100MB to be interrupted.  Otherwise
  it is a simple matter to DOS the machine into oblivion.

  And if you think it could be bad on a 32 bit machine, just think what
  can happen on a 64-bit machine with a multi-terrabyte address space!

14 years agoAMD64 - Refactor uio_resid and size_t assumptions.
Matthew Dillon [Wed, 19 Aug 2009 03:30:09 +0000 (20:30 -0700)]
AMD64 - Refactor uio_resid and size_t assumptions.

* uio_resid changed from int to size_t (size_t == unsigned long equivalent).

* size_t assumptions in most kernel code has been refactored to operate in a
  64 bit environment.

* In addition, the 2G limitation for VM related system calls such as mmap()
  has been removed in 32 bit environments.  Note however that because
  read() and write() return ssize_t, these functions are still limited
  to a 2G byte count in 32 bit environments.

14 years agoChange typedefs for vm_offset_t, vm_size_t, and vm_pindex_t, add szmin/sz/max
Matthew Dillon [Wed, 19 Aug 2009 03:01:13 +0000 (20:01 -0700)]
Change typedefs for vm_offset_t, vm_size_t, and vm_pindex_t, add szmin/sz/max

* Generally change these types from unsigned int to unsigned long in
  order to better catch int/long issues on both 32 and 64 bit builds.

* Add szmin() and szmax() inlines which take and return size_t.

14 years agoFix miscellanious size_t related compiler warnings.
Matthew Dillon [Wed, 19 Aug 2009 02:59:59 +0000 (19:59 -0700)]
Fix miscellanious size_t related compiler warnings.

14 years agosize_t/ssize_t - change to [unsigned] long
Matthew Dillon [Wed, 19 Aug 2009 02:56:17 +0000 (19:56 -0700)]
size_t/ssize_t - change to [unsigned] long

* change size_t from unsigned int to unsigned long, and change ssize_t
  from int to long for both 32 and 64 bit builds.

  NOTE: This may not last for 32 bit builds, depending on what it breaks
  in pkgsrc land, but the change makes it easier to detect 32/64 bit
  issues with size_t, sizeof, and pointer arithmatic on 32 bit machines.

14 years agotest/amd64: increase qemu opcode buffer limits
Simon Schubert [Sun, 16 Aug 2009 23:43:08 +0000 (01:43 +0200)]
test/amd64: increase qemu opcode buffer limits

qemu 0.10.6 segfaults with the standard opcode buffer limits, so we have
to increase them a bit to make it work.

14 years agotest/amd64: update to qemu-0.10.6
Simon Schubert [Sun, 16 Aug 2009 17:24:40 +0000 (19:24 +0200)]
test/amd64: update to qemu-0.10.6

14 years agotest/amd64: increase root size
Simon Schubert [Sun, 16 Aug 2009 17:33:28 +0000 (19:33 +0200)]
test/amd64: increase root size

A world with all binaries compiled with -g will not fit into 512MB, so
let's go with 2GB for now.

14 years agonewvers.sh: use gitrev.sh to assemble uname -v
Simon Schubert [Sun, 16 Aug 2009 07:32:46 +0000 (09:32 +0200)]
newvers.sh: use gitrev.sh to assemble uname -v

14 years agonrelease: use space instead of "-" in iso label
Simon Schubert [Tue, 18 Aug 2009 21:29:05 +0000 (23:29 +0200)]
nrelease: use space instead of "-" in iso label

14 years agogitrev.sh: make it usable during buildkernel/world
Simon Schubert [Sun, 16 Aug 2009 07:32:11 +0000 (09:32 +0200)]
gitrev.sh: make it usable during buildkernel/world

buildkernel/world operate with a reduced PATH, so we have to
add the standard dirs where git could be installed.

14 years agogitrev.sh: search harder for the git dir
Simon Schubert [Sun, 16 Aug 2009 10:18:21 +0000 (12:18 +0200)]
gitrev.sh: search harder for the git dir

If gitrev.sh was called from an objdir, it would not be able to find the
git dir and thus fail to determine the version.  Try harder by either
using an argument as source (sub) dir, or using the path of the
gitrev.sh script itself.

14 years agobuildworld: properly sequence quickworld
Simon Schubert [Tue, 18 Aug 2009 21:31:46 +0000 (23:31 +0200)]
buildworld: properly sequence quickworld

We must not run any of build stage in parallel.  The existing .ORDER
only works for the sequence of a full buildworld.  It seems that make is
not ordering any pair in an .ORDER target, but only pairs as written.
Quickworld does not run the intermediate stages between _obj and
_includes, thus allowing make to parallelize these two.

The proper fix might be in make, if we want to change the semantics of
the .ORDER target, but fixing it here doesn't hurt in any case.

14 years agovnconfig: fix misleading error message
Simon Schubert [Sun, 16 Aug 2009 11:25:13 +0000 (13:25 +0200)]
vnconfig: fix misleading error message

14 years agoadd unlinkat(2) system call
Nicolas Thery [Tue, 18 Aug 2009 19:27:32 +0000 (21:27 +0200)]
add unlinkat(2) system call

Also add libc_r wrapper and man page.

14 years agosystat.1: Document pvmmeter display.
Sascha Wildner [Tue, 18 Aug 2009 12:31:19 +0000 (14:31 +0200)]
systat.1: Document pvmmeter display.

Submitted-by: Antoniu Huete Jimenez <ahuete.devel@gmail.com>
14 years agoSync zoneinfo database with tzdata2009l from elsie.
Sascha Wildner [Tue, 18 Aug 2009 11:48:54 +0000 (13:48 +0200)]
Sync zoneinfo database with tzdata2009l from elsie.

africa:         8.22 -> 8.23
australasia:    8.11 -> 8.12

* africa: Egypt starts winter time on August 21.

* australasia: Add comment about the possibility of Samoa observing DST
      in 2009/2010.

14 years agodistrib-dirs: Create /sys only if it doesn't exist.
Sascha Wildner [Sun, 16 Aug 2009 20:59:33 +0000 (22:59 +0200)]
distrib-dirs: Create /sys only if it doesn't exist.

14 years agoinstaller: Fix creation of the /sys symlink.
Sascha Wildner [Sun, 16 Aug 2009 20:58:46 +0000 (22:58 +0200)]
installer: Fix creation of the /sys symlink.

14 years agomount_devfs.8: Update for new options. Add some EXAMPLES.
Sascha Wildner [Sun, 16 Aug 2009 12:58:15 +0000 (14:58 +0200)]
mount_devfs.8: Update for new options. Add some EXAMPLES.

Submitted-by: alexh
14 years agoAMD64 - Fix printf type
Matthew Dillon [Tue, 18 Aug 2009 00:11:47 +0000 (17:11 -0700)]
AMD64 - Fix printf type

14 years agoAMD64 - Move fdisk and nextboot up one level and remove src/sbin/i386.
Matthew Dillon [Tue, 18 Aug 2009 00:07:40 +0000 (17:07 -0700)]
AMD64 - Move fdisk and nextboot up one level and remove src/sbin/i386.

* Move fdisk and nextboot up, remove src/sbin/i386, and conditionalize
  the build to build it for amd64 as well.

Submitted-by: Antonio Huete <tuxillo@quantumachine.net>
14 years agoINSTALLER - Fix a bug with varargs
Antonio Huete [Mon, 17 Aug 2009 22:05:48 +0000 (22:05 +0000)]
INSTALLER - Fix a bug with varargs

In i_log() function, vfprintf() is used twice in a va_start()/va_end()
block.

Submitted-by: Antonio Huete <tuxillo@quantumachine.net>
14 years agoNFS - Fix socket race against nfs_timer.
Matthew Dillon [Mon, 17 Aug 2009 21:46:40 +0000 (14:46 -0700)]
NFS - Fix socket race against nfs_timer.

* Fix a socket race where the nfs_timer can sometimes operate on a
  TCP socket before the socket completes its connection to the target,
  resulting in a panic.

Tracked-down-by: Sepherosa Ziehau <sepherosa@gmail.com>
14 years agoHAMMER Util - Bulk transfer, SIGPIPE, more features.
Matthew Dillon [Mon, 17 Aug 2009 20:14:53 +0000 (13:14 -0700)]
HAMMER Util - Bulk transfer, SIGPIPE, more features.

* Add -B option for initial bulk transfer in a mirror-stream

* The parent process in a mirror-stream and mirror-copy operation
  now ignores SIGPIPE

* Use the smaller of ctime or mtime when calculating the real timestamp
  for a snapshot softlink in a prune operation.

* Sleep an additional 15 seconds before reconnecting a failed connection
  in a mirror-stream operation.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 17 Aug 2009 18:11:04 +0000 (11:11 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER Util - Add new features, fix history retention bug in prune
Matthew Dillon [Mon, 17 Aug 2009 18:05:09 +0000 (11:05 -0700)]
HAMMER Util - Add new features, fix history retention bug in prune

* The prune code was not retaining the fine-grained history between
  the last snapshot and current.

* Add a new PFS config variable called 'prune-min' which may be used
  to set the minimum fine-grained history retention, in seconds.  The
  hammer prune code will not prune inbetween any snapshots that are
  within the fine-grained retention period.

* The mirror-stream directive now automatically loops and reconnects
  if the network connection fails.

* The mirror-stream directive now attempts to break-up a large initial
  bulk transfer into smaller transfers, inserting synchronization points
  so a failure in the middle of the large bulk transfer does not require
  starting from scratch again.

* The show directive (show btree) now takes an optional localization[:objid]
  argument (specified in hex).  If specified the directive will search
  the B-Tree for the key, printing nodes as it goes, and then continue
  with a normal iteration.

14 years agofd - Fix panic due to device_busy
Alex Hornung [Mon, 17 Aug 2009 17:37:53 +0000 (18:37 +0100)]
fd - Fix panic due to device_busy

* Fix panic introduced by 7ba1363dc2de5d52704, caused by a too
  early call to device_busy, before the device is marked as
  attached.

NOTE: This might have yet unknown repercussions on the use of
      floppies.

Suggested-By: Matthew Dillon
14 years agoDEVFS - Remove /usr/sbin/devfsctl when upgrading.
Matthew Dillon [Mon, 17 Aug 2009 15:30:45 +0000 (08:30 -0700)]
DEVFS - Remove /usr/sbin/devfsctl when upgrading.

* devfsctl has moved to /sbin.  Remove the /usr/sbin version.

14 years agopktgen - fix to work with devfs
Alex Hornung [Mon, 17 Aug 2009 09:09:14 +0000 (10:09 +0100)]
pktgen - fix to work with devfs

* Remove usage of dev_ops_add

* Move make_dev from open to MOD_LOAD

* Change dev_ops_remove to dev_ops_remove_all

NOTE: This limits pktgen to only one device, but pktgenctl doesn't
      seem to use more than one anyways, as it defaults to open
      pktg0.

14 years agomount_devfs(8) - Accept another argument as mount from
Alex Hornung [Mon, 17 Aug 2009 08:59:05 +0000 (09:59 +0100)]
mount_devfs(8) - Accept another argument as mount from

* Accept passing of another argument as mount does, but ignore it.
  This way we can accept mount_devfs devfs /mnt, and by extension
  mount -t devfs devfs /mnt

14 years agodevfsctl(8) - move devfsctl to sbin
Alex Hornung [Mon, 17 Aug 2009 07:33:28 +0000 (08:33 +0100)]
devfsctl(8) - move devfsctl to sbin

* move devfsctl from usr/sbin to sbin and link into build.

14 years agoDEVFS - move devfs headers to sys/sys; fix consumers
Alex Hornung [Mon, 17 Aug 2009 07:24:14 +0000 (08:24 +0100)]
DEVFS - move devfs headers to sys/sys; fix consumers

* Move devfs.h and devfs_rules.h from sys/vfs/devfs/ to sys/sys/

* Fix all consumers of the devfs headers to use the new path

14 years agoDEVFS - add link-to-link support to nresolve
Alex Hornung [Mon, 17 Aug 2009 06:52:05 +0000 (07:52 +0100)]
DEVFS - add link-to-link support to nresolve

* Add support for devfs autolinks linking to other devfs autolinks, up
  to a level of 8, to avoid recursion.

14 years agoDEVFS - sync up mount with userland; fix bugs
Alex Hornung [Fri, 14 Aug 2009 16:34:18 +0000 (17:34 +0100)]
DEVFS - sync up mount with userland; fix bugs

* Add support for the userland mount options in kernel and rely
  on them to set the jailed property of the mount point.

* Fix comparison of mount points by changing it to use strcmp instead
  of relying on an always-0 length.

* Allow link rules to be created for links. (* possibly problematic? *)

14 years agodevfsctl - Disable ruletab support; use proper working dirs
Alex Hornung [Fri, 14 Aug 2009 16:31:11 +0000 (17:31 +0100)]
devfsctl - Disable ruletab support; use proper working dirs

* Disable (temporarily) all ruletab support in devfsctl.

* If a configuration file cannot be found, it is searched after in the
  default directory (/etc/devfs) before erroring out.

* When including a file in some other directory, the working directory
  is temporarily changed to that dir, so that further includes work
  as intended. After each include, the working directory is restored
  to the previous one.

* Make sure that all configuration files are owned by root so the
  system is protected from malicious rule files.

14 years agomount_devfs - Complete functionality; integrate rule support
Alex Hornung [Fri, 14 Aug 2009 16:27:29 +0000 (17:27 +0100)]
mount_devfs - Complete functionality; integrate rule support

* add support for -o ruleset=... and -o jail.

* After a successful mount, rules are cleared for that mount point
  and if -o ruleset=foo was specified, the rules in foo are applied
  to the mount point.

* Also do this if a devfs mp is being remounted, don't bother calling
  mount, just do the rule magic.

14 years agoDEVFS - Add support for wildcard link rules
Alex Hornung [Fri, 14 Aug 2009 08:23:57 +0000 (09:23 +0100)]
DEVFS - Add support for wildcard link rules

* Add support for link rules with wildcards like:
  link da0* backup.
  which would result in the following links:
  backup. -> da0
  backup.s1 -> da0s1
  backup.s1a -> da0s1a
  ...

14 years agodevfsctl - Add initial devfs/ruletab support
Alex Hornung [Thu, 13 Aug 2009 18:42:16 +0000 (19:42 +0100)]
devfsctl - Add initial devfs/ruletab support

* Add -t option, yet undocumented, to specify that one wants to use
  the ruletab mode. This mode allows to load either all rules for
  the specified mountpoints (1) in ruletab, just the generic rules (*)
  and for /dev (2), or all the rules specified in the ruletab (3).
  Mode (1) is entered by passing -m with a specific mount point
  that shall not be 'boot' or '*'.
  Mode (2) is entered by passing '-m boot'
  Mode (3) is entered by passing '-m *'

14 years agoDEVFS - don't apply generic rules to jailed mountpoints
Alex Hornung [Thu, 13 Aug 2009 13:56:50 +0000 (14:56 +0100)]
DEVFS - don't apply generic rules to jailed mountpoints

* Only apply rules intended for jails to jailed mountpoints, not
  any rule, as before.

14 years agodevfsctl - Bring in sync with kernel rule changes
Alex Hornung [Thu, 13 Aug 2009 11:28:31 +0000 (12:28 +0100)]
devfsctl - Bring in sync with kernel rule changes

* Sync up with kernel by changing to use devfs_rule_ioctl and separating
  rule_cmd from rule_type.

14 years agoDEVFS - Separate ioctl struct from in-kernel struct
Alex Hornung [Thu, 13 Aug 2009 11:06:00 +0000 (12:06 +0100)]
DEVFS - Separate ioctl struct from in-kernel struct

* Separate out an ioctl structure from the devfs_rule struct called
  devfs_rule_ioctl.
  This avoids unnecessary complications like copyin, and it avoids
  problems caused by userland reporting wrong sizes.

* Also separate the rule_type from the rule_cmd into different fields
  in both structs.

Suggested-By: Simon "corecode" Schubert
14 years agoAHCI - Chip reset, Inquiry alignment, ATAPI adjustments, Intel attach
Matthew Dillon [Mon, 17 Aug 2009 06:36:28 +0000 (23:36 -0700)]
AHCI - Chip reset, Inquiry alignment, ATAPI adjustments, Intel attach

* When resetting the chip set AE before issuing HR and leave AE set
  when issuing HR.  After reset is complete, set AE again.

* Do Intel hocus pocus at config register 0x92 for Intel chipsets.

* The only PIO request is basically the initial INQUIRY during probe.
  Make sure the structure does not cross a page boundary so only one
  DRQ buffer is needed.  Very old AHCI chipsets may need this.

* Make minor flags adjustments for PIO setup commands during the
  initial probe.

* Reduce verbosity slightly.

14 years agoKernel - Use built-in suffix handling for "hw.physmem" kenv.
Matthew Dillon [Mon, 17 Aug 2009 06:34:30 +0000 (23:34 -0700)]
Kernel - Use built-in suffix handling for "hw.physmem" kenv.

* Remove the roll-your-own code and use the suffix handling that is
  now built into kgetenv_quad().

14 years agoDEVFS - Call disk_setdiskinfo() for SCSI/ATAPI CDs.
Matthew Dillon [Mon, 17 Aug 2009 06:31:23 +0000 (23:31 -0700)]
DEVFS - Call disk_setdiskinfo() for SCSI/ATAPI CDs.

* When a CD drive is registered we need to call disk_setdiskinfo()
  after the initial probe whether a CD is in the drive or not
  before the disk subsystem will allow userland to open the device.

14 years agoAMD64 - Fix bogus signal interruption
Matthew Dillon [Mon, 17 Aug 2009 04:03:08 +0000 (21:03 -0700)]
AMD64 - Fix bogus signal interruption

* The TF_XFLAGS field in the trap frame was not getting cleared on trap and
  syscall entry.  This field can cause a mailbox signal to be flagged in
  the signal frame which in turn can cause the next blockable system call
  to return EINTR.

  This fixes the last issue with mount_mfs.

* Cast the signal function to intptr_t rather then int.

14 years agoMFS - Clean up debug code, remove stuff no longer needed for DEVFS
Matthew Dillon [Mon, 17 Aug 2009 04:00:20 +0000 (21:00 -0700)]
MFS - Clean up debug code, remove stuff no longer needed for DEVFS

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 17 Aug 2009 01:38:03 +0000 (18:38 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoMFS - Fix bug in SIGUSR1 signaling.
Matthew Dillon [Mon, 17 Aug 2009 01:37:21 +0000 (18:37 -0700)]
MFS - Fix bug in SIGUSR1 signaling.

* The signaling code was using sigblock() improperly, not only passing
  the wrong mask but also trying to restore the original mask using
  sigblock() instead of sigsetmask().

14 years agousbd - Do not start moused by default when a usb mouse is connected
Matthew Dillon [Sun, 16 Aug 2009 23:31:27 +0000 (16:31 -0700)]
usbd - Do not start moused by default when a usb mouse is connected

* Because it interferes with X.  Better for X to just attach directly
  to the usb mouse.

14 years agoHAMMER - Add vfs.hammer.yield_check, yield on cpu intensive loops
Matthew Dillon [Sun, 16 Aug 2009 23:18:11 +0000 (16:18 -0700)]
HAMMER - Add vfs.hammer.yield_check, yield on cpu intensive loops

* When running in the kernel HAMMER can wind up cpu-bound.  This code
  allows it to yield to other processes during these periods.  This is
  a bit of a hack and may undergo further development.

* Default check for yield every 16 B-tree iterations.

14 years agoKernel - Instrumentation for experimentation, interrupt threads
Matthew Dillon [Sun, 16 Aug 2009 23:15:32 +0000 (16:15 -0700)]
Kernel - Instrumentation for experimentation, interrupt threads

* Add kern.intr_migrate (default off).  If set to 1 interrupt threads
  will chase the big giant lock around the cpu space instead of waiting
  for another cpu to release it.

* Add lwkt.bgl_yield, default 10 (uS).  Set the polling delay when
  yielding the BGL to another thread.