dragonfly.git
12 years agoRemove old file.
Simon Schubert [Wed, 9 Jan 2008 00:09:10 +0000 (00:09 +0000)]
Remove old file.

12 years agoCompile the kernel and modules with C99 warnings, not C90 (-ansi).
Simon Schubert [Wed, 9 Jan 2008 00:07:57 +0000 (00:07 +0000)]
Compile the kernel and modules with C99 warnings, not C90 (-ansi).

This does not remove or add warnings, but will allow for new features,
especially // C++ commends, which are used by some 3rd party sources.

12 years agoRemove trailing whitespace.
Sascha Wildner [Tue, 8 Jan 2008 20:30:57 +0000 (20:30 +0000)]
Remove trailing whitespace.

12 years agoBrush up the example a bit.
Sascha Wildner [Tue, 8 Jan 2008 17:45:43 +0000 (17:45 +0000)]
Brush up the example a bit.

12 years agoUse the new kldstat -q/-m options instead of "| grep"
Matthias Schmidt [Tue, 8 Jan 2008 15:30:34 +0000 (15:30 +0000)]
Use the new kldstat -q/-m options instead of "| grep"

12 years agoSync with FreeBSD. This bings us the -m option to look for a specific
Matthias Schmidt [Tue, 8 Jan 2008 15:27:57 +0000 (15:27 +0000)]
Sync with FreeBSD.  This bings us the -m option to look for a specific
module and -q which checks if a module is loaded and set the return
value accordingly.

12 years agoRemove reference to the FreeBSD developers handbook. We have a chapter
Matthias Schmidt [Tue, 8 Jan 2008 14:20:46 +0000 (14:20 +0000)]
Remove reference to the FreeBSD developers handbook.  We have a chapter
about kernel debugging in our own handbook now.  The reference to the FreeBSD
chapter is kept as link in the mentioned chapter.

12 years agoFix id of the 945GME chip.
Hasso Tepper [Tue, 8 Jan 2008 04:25:07 +0000 (04:25 +0000)]
Fix id of the 945GME chip.

12 years agoThis one is a very accessible intro to err.. nearly everything. And I had some
Nuno Antunes [Tue, 8 Jan 2008 00:43:23 +0000 (00:43 +0000)]
This one is a very accessible intro to err.. nearly everything. And I had some
loud laughs while reading it too.

12 years agoAdd _rtld_functrace support.
Simon Schubert [Tue, 8 Jan 2008 00:02:04 +0000 (00:02 +0000)]
Add _rtld_functrace support.

Joint-work-with:  aggelos@

12 years agofill_kinfo_proc() may be asked to load information on a zombied process,
Matthew Dillon [Mon, 7 Jan 2008 23:41:55 +0000 (23:41 +0000)]
fill_kinfo_proc() may be asked to load information on a zombied process,
deal with NULL pointers in the proc structure.

Reported-by: Peter Avalos <pavalos@theshell.com>
12 years agoSync the passive fingerprinting database with OpenBSD to get support for
Matthias Schmidt [Mon, 7 Jan 2008 14:46:46 +0000 (14:46 +0000)]
Sync the passive fingerprinting database with OpenBSD to get support for
the latest OS.

12 years agoAdd pam(3) support for cron(8). cron uses pam to check if the user's account
Matthias Schmidt [Mon, 7 Jan 2008 14:11:23 +0000 (14:11 +0000)]
Add pam(3) support for cron(8).  cron uses pam to check if the user's account
is expired, locked or whatever.  If this is true cron skips the entries of
the users crontab.  Skip this for system tasks.

Obtained-from:  FreeBSD

12 years agoIf -m is specified, a newfs(8) command is printed that can be used to
Matthias Schmidt [Mon, 7 Jan 2008 12:07:06 +0000 (12:07 +0000)]
If -m is specified, a newfs(8) command is printed that can be used to
generate a new file system with equivalent settings.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue868
Submitted-by: Eric <ejc@thousandplaces.org>
Obtained-from: FreeBSD

12 years agoFix brain-o introduced in my previous commit.
Sascha Wildner [Mon, 7 Jan 2008 09:42:07 +0000 (09:42 +0000)]
Fix brain-o introduced in my previous commit.

Reported-by: Jason Smethers <jason@smethers.net>
12 years agoDon't segfault when printing unknown signals.
Simon Schubert [Mon, 7 Jan 2008 01:35:43 +0000 (01:35 +0000)]
Don't segfault when printing unknown signals.

12 years agoPull up CVS idents from FreeBSD to match our current version.
Simon Schubert [Mon, 7 Jan 2008 01:34:58 +0000 (01:34 +0000)]
Pull up CVS idents from FreeBSD to match our current version.

