dragonfly.git
12 years agokernel: mfs -- Fix unmount panic for MFS filesystems.
Venkatesh Srinivas [Thu, 16 Feb 2012 15:53:22 +0000 (07:53 -0800)]
kernel: mfs -- Fix unmount panic for MFS filesystems.

mfs_start() is active for the life of an MFS mount, handling copyin/out
requests. It is directed to exit when an MFS filesystem is unmounted.
The VFS accounting code and VFS MPLOCK code assumed that the mountpoint
structure was stable on return of mfs_start, which was not the case.

To work around that, don't call acinit if the vfs_start vfsop returns
EMOUNTEXIT, a kernel-specific pseudo-errno. Also allow marking vfs_start
MPSAFE and mark mfs vfs_start MPSAFE, to avoid accessing a per-mount
token field. A future commit will rework MFS's locking so that critical
sections are not used to protect the MFS bioq.

This is a hack for MFS; future work should either rework the filesystem
or replace it outright with tmpfs.

Closes: Bug 2276

12 years agohammer2 - clean-up the chain code, first cut at the read/write/strategy code
Matthew Dillon [Tue, 14 Feb 2012 08:11:59 +0000 (00:11 -0800)]
hammer2 - clean-up the chain code, first cut at the read/write/strategy code

* Do a major cleanup of the hammer2_chain handling code.

  We no longer kmalloc() a local copy when a chain element is modified.

  Instead we differentiate elements whos data is embedded (volume header,
  inodes) vs elements whos data is mapped to a buffer cache buffer (indirect
  blocks and data).

  Elements with embedded data simply leave the data pointer pointing at the
  embedded data as before.

  Elements without embedded data instantiate the newly allocated
  copy-on-write buffer cache buffer and bcopy() the data from the old
  buffer to the new buffer, replacing chain->bp and the chain->data pointer.
  The new bp is dirtied.

  The modified data no longer needs to be retained when the chain elmeent
  is released, we bdwrite() the bp and thus can reinstantiate the modified
  data at any time in the future.  This also allows the system to flush
  the modified data out.

* Implement hammer2_vop_read(), hammer2_vop_write(), and
  hammer2_vop_strategy().

  Currently untested (files cannot be created yet), but fairly
  straight-forward.  Definitely also not optimized yet.

12 years agohammer2 - correct saveoff in hammer2_vop_readdir()
Matthew Dillon [Tue, 14 Feb 2012 05:22:01 +0000 (21:22 -0800)]
hammer2 - correct saveoff in hammer2_vop_readdir()

* When terminating a search early read the next entry and set save_off
  to that, instead of setting it to the last returned entry's key + 1.

  This ensures an exact match when the search resume.  This could create
  problems in the future but for now its a quick way to track the
  directory scan due to the fully-associative nature of the on-media
  blockref arrays.

  (In the future we may have to sort the fully associative array on-media
  to really solve the issue).

