dragonfly.git
5 years agoAdd the make_autoclone_dev(9) manual page.
Sascha Wildner [Mon, 7 Sep 2009 14:56:21 +0000 (16:56 +0200)]
Add the make_autoclone_dev(9) manual page.

Submitted-by: alexh
5 years agosio(4) - Fix double make_dev if used as console
Alex Hornung [Mon, 7 Sep 2009 11:34:45 +0000 (12:34 +0100)]
sio(4) - Fix double make_dev if used as console

* sio was calling another make_dev for ttyd0 if it was being used as
  console. This is no longer valid with devfs, so we look for the
  existing ttyd0, as it must exist already if the device has been
  attached.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1485
Reported-by: Hasso Tepper, Jordan Gordeev
5 years agoUSB - Formalize polling mode and fix ohci interrupt storm
Matthew Dillon [Mon, 7 Sep 2009 06:05:09 +0000 (23:05 -0700)]
USB - Formalize polling mode and fix ohci interrupt storm

* Formalize entering and leaving polling mode via usb_set_polling().

* Call bus->methods->do_poll() once when leaving polling mode to
  catch-up any lost interrupts.

* OHCI now acknowledges interrupts from the interrupt handler when
  it finds itself in polling mode to prevent the interrupt from
  storming.  The interrupts are recorded for later use.

5 years agoUSB - Preallocate umass buffers to avoid interrupt deadlock
Matthew Dillon [Mon, 7 Sep 2009 02:37:55 +0000 (19:37 -0700)]
USB - Preallocate umass buffers to avoid interrupt deadlock

* Try to avoid usb allocations made from the interrupt servicer.
  These can deadlock the interrupt handler and any other device
  sharing that irq as well as cause USB panics due to the broken
  critical section.

* This is only a temporary fix.  Another unaddressed issue is
  contigmalloc()'s inability to allocate large physically contiguous
  buffers after the machine has been up a while.

Reported-by: Rumko and multiple others over time
5 years agoUSB - Avoid unnecessary reprobes.
Matthew Dillon [Sun, 6 Sep 2009 21:53:51 +0000 (14:53 -0700)]
USB - Avoid unnecessary reprobes.

* Do not unconditionally setdiskinfo when a removable DA* device is
  opened.  It takes time for the kernel to reprobe the drive and this
  seriously messes up mountroot during kernel boot or attempts to
  access partitions in slices (instant open + access partition).

  If the size hasn't changed, do not call setdiskinfo again.

* This is a bad hack.  A better solution (detect actual device
  replacement) is needed.