12 years agoAdd small hack to allow both agp and drm to attach to i810+ devices.
Simon Schubert [Mon, 7 Jan 2008 01:27:17 +0000 (01:27 +0000)]
Add small hack to allow both agp and drm to attach to i810+ devices.

Obtained-from:  FreeBSD (6.x)

12 years agoUpdate from FreeBSD:
Simon Schubert [Mon, 7 Jan 2008 01:25:29 +0000 (01:25 +0000)]
Update from FreeBSD:

Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture.  Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.

Obtained-from:  FreeBSD

12 years agoRename RB_STATIC_* to RB_*_STATIC to match up with FreeBSD.
Simon Schubert [Mon, 7 Jan 2008 01:22:30 +0000 (01:22 +0000)]
Rename RB_STATIC_* to RB_*_STATIC to match up with FreeBSD.

12 years agoLet's try and start a tradition here. This is book is now a classic.
Aggelos Economopoulos [Mon, 7 Jan 2008 01:01:29 +0000 (01:01 +0000)]
Let's try and start a tradition here. This is book is now a classic.
Hopefully some future committer will tease us with an excerpt from
an unknown book we'll all want to read. Yeah, right.

12 years agoAdd sdpd(8) (Bluetooth Service Discovery Protocol daemon) and sdpquery(1)
Hasso Tepper [Sun, 6 Jan 2008 21:51:30 +0000 (21:51 +0000)]
Add sdpd(8) (Bluetooth Service Discovery Protocol daemon) and sdpquery(1)
(SDP query utility). Also add btconfig rc script in progress.

Obtained-from: NetBSD

12 years agoRemove bogus checks after kmalloc(M_WAITOK) which never returns NULL.
Sascha Wildner [Sun, 6 Jan 2008 16:55:53 +0000 (16:55 +0000)]
Remove bogus checks after kmalloc(M_WAITOK) which never returns NULL.

Reviewed-by: hasso
12 years agoRemoved non-existent entry in .PATH:.
Nicolas Thery [Sun, 6 Jan 2008 16:15:29 +0000 (16:15 +0000)]
Removed non-existent entry in .PATH:.

12 years agoAccording to Ralink Linux driver, tx/encryption intr processing should be
Sepherosa Ziehau [Sun, 6 Jan 2008 03:03:17 +0000 (03:03 +0000)]
According to Ralink Linux driver, tx/encryption intr processing should be
called when rx intr comes.

12 years agoReplace MALLOC()/bzero() with MALLOC(M_ZERO).
Sascha Wildner [Sun, 6 Jan 2008 01:51:55 +0000 (01:51 +0000)]
Replace MALLOC()/bzero() with MALLOC(M_ZERO).

12 years agoRemove some dead code.
Sascha Wildner [Sun, 6 Jan 2008 01:29:00 +0000 (01:29 +0000)]
Remove some dead code.

12 years agoSync trm manual with FreeBSD.
Peter Avalos [Sat, 5 Jan 2008 22:46:35 +0000 (22:46 +0000)]
Sync trm manual with FreeBSD.

12 years agoSync with FreeBSD.
Peter Avalos [Sat, 5 Jan 2008 22:44:08 +0000 (22:44 +0000)]
Sync with FreeBSD.

12 years agoSync with FreeBSD:
Peter Avalos [Sat, 5 Jan 2008 22:24:08 +0000 (22:24 +0000)]
Sync with FreeBSD:

CAM_NEW_TRAN_CODE fixes.

Remove unneeded includes and add missing ones.

Use BUS_PROBE_DEFAULT in preference to 0.

Call trm_Interrupt() in trm_poll(). This fixes the lock at reboot time some
people reported in FreeBSD.

Use bus_alloc_resource_any(9).

Use one bus_dma_tag_t for all pSRB instead of creating one for each.
Free what is allocated for pSRBs at unload time or if something bad happens.

Do not test if pDCB is not NULL, we dereference it before anyway, and it
should not happen. Add a KASSERT instead.

Mark trm as depending on cam.

Use PCIR_BAR(x) instead of PCIR_MAPS.

Remove two useless bzero() calls.

Use cam_calc_geometry.

Indentation/style fixes.

Add support for Tekram DC395U2W cards.

Obtained-from: FreeBSD

12 years agokmalloc(M_WAITOK) never returns NULL.
Nicolas Thery [Sat, 5 Jan 2008 16:56:17 +0000 (16:56 +0000)]
kmalloc(M_WAITOK) never returns NULL.

12 years agoFor kmalloc(), MALLOC() and contigmalloc(), use M_ZERO instead of
Sascha Wildner [Sat, 5 Jan 2008 14:02:41 +0000 (14:02 +0000)]
For kmalloc(), MALLOC() and contigmalloc(), use M_ZERO instead of
explicitly bzero()ing.

