Commit Graph

2384 Commits

Author SHA1 Message Date
Nick Hibma 6979450036 Update the comments on values than can be returned by DEVICE_PROBE.
DEVICE_PROBE can return priorities.

Reviewed by:	Doug Rabson <dfr@nlsystems.com>
1999-06-17 19:22:12 +00:00
Bruce Evans 212dfe6fc7 Fixed a missing userland dev_t to kernel dev_t conversion. 1999-06-17 07:07:55 +00:00
Julian Elischer 4e1b754078 Reformat comment to match indentation of code around it. 1999-06-17 01:25:25 +00:00
Kirk McKusick f9c8cab591 Add a vnode argument to VOP_BWRITE to get rid of the last vnode
operator special case. Delete special case code from vnode_if.sh,
vnode_if.src, umap_vnops.c, and null_vnops.c.
1999-06-16 23:27:55 +00:00
Dmitrij Tejblum 71ddfdbbd5 Make sure syscall arguments properly aligned in ktrace records.
Make syscall return value a register_t.

Based on a patch from Hidetoshi Shimokawa.
Mostly reviewed by:	Hidetoshi Shimokawa and Bruce Evans.
1999-06-16 18:37:01 +00:00
David Greenman cd3fe8d008 Changed trypbuf to a getpbuf to work around a problem where redundant writes
would occur when clustering them - caused by running out of buffers
and taking a degenerate code path as a result. It appears that waiting
instead for buffers to become available is okay.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Discovered by: Craig A Soules <soules+@andrew.cmu.edu>
1999-06-16 15:54:30 +00:00
Tor Egge 01cf8ad024 If we still haven't got a sufficient number of free buffers after the
call to flushdirtybuffers() then sleep in waitfreebuffers().
PR:		11697
Reviewed by:	David Greenman, Matt Dillon
1999-06-16 03:19:04 +00:00
Kirk McKusick e4ab40bcb6 Get rid of the global variable rushjob and replace it with a function in
kern/vfs_subr.c named speedup_syncer() which handles the speedup request.
Change the various clients of rushjob to use the new function.
1999-06-15 23:37:29 +00:00
Mike Smith 79fc0bf4a0 From the submitter:
- this causes POSIX locking to use the thread group leader
   (p->p_leader) as the locking thread for all advisory locks.
   In non-kernel-threaded code p->p_leader == p, so this will have
   no effect.

   This results in (more) correct POSIX threaded flock-ing semantics.

   It also prevents the leader from exiting before any of the children.
   (so that p->p_leader will never be stale) in exit1().

   We have been running this patch for over a month now in our lab
   under load and at customer sites.

Submitted by:	John Plevyak <jplevyak@inktomi.com>
1999-06-07 20:37:29 +00:00
Archie Cobbs 05292ba234 ksprintn() may be called with base=2, so redefine MAXNBUF accordingly.
Other brucification tweaks.

Obtained from:	bde@freebsd.org
1999-06-07 18:26:26 +00:00
Archie Cobbs ad4f8dbd23 The function ksprintn(), which is used to convert numbers to ASCII, is not
reentrant because it returns a static buffer. This results in a race condition
when/if an interrupt handler calls log(), printf() etc. Fix this.
1999-06-06 02:41:55 +00:00
Alan Cox 3d41489171 Restructure pipe_read in order to eliminate several race conditions.
Submitted by:	Matthew Dillon <dillon@apollo.backplane.com> and myself
1999-06-05 03:53:57 +00:00
Peter Wemm 9c9906e912 Plug a mbuf leak in tcp_usr_send(). pru_send() routines are expected
to either enqueue or free their mbuf chains, but tcp_usr_send() was
dropping them on the floor if the tcpcb/inpcb has been torn down in the
middle of a send/write attempt.  This has been responsible for a wide
variety of mbuf leak patterns, ranging from slow gradual leakage to rather
rapid exhaustion.  This has been a problem since before 2.2 was branched
and appears to have been fixed in rev 1.16 and lost in 1.23/1.28.