5 years agoLINT: Mention KTR_CTXSW.
Sascha Wildner [Sun, 6 Sep 2009 18:19:21 +0000 (20:19 +0200)]
LINT: Mention KTR_CTXSW.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 23:17:59 +0000 (16:17 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoMFS - Use mmap() instead of malloc().
Matthew Dillon [Sat, 5 Sep 2009 23:17:10 +0000 (16:17 -0700)]
MFS - Use mmap() instead of malloc().

* mmap does not have the dataspace limitations which malloc does, allowing
  us to create a much larger MFS filesystem.

5 years agosmbfs: use libiconv v.2
Alexander Polakov [Sat, 5 Sep 2009 21:25:00 +0000 (01:25 +0400)]
smbfs: use libiconv v.2

5 years agosys/conf/files: Remove duplicates.
Sascha Wildner [Sat, 5 Sep 2009 21:18:02 +0000 (23:18 +0200)]
sys/conf/files: Remove duplicates.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 20:15:53 +0000 (13:15 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoPIPE - Fix more races in the pipe code
Matthew Dillon [Sat, 5 Sep 2009 20:12:49 +0000 (13:12 -0700)]
PIPE - Fix more races in the pipe code

* Numerous additional races can occur with the setting and clearing of
  PIPE_SEL.

* EOF must be retested after getting the second token lock because the
  acquisition of the second lock can temporarily release the first one.

Reported-by: Tobias Weingartner <weingart@tepid.org>, Rumko
5 years agonetbt: add MODULE_VERSION
Alexander Polakov [Sat, 5 Sep 2009 19:49:14 +0000 (23:49 +0400)]
netbt: add MODULE_VERSION

Reported-by: Rumko <rumcic@gmail.com>
DragonFly-bug: http://bugs.dragonflybsd.org/issue1487

5 years agoOops, revert the GENERIC part of f5ff88dca23b1b8f4b9287fb7c59959eb976a808
Alexander Polakov [Sat, 5 Sep 2009 17:55:29 +0000 (21:55 +0400)]
Oops, revert the GENERIC part of f5ff88dca23b1b8f4b9287fb7c59959eb976a808

5 years agomount_msdos: remove conversion tables.
Alexander Polakov [Sat, 5 Sep 2009 16:33:38 +0000 (20:33 +0400)]
mount_msdos: remove conversion tables.

5 years agomsdosfs: add MODULE_VERSION.
Alexander Polakov [Sat, 5 Sep 2009 10:53:43 +0000 (14:53 +0400)]
msdosfs: add MODULE_VERSION.

5 years agomissing type in iso.h
Alexander Polakov [Sat, 11 Jul 2009 04:27:42 +0000 (08:27 +0400)]
missing type in iso.h

5 years agocitrus: ooops, actually build utf1632.
Alexander Polakov [Fri, 4 Sep 2009 10:39:04 +0000 (14:39 +0400)]
citrus: ooops, actually build utf1632.

5 years agoMove isonum_ declaration to iso.h
Alexander Polakov [Fri, 10 Jul 2009 21:35:56 +0000 (01:35 +0400)]
Move isonum_ declaration to iso.h

5 years agolibiconv: we can now link mount_cd9660 and mount_msdos statically.
Alexander Polakov [Thu, 3 Sep 2009 22:21:41 +0000 (02:21 +0400)]
libiconv: we can now link mount_cd9660 and mount_msdos statically.

5 years agolibkiconv: make libkiconv work when statically linked.
Alexander Polakov [Thu, 3 Sep 2009 22:18:30 +0000 (02:18 +0400)]
libkiconv: make libkiconv work when statically linked.

5 years agocitrus: compile in UTF16/32 support for iconv.
Alexander Polakov [Thu, 3 Sep 2009 22:15:49 +0000 (02:15 +0400)]
citrus: compile in UTF16/32 support for iconv.

5 years agoConnect cd9660_iconv msdosfs_iconv to the build.
Alexander Polakov [Thu, 3 Sep 2009 22:14:15 +0000 (02:14 +0400)]
Connect cd9660_iconv msdosfs_iconv to the build.

5 years agolibiconv: change mount_cd9660 to use libkiconv.
Alexander Polakov [Tue, 7 Jul 2009 16:07:50 +0000 (20:07 +0400)]
libiconv: change mount_cd9660 to use libkiconv.

Add "-L locale" option like mount_msdos.

5 years agolibiconv: convert cd9660 to libiconv.
Alexander Polakov [Thu, 3 Sep 2009 21:09:33 +0000 (01:09 +0400)]
libiconv: convert cd9660 to libiconv.

5 years agolibiconv conversion: add libkiconv to the build, fix header path in mount_msdos.
Alexander Polakov [Fri, 5 Jun 2009 10:14:28 +0000 (14:14 +0400)]
libiconv conversion: add libkiconv to the build, fix header path in mount_msdos.

5 years agoStage 5/5: Change mount_msdos to use libkiconv
Alexander Polakov [Fri, 5 Jun 2009 08:29:46 +0000 (12:29 +0400)]
Stage 5/5: Change mount_msdos to use libkiconv

mount_msdos should be linked shared now, that's unusual for
/sbin.

5 years agoStage 4/5: Import libkiconv from FreeBSD.
Alexander Polakov [Fri, 5 Jun 2009 08:24:06 +0000 (12:24 +0400)]
Stage 4/5: Import libkiconv from FreeBSD.

libkiconv user space library is used by mount_msdos.

5 years agoStage 3/5: Add msdosfs_iconv.
Alexander Polakov [Fri, 5 Jun 2009 08:18:02 +0000 (12:18 +0400)]
Stage 3/5: Add msdosfs_iconv.

Contains actual code to do conversion.
It seems like unloading is broken. Should be fixed later.

5 years agoStage 2/5: Change msdosfs to use libiconv in case.
Alexander Polakov [Fri, 5 Jun 2009 08:10:38 +0000 (12:10 +0400)]
Stage 2/5: Change msdosfs to use libiconv in case.

Code mostly from FreeBSD, ported by me. Still works with old
userspace (if mounted without conversion).

5 years agolibiconv: Uncomment iconv_vfs_refcount.
Alexander Polakov [Fri, 5 Jun 2009 08:04:28 +0000 (12:04 +0400)]
libiconv: Uncomment iconv_vfs_refcount.

5 years agoStage 1/5: Update libiconv to support multibyte encodings.
Alexander Polakov [Fri, 5 Jun 2009 07:59:03 +0000 (11:59 +0400)]
Stage 1/5: Update libiconv to support multibyte encodings.

Code from FreeBSD, ported by Alexander Polakov, fixed by Simon
Schubert.

5 years agocitrus: iconv support for static binaries
Alexander Polakov [Thu, 3 Sep 2009 18:51:10 +0000 (22:51 +0400)]
citrus: iconv support for static binaries

Compile iconv into libc.a.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 04:10:41 +0000 (21:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agosoopt_from_kbuf: Use szmin(), since both len and sopt_valsize is size_t
Sepherosa Ziehau [Sat, 5 Sep 2009 03:52:32 +0000 (11:52 +0800)]
soopt_from_kbuf: Use szmin(), since both len and sopt_valsize is size_t

Mainly to avoid integer truncation on 64bit platform.

Reminded-by: dillon@
5 years agosockopt: Short circuit most of the code in soopt_from_kbuf(), if len == 0
Sepherosa Ziehau [Sat, 5 Sep 2009 03:27:25 +0000 (11:27 +0800)]
sockopt: Short circuit most of the code in soopt_from_kbuf(), if len == 0

Current kva_p() does not work w/ zero sized kmalloced memory.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1481

5 years agoadd KTR_CTXSW option to log context switches
Aggelos Economopoulos [Sat, 5 Sep 2009 00:46:14 +0000 (03:46 +0300)]
add KTR_CTXSW option to log context switches

This logs the current thread and the thread we switch
to on every context switch or thread preemption event
when enabled.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 01:04:40 +0000 (18:04 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agotop(1): Silence gcc warnings.
Stathis Kamperis [Fri, 4 Sep 2009 17:22:49 +0000 (20:22 +0300)]
top(1): Silence gcc warnings.

The ORDERKEY_XXX() macros build up a deeply nested set of if-statements.
E.g.,

if (expr)
   if (expr)
      if (expr)
        if (expr)

The last if-statement needs to contain nothing (every expression has
its own side effect, so the whole cascade is actually meaningful). Using
a ; though, makes gcc generate warnings regarding 'empty body in if
statements'. That's why we, instead, use:

ORDERKEY_FOO1
ORDERKEY_FOO2
...
ORDERKEY_FOO3
{}

We could have embedded the {} in the definition of the macro itself, but
that would break if someone rearranged the macros' call order.

Reviewed-by: dillon@
5 years agonrelease.7: /dev/da8 is the default IMGUSBDEV.
Sascha Wildner [Fri, 4 Sep 2009 20:32:37 +0000 (22:32 +0200)]
nrelease.7: /dev/da8 is the default IMGUSBDEV.

Reported-by: Johannes Hofmann
5 years agoAMD64 - Make machine/endian.h work properly when compiled -m32.
Matthew Dillon [Fri, 4 Sep 2009 03:56:40 +0000 (20:56 -0700)]
AMD64 - Make machine/endian.h work properly when compiled -m32.

* Fixes issues compiling sys/boot in a 64-bit native environment.

Reported-by: corecode
5 years agomodules: Kill debugging.
Matthew Dillon [Thu, 3 Sep 2009 23:53:50 +0000 (16:53 -0700)]
modules: Kill debugging.

Requested-by: corecode
5 years agomodules: correct dependencies / version declarations
Simon Schubert [Thu, 3 Sep 2009 22:47:11 +0000 (00:47 +0200)]
modules: correct dependencies / version declarations

5 years agotest/amd64: build and install modules
Simon Schubert [Thu, 3 Sep 2009 20:42:52 +0000 (22:42 +0200)]
test/amd64: build and install modules

also don't try to install gcc44 since we don't build it.

5 years agoloader: update elf module code from FreeBSD
Simon Schubert [Thu, 3 Sep 2009 21:59:53 +0000 (23:59 +0200)]
loader: update elf module code from FreeBSD

5 years agomodules: add elf_obj linker for amd64
Simon Schubert [Thu, 3 Sep 2009 21:58:17 +0000 (23:58 +0200)]
modules: add elf_obj linker for amd64

Obtained-from:  FreeBSD

5 years agomodules: pull in most of FreeBSD's module linker changes
Simon Schubert [Thu, 3 Sep 2009 23:17:18 +0000 (01:17 +0200)]
modules: pull in most of FreeBSD's module linker changes

The big user-visible difference is that the module dependency
system changed.  Module dependencies are now the same as for
the loader, and the hack linker (and Makefile) magic is not
needed anymore.

Obtained-from:  FreeBSD

5 years agomodules: disable dummy module declarations
Simon Schubert [Thu, 3 Sep 2009 20:45:30 +0000 (22:45 +0200)]
modules: disable dummy module declarations

dummy modules serve a questionable goal and conflict with the
module linker update.

5 years agomodules: drop a.out module support
Simon Schubert [Thu, 3 Sep 2009 20:29:02 +0000 (22:29 +0200)]
modules: drop a.out module support

5 years agoamd64: declare initializecpu outside of SMP
Simon Schubert [Thu, 3 Sep 2009 20:41:01 +0000 (22:41 +0200)]
amd64: declare initializecpu outside of SMP

initializecpu() is not a SMP-only function; we have to
always declare it.  smp.h is the wrong file, but I didn't
find any better location.

5 years agoacpi: restructure genwakecode.sh
Simon Schubert [Thu, 3 Sep 2009 20:34:03 +0000 (22:34 +0200)]
acpi: restructure genwakecode.sh

genwakecode.sh used some obscure hexdump/sed magic to embed a binary
into source.  The specific usage of sed breaks in at least the UTF-8
locale.  Rework the script to use hexdump and sed in a less obscure
way.

5 years agoHAMMER Util - hammer iostats now reports undo space used.
Matthew Dillon [Thu, 3 Sep 2009 20:37:20 +0000 (13:37 -0700)]
HAMMER Util - hammer iostats now reports undo space used.

5 years agoHAMMER - Add vfs.hammer.stats_undo
Matthew Dillon [Thu, 3 Sep 2009 20:36:32 +0000 (13:36 -0700)]
HAMMER - Add vfs.hammer.stats_undo

* Statistics on number of bytes of undo space written.

5 years agoCAM - Check DA media on open, basic suppor for removable DA media (vs CD).
Matthew Dillon [Thu, 3 Sep 2009 15:26:26 +0000 (08:26 -0700)]
CAM - Check DA media on open, basic suppor for removable DA media (vs CD).

* Install setdiskinfo on probe for DA if no media is present, similar to how
  the CD works.  This allows open() to function.

* Recheck media presence on open().

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 3 Sep 2009 15:25:26 +0000 (08:25 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoHAMMER - Fix lost inode issue (primarily with nohistory mounts)
Matthew Dillon [Thu, 3 Sep 2009 15:18:43 +0000 (08:18 -0700)]
HAMMER - Fix lost inode issue (primarily with nohistory mounts)

* When a HAMMER cursor is unlocked it becomes tracked and unrelated
  B-Tree operations will cause the tracked cursor's nodes and indices
  to be updated.  The cursor structure also has a leaf element pointer
  which was not being properly updated.  This could lead to panics and
  lost inodes.

  Properly adjust the leaf element pointer in tracked cursors.

* The bug primarily occurs with nohistory mounts or nohistory sub-trees
  due to the larger number of physical deletions made to the B-Tree, but
  could also occur (rarely) with normal mounts.

* Add additional assertions to catch any further occurrences (though I
  think all the cases have been covered now).

* Add a new sysctl vfs.hammer.error_panic which can be set to e.g. 9 to
  cause critical errors to panic immediately instead of returning
  through the call stack, making debugging possible.

Reported-by: Numerous people
5 years agosubr_disk - add debug info
Alex Hornung [Thu, 3 Sep 2009 13:18:25 +0000 (14:18 +0100)]
subr_disk - add debug info

* Add tunable and sysctl int kern.disk_debug which enables debug info
  in critical parts of subr_disk (probing, creating, unprobing,
  destroying).

5 years agoacpi_wakeup - Mark used vars with attribute used
Alex Hornung [Thu, 3 Sep 2009 07:57:34 +0000 (08:57 +0100)]
acpi_wakeup - Mark used vars with attribute used

* Mark obscurely used variables (such as variables only used from inside
  inline assembly) with __attribute__((used)).
  This also solves an issue with llvm/clang.

5 years agomxge - Avoid using #cpu
Alex Hornung [Thu, 3 Sep 2009 07:54:41 +0000 (08:54 +0100)]
mxge - Avoid using #cpu

* Don't use #cpu preprocessor macro, as it isn't needed. CPU is detected
  properly by defines as CPU __CPU__ __CPU.
  This also fixes compilation problems with llvm/clang.

5 years agolinuxemu - fix typo
Alex Hornung [Thu, 3 Sep 2009 09:33:22 +0000 (10:33 +0100)]
linuxemu - fix typo

* Commit e54488bbec5c9f80e95cedd395b0e3d31fde253d introduced a typo
  in linux_file breaking anything using linux getdents stuff.
  This also fixes issue 1471 and brings linuxulator back into working
  condition.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1471
Reported-By: ftigeot
5 years agoTCP - Reduce context switching when handling large send*() or write()'s
Matthew Dillon [Thu, 3 Sep 2009 05:15:12 +0000 (22:15 -0700)]
TCP - Reduce context switching when handling large send*() or write()'s

* Large sends or writes would cause sosend() to sleep and wakeup for every
  tcp segment acknowledged, resulting in massive inefficiencies.  To deal
  with this, if no LOWAT is set we automatically set the LOWAT to 1/2 the
  send buffer size and adjust the wakeup code.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 3 Sep 2009 05:12:06 +0000 (22:12 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoNFE - Fix bug with imtimer transitions and improve performance
Matthew Dillon [Thu, 3 Sep 2009 05:06:22 +0000 (22:06 -0700)]
NFE - Fix bug with imtimer transitions and improve performance

* When the imtimer transitions to a new state via a sysctl the
  code called ifp->if_init() which more often then not caused
  the device to stop taking all interrupts.

* Change the way dynamic interrupt moderation works.  Timer moderation is
  not turned on until the discrete interrupt rate exceeds the threshold.
  e.g. by default 500uS is 2000 interrupts/second so timer moderation
  is not turned on until the discrete interrupt rate exceeds 2000 ips.

  This allows the device to respond interactively as long as traffic levels
  are reasonable, before converting into moderation-timer-based batching.

  Timer moderation is turned off and we go back to discrete interrupts
  if the average rate over ~4 seconds falls below the threshold.

* Change the interrupt moderation default from 125uS to 500uS.  125uS can
  saturate the cpu if the interrupt line is shared with other devices.
  A larger moderation timer is also more reasonable now that discrete
  interrupts are left intact until the rate exceeds the threshold.

  The moderation timer should be roughly designed to deal with the txring
  and rxring size.

5 years agotest commit
Alexander Polakov [Wed, 2 Sep 2009 15:25:08 +0000 (19:25 +0400)]
test commit

5 years agocitrus: add a list of supported locales and build UTF8 by default.
Alexander Polakov [Wed, 2 Sep 2009 14:54:57 +0000 (18:54 +0400)]
citrus: add a list of supported locales and build UTF8 by default.

5 years agocitrus: fix libc_rtld build with STATIC_LOCALES set.
Alexander Polakov [Wed, 2 Sep 2009 13:38:51 +0000 (17:38 +0400)]
citrus: fix libc_rtld build with STATIC_LOCALES set.

Fix locales build for libc_rtld
Disabled locales for libc_rtld.

5 years agomake.conf(5): mention STATIC_LOCALES
Alexander Polakov [Wed, 2 Sep 2009 12:54:19 +0000 (16:54 +0400)]
make.conf(5): mention STATIC_LOCALES

5 years agolibobjc (gcc44): Don't build when NO_OBJC is set.
Sascha Wildner [Wed, 2 Sep 2009 13:17:55 +0000 (15:17 +0200)]
libobjc (gcc44): Don't build when NO_OBJC is set.

Reported-by: Venkatesh Srinivas
5 years agottyslot(3) - Update for unix98 ptys
Alex Hornung [Wed, 2 Sep 2009 08:12:58 +0000 (09:12 +0100)]
ttyslot(3) - Update for unix98 ptys

* Update ttyslot(3) to be compatible with unix98 ptys. This fixes
  problems with logins on unix98 ptys not appearing in utmp.

* ttyslot was calling rindex, which is invalid for unix98 pty files,
  so now we just strip "/dev/".

Obtained-from: FreeBSD

5 years agogetttyent(3) - Update for unix98 ptys
Alex Hornung [Wed, 2 Sep 2009 07:26:26 +0000 (08:26 +0100)]
getttyent(3) - Update for unix98 ptys

* Update getttyent(3) to be compatible with unix98 ptys. This fixes
  problems with logins on unix98 ptys not appearing in utmp.

Obtained-from: FreeBSD

5 years agowall(1) - Fix for unix98 ptys
Alex Hornung [Wed, 2 Sep 2009 06:26:29 +0000 (07:26 +0100)]
wall(1) - Fix for unix98 ptys

* Wall didn't know about unix98 ptys, so it errored out about too many
  slashes in the terminal name, as pts/X, still contains a slash.

Obtained-from: FreeBSD

5 years agolibc: locale support for static binaries.
Alexander Polakov [Tue, 1 Sep 2009 21:09:48 +0000 (01:09 +0400)]
libc: locale support for static binaries.

Compile a fixed set of locales definable by STATIC_LOCALES into libc.

Partially-Obtained-From: http://osdir.com/ml/os.netbsd.bugs/2002-09/msg00025.html
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1362

5 years agoamd64: sync missing functions/config from i386
Simon Schubert [Sun, 30 Aug 2009 08:55:58 +0000 (10:55 +0200)]
amd64: sync missing functions/config from i386

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 1 Sep 2009 18:22:22 +0000 (11:22 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoKernel - Minor cleanup.
Matthew Dillon [Tue, 1 Sep 2009 18:22:05 +0000 (11:22 -0700)]
Kernel - Minor cleanup.

5 years agoKernel - remove the old specfs trialings.
Matthew Dillon [Tue, 1 Sep 2009 18:21:28 +0000 (11:21 -0700)]
Kernel - remove the old specfs trialings.

5 years agoKernel - Disk - do not bother trying to read the MBR if media_size is 0
Matthew Dillon [Tue, 1 Sep 2009 18:18:57 +0000 (11:18 -0700)]
Kernel - Disk - do not bother trying to read the MBR if media_size is 0

* Do not bother trying to read the MBR if media_size is 0, typically
  indicating removable media with no media present.

5 years agoKernel - add missing crfree() calls to two linux emulation functions
Matthew Dillon [Tue, 1 Sep 2009 18:18:11 +0000 (11:18 -0700)]
Kernel - add missing crfree() calls to two linux emulation functions

5 years agoopenpty(3) - change to use unix98 ptys
Alex Hornung [Tue, 18 Aug 2009 17:50:26 +0000 (18:50 +0100)]
openpty(3) - change to use unix98 ptys

* Try, by default, to use unix98 ptys first. If they fail at any
  point, fall back to bsd ptys (/dev/[pt]ty*).

Partially-Obtained-From: FreeBSD

5 years agopty - Introduce unix98 ptys
Alex Hornung [Tue, 1 Sep 2009 13:00:15 +0000 (14:00 +0100)]
pty - Introduce unix98 ptys

* Add the clone base device, /dev/ptmx.

* Add TIOCISPTMASTER ioctl, which returns successfully if the
  device is a unix98 pty master.

* Add sysctl kern.pty_debug, default to 0, to control pty debug
  info printing.

* Remove old unix98 pty code, which was inactive and inherited
  from an initial implementation during devfs development.

* Add userland functions:
  - posix_openpt (is equivalent to opening /dev/ptmx)
  - ptsname (as described in standard but thread-safe)
  - unlockpt (no op)
  - grantpt (no op)

* Implement proper permissions for unix98 pty slaves.
  Set them to real uid - group "tty" - 0620 for
  the slave device, as specified in standard (for grantpt).
  Master's permissions don't matter as the device cannot be opened
  again.
  Set the permissions of the unix98 ptys to be overridable by
  setattr() as the old ptys are.

* Use the define UNIX98_PTYS to activate/deactivate the unix98
  pty code in tty_pty.c. By default it is enabled.

NOTE: due to the permission handling on cloning of the slave
      pty, grantpt is not needed and would only pose a security
      risk.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 1 Sep 2009 14:38:50 +0000 (07:38 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoMFS - Fix MFS size passed to kernel mfs component
Matthew Dillon [Tue, 1 Sep 2009 14:37:42 +0000 (07:37 -0700)]
MFS - Fix MFS size passed to kernel mfs component

* Half the size was being passed because fssize is adjusted by
  mkfs from a sector-based count to a filesystem-block-based count.
  This caused failures as the MFS filesystem filled up.

5 years agomath(3): Remove some dead initialization.
Sascha Wildner [Tue, 1 Sep 2009 12:00:49 +0000 (14:00 +0200)]
math(3): Remove some dead initialization.

In-discussion-with: Stathis Kamperis <ekamperi@gmail.com>

5 years agoELF - allow execution of shared objects
Alex Hornung [Tue, 1 Sep 2009 09:42:56 +0000 (10:42 +0100)]
ELF - allow execution of shared objects

* Allow execution of shared ELF objects by default.

* Add a sysctl kern.elf_exec_dyn, default to 1, to control permission
  to execute shared elf objects.

* Incidentally, this also makes PIE work, at least for basic testcases
  as ncal, whereis, ...

Obtained-from: FreeBSD
Reported-By: Hasso Tepper
5 years agoUse pseudo-device to specify number of precreated devs
Alex Hornung [Tue, 1 Sep 2009 06:55:15 +0000 (07:55 +0100)]
Use pseudo-device to specify number of precreated devs

* use pseudo-device <dev> <n> in the kernel config to specify
  the number of devices to precreate (<n>) for snp, tun, vn, bpf.

* The full rationale (for vn, snp, bpf and tun) is:
  - if NO pseudo-device foo is specified, 4 devices will be
    precreated.
  - if pseudo-device foo is specified, 4 devices will be
    precreated.
  - if pseudo-device foo N, where N > 1 is specified, N devices
    will be precreated.

5 years agorpc.statd(8): Fix 2 cases where syslog() was passed too many args.
Sascha Wildner [Tue, 1 Sep 2009 08:21:37 +0000 (10:21 +0200)]
rpc.statd(8): Fix 2 cases where syslog() was passed too many args.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 31 Aug 2009 21:54:43 +0000 (14:54 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoMFS - Fix mmap issues with files under MFS
Matthew Dillon [Mon, 31 Aug 2009 21:52:08 +0000 (14:52 -0700)]
MFS - Fix mmap issues with files under MFS

* MFS relied on specfs to supply a getpages function.  specfs no longer
  exists and MFS's constructed vnode did not point at devfs.

  Instead of synthesizing a vnode access the real devfs vnode associated
  with /dev/mfs%d.

* Remove the MFS vnops for its synthesized vnode.  MFS now uses a devfs
  vnode which uses the devfs vnops.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>:
5 years agovn - enable autocloning
Alex Hornung [Mon, 31 Aug 2009 18:18:32 +0000 (19:18 +0100)]
vn - enable autocloning

* Create /dev/vn as autoclone device, but keep precreating 4
  vn devices (vn0 .. vn3).

* When "vn" is specified to vnconfig instead of "vnXX", the vn
  device is cloned and the name of the new device is printed
  on screen in a message of the form:
  "Using: vn6".

* On detach of the vn device (vnconfig -u) the cloned device is
  destroyed. This only happens for cloned vn devices (vn4 ..vnX).

5 years agotap - Don't make_dev if dev already exists
Alex Hornung [Sun, 30 Aug 2009 17:44:30 +0000 (18:44 +0100)]
tap - Don't make_dev if dev already exists

* If the unit already exists when calling tap_clone_create,
find the corresponding cdev by calling
devfs_find_device_by_name.
* If the unit doesn't exist, call make_dev.
* Assert that dev != NULL before calling tapcreate()

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1453
Reported-By: Rumko
5 years agotrek(6): Drop fast/slow modes and the broken autodetection
Sascha Wildner [Sun, 30 Aug 2009 09:58:32 +0000 (11:58 +0200)]
trek(6): Drop fast/slow modes and the broken autodetection

These modes were not documented in the manpage, the autodetect
logic was reversed (only terminals with baud < 1200 would get the fast
flag) and even the source was confused claiming this fast setting was
for terminals with baud > 300.

The only thing that changes is the automatic short range scan output
down when entering a new sector. Now the full report is shown always
but can still be somewhat customized.

Incidentally, this also obviates the need for termios. yay!

Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1470>

5 years agoSome small fixes in the iscsi manual pages.
Sascha Wildner [Sun, 30 Aug 2009 09:36:10 +0000 (11:36 +0200)]
Some small fixes in the iscsi manual pages.

5 years agomake_dev.9: Use .Dx and fix a typo.
Sascha Wildner [Sun, 30 Aug 2009 09:26:15 +0000 (11:26 +0200)]
make_dev.9: Use .Dx and fix a typo.

5 years agoFix registration issue in the devfs rc script.
Sascha Wildner [Sun, 30 Aug 2009 09:19:28 +0000 (11:19 +0200)]
Fix registration issue in the devfs rc script.

rc.d/devfs is not controlled by an _enable variable so just register properly
as being configured, so that later scripts indirectly depending on it will
not fail when being started by rcrun(8).

Reported-by: hasso
While here, add some comments about the scripts purpose and print rules files
as they are applied.

5 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 30 Aug 2009 03:48:42 +0000 (20:48 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

5 years agoKernel - replace unbounded uses of kvcprintf() and reduce stack use by devfs
Matthew Dillon [Sun, 30 Aug 2009 03:46:41 +0000 (20:46 -0700)]
Kernel - replace unbounded uses of kvcprintf() and reduce stack use by devfs

* Replace unbounded uses of kvcprintf() to guarantee that buffers do not
  overflow.

* Do not declare PATH_MAX buffers on the stack.  Use kvasnrprintf() or
  kmalloc() to allocate space.

* In make_autoclone_dev() fix an improper use of a buffer passed as the
  fmt argument to make_dev().

5 years agoKernel - add ksnrprintf() and friends.
Matthew Dillon [Sun, 30 Aug 2009 03:44:30 +0000 (20:44 -0700)]
Kernel - add ksnrprintf() and friends.

* Add ksnrprintf(), kvsnrprintf(), kvasnrprintf(), and kvasfree(),
  functions to replace unbounded uses of kvcprintf().

5 years agoFix some more typos in manual pages and messages.
Sascha Wildner [Sat, 29 Aug 2009 21:55:15 +0000 (23:55 +0200)]
Fix some more typos in manual pages and messages.

5 years agoFix typo: aquire -> acquire.
Sascha Wildner [Sat, 29 Aug 2009 21:04:45 +0000 (23:04 +0200)]
Fix typo: aquire -> acquire.

5 years agoFix installing from read-only ${.OBJDIR}
YONETANI Tomokazu [Fri, 28 Aug 2009 10:06:32 +0000 (19:06 +0900)]
Fix installing from read-only ${.OBJDIR}

By default, install command preserves mtime, and files in the source tree
always have older mtime than a file created by touch command, in this case
${.OBJDIR}/openssl/.dummy, even though it's created earlier by dependency.
Since .dummy is newer, header files get created in objdir at install target
and that requires write permission on ${.OBJDIR}.