Reviewed-by: sephe
12 years agoCorrect errno value to comply with SUSv3.
Simon Schubert [Sat, 5 Jan 2008 13:38:08 +0000 (13:38 +0000)]
Correct errno value to comply with SUSv3.

12 years agoAdd support for newer CPU models.
Simon Schubert [Sat, 5 Jan 2008 13:37:15 +0000 (13:37 +0000)]
Add support for newer CPU models.

Obtained-from:  FreeBSD

12 years agoDefine _KERNEL_STRUCTURES when obtaining the list of include files.
Simon Schubert [Sat, 5 Jan 2008 13:36:37 +0000 (13:36 +0000)]
Define _KERNEL_STRUCTURES when obtaining the list of include files.

12 years agoCall selwakeup() from an MP-protected taskqueue.
Simon Schubert [Sat, 5 Jan 2008 13:34:22 +0000 (13:34 +0000)]
Call selwakeup() from an MP-protected taskqueue.

Before, we would call selwakeup() from interrupt context.  This
was working as long kern.intr_mpsafe == 0.  selwakeup() however needs
the MP lock held, so we can't call it directly from the interrupt
when running with kern.intr_mpsafe=1.

Instead, perform the wakeup from a "bottom half" taskqueue SWI to make the
sound devices intr_mpsafe, as they claim to be.

12 years agoDon't let DS_BUSY buses block attachment of other devices.
Simon Schubert [Sat, 5 Jan 2008 13:30:33 +0000 (13:30 +0000)]
Don't let DS_BUSY buses block attachment of other devices.

DS_BUSY implies that the device has been in state DS_ATTACHED
before, so we need include DS_BUSY buses in the search as well.

Joint-work-with:  matthias@

12 years agoExport bootverbose as sysctl debug.bootverbose.
Simon Schubert [Sat, 5 Jan 2008 13:23:48 +0000 (13:23 +0000)]
Export bootverbose as sysctl debug.bootverbose.

12 years agoCommit pkg_radd(1) on behalf of corecode@. pkg_radd is a wrapper for
Matthias Schmidt [Sat, 5 Jan 2008 10:14:26 +0000 (10:14 +0000)]
Commit pkg_radd(1) on behalf of corecode@.  pkg_radd is a wrapper for
pkg_add(1) to install binary packages.  This allows users to install binary
packages out-of-the-box without fetching the pkgsrc(7) tree or without
looking at any site hosting binary packages.

  # pkg_radd -v host
  [...]
  extract: Package name is host-20040812
  extract: CWD to /usr/pkg
  [...]
  Attempting to record package into /var/db/pkg/host-20040812.
  Package host-20040812 registered in /var/db/pkg/host-20040812

The mentioned /etc/settings.conf will follow in a later commit.  pkg_radd
will work fine without that file.

Submitted-by: corecode@
mdoc-ok-by: swildner@

12 years agoBuild aic(4) as a kernel module.
Peter Avalos [Sat, 5 Jan 2008 08:16:04 +0000 (08:16 +0000)]
Build aic(4) as a kernel module.

12 years agoSync with FreeBSD:
Peter Avalos [Sat, 5 Jan 2008 07:27:09 +0000 (07:27 +0000)]
Sync with FreeBSD:

Eliminate support for oldcard by removing the compat shims.

Convert callers to the new bus_alloc_resource_any(9) API.

Initialize variable to fix possible warning.

Use cam_calc_geometry().

Be consistent about "static" functions.

Support for LG GM82C700, an AIC6360 clone.

Add PnP IDs for AHA-1530 and AHA-1520 cards.

Enable 10MHz (fast SCSI) operation on boards that support it.

Bounds check sync periods and offsets passed in from the transport layer.

Tell the user which resource allocation failed (for the ISA probe) if we
weren't able to allocate an IRQ, DRQ or I/O port.

Remove unneeded includes.

Obtained-from: FreeBSD

12 years ago.Pp before .Sh is not needed.
Sascha Wildner [Fri, 4 Jan 2008 18:17:49 +0000 (18:17 +0000)]
.Pp before .Sh is not needed.

12 years agoRenamed kern.ps_showallprocs to security.ps_showallprocs
Matthias Schmidt [Fri, 4 Jan 2008 12:31:45 +0000 (12:31 +0000)]
Renamed kern.ps_showallprocs to security.ps_showallprocs

12 years agoMove the following entries from kern to security
Matthias Schmidt [Fri, 4 Jan 2008 12:16:19 +0000 (12:16 +0000)]
Move the following entries from kern to security

- kern.ps_showallprocs
- kern.ps_showallthreads
- kern.unprivileged_read_msgbuf
- kern.hardlink_check_uid
- kern.hardlink_check_gid

This is only a cosmetic change helping users to find the right sysctls
more easily.  And it could help if we want to add more security related
function (eg MAC framework etc).

