dragonfly.git
14 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

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

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

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

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

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

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

14 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.

14 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.

14 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.

14 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.

14 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).

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

14 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.

14 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.

14 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@
14 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

14 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.

14 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@
14 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
14 years agomodules: Kill debugging.
Matthew Dillon [Thu, 3 Sep 2009 23:53:50 +0000 (16:53 -0700)]
modules: Kill debugging.

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

14 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.

14 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

14 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

14 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

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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>
14 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

14 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
14 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).

14 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.

14 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.

14 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
14 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.

14 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

14 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.

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

14 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.

14 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.

14 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

14 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
14 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

14 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

14 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

14 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

14 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

14 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

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

14 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.

14 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.

14 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

14 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

14 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.

14 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

14 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.

14 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>

14 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
14 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.

14 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.

14 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

14 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>:
14 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).

14 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
14 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>

14 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.

14 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.

14 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.

14 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

14 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().

14 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().

14 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.

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

14 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}.

14 years agoFix installing from read-only ${.OBJDIR}
YONETANI Tomokazu [Thu, 27 Aug 2009 08:06:34 +0000 (17:06 +0900)]
Fix installing from read-only ${.OBJDIR}

creating a file in beforeinstall target requires write permission
in ${.OBJDIR} on machines to run installworld, making it impossible
if mounted read-only via NFS.

14 years agomalloc.3: IMPLEMENTATION NOTES were moved to posix_memalign.3.
Sascha Wildner [Sat, 29 Aug 2009 02:20:37 +0000 (04:20 +0200)]
malloc.3: IMPLEMENTATION NOTES were moved to posix_memalign.3.

14 years agodevice.h: Properly tabify
Sascha Wildner [Fri, 28 Aug 2009 20:07:06 +0000 (22:07 +0200)]
device.h: Properly tabify

14 years agoUpdate the make_dev(9) manual page for devfs.
Sascha Wildner [Fri, 28 Aug 2009 20:06:35 +0000 (22:06 +0200)]
Update the make_dev(9) manual page for devfs.

Submitted-by: alexh
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 28 Aug 2009 17:54:21 +0000 (10:54 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoNFS - Fix remaining VM/BIO issues
Matthew Dillon [Fri, 28 Aug 2009 16:47:44 +0000 (09:47 -0700)]
NFS - Fix remaining VM/BIO issues

The only bug that could not be resolved by the previous commit is related
to the use of dynamic buffer sizing for the buffer that straddles the
EOF of the file.  For example, if a file is 32768+4127 bytes then the
second buffer cache buffer would have a size of 4127 bytes instead of
32768 bytes.  Because the EOF point can move around and NFS does not
keep good track of it buffers with weird sizes could build up in the
system and interfere with operations against backing VM pages.

In particular truncations followed by seek-write extensions would
interfere with mmap()'s areas around the original (now non-applicable)
truncation point.

It was not possible to fix this bug while still keeping the dynamic
buffer sizing, so this patch converts NFS's buffer cache operations
to use fixed-sized buffers in all cases.  This leads to more wasted
memory when dealing with small files and further optimizations may be
attempted in the future, but it seems to solve issues with BIO/VM
interactions.

* Fsx now survives an overnight pass.

* Buildworld now survives multiple passes when using a writable NFS /usr/obj.

* Fix umount sequencing.  Sometimes the rxthread would get into a
  reconnect loop and not exit.

14 years agoAdd iscsi_initiator(4) manual page to the build.
Sascha Wildner [Fri, 28 Aug 2009 11:21:34 +0000 (13:21 +0200)]
Add iscsi_initiator(4) manual page to the build.

14 years agodma: add TODO
Simon Schubert [Fri, 28 Aug 2009 11:00:33 +0000 (13:00 +0200)]
dma: add TODO

14 years agoMerge commit 'crater/master'
Simon Schubert [Fri, 28 Aug 2009 10:33:13 +0000 (12:33 +0200)]
Merge commit 'crater/master'

14 years agogcc44: install mm_malloc.h
Simon Schubert [Fri, 28 Aug 2009 10:29:46 +0000 (12:29 +0200)]
gcc44: install mm_malloc.h

14 years agogcc41: install mm_malloc.h
Simon Schubert [Fri, 28 Aug 2009 10:29:35 +0000 (12:29 +0200)]
gcc41: install mm_malloc.h

14 years agogcc44: update README.DELETED
Simon Schubert [Fri, 28 Aug 2009 10:29:04 +0000 (12:29 +0200)]
gcc44: update README.DELETED

14 years agoMerge branch 'vendor/GCC44'
Simon Schubert [Fri, 28 Aug 2009 10:28:55 +0000 (12:28 +0200)]
Merge branch 'vendor/GCC44'

14 years agogcc44: add forgotten file
Simon Schubert [Fri, 28 Aug 2009 10:28:45 +0000 (12:28 +0200)]
gcc44: add forgotten file

14 years agogcc41: update README.DELETED
Simon Schubert [Fri, 28 Aug 2009 10:26:29 +0000 (12:26 +0200)]
gcc41: update README.DELETED

14 years agoMerge branch 'vendor/GCC'
Simon Schubert [Fri, 28 Aug 2009 10:26:18 +0000 (12:26 +0200)]
Merge branch 'vendor/GCC'