Thanks to Jayanth Vijayaraghavan <jayanth@yahoo-inc.com> for checking
(extensively) into this on a live production 2.2.x system and that it
was the actual cause of the leak and looks like it fixes it.  The machine
in question was loosing (from memory) about 150 mbufs per hour under
load and a change similar to this stopped it.  (Don't blame Jayanth
for this patch though)

An alternative approach to this would be to recheck SS_CANTSENDMORE etc
inside the splnet() right before calling pru_send() after all the potential
sleeps, interrupts and delays have happened.  However, this would mean
exposing knowledge of the tcp stack's reset handling and removal of the
pcb to the generic code.  There are other things that call pru_send()
directly though.

Problem originally noted by:  John Plevyak <jplevyak@inktomi.com>
1999-06-04 02:27:06 +00:00
Dmitrij Tejblum 4ea5ad99d5 || vs && confusion in cdevsw_add(). 1999-06-01 20:41:26 +00:00
Poul-Henning Kamp 6fcd8a7c93 Introduce the makebdev() function, it does the same as the makedev()
function for now, but that will change.
1999-06-01 18:56:26 +00:00
Jonathan Lemon eb9d435ae7 Unifdef VM86.
Reviewed by:	silence on on -current
1999-06-01 18:20:36 +00:00
Poul-Henning Kamp 2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +00:00
Poul-Henning Kamp 4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Doug Rabson 20b62c5ac9 * Add a function devclass_create() which looks up the named devclass and
creates it if it doesn't exist.
* Rename resource_list_remove() to resource_list_delete() for consistency.
1999-05-30 10:27:11 +00:00
Doug Rabson bea6af4d31 * Change device_add_child_after() to device_add_child_ordered() which is
easier to use and more flexible.
* Change BUS_ADD_CHILD to take an order argument instead of a place.
* Define a partial ordering for isa devices so that sensitive devices are
  probed before non-sensitive ones.