While here add missing description for three of them.

12 years agoAdd btconfig(8) - the utility used to configure Bluetooth devices.
Hasso Tepper [Fri, 4 Jan 2008 09:54:22 +0000 (09:54 +0000)]
Add btconfig(8) - the utility used to configure Bluetooth devices.

Obtained-from: NetBSD

12 years agoRemove trailing space.
Sascha Wildner [Thu, 3 Jan 2008 18:18:37 +0000 (18:18 +0000)]
Remove trailing space.

12 years agoSort entries in /etc and bump .Dd for today's change.
Sascha Wildner [Thu, 3 Jan 2008 18:17:08 +0000 (18:17 +0000)]
Sort entries in /etc and bump .Dd for today's change.

12 years agoDon't use leading 0 in .Dd and begin sentence on a new line.
Sascha Wildner [Thu, 3 Jan 2008 18:16:17 +0000 (18:16 +0000)]
Don't use leading 0 in .Dd and begin sentence on a new line.

12 years agoMajor update to pkg_search(1)
Matthias Schmidt [Thu, 3 Jan 2008 16:42:43 +0000 (16:42 +0000)]
Major update to pkg_search(1)

- Print verbose information about packages when operating with the
  pkg_summary(5) file
- pkg_search displayed an incorrect field instead of the URL field.
- Don't download a pkg_summary(5) file if an INDEX file is available
- Honor -k when searching with -v (index file only)
- style(9) changes
- Enhanced the man page, add some comments and change my email address.
- We're on DragonFly so remove the check for DragonFly.

12 years agoAdd bluetooth(3) and sdp(3) libraries. Adjust indenting in progress.
Hasso Tepper [Thu, 3 Jan 2008 13:59:03 +0000 (13:59 +0000)]
Add bluetooth(3) and sdp(3) libraries. Adjust indenting in progress.

Reminded-by: swildner@
12 years agoAdd /etc/bluetooth/ with common files.
Hasso Tepper [Thu, 3 Jan 2008 13:35:21 +0000 (13:35 +0000)]
Add /etc/bluetooth/ with common files.

12 years agoo Mention pam_nologin(8) in nologin(5). Only adapt the changes from FreeBSD
Matthias Schmidt [Thu, 3 Jan 2008 12:47:56 +0000 (12:47 +0000)]
o Mention pam_nologin(8) in nologin(5).  Only adapt the changes from FreeBSD
  related to us.
o Remove the 3rd clause of Berkeley license.

Reminded-by: swildner@
Obtained-From: FreeBSD

12 years agoAdd bluetooth userspace libraries - bluetooth(3) and sdp(3).
Hasso Tepper [Thu, 3 Jan 2008 11:47:53 +0000 (11:47 +0000)]
Add bluetooth userspace libraries - bluetooth(3) and sdp(3).

Obtained-from: NetBSD

12 years agoUse NULL for pointers
Sepherosa Ziehau [Thu, 3 Jan 2008 11:41:05 +0000 (11:41 +0000)]
Use NULL for pointers

12 years agoHAMMER 15/many - user utility infrastructure, refactor alists, misc
Matthew Dillon [Thu, 3 Jan 2008 06:48:49 +0000 (06:48 +0000)]
HAMMER 15/many - user utility infrastructure, refactor alists, misc

* Abstract out userland access to HAMMER's on-disk structures in
  preparation for more userland work.

* Clean up compiler warnings.

* Refactor the A-list recursion API.  Use another bit code (10) to indicate
  the all-allocated & initialized state, verses an all-allocated &
  uninitialized state.

  This allows an all-empty flag to propogate up the chain properly which
  in turn allows us to avoid flushing out dirty backing store for freed
  disk blocks and will eventually lead to freeing typed buffers back to
  the cluster's master a-list.

* Fix an edge case in the B-Tree code related to running out of space
  during an insertion search.  If the insertion search ran out of space
  at a cluster boundary the spike code asserted because the parent B-Tree
  node wasn't in the same cluster as the node it thought it had to spike.
  (The root B-Tree node of a cluster cannot be spiked).

* Use a second cache pointer in the in-memory structure for directory
  inodes.  The second cache will be used for inode lookups relative to
  the directory and will (eventually) greatly reduce the B-Tree search
  overhead required to stat directory elements.

12 years agoAdd definitions for LONG_BIT and WORD_BIT.
Sascha Wildner [Wed, 2 Jan 2008 23:06:44 +0000 (23:06 +0000)]
Add definitions for LONG_BIT and WORD_BIT.

12 years agoBack out the last commit, it asserts in the getblk code due to the vnode
Matthew Dillon [Wed, 2 Jan 2008 22:42:37 +0000 (22:42 +0000)]
Back out the last commit, it asserts in the getblk code due to the vnode
having zero references.  I'll have to find another solution.