* This corrects repeated entries in 'ls' output.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Tue, 14 Feb 2012 05:11:51 +0000 (21:11 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agoRemove an obsolete header file specific to labpc(4) (which was removed).
Sascha Wildner [Mon, 13 Feb 2012 22:54:06 +0000 (23:54 +0100)]
Remove an obsolete header file specific to labpc(4) (which was removed).

12 years agoworld: Add missing DPADDs in some Makefiles.
Sascha Wildner [Mon, 13 Feb 2012 21:37:59 +0000 (22:37 +0100)]
world: Add missing DPADDs in some Makefiles.

12 years agoFix some typos.
Sascha Wildner [Mon, 13 Feb 2012 14:09:01 +0000 (15:09 +0100)]
Fix some typos.

12 years agohammer2 - Initial media flush implementation
Matthew Dillon [Mon, 13 Feb 2012 08:52:21 +0000 (00:52 -0800)]
hammer2 - Initial media flush implementation

* Implement hammer2_chain_flush(), hammer2_vfs_sync(), and hammer2_vop_fsync().
  The flush code currently handles inodes but not data.

* hammer2_chain_flush() recursively flushes a chain structure, handing the
  parent the updated blockref.  When flushing downward pending chain elements
  will allocate new blocks for copy-on-write.

* Survives mount/mkdir/umount/mount

NOTES: fsync currently stops at the inode and does not currently flush
       through to the volume root.  We need to implement a short-cut for
       fsync using currently reserved volume header fields to avoid having
       to flush out the entire chain.

       We haven't implemented data blocks yet.

12 years agohammer2 - initial mkdir skeleton
Matthew Dillon [Mon, 13 Feb 2012 03:22:10 +0000 (19:22 -0800)]
hammer2 - initial mkdir skeleton

* Code up VOP_NMKDIR() to test the chain creation code and VOP_READDIR.

* Code up VOP_NLOOKUPDOTDOT.

* Adjust newfs_hammer2 to set alloc_tid to 16, so we can reserve some
  inode numbers for the super-root and root.

* Add another field to the media inode_data for inode allocation within
  a PFS.

Note: These are mostly skeletons.  We don't flush modified chain elements
      back to the disk yet and the chain create path can't create indirect
      blocks yet.

12 years agohammer2 - flesh out getattr
Matthew Dillon [Mon, 13 Feb 2012 01:38:24 +0000 (17:38 -0800)]
hammer2 - flesh out getattr

* Load vap field from the inode media structure, setup remaining fields.
  ls -la /mnt can display '.' and '..' now.

* Pull in some helper procedures from HAMMER1 to help out.

12 years agohammer2 - Adjust chain lookup/iteration API, add readdir
Matthew Dillon [Mon, 13 Feb 2012 00:50:01 +0000 (16:50 -0800)]
hammer2 - Adjust chain lookup/iteration API, add readdir

* Adjust the chain lookup/iteration API to take a key range key_beg to key_end
  (inclusive), instead of a key/mask pair.

* Add and initialize a parent inode pointer in hammer2_inode{}.

* Adjust the directory key hash to always OR with 0x8000U in order to
  guarantee that some low valued codes remain unused so we can use them
  for pseudo directory cookies (for '.' and '..').

  newfs2_hammer is required on the test volume with this change.

* Implement hammer2_vop_readdir().

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Mon, 13 Feb 2012 00:49:20 +0000 (16:49 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agohammer2 - cleanup inode locking paths
Matthew Dillon [Sun, 12 Feb 2012 23:05:25 +0000 (15:05 -0800)]
hammer2 - cleanup inode locking paths

* Cleanup inode locking paths

* Give inode a ref representing the vnode association

12 years agobinutils: Fix typo in Makefile
John Marino [Sun, 12 Feb 2012 22:10:28 +0000 (23:10 +0100)]
binutils: Fix typo in Makefile

The variable for the backup binutils is BU_BACKUP, not BU_SECONDARY.
The backup binutils wasn't getting built after the recent makefile
changes due to this mixup.

12 years agohammer2 - rename hammer2_*() to hammer2_vfs_*() for the VFS op functions
Matthew Dillon [Sun, 12 Feb 2012 22:07:28 +0000 (14:07 -0800)]
hammer2 - rename hammer2_*() to hammer2_vfs_*() for the VFS op functions

* Rename hammer2_*() to hammer2_vfs_*() for the VFS op functions.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Sun, 12 Feb 2012 22:06:58 +0000 (14:06 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agobinutils: Revert unwanted change to Makefile.inc
John Marino [Sun, 12 Feb 2012 21:28:31 +0000 (22:28 +0100)]
binutils: Revert unwanted change to Makefile.inc

In the original changeset, Makefile.inc1 was incorporated into
Makefile.inc.  When it was split out, one of the variables was orphaned,
and as a result some of the binaries won't get installed.  Changes to
these two files should not have been committed before.

12 years agoremove unused /usr/libexec/binutils2*/elf/ld
John Marino [Sun, 12 Feb 2012 17:44:21 +0000 (18:44 +0100)]
remove unused /usr/libexec/binutils2*/elf/ld

After a recent commit (0784934ab2d8a3bba5ad1f59713db3cea8005865),
objformat handles the execution of the linker.  It chooses between
/usr/libexec/binutils*/elf/ld.bfd and /usr/libexec/binutils*/elf/ld.gold
and  /usr/libexec/binutils*/elf/ld is no longer referenced.

This commit cleans up the binutils 2.21 and 2.22 ld binaries using the
"make upgrade" command.

12 years agobinutils: Make manpage handling generic to ease maintenance
John Marino [Sun, 12 Feb 2012 17:35:45 +0000 (18:35 +0100)]
binutils: Make manpage handling generic to ease maintenance

DragonFly has two sets of binutils with one designated as primary and the
other is the backup.  In the recent past, every time these designation
were switched or a new binutils was brought in, around 30 makefiles had
to be manually and tediously updated in at least 3 places per file.

This commit implements common variables that will make future primary
designation changes not require changes to individual makefiles, but
rather limit the update to a couple of commons ones.

12 years agohammer2 - Implement more of the hammer2_chain infrastructure
Matthew Dillon [Sun, 12 Feb 2012 19:23:17 +0000 (11:23 -0800)]
hammer2 - Implement more of the hammer2_chain infrastructure

* Allocate system structures through their chain type.

* Implement core lookup and iteration code

* Non-terminal media objects which are smaller than HAMMER2_PBUFSIZE (64K)
  cannot hold onto their buffer cache buffer without deadlocking against
  or interfering with the chain.

  This is just inodes for now.  An embedded copy of the media data is
  retained (I had removed it before thinking I could just map the bp but
  it doesn't work, so it goes back in).

* Data references for other media objects can be temporary and allocated.
  The chain locking and unlocking code will instantiate and destroy the
  allocated copy as needed.

  This also enforces the chain locking requirement for media data access.

* hammer2_chain_create() skeleton added (cannot create indirect blocks yet).

* hammer2_chain_delete() does nothing atm.

* tested with mount/umount.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Sun, 12 Feb 2012 19:22:32 +0000 (11:22 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agoobjformat - Duplicate NELEM() macro
Samuel J. Greear [Sun, 12 Feb 2012 18:24:26 +0000 (11:24 -0700)]
objformat - Duplicate NELEM() macro

* Fix buildworld on DragonFly hosts built before Dec 18, 2010 (2.9).

* NELEM() macro was added to sys/param.h on Dec 18, 2010 and objformat was
  made to use it on May 20, 2011. This broke upgrades for machines running a
  DragonFly version built prior to Dec 18, 2010 since objformat is built with
  the hosts headers as part of the cross tools stage.

12 years agoobjformat: Avoid unnecessary getenv calls
John Marino [Sun, 12 Feb 2012 11:13:28 +0000 (12:13 +0100)]
objformat: Avoid unnecessary getenv calls

The CCVER and BINUTILSVERS are always checked by objformat, even when
these values won't be used.  For example, there's no need to know the
value of CCVER when executing the realelf binutils binary, but it was
getting requested in all cases.

This commit limits the getenv requests to the bare minimum required.
Additionally it adds whitespace to the commands structure for the
purpose of aesthetics.

12 years agoobjformat: Add LINKERVER environment variable recognition
John Marino [Sun, 12 Feb 2012 09:48:33 +0000 (10:48 +0100)]
objformat: Add LINKERVER environment variable recognition

objformat will now scan for the LINKERVER environment variable.  If this
variable exists *AND* it has the value of "ld.gold", the command "ld"
will point at the gold linker.  In every other case, it will point at
the classic "gnu ld" linker.

The relative command position of "ld" was moved to after the compiler
group because it's a popular command and having it towards the front
means less time in the search loop.

12 years agostatic dl_iterate_phdr: remove unused phent variable
John Marino [Sat, 11 Feb 2012 22:23:14 +0000 (23:23 +0100)]
static dl_iterate_phdr: remove unused phent variable

This variable had been used in a validity check that was removed before
the last commit of dlfcn.c and it got orphaned.

12 years agogold linker v2.22: Return to constructors in DT_INIT_ARRAY
John Marino [Sat, 11 Feb 2012 21:17:12 +0000 (22:17 +0100)]
gold linker v2.22: Return to constructors in DT_INIT_ARRAY

This commit effectively reverses 17078250df568635285cd6be4515d29ee8c1b72a.
At the time, DragonFly did not recognize .init_array sections in an elf
file, and the gold linker was lumping the contructors from gcc into this
array which was subsequently filtered out.

DT_INIT_ARRAY and friends are now fully supported since commit
b28bf640312db2b299faff75052fbb01d67fd821 so the local modification is
being removed in favor of a default build.

12 years agortld: Add support for preinit, init, and fini arrays
John Marino [Sat, 11 Feb 2012 19:17:51 +0000 (20:17 +0100)]
rtld: Add support for preinit, init, and fini arrays

As far as I can tell, all BSDs limit their ELF executable file
initialization and termination to the .init and .fini sections.  In
contrast, Linux has additionally supported the .preinit_array,
.init_array, and .fini_array sections for over a decade through glibc.
With this commit, DragonFly becomes the first BSD to support these
arrays of function pointers.  It was tested using test cases taken from
glibc, gnu ld linker, and the gold linker.

For the main executable file, the .init_array and .fini_array sections
are handled by crt1, just like .init and .fini are.  In the case of
a statically linked binary, the .preinit_array section is also handled
by crt1.  The real-time linker handles the .init_array and .fini_array
sections for dynamically shared objects (libraries) and .preinit_array
for dynamically-linked binaries.  There are no .preinit_array sections
in the DSOs per standard.

These sections are described by the System V Application Binary Interface
http://www.sco.com/developers/gabi/latest/ch4.sheader.html#special_sections

The .init_array and .fini_array handling by rtld was reviewed by
Konstantin Belousov.

12 years agoRemove the duplicate fsx from tools/regression.
Sascha Wildner [Sat, 11 Feb 2012 19:29:36 +0000 (20:29 +0100)]
Remove the duplicate fsx from tools/regression.

12 years agohammer2 - fix umount panic, misc fixes
Matthew Dillon [Sat, 11 Feb 2012 08:27:34 +0000 (00:27 -0800)]
hammer2 - fix umount panic, misc fixes

* Properly assign the vnode type.  Remove ip->type and instead of use
  ip->data.type.  This also allows vflush() to work properly during umount.

* Handle degenerate VOP_RECLAIM case.

* Add freecache[] array to help in the upcoming simple test-only freemap
  allocator.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Sat, 11 Feb 2012 06:40:05 +0000 (22:40 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agoUse copyinstr for volume field.
Venkatesh Srinivas [Sat, 11 Feb 2012 03:38:10 +0000 (22:38 -0500)]
Use copyinstr for volume field.

12 years agohammer2 - Implement most of the hammer2_chain_*() function set
Matthew Dillon [Sat, 11 Feb 2012 02:20:05 +0000 (18:20 -0800)]
hammer2 - Implement most of the hammer2_chain_*() function set

* Implement hammer2_chain_push/first/next/get/link/unlink.  Integrate
  the hammer2_inode into the chain topology.

* Route both the reference count and the busy count through the chain
  structure.

* Implement simplified I/O via the chain functions.

* Indirect blocks not yet implemented in the chain functions.

* Use the chain functions to locate both the super-root inode and the
  root-inode via its label.

12 years agohammer2 - flesh out inode and blockref chaining
Matthew Dillon [Fri, 10 Feb 2012 22:12:13 +0000 (14:12 -0800)]
hammer2 - flesh out inode and blockref chaining

* Move the inode code into hammer2_inode.c

* Rename ipstack to chain and do an initial skeleton in hammer2_chain.c

* The hammer2_chain structures embed a blockref and maintain a chain
  of pointers all the way to the volume root.

  hammer2_chain structures are embedded in major hammer2 system memory
  structures (hammer2_inode, hammer2_mount, hammer2_indblock).

  All lookups and searches are tracked via hammer2_chain structures.

12 years agohammer2 - Add copyright headers
Matthew Dillon [Fri, 10 Feb 2012 22:11:34 +0000 (14:11 -0800)]
hammer2 - Add copyright headers

* Add copyright headers

12 years agohammer2 - hammer2_install_volume_header() cleanup
Matthew Dillon [Fri, 10 Feb 2012 18:10:27 +0000 (10:10 -0800)]
hammer2 - hammer2_install_volume_header() cleanup

* Use one bp and copy the best valid header into the hmp.

* Flesh out the error reporting.

* Document the fact that a read may fail due to device EOF.

12 years agohammer2 - correct icrc generation for sector 0
Matthew Dillon [Fri, 10 Feb 2012 18:09:25 +0000 (10:09 -0800)]
hammer2 - correct icrc generation for sector 0

* Correct the icrc generation for sector 0. Other icrc's are also stored
  in sector 0 and have be generated first.

* Write the volume header out to all volume header alternates.  All four
  are, in fact, master copies.  The mount code will find the best one.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Fri, 10 Feb 2012 17:40:47 +0000 (09:40 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agodisk - add uuid to udev dict of parts
Alex Hornung [Fri, 10 Feb 2012 16:44:28 +0000 (16:44 +0000)]
disk - add uuid to udev dict of parts

 * Add the partition (disklabel64) UUID to the
   udev dictionary of partition disk devices,
   e.g. da0s1a.

12 years agohammer2 -- Add missing error set in valid path.
Venkatesh Srinivas [Fri, 10 Feb 2012 15:17:12 +0000 (10:17 -0500)]
hammer2 -- Add missing error set in valid path.

12 years agohammer2 -- Read multiple volume headers and validate CRC for sect0.
Venkatesh Srinivas [Fri, 10 Feb 2012 14:56:46 +0000 (09:56 -0500)]
hammer2 -- Read multiple volume headers and validate CRC for sect0.

12 years agohammer2 - wire in statfs/statvfs, add the chain structure, etc
Matthew Dillon [Fri, 10 Feb 2012 07:49:37 +0000 (23:49 -0800)]
hammer2 - wire in statfs/statvfs, add the chain structure, etc

* Wire mnt_stat and mnt_vstat.  Currently dummy-up the values.  This allows
  the mount point to show up in 'df' output.

* Add the chain structure for upcoming directory search work.  This
  structure will also be used to track through indirect blocks.  The
  chain structure supplies the full blockref chain from an in-memory
  structure to the root volume, allowing modifications to be properly
  tracked.

* Move the volume header read to its own support procedure, it's going to
  eventually be considerably more complex.

* Bring the hammer2_dirhash() procedure in from newfs_hammer2.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Fri, 10 Feb 2012 06:04:34 +0000 (22:04 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agoRead volume header.
Venkatesh Srinivas [Fri, 10 Feb 2012 04:00:54 +0000 (23:00 -0500)]
Read volume header.

12 years agoCorrect assertion in hammer2_freei.
Venkatesh Srinivas [Fri, 10 Feb 2012 03:46:13 +0000 (22:46 -0500)]
Correct assertion in hammer2_freei.

12 years agohammer2 - followup cleanup
Matthew Dillon [Fri, 10 Feb 2012 03:31:08 +0000 (19:31 -0800)]
hammer2 - followup cleanup

* followup cleanup to last commit

12 years agohammer2 - cleanup, kldload, mount, iget/ifree and other stuff.
Matthew Dillon [Fri, 10 Feb 2012 03:28:11 +0000 (19:28 -0800)]
hammer2 - cleanup, kldload, mount, iget/ifree and other stuff.

* Make kldload and kldunload run cleanly

* Make mount/umount run cleanly.  Properly deallocate the root inode and
  close the underlying device.

* Write iget/ifree and properly deal with deadlocks between reclaim and
  iget.

* Remove the hm_ prefix for the hammer2_mount structure.

* Use 'hammer2_xxx_t' instead of 'struct hammer2_xxx' in many cases.

* Other general cleanups.

12 years agohammer2 - complain if the hammer2 kld module isn't loaded
Matthew Dillon [Fri, 10 Feb 2012 02:18:45 +0000 (18:18 -0800)]
hammer2 - complain if the hammer2 kld module isn't loaded

* Complain if the hammer2 kld module isn't loaded instead of exiting
  silently.

12 years agohammer2 - code cleanup, fix kldload issue
Matthew Dillon [Fri, 10 Feb 2012 01:54:59 +0000 (17:54 -0800)]
hammer2 - code cleanup, fix kldload issue

* More code cleanups.   Formatting, add missing copyright notices,
  staticization, etc.

* Fix a missing symbol that was renamed.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Fri, 10 Feb 2012 01:40:00 +0000 (17:40 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agohammer2 -- Flesh out _mount vfsops, add mountctl.
Venkatesh Srinivas [Fri, 10 Feb 2012 00:29:01 +0000 (19:29 -0500)]
hammer2 -- Flesh out _mount vfsops, add mountctl.

12 years agohammer2 -- Remove tmpfs scaffold.
Venkatesh Srinivas [Fri, 10 Feb 2012 00:15:43 +0000 (19:15 -0500)]
hammer2 -- Remove tmpfs scaffold.

tmpfs structures were used in HAMMER2 development to help get a
mountable object, but were no longer needed.

12 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Thu, 9 Feb 2012 22:29:41 +0000 (14:29 -0800)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agohammer2 -- Cleanup volume header readout a bit.
Venkatesh Srinivas [Thu, 9 Feb 2012 21:54:03 +0000 (16:54 -0500)]
hammer2 -- Cleanup volume header readout a bit.

12 years agodevattr - add more helpful failure message
Alex Hornung [Thu, 9 Feb 2012 21:49:14 +0000 (21:49 +0000)]
devattr - add more helpful failure message

Reported-by: luxh, swildner
12 years agohammer2 -- Compile fixes #2.
Venkatesh Srinivas [Thu, 9 Feb 2012 21:26:50 +0000 (16:26 -0500)]
hammer2 -- Compile fixes #2.

Disable code reading volhdr for a bit; allows mounting w/o panic.

12 years agohammer2 -- Compile fixes.
Venkatesh Srinivas [Thu, 9 Feb 2012 21:02:56 +0000 (16:02 -0500)]
hammer2 -- Compile fixes.

12 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into...
Matthew Dillon [Thu, 9 Feb 2012 20:29:11 +0000 (12:29 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

12 years agondis(4): Use callout_init_mp(). Overlooked when I ported it.
Sascha Wildner [Thu, 9 Feb 2012 16:52:59 +0000 (17:52 +0100)]
ndis(4): Use callout_init_mp(). Overlooked when I ported it.

12 years agopuffs(4): Don't reference vp before it's initialized.
Sascha Wildner [Thu, 9 Feb 2012 16:30:16 +0000 (17:30 +0100)]
puffs(4): Don't reference vp before it's initialized.

12 years agohptiop(4): Use cam_calc_geometry() instead of duplicating it.
Sascha Wildner [Thu, 9 Feb 2012 13:02:07 +0000 (14:02 +0100)]
hptiop(4): Use cam_calc_geometry() instead of duplicating it.

Taken-from: FreeBSD

12 years agohptiop(4): Remove an unused variable.
Sascha Wildner [Thu, 9 Feb 2012 12:25:58 +0000 (13:25 +0100)]
hptiop(4): Remove an unused variable.

12 years agohammer2 - Initial newfs_hammer2 implementation
Matthew Dillon [Thu, 9 Feb 2012 06:28:48 +0000 (22:28 -0800)]
hammer2 - Initial newfs_hammer2 implementation

* This is a rough start for the newfs_hammer2 implementation.

* Creates the volume header, super-root inode, and named root inode.

12 years agohammer2 - Adjust media fields
Matthew Dillon [Thu, 9 Feb 2012 06:16:17 +0000 (22:16 -0800)]
hammer2 - Adjust media fields

* Expand the reserved area from 2MB to 4MB per every 2GB.  Just in case.

* Add definitions for compress and check code classes.

* Other misc adjustments.

12 years agohammer2 - add titling to DESIGN document
Matthew Dillon [Thu, 9 Feb 2012 03:19:35 +0000 (19:19 -0800)]
hammer2 - add titling to DESIGN document

* Add titling to the DESIGN document

12 years agohammer2 - More media format spec work, add DESIGN document
Matthew Dillon [Thu, 9 Feb 2012 03:08:47 +0000 (19:08 -0800)]
hammer2 - More media format spec work, add DESIGN document

* Add additional fields to support up to 256 configured copyid's in the
  volume header.  Directory subtree copies are still limited to 8 but this
  will allow us to implement many different copy sets for different
  sub-trees.

* Add a flags field to the blockref for synchronization and desynchronization
  flags.

* Rename allocmap to freemap and add a freemap_version field which is
  separate from the global version field, which will allow a HAMMER2
  volume to at least be mounted read-only on older versions of HAMMER2
  if the only difference is in the freemap handling algorithm.

* Add the DESIGN document.

12 years agohammer2 - create new branch, sync working trees from dillon & vsrinivas
Matthew Dillon [Wed, 8 Feb 2012 23:50:01 +0000 (15:50 -0800)]
hammer2 - create new branch, sync working trees from dillon & vsrinivas

* hammer2 branch in main repo created.  This branch will loosely track
  master with the additional hammer2 bits added.  Any changes that have to
  be made to non-hammer2 bits will be done in master and merged into this
  branch instead of the other way around.

* Merge dillon's and vsrinivas's work, placing the files in the appropriate
  places in the source tree.

* Initial whitespace cleanup so git doesn't complain

* Major adjustments to hammer2_disk.h taking into account all discussions
  between dillon and vsrinivas to date relative to the original design.

  (1) The media blockref was expanded from 32 to 64 bytes in order to
      accomodate up to a 192 bit cryptographic hash.

  (2) The new blockref will also support multiple crc/hash/check algorithms.

  (3) The new blockref will also support multiple block compression algorithms.

  (4) The new blockref supports a full 64-bit key as well as a key mask,
      and an explicit type field instead of overloading the functionality
      of data_off's 6-bit physical storage size radix.

  (5) The fully associative blockset was reduced from 16 to 8 blockref
      entries.

  (6) Support for multiple copies is possible within a fully associative
      blockset (also needed new fields in the new blockref).

  (7) The media volume structure has been fleshed out to support the new
      features.

  (8) The volume structure now also contains fields for configuring device
      paths for up to 8 copies, a fully associative blockset pointint to
      the root inode, and multiple sub-block crcs.

12 years agotest - Adjust randread to not share file descriptors
Matthew Dillon [Wed, 8 Feb 2012 23:32:52 +0000 (15:32 -0800)]
test - Adjust randread to not share file descriptors

* Close and reopen the device when randread fork()s so the physical
  file descriptor is not shared.  The vnode will still be shared.

* Works around a serialization issue when a file descriptor is shared.

12 years agomps(4): Add module version.
Sascha Wildner [Wed, 8 Feb 2012 20:40:35 +0000 (21:40 +0100)]
mps(4): Add module version.

12 years agolibexec: Remove duplicate includes.
Sascha Wildner [Wed, 8 Feb 2012 12:59:10 +0000 (13:59 +0100)]
libexec: Remove duplicate includes.

12 years agoRevert "mount_psshfs: Add a missing include dir to the Makefile."
Sascha Wildner [Wed, 8 Feb 2012 12:48:14 +0000 (13:48 +0100)]
Revert "mount_psshfs: Add a missing include dir to the Makefile."

This reverts commit 25766f8a90b7331f83451cfc4e175d1148a5dd08.

My thinking was wrong and it is not needed.

12 years agousr.sbin: Remove duplicate includes.
Sascha Wildner [Wed, 8 Feb 2012 12:37:51 +0000 (13:37 +0100)]
usr.sbin: Remove duplicate includes.

12 years agomount_psshfs: Add a missing include dir to the Makefile.
Sascha Wildner [Wed, 8 Feb 2012 12:37:23 +0000 (13:37 +0100)]
mount_psshfs: Add a missing include dir to the Makefile.

12 years agousr.bin: Remove duplicate includes.
Sascha Wildner [Wed, 8 Feb 2012 12:17:10 +0000 (13:17 +0100)]
usr.bin: Remove duplicate includes.

12 years agomps(4): Mark a function __printflike() and fix a resulting warning.
Sascha Wildner [Wed, 8 Feb 2012 11:01:20 +0000 (12:01 +0100)]
mps(4): Mark a function __printflike() and fix a resulting warning.

12 years agosbin: Remove duplicate includes.
Sascha Wildner [Tue, 7 Feb 2012 16:41:13 +0000 (17:41 +0100)]
sbin: Remove duplicate includes.

12 years agoSome cleanup in the puffs manpages.
Sascha Wildner [Tue, 7 Feb 2012 13:28:53 +0000 (14:28 +0100)]
Some cleanup in the puffs manpages.

12 years agoifconfig(8): Use strdup() instead of duplicating it.
Sascha Wildner [Tue, 7 Feb 2012 02:27:58 +0000 (03:27 +0100)]
ifconfig(8): Use strdup() instead of duplicating it.

12 years agomps(4): Remove some useless casts.
Sascha Wildner [Tue, 7 Feb 2012 10:53:42 +0000 (11:53 +0100)]
mps(4): Remove some useless casts.

I've inserted them by mistake because I had not realized that the
wrong typedefs for U32 and S32 were the real issue.

12 years agomps: Hold lock for the shutdown event handler
Sepherosa Ziehau [Tue, 7 Feb 2012 09:36:19 +0000 (17:36 +0800)]
mps: Hold lock for the shutdown event handler

12 years agomps: If we don't have enough space for a sge and chain, don't claim we can
Sepherosa Ziehau [Tue, 7 Feb 2012 09:35:20 +0000 (17:35 +0800)]
mps: If we don't have enough space for a sge and chain, don't claim we can

12 years agomps: Use WAITOK to allocate critical data struct on attach path
Sepherosa Ziehau [Tue, 7 Feb 2012 09:17:55 +0000 (17:17 +0800)]
mps: Use WAITOK to allocate critical data struct on attach path

12 years agomps: Properly define U32 and S32
Sepherosa Ziehau [Tue, 7 Feb 2012 09:15:45 +0000 (17:15 +0800)]
mps: Properly define U32 and S32

12 years agomps.4: Document how we disable MSI and comment out MSI-X documentation.
Sascha Wildner [Tue, 7 Feb 2012 08:50:08 +0000 (09:50 +0100)]
mps.4: Document how we disable MSI and comment out MSI-X documentation.

12 years agomps(4): Sync with FreeBSD.
Sascha Wildner [Tue, 7 Feb 2012 08:42:32 +0000 (09:42 +0100)]
mps(4): Sync with FreeBSD.

This a still in progress port of the new, LSI-supported version of the
mps(4) driver from FreeBSD.

Some of the changes are (from FreeBSD's commit msg):

- Integrated RAID (IR) support.
- Support for WarpDrive controllers.
- Support for SCSI protection information (EEDP).
- Support for TLR (Transport Level Retries), needed for tape drives.
- Improved error recovery code.
- ioctl interface compatible with LSI utilities.

This commit also moves the driver from sys/dev/disk to sys/dev/raid.

It still fails attaching at this stage. Work on it will continue in
master.

12 years agodpt(4): Remove an old unneeded file.
Sascha Wildner [Mon, 6 Feb 2012 13:29:06 +0000 (14:29 +0100)]
dpt(4): Remove an old unneeded file.

12 years agomlx(4): Remove an unused variable.
Sascha Wildner [Mon, 6 Feb 2012 08:29:22 +0000 (09:29 +0100)]
mlx(4): Remove an unused variable.

12 years agosnd_hda(4): Use MSI if it is supported by the device.
Sascha Wildner [Mon, 6 Feb 2012 03:42:17 +0000 (04:42 +0100)]
snd_hda(4): Use MSI if it is supported by the device.

12 years agopci: Fix manual interrupt routing support
Sepherosa Ziehau [Mon, 6 Feb 2012 03:02:18 +0000 (11:02 +0800)]
pci: Fix manual interrupt routing support

- Add function id to tunable name
- Call BUS_CONFIG_INTR upon manually assigned interrupt

Tested-by: swildner@
12 years agoUpdate the pciconf(8) database.
Sascha Wildner [Mon, 6 Feb 2012 02:17:58 +0000 (03:17 +0100)]
Update the pciconf(8) database.

Jan 18, 2012 snapshot from http://pciids.sourceforge.net/

12 years agosh: Test EXIT trap with multiple statements in it
Peter Avalos [Sun, 5 Feb 2012 20:43:12 +0000 (12:43 -0800)]
sh: Test EXIT trap with multiple statements in it

Obtained-from:  FreeBSD 230211

12 years agosh: Add testcases that should not be broken by future optimizations.
Peter Avalos [Sun, 5 Feb 2012 20:38:57 +0000 (12:38 -0800)]
sh: Add testcases that should not be broken by future optimizations.

Obtained-from:  FreeBSD 230121

12 years agosh: Avoid possible echo options in a testcase.
Peter Avalos [Sun, 5 Feb 2012 20:36:00 +0000 (12:36 -0800)]
sh: Avoid possible echo options in a testcase.

Obtained-from:  FreeBSD 229742

12 years agosh: Fix swapped INTON/INTOFF.
Peter Avalos [Sun, 5 Feb 2012 20:26:01 +0000 (12:26 -0800)]
sh: Fix swapped INTON/INTOFF.

A possible consequence of this bug was a memory leak if SIGINT arrived
during a 'set' command (listing variables).

Obtained-from:  FreeBSD 231001

12 years agosh: Use vfork in a few common cases.
Peter Avalos [Sun, 5 Feb 2012 20:21:25 +0000 (12:21 -0800)]
sh: Use vfork in a few common cases.

This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked
child.

There is a large speedup (for example 35%) in microbenchmarks. The
difference in buildkernel is smaller (for example 0.5%) but still
statistically significant. See
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html
for some numbers.

The use of vfork() can be disabled by setting a variable named
SH_DISABLE_VFORK.

Obtained-from:  FreeBSD 230998

12 years agosh: Fix $? in the first command of a 'for'.
Peter Avalos [Sun, 5 Feb 2012 20:12:44 +0000 (12:12 -0800)]
sh: Fix $? in the first command of a 'for'.

In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.

Obtained-from:  FreeBSD 230463

12 years agosh: Remove "kill" example function, which is superseded by the kill
Peter Avalos [Sun, 5 Feb 2012 20:10:27 +0000 (12:10 -0800)]
sh: Remove "kill" example function, which is superseded by the kill
builtin

Obtained-from:  FreeBSD 230437

12 years agosh: Fix execution of multiple statements in a trap when evalskip is set
Peter Avalos [Sun, 5 Feb 2012 20:07:56 +0000 (12:07 -0800)]
sh: Fix execution of multiple statements in a trap when evalskip is set

Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
    o  "-e" is set for this shell
    o  a trap is set on EXIT
    o  a function returns 1 and causes the script to abort

Obtained-from:  FreeBSD 230212

12 years agosh: Fix some bugs with exit status from case containing ;&.
Peter Avalos [Sun, 5 Feb 2012 20:04:53 +0000 (12:04 -0800)]
sh: Fix some bugs with exit status from case containing ;&.

Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().

Fixed bugs:

* If a ;& list with non-zero exit status is followed by an empty ;; or final
  list, the exit status of the case command should be equal to the exit
  status of the ;& list, not 0.

* An empty ;& case should not reset $?.

Obtained-from:  FreeBSD 230161

12 years agosh: Fix two bugs with case and exit status:
Peter Avalos [Sun, 5 Feb 2012 20:02:44 +0000 (12:02 -0800)]
sh: Fix two bugs with case and exit status:

* If no pattern is matched, POSIX says the exit status shall be 0 (even if
  there are command substitutions).
* If a pattern is matched and there are no command substitutions, the first
  command should see the $? from before the case command, not always 0.

Obtained-from:  FreeBSD 230154

12 years agosh: Change input buffer size from 1023 to 1024.
Peter Avalos [Sun, 5 Feb 2012 20:00:29 +0000 (12:00 -0800)]
sh: Change input buffer size from 1023 to 1024.

Apparently this improves performance on slower platforms.

Obtained-from:  FreeBSD 230118