1999-05-28 09:25:16 +00:00
Doug Rabson 8be70a6eac Fix an embarrasing typo in device_add_child_after(). I can't understand
how this hasn't caused problems before.

Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1999-05-27 07:18:41 +00:00
John Birrell 350185153d Back out my previous change (phk didn't like it) in favour of setting
rootdev in the mfs initialisation code iff MFS_ROOT (which Bruce doesn't
like). Damned if I do - damned if I don't.
1999-05-24 00:37:26 +00:00
John Birrell 02013ff886 Remove the test for bdevsw(dev) == NULL from bdevvp() because it fails
if there is no character device associated with the block device. In this
case that doesn't matter because bdevvp() doesn't use the character
device structure.

I can use the pointy bit of the axe too.
1999-05-24 00:34:10 +00:00
John Birrell d47066829a Make MFS_ROOT work again. MFS_ROOT means that rootdev is not set.
Broken by: phk
Problem ignored by: phk
1999-05-23 10:51:33 +00:00
Dmitrij Tejblum 9d3a442583 Don't call calcru() on a swapped-out process. calcru() access p_stats, which
is in U-area.
1999-05-22 20:10:31 +00:00
Doug Rabson 7e082b48a2 Add some helper functions to make it easier to write a driver for a bus
which needs to manage resources for its children.
1999-05-22 14:57:15 +00:00
Peter Wemm 13b758eb46 Add seatbelt like in previous function.. 1999-05-22 09:52:21 +00:00
Andrey A. Chernov 925fa5c3f5 Realy fix overflow on SO_*TIMEO
Submitted by: bde
1999-05-21 15:54:40 +00:00
Doug Rabson 0053cc2cfe Silently return NULL from devclass_get_device if dc == NULL. The caller
should be handling NULL returns already.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-05-21 08:23:58 +00:00
Peter Wemm 1d23cba9b7 Oops, set module->file..
PR: 1179
Submitted-by: lha@stacken.kth.se
1999-05-20 00:00:58 +00:00
Luoqi Chen 15a33d7c1d TIOCEXT is also inapproriate before the slave is open, return EAGAIN when
these ioctls are attempted. Move a misplaced comment.

Pointed out by:	Bruce
1999-05-18 14:53:52 +00:00
Luoqi Chen 519566d2e3 Avoid negative numbers in dev_t manipulation. This should fix recent MFS
related crashes.
1999-05-18 13:14:43 +00:00
Poul-Henning Kamp 6a0ce00218 Use NOUDEV for udev_t's 1999-05-17 13:50:24 +00:00
Doug Rabson f40ddd55b0 Change the definition of e_tdev in struct kinfo_proc from dev_t to udev_t
Reviewed by: Poul-Henning Kamp <phk@critter.freebsd.dk>
1999-05-17 13:28:35 +00:00
Alan Cox e972780a11 Add the options MAP_PREFAULT and MAP_PREFAULT_PARTIAL to vm_map_find/insert,
eliminating the need for the pmap_object_init_pt calls in imgact_* and
mmap.

Reviewed by:	David Greenman <dg@root.com>
1999-05-17 00:53:56 +00:00
Eivind Eklund 1d8290f3c3 Add enough include files to make this actually compile on an a.out system. 1999-05-15 23:18:32 +00:00
Alan Cox e5f13bdd09 Simplify vm_map_find/insert's interface: remove the MAP_COPY_NEEDED option.
It never makes sense to specify MAP_COPY_NEEDED without also specifying
MAP_COPY_ON_WRITE, and vice versa.  Thus, MAP_COPY_ON_WRITE suffices.

Reviewed by:	David Greenman <dg@root.com>
1999-05-14 23:09:34 +00:00
Luoqi Chen 7af0acae17 Ignore some ioctls on the master until the slave is open. 1999-05-14 20:44:20 +00:00
Luoqi Chen 0ce54cbb0c Legally acquire a major number for mfs. 1999-05-14 20:40:23 +00:00
Doug Rabson 6c2e3dde8c * Define a new static method DEVICE_IDENTIFY which is called to add device
instances to a parent bus.
* Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY
  to add new instances.
* Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY
  for each driver attached to the parent's devclass.
* Move the hint-based isa probe from the isa driver to a new isahint driver
  which can be shared between i386 and alpha.
1999-05-14 11:22:47 +00:00
Doug Rabson 454a0546ba Adjust method dispatch to ensure that default methods are called properly. 1999-05-14 09:13:43 +00:00
Kirk McKusick eaea7a9e9f Previously directories were sync'ed every 10 seconds while bitmaps &
inodes were synced every 15 seconds. This is now reversed as during
directory create, we cannot commit the directory entry until its
inode has been written. With this switch, the inodes will be more
likely to be written by the time that the directory is written thus
reducing the number of directory rollbacks that are needed.
1999-05-14 01:29:21 +00:00
Bruce Evans 7d9509f96c Added ../sys/syscall.mk to targets. Back it up like all the other
targets.
1999-05-13 09:19:14 +00:00
Bruce Evans 853cbeeb35 Regenerated. 1999-05-13 09:12:57 +00:00
Bruce Evans f664346fbe Fixed nonsense arg type `const caddr_t' in the prototype() for utrace().
Changed to `const void *'.  utrace() is undocumented, so nothing should
notice.

Fixed missing consts for utrace() and ktrace() in syscalls.master.

sys/ktrace.h is missing some Lite2 changes of shorts to ints.
1999-05-13 09:09:37 +00:00
Peter Wemm ccb84588dd Try an fix a couple of dev_t/major/minor etc nits. 1999-05-12 22:30:50 +00:00
Luoqi Chen 0f0fe5a4c5 Unbreak VESA on SMP. 1999-05-12 21:39:07 +00:00
Peter Wemm cc5881cff5 Fix (?) SPECHASH dev_t/major/minor/etc args 1999-05-12 19:06:40 +00:00
Poul-Henning Kamp e519e78b42 braino. 1999-05-12 13:06:34 +00:00
Bruce Evans ce45b512b3 Fixed corruption of the kmemstatistcs list. The first malloc()
with malloc type at the tail of the list changed the list from
linear to circular.  This seemed to cause surprisingly few problems,
but it now causes weird output from `vmstat -m', probably because
a more important malloc type is now at the tail of the list.

Fix it by abusing ks_limit instead of ks_next as a flag for being
on the list.  Don't forget to clear the flag when a malloc type is
uninit'ed.  Uninit'ing is still fundamentally broken -- it loses
history.
1999-05-12 11:11:27 +00:00