12 years agoUFS vnodes must have VM objects before they can be truncated. This is
Matthew Dillon [Wed, 2 Jan 2008 20:15:48 +0000 (20:15 +0000)]
UFS vnodes must have VM objects before they can be truncated.  This is
normally guarenteed when the vnode is instantiated but there is a degenerate
case in ufs_inactive() that wasn't handled.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
12 years agoPay attention to the timeout value passed down by the upper layer. This
Hasso Tepper [Wed, 2 Jan 2008 19:29:59 +0000 (19:29 +0000)]
Pay attention to the timeout value passed down by the upper layer. This
fix makes USB CD/DVD writers work.

Obtained-from: NetBSD via FreeBSD

12 years agoAdd pam_nologin(8) to the tree. pam_nologin verifies
Matthias Schmidt [Wed, 2 Jan 2008 17:41:30 +0000 (17:41 +0000)]
Add pam_nologin(8) to the tree.  pam_nologin verifies
whether logins are administratively disabled via nologin(5).  It returns
success if the user's login class has an "ignorenologin" capability spec-
ified in login.conf(5) or the nologin(5) file does not exist.

Obtained-From: FreeBSD

12 years agoAdd more sanity checks in bpf_validate():
Sepherosa Ziehau [Wed, 2 Jan 2008 12:30:34 +0000 (12:30 +0000)]
Add more sanity checks in bpf_validate():
- BPF programs with no instructions or with more than BPF_MAXINSNS
  instructions.
- BPF_STX and BPF_LDX|BPF_MEM instructions that have out-of-range offsets
  (which could be made to fetch or store into arbitrary memory locations).
- BPF_DIV instructions with a constant 0 divisor (that's a check also done
  at run time).

Submitted-by: Guy Harris <guy@alum.mit.edu>
Obtained-from:
    OpenBSD (with additional comments and modification from the submitter)

12 years agoAdd missing ';'.
Hasso Tepper [Wed, 2 Jan 2008 11:41:52 +0000 (11:41 +0000)]
Add missing ';'.

12 years agoMake the cast (zero extension) consistent between non-indexed loads
Sepherosa Ziehau [Wed, 2 Jan 2008 11:22:03 +0000 (11:22 +0000)]
Make the cast (zero extension) consistent between non-indexed loads
and indexed loads.

Submitted-by: Guy Harris <guy@alum.mit.edu>
12 years agoMake NO_GETMAXLUN quirk really do something useful.
Hasso Tepper [Wed, 2 Jan 2008 10:45:31 +0000 (10:45 +0000)]
Make NO_GETMAXLUN quirk really do something useful.

Obtained-from: FreeBSD

12 years agoWhen attached to a high-speed device, report a more appropriate
Hasso Tepper [Wed, 2 Jan 2008 10:43:28 +0000 (10:43 +0000)]
When attached to a high-speed device, report a more appropriate
base transfer speed to CAM. The actual value used (40MB/s) is fairly
arbitrary, but assumes the same 33% overhead as was implied by the
1MB/s figure we used for USB1 devices.

Obtained-from: FreeBSD

12 years agoPass all ATAPI commands through. Fixes detecting capabilities of DVD
Hasso Tepper [Wed, 2 Jan 2008 10:31:53 +0000 (10:31 +0000)]
Pass all ATAPI commands through. Fixes detecting capabilities of DVD
writers.

Obtained-from: FreeBSD with modifications.

12 years agoUse .Bx 386 for 386BSD.
Sascha Wildner [Tue, 1 Jan 2008 23:19:46 +0000 (23:19 +0000)]
Use .Bx 386 for 386BSD.

12 years agoMention /etc/firmware for firmware(9) image files.
Matthias Schmidt [Tue, 1 Jan 2008 18:02:51 +0000 (18:02 +0000)]
Mention /etc/firmware for firmware(9) image files.

12 years agoUpdate to get entries for the Sun Grid Engine and iSCSI.
Matthias Schmidt [Tue, 1 Jan 2008 17:28:20 +0000 (17:28 +0000)]
Update to get entries for the Sun Grid Engine and iSCSI.

Obtained-From: FreeBSD

12 years agoo Add missing dot (.)
Matthias Schmidt [Tue, 1 Jan 2008 17:22:02 +0000 (17:22 +0000)]
o Add missing dot (.)
o Add /usr/pkg/etc to the list of important directories

12 years agoUpdate kdump(1) to print more human readable information.
Matthias Schmidt [Tue, 1 Jan 2008 14:09:02 +0000 (14:09 +0000)]
Update kdump(1) to print more human readable information.

This shows the difference between the old output and the new one:

-73540 telnet   CALL  mmap(0,0xb80,0x3,0x1000,0xffffffff,0,0,0)
+73540 telnet   CALL  mmap(0,0xb80,PROT_READ|PROT_WRITE,MAP_ANON,0xffffffff,0,0,0)
-73540 telnet   CALL  sigprocmask(0x1,0x2806f97c,0xbfbff2c8)
+73540 telnet   CALL  sigprocmask(SIG_BLOCK,0x2806f97c,0xbfbff2c8)
-73540 telnet   CALL  socket(0x1c,0x1,0x6)
+73540 telnet   CALL  socket(PF_INET6,SOCK_STREAM,0x6)

Obtained-from: FreeBSD

12 years agoEnclose O_ROOTCRED in _KERNEL_STRUCTURES. This is needed for the upcoming
Matthias Schmidt [Tue, 1 Jan 2008 14:01:36 +0000 (14:01 +0000)]
Enclose O_ROOTCRED in _KERNEL_STRUCTURES.  This is needed for the upcoming
kdump(1) work.

12 years agoAdd PCI IDs for ICH9.
Sascha Wildner [Tue, 1 Jan 2008 12:16:40 +0000 (12:16 +0000)]
Add PCI IDs for ICH9.

Taken-from: FreeBSD

12 years agoHAMMER 14/many - historical access cleanup, itimes, bug fixes.
Matthew Dillon [Tue, 1 Jan 2008 01:00:03 +0000 (01:00 +0000)]
HAMMER 14/many - historical access cleanup, itimes, bug fixes.

With this commit most historical accesses work and I can go through at least
two cycles of cpdup / rm -rf without crashing.

* Fix a bug in the B-Tree code related to searches on historical records.
  These records are differentiated by key.create_tid but unlike the rest
  of the key the matching algorithm has to be somewhat more sophisticated.
  e.g. A search as of time 10 needs to find a record with a create_tid of 5.

  To make this work properly we use a trick when we generate the separator
  when splitting a leaf. see hammer_btree.c / hammer_make_separator().

* Recycle inodes a link count of 0 immediately.

* Optimization: Do not flush backing store to disk on reclaim.

* Add a per-inode read-only flag.  Mark all historical inodes as read-only

* Implement read-only semantics in the vnops and assert attempts to modify
  inodes marked read-only.

* Properly record the last transaction id for use when synchronizing
  inodes to the platter.  There were a few cases when late synchronizations
  were using the wrong transaction id, breaking user expectations when
  accessing historical data after a sync.

* Update the itimes (atime and mtime). These are non-historical updates by
  default (meaning we just overwrite the latest inode record instead of
  deleting it and inserting a new one).  A future mount option will allow
  these updates to operate historically (the coding is trivial)... didn't
  you always want to know the last time a file was accessed prior to a
  particular date?  Think about it...

* Fix an inode memory leak.  The inode in-memory structure must be freed
  on last reference.  There were cases where it was being left in the
  HAMMER cache.

* Optimization: Reduce vnode scan overhead during 'sync' by improving
  on the inode flags which indicate that some sort of sync is required.

* Optimization: Don't flush inodes when their link count drops by 1, try
  to only flush them when their link drops to 0.

* Fix a couple of potential deadlocks.

* Fix a case in the vnops code where an inode was not being properly flagged
  as being dirty.

12 years agoAdd the 'hammer' utility. This is going to be a catch-all for various
Matthew Dillon [Tue, 1 Jan 2008 00:57:57 +0000 (00:57 +0000)]
Add the 'hammer' utility.  This is going to be a catch-all for various
hammer functions.  At the moment it is just a skeleton.

hammer now - return timestamp suitable for historical access via
  [path]@@<timestamp>

12 years agoAdd 2008 to our copyrights. Happy new year!
Sascha Wildner [Mon, 31 Dec 2007 23:53:32 +0000 (23:53 +0000)]
Add 2008 to our copyrights. Happy new year!

12 years agoSync zoneinfo database with tzdata2007k from elsie.
Sascha Wildner [Mon, 31 Dec 2007 17:26:20 +0000 (17:26 +0000)]
Sync zoneinfo database with tzdata2007k from elsie.

backward:       8.3  -> 8.4
europe:         8.11 -> 8.12
southamerica:   8.13 -> 8.15
zone.tab:       8.12 -> 8.13

From Paul Eggert's comments:

* Changes to the "southamerica" file (combinining material from
  Jesper Norgaard Welen and Paul Eggert) to reflect Argentina's
  readoption of daylight saving time

* Move Atlantic/Jan_Mayen to the 'backward' file
  (thanks to Jonas Melian for this).

12 years agoHAMMER 13B/many - addendum to 13.
Matthew Dillon [Mon, 31 Dec 2007 05:44:33 +0000 (05:44 +0000)]
HAMMER 13B/many - addendum to 13.

* Fix ref count bug w/ hammer_volume.

12 years agoHAMMER 13/many - Stabilization commit
Matthew Dillon [Mon, 31 Dec 2007 05:33:12 +0000 (05:33 +0000)]
HAMMER 13/many - Stabilization commit

* Clean up the in-memory record API.

* Add B-Tree boundary assertions and B-Tree debugging code.

* Delay freeing bits in the allocation bitmaps for B-Tree nodes and
  clusters until the last reference to the in-memory structure goes away.
  This avoids premature reallocation.

* Fix a bug in btree_split_leaf() - the cursor was not being properly
  adjusted in a particular boundary case.

* Fix a recursive lock bug on a buffer cache buffer in hammer_io.c

* Do not allow a non-empty directory to be removed.

* Synthesize directory entries for "." and "..".  Adjust the
  hammer_directory_namekey() procedure to reserve key-space for the
  synthesized entries.

* Fix memory leaks related to the hammer_node and hammer_record structures.

* Finish writing the rename code.

12 years ago- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
Sepherosa Ziehau [Mon, 31 Dec 2007 04:58:54 +0000 (04:58 +0000)]
- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
  ifnet.if_addrhead
- Use above function in if_detach() and free link ifaddr manually, add some
  assertion there to make sure ifnet.if_addrhead is in sane state

Submitted-by: pavalos@
Obtained-from: FreeBSD (w/ modification)

For tap(4)
- Use if_purgeaddrs_nolink() to clean up tap's if_addrhead
- Cleaning up ifaddrs has nothing to do with current tap's mode (vmnet/tap)
- In non-vmnet mode, clear IFF_RUNNING if_flags when a tap is brought down

For tun(4)
- Use if_purgeaddrs_nolink() to clean up tun's if_addrhead
- Cleaning up ifaddrs has nothing to do with IFF_RUNNING
- in_control() is clever enough to set the RTF_HOST flags for tun, so tun
  does not need to record that dst addr has been set.  Since net/tun/if_tunvar.h
  was exposed to /usr/include "accidentally", instead of nuking TUN_DSTADDR,
  I just mark it as "unused" in comment.

12 years agoKernel part of bluetooth stack ported by Dmitry Komissaroff. Very much work
Hasso Tepper [Sun, 30 Dec 2007 20:02:57 +0000 (20:02 +0000)]
Kernel part of bluetooth stack ported by Dmitry Komissaroff. Very much work
in progress.

Obtained-from: NetBSD via OpenBSD

12 years agoMake DDB optional in vkernels.
Sascha Wildner [Sun, 30 Dec 2007 16:15:05 +0000 (16:15 +0000)]
Make DDB optional in vkernels.

Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
12 years agoRemove 3rd clause of Berkely copyright, per letter. Don't rename 4. to 3.
Matthias Schmidt [Sun, 30 Dec 2007 13:44:33 +0000 (13:44 +0000)]
Remove 3rd clause of Berkely copyright, per letter.  Don't rename 4. to 3.
to avoid diff mismatch against FreeBSD.

12 years agoBring in some fixes from FreeBSD.
Sascha Wildner [Sun, 30 Dec 2007 11:56:54 +0000 (11:56 +0000)]
Bring in some fixes from FreeBSD.

12 years agoHAMMER 12/many - buffer cache sync, buffer cache interactions, misc fixes.
Matthew Dillon [Sun, 30 Dec 2007 08:49:20 +0000 (08:49 +0000)]
HAMMER 12/many - buffer cache sync, buffer cache interactions, misc fixes.

As of this commit all vnops work, the filesystem remains consistent across
umount/remount, and the 'cpdup / /mnt/root' test succeeds.  There is still
a ton of work to do but this is a major milestone.

* Get sync and umount working properly.  Properly sync out in-memory records
  and inode updates, and properly release buffer cache buffers so the
  kernel can throw them away.

* Modifications to buffers backed by the buffer cache ensure that any
  asynchronous writes complete to avoid a modify-write race.

* Fix miscellanious reference counting bugs.

* Fix two insertion bugs for internal B-Tree nodes that were causing the
  code to blow up.

12 years agoHAMMER 12/many - add VOPs for symlinks, device, and fifo support.
Matthew Dillon [Sun, 30 Dec 2007 00:47:22 +0000 (00:47 +0000)]
HAMMER 12/many - add VOPs for symlinks, device, and fifo support.

* Add some missing VOP bits.  Add a fixed attribute record type and store
  the symlink path as fixed attribute record #1.

* Adjust hammer_inode_data to add missing major and minor device fields.

* Add support for adding generic records and special case deletion of
  an object's entire set of records.

* Fix a minor bug that was causing the root cluster to be improperly kfree()'d.

12 years agoRemove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()
Matthias Schmidt [Sat, 29 Dec 2007 22:55:29 +0000 (22:55 +0000)]
Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()
that has been here for a long time.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue900>
Submitted-by: Frank W. Josellis <frank@dynamical-systems.org>
Obtained-from: FreeBSD

12 years agoDon't show in netstat(1) output without the -a switch TCP socket in LISTEN
Hasso Tepper [Sat, 29 Dec 2007 22:15:06 +0000 (22:15 +0000)]
Don't show in netstat(1) output without the -a switch TCP socket in LISTEN
state if it happens to be bound to an interface.

Obtained-from: FreeBSD

12 years agoUpdate the man page to reflect the recent sync with FreeBSD.
Matthias Schmidt [Sat, 29 Dec 2007 21:57:58 +0000 (21:57 +0000)]
Update the man page to reflect the recent sync with FreeBSD.

Obtained-From:  FreeBSD

12 years agoSync etc/periodic with FreeBSD. Short summary:
Matthias Schmidt [Sat, 29 Dec 2007 21:44:44 +0000 (21:44 +0000)]
Sync etc/periodic with FreeBSD.  Short summary:

 - Display information about blocked counts from pf(4)
 - Make df output more human readable
 - Add login.conf checking to security
 - Fix several bugs and add some enhancements to various scripts

The list of all relevant FreeBSD Revisions is available here:

http://leaf.dragonflybsd.org/mailarchive/submit/2007-12/msg00009.html

Obtained-From: FreeBSD

12 years agoSync with FreeBSD (adds NetBSD 4.0).
Sascha Wildner [Sat, 29 Dec 2007 21:00:42 +0000 (21:00 +0000)]
Sync with FreeBSD (adds NetBSD 4.0).

12 years agoRemove trailing space.
Sascha Wildner [Sat, 29 Dec 2007 18:18:00 +0000 (18:18 +0000)]
Remove trailing space.

12 years agoRemove the xrpu driver as FreeBSD did ~1 month ago.
Sascha Wildner [Sat, 29 Dec 2007 13:40:28 +0000 (13:40 +0000)]
Remove the xrpu driver as FreeBSD did ~1 month ago.

12 years agoUse TAILQ_HEAD_INITIALIZER to initialize global variable 'ifnet'
Sepherosa Ziehau [Sat, 29 Dec 2007 12:51:17 +0000 (12:51 +0000)]
Use TAILQ_HEAD_INITIALIZER to initialize global variable 'ifnet'

12 years agoHAMMER 11/many - initial spike commit.
Matthew Dillon [Sat, 29 Dec 2007 09:01:27 +0000 (09:01 +0000)]
HAMMER 11/many - initial spike commit.

* Fix a bug in the cluster disk offset calculation.
* Implement the cluster allocator and related header initialization.
* Remove wildcarding from hammer_btree_cmp().
* Move the historical filter out of hammer_btree_cmp() and into its own
  procedure.
* Allow the ending element in a B-Tree range iteration to be inclusive or
  exclusive of the range.
* Add infrastructure for cluster-localizes searches.
* Initial commit of the spike code (still in progress).

This commit brings in most of the infrastructure needed for the spike code.
The spike code is what glues one cluster's B-Tree to another cluster's B-Tree.
At the moment we spike by taking the B-Tree leaf node at the cursor after
a search and moving all of its elements to a new cluster, then replacing
the pointer to that leaf node in the parent B-Tree node with a cluster
reference.

This is non-optimal at the moment.  Several optimizations are possible and
will be eventually be implemented.

12 years agoSync the adduser(8) command with FreeBSD. Summary:
Matthias Schmidt [Fri, 28 Dec 2007 16:37:10 +0000 (16:37 +0000)]
Sync the adduser(8) command with FreeBSD.  Summary:

 o Check if a user already exists
 o Correct nologin path (was /usr/sbin instead of /sbin)
 o Man page fixes (mostly typos and some rewording)

12 years ago- Regroup global variables, function declarations and macros
Sepherosa Ziehau [Fri, 28 Dec 2007 14:09:25 +0000 (14:09 +0000)]
- Regroup global variables, function declarations and macros
- Nuke unused head file
- Minor style changes

# No functional changes

12 years agoUse M_ASSERTPKTHDR
Sepherosa Ziehau [Fri, 28 Dec 2007 13:27:45 +0000 (13:27 +0000)]
Use M_ASSERTPKTHDR

12 years agokmalloc(M_WAITOK) will not return NULL
Sepherosa Ziehau [Fri, 28 Dec 2007 13:16:10 +0000 (13:16 +0000)]
kmalloc(M_WAITOK) will not return NULL

12 years agoUse the correct version.
Sascha Wildner [Fri, 28 Dec 2007 12:34:44 +0000 (12:34 +0000)]
Use the correct version.