Commit Graph

2786 Commits

Author SHA1 Message Date
Matt Jacob 9efed284d5 correct incomplete last change 1999-12-03 09:10:04 +00:00
Matthew N. Dodd fe0d408987 Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered().  'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t.  Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything.  I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by:	peter, dfr
1999-12-03 08:41:24 +00:00
Nick Hibma 39e86a12aa Remove check for attached state.
sc = devclass_get_softc(devclass, unit);

doesn't return NULL during attach anymore, and produces the sc,
identical to (for devclass_get_unit(devclass, unit) != NULL that is):

   sc = device_get_softc(devclass_get_unit(devclass, unit));

Reviewed-by:   dfr
1999-12-02 16:30:21 +00:00
Archie Cobbs 1c38f2ea70 The functions m_copym() and m_copypacket() return read-only copies,
because in the case of mbuf clusters they only increment the reference
count rather than actually copying the data.

Add comments to this effect, and add a new routine called m_dup() that
returns a real, writable copy of an mbuf chain.

This is preliminary work required for implementing 'ipfw tee'.

Reviewed by:	julian
1999-12-01 22:31:32 +00:00
Brian Feldman 226420a464 Separate some common sysctl code into sysctl_find_oid() and calling
thereof.  Also, make the errno returns  _correct_, and add a new one
which is more appropriate.
1999-12-01 02:25:19 +00:00
Kirk McKusick e9cc475851 Collect read and write counts for filesystems. This new code
drops the counting in bwrite and puts it all in spec_strategy.
I did some tests and verified that the counts collected for writes
in spec_strategy is identical to the counts that we previously
collected in bwrite. We now also get read counts (async reads
come from requests for read-ahead blocks). Note that you need
to compile a new version of mount to get the read counts printed
out. The old mount binary is completely compatible, the only
reason to install a new mount is to get the read counts printed.

Submitted by:	Craig A Soules <soules+@andrew.cmu.edu>
Reviewed by:	Kirk McKusick <mckusick@mckusick.com>
1999-12-01 02:09:30 +00:00
Peter Wemm ebc49c5654 Don't make the ktrace hook in tsleep() deref a null curproc after a panic.
PR:		15169
Submitted by:	David Gilbert <dgilbert@velocet.ca>
1999-11-30 09:01:46 +00:00
Matthew N. Dodd 44a451ba24 Reduce code duplication.
Hopefully this clears up some confusion about the nature of
devclass_get_softc() vs. device_get_softc() as well.

The check against DS_ATTACHED remains as this is not
a change that modifies functionality.

Reviewed by:	Peter "in principle" Wemm
1999-11-30 07:06:03 +00:00
Matthew Dillon 245efbba4d Remove vfs_getrootfsid() function (a temporary hack added a few months
ago to make BOOTP work again).  It is no longer required by BOOTP and
    no longer used.
1999-11-29 22:25:36 +00:00
Poul-Henning Kamp c464420c89 Report swapdevices as cdevs rather than bdevs.
Remove unused dev2budev() function.
1999-11-29 21:37:18 +00:00
Poul-Henning Kamp 38941f351c Remove the now unused chrtoblk() function. 1999-11-29 20:50:58 +00:00
Matthew Dillon 99e659dcfa Make BOOTP work again.
Submitted by:	Doug Ambrisko <ambrisko@whistle.com>
1999-11-29 18:51:04 +00:00
Poul-Henning Kamp 8f04f6c729 Add a bit of sanity checking and problem avoidance in case the
timecounter hardware is bogus.

This will produce a new warning "microuptime() went backwards"
and try to not screw up the process resource accounting.
1999-11-29 11:29:04 +00:00
Mike Smith c0da4cacd0 Use the correct mounted-from path when allocating the root mount, if we know
what it is.

Be more correct in unbusying the mountpoint (especially before freeing it).

Remove support for mounting 'r' devices as root.  You don't mount 'r'
devices anywhere else, and they're going away anyway.

Submitted by:	bde
1999-11-28 22:20:18 +00:00
Dan Moschuk ee3fd60126 Introduce OpenBSD-like Random PIDs. Controlled by a sysctl knob
(kern.randompid), which is currently defaulted off.  Use ARC4 (RC4) for our
random number generation, which will not get me executed for violating
crypto laws; a Good Thing(tm).

Reviewed and Approved by: bde, imp
1999-11-28 17:51:09 +00:00
Poul-Henning Kamp ee072c08d0 Convert dumpon to work on character devices instead of block devices.
NB: You may need to change your /etc/rc.conf!
1999-11-28 16:25:17 +00:00
Bruce Evans bdf423572e Scheduler fixes equivalent to the ones logged in the following NetBSD
commit to kern_synch.c:

----------------------------
revision 1.55
date: 1999/02/23 02:56:03;  author: ross;  state: Exp;  lines: +39 -10
Scheduler bug fixes and reorganization
* fix the ancient nice(1) bug, where nice +20 processes incorrectly
  steal 10 - 20% of the CPU, (or even more depending on load average)
* provide a new schedclk() mechanism at a new clock at schedhz, so high
  platform hz values don't cause nice +0 processes to look like they are
  niced
* change the algorithm slightly, and reorganize the code a lot
* fix percent-CPU calculation bugs, and eliminate some no-op code

=== nice bug === Correctly divide the scheduler queues between niced and
compute-bound processes. The current nice weight of two (sort of, see
`algorithm change' below) neatly divides the USRPRI queues in half; this
should have been used to clip p_estcpu, instead of UCHAR_MAX.  Besides
being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op,
and it was done after decay_cpu() which can only _reduce_ the value.  It
has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can
scheduler-penalize themselves onto the same queue as nice +20 processes.
(Or even a higher one.)

=== New schedclk() mechansism === Some platforms should be cutting down
stathz before hitting the scheduler, since the scheduler algorithm only
works right in the vicinity of 64 Hz. Rather than prescale hz, then scale
back and forth by 4 every time p_estcpu is touched (each occurance an
abstraction violation), use p_estcpu without scaling and require schedhz
to be generated directly at the right frequency. Use a default stathz (well,
actually, profhz) / 4, so nothing changes unless a platform defines schedhz
and a new clock.  Define these for alpha, where hz==1024, and nice was
totally broke.

=== Algorithm change === The nice value used to be added to the
exponentially-decayed scheduler history value p_estcpu, in _addition_ to
be incorporated directly (with greater wieght) into the priority calculation.
At first glance, it appears to be a pointless increase of 1/8 the nice
effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that
because it will ramp up linearly but be decayed only exponentially, thus
converging to an additional .75 nice for a loadaverage of one. I killed
this, it makes the behavior hard to control, almost impossible to analyze,
and the effect (~~nothing at for the first second, then somewhat increased
niceness after three seconds or more, depending on load average) pointless.

=== Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation.
Collect scheduler functionality. Try to put each abstraction in just one
place.
----------------------------

The details are a little different in FreeBSD:

=== nice bug ===   Fixing this is the main point of this commit.  We use
essentially the same clipping rule as NetBSD (our limit on p_estcpu
differs by a scale factor).  However, clipping at all is fundamentally
bad.  It gives free CPU the hoggiest hogs once they reach the limit, and
reaching the limit is normal for long-running hogs.  This will be fixed
later.

=== New schedclk() mechanism ===  We don't use the NetBSD schedclk()
(now schedclock()) mechanism.  We require (real)stathz to be about 128
and scale by an extra factor of 2 compared with NetBSD's statclock().
We scale p_estcpu instead of scaling the clock.  This is more accurate
and flexible.

=== Algorithm change ===  Same change.

=== Other bugs ===  The p_pctcpu bug was fixed long ago.  We don't try as
hard to abstract functionality yet.

Related changes: the new limit on p_estcpu must be exported to kern_exit.c
for clipping in wait1().

Agreed with by:		dufault
1999-11-28 12:12:14 +00:00
Bruce Evans f0ebe4973f Scheduler fixes equivalent to the ones logged in the following NetBSD
commit to kern_synch.c:

  ----------------------------
  revision 1.55
  date: 1999/02/23 02:56:03;  author: ross;  state: Exp;  lines: +39 -10
  Scheduler bug fixes and reorganization
  * fix the ancient nice(1) bug, where nice +20 processes incorrectly
    steal 10 - 20% of the CPU, (or even more depending on load average)
  * provide a new schedclk() mechanism at a new clock at schedhz, so high
    platform hz values don't cause nice +0 processes to look like they are
    niced
  * change the algorithm slightly, and reorganize the code a lot
  * fix percent-CPU calculation bugs, and eliminate some no-op code

  === nice bug === Correctly divide the scheduler queues between niced and
  compute-bound processes. The current nice weight of two (sort of, see
  `algorithm change' below) neatly divides the USRPRI queues in half; this
  should have been used to clip p_estcpu, instead of UCHAR_MAX.  Besides
  being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op,
  and it was done after decay_cpu() which can only _reduce_ the value.  It
  has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can
  scheduler-penalize themselves onto the same queue as nice +20 processes.
  (Or even a higher one.)

  === New schedclk() mechansism === Some platforms should be cutting down
  stathz before hitting the scheduler, since the scheduler algorithm only
  works right in the vicinity of 64 Hz. Rather than prescale hz, then scale
  back and forth by 4 every time p_estcpu is touched (each occurance an
  abstraction violation), use p_estcpu without scaling and require schedhz
  to be generated directly at the right frequency. Use a default stathz (well,
  actually, profhz) / 4, so nothing changes unless a platform defines schedhz
  and a new clock.  Define these for alpha, where hz==1024, and nice was
  totally broke.

  === Algorithm change === The nice value used to be added to the
  exponentially-decayed scheduler history value p_estcpu, in _addition_ to
  be incorporated directly (with greater wieght) into the priority calculation.
  At first glance, it appears to be a pointless increase of 1/8 the nice
  effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that
  because it will ramp up linearly but be decayed only exponentially, thus
  converging to an additional .75 nice for a loadaverage of one. I killed
  this, it makes the behavior hard to control, almost impossible to analyze,
  and the effect (~~nothing at for the first second, then somewhat increased
  niceness after three seconds or more, depending on load average) pointless.

  === Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation.
  Collect scheduler functionality. Try to put each abstraction in just one
  place.
  ----------------------------

The details are a little different in FreeBSD:

=== nice bug ===   Fixing this is the main point of this commit.  We use
essentially the same clipping rule as NetBSD (our limit on p_estcpu
differs by a scale factor).  However, clipping at all is fundamentally
bad.  It gives free CPU the hoggiest hogs once they reach the limit, and
reaching the limit is normal for long-running hogs.  This will be fixed
later.

=== New schedclk() mechanism ===  We don't use the NetBSD schedclk()
(now schedclock()) mechanism.  We require (real)stathz to be about 128
and scale by an extra factor of 2 compared with NetBSD's statclock().
We scale p_estcpu instead of scaling the clock.  This is more accurate
and flexible.

=== Algorithm change ===  Same change.

=== Other bugs ===  The p_pctcpu bug was fixed long ago.  We don't try as
hard to abstract functionality yet.

Related changes: the new limit on p_estcpu must be exported to kern_exit.c
for clipping in wait1().

Agreed with by:		dufault
1999-11-28 12:12:13 +00:00
Peter Wemm 64f86df1ed Take a shot at implementing the fix for PR 15014 for the a.out kernel
linker as well.

PR:		15014
Submitted by:	Vladimir N. Silyaev <vns@delta.odessa.ua>
1999-11-28 12:06:29 +00:00
Peter Wemm b5abfb708c Fix an embarresing mistake in the kld symbol lookup for DDB. It should
now correctly do a traceback when crashing inside a KLD module.

PR:		15014
Submitted by:	Vladimir N. Silyaev <vns@delta.odessa.ua>
1999-11-28 11:59:18 +00:00
Bruce Evans 9bc8d885ed Updated comments for the move in the previous commit. 1999-11-27 15:27:11 +00:00
Bruce Evans 71a62f8a05 Fixed some comments in statclock(). The previous commit made it clearer
that one comment was attached to null code.
1999-11-27 14:37:34 +00:00
Bruce Evans 8a9d4d98b1 Moved scheduling-related code to kern_synch.c so that it is easier to fix
and extend.  The new function containing the code is named schedclock()
as in NetBSD, but it has slightly different semantics (it already handles
incrementation of p->p_cpticks, and it should handle any calling frequency).

Agreed with in principle by:	dufault
1999-11-27 12:32:27 +00:00
Poul-Henning Kamp 71e4fff823 Retire MFS_ROOT and MFS_ROOT_SIZE options from the MFS implementation.
Add MD_ROOT and MD_ROOT_SIZE options to the md driver.

Make the md driver handle MFS_ROOT and MFS_ROOT_SIZE options for compatibility.

Add md driver to GENERIC, PCCARD and LINT.

This is a cleanup which removes the need for some of the worse hacks in
MFS:  We really want to have a rootvnode but MFS on a preloaded image
doesn't really have one.  md is a true device, so it is less trouble.

This has been tested with make release, and if people remember to add
the "md" pseudo-device to their kernels, PicoBSD should be just fine
as well.  If people have no other use for MFS, it can be removed from
the kernel.
1999-11-26 20:08:44 +00:00
Poul-Henning Kamp a8704f8999 Add a sysctl to control if argv is disclosed to the world:
kern.ps_argsopen
It defaults to 1 which means that all users can see all argvs in ps(1).

Reviewed by:	Warner
1999-11-26 08:27:16 +00:00
Poul-Henning Kamp 9b962c56a4 General clean-up of socket.h and associated sources to synchronise up
with NetBSD and the Single Unix Specification v2.

This updates some structures with other, almost equivalent types and
effort is under way to get the whole more consistent.

Also removes a double definition of INET6 and some other clean-ups.

Reviewed by: green, bde, phk
Some part obtained from: NetBSD, SUSv2 specification
1999-11-24 20:49:04 +00:00
Archie Cobbs 25792ef324 Change the prototype of the strto* routines to make the second
parameter a char ** instead of a const char **.  This make these
kernel routines consistent with the corresponding libc userland
routines.

Which is actually 'correct' is debatable, but consistency and
following the spec was deemed more important in this case.

Reviewed by (in concept):	phk, bde
1999-11-24 01:03:08 +00:00
Nick Hibma 28d38bdf15 Fix some bugs in user-end output and add a reference to the original
copyright in the resulting file.
1999-11-22 14:40:04 +00:00
Poul-Henning Kamp 38224dcd59 Convert various pieces of code to use vn_isdisk() rather than checking
for vp->v_type == VBLK.

In ccd: we don't need to call VOP_GETATTR to find the type of a vnode.

Reviewed by:    sos
1999-11-22 10:33:55 +00:00
Yoshinobu Inoue 82cd038d51 KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCP
for IPv6 yet)

With this patch, you can assigne IPv6 addr automatically, and can reply to
IPv6 ping.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-11-22 02:45:11 +00:00
Poul-Henning Kamp a9e0361b4a Introduce the new function
p_trespass(struct proc *p1, struct proc *p2)
which returns zero or an errno depending on the legality of p1 trespassing
on p2.

Replace kern_sig.c:CANSIGNAL() with call to p_trespass() and one
extra signal related check.

Replace procfs.h:CHECKIO() macros with calls to p_trespass().

Only show command lines to process which can trespass on the target
process.
1999-11-21 19:03:20 +00:00
Poul-Henning Kamp da654d9070 s/p_cred->pc_ucred/p_ucred/g 1999-11-21 12:38:21 +00:00
Mike Smith b3be35ee5e If vfs_mountroot_try() isn't given a path to try mounting, return a silent
error rather than complaining about it verbosely.  No path is not really
a failure, but the diagnostic was confusing and unuseful.
1999-11-21 08:05:50 +00:00
Peter Wemm 95dc37f68d Tempt fate and stop index from converting a const char * into a char *.
I've made a seperate version (c_index() etc) that use const/const, but
I'm not sure it's worth it considering there is one file in the tree
that uses index on const strings (kern_linker.c) and it's easily adjusted
to scan the strings directly (and is perhaps more efficient that way).
1999-11-21 04:26:48 +00:00
Jordan K. Hubbard 87d643ce34 Revert peter's commit to remove cdevsw_add() - it was a bit premature
since things fail to function properly without it (pty allocation becomes
somewhat haphazard).
1999-11-21 02:54:54 +00:00
Poul-Henning Kamp 0429e37ade struct mountlist and struct mount.mnt_list have no business being
a CIRCLEQ.  Change them to TAILQ_HEAD and TAILQ_ENTRY respectively.

This removes ugly  mp != (void*)&mountlist  comparisons.

Requested by:   phk
Submitted by:   Jake Burkholder jake@checker.org
PR:             14967
1999-11-20 10:00:46 +00:00
Boris Popov a3021f91e3 Vnode was left referenced in the case if ELF image is broken.
Reviewed by:	Peter Wemm <peter@netplex.com.au>
1999-11-20 03:03:14 +00:00
Jordan K. Hubbard 8d67e113dc Conditionalise unwanted chattyness. 1999-11-19 23:34:01 +00:00
Poul-Henning Kamp 93efcae809 The at_exit and at_fork functions currently use a 'roll your own'
linked list to store the callbak routines.  The patch converts the
lists to queue(3) TAILQs, making the code slightly clearer and ensuring
that callbacks are executed in FIFO order.

Man page also updated as necesary.

(discontinued use of M_TEMP malloc type while here anyway /phk)

Submitted by:   Jake Burkholder jake@checker.org
PR:             14912
1999-11-19 21:29:03 +00:00
Brian Somers 9ed3b901be Cop on a bit and regenerate things correctly.
Pointed out by:	bde
1999-11-18 20:45:04 +00:00
Matthew Dillon 91921bd597 Ensure that garbage from the kernel stack does not wind up being
returned to user mode in the spare fields of the stat structure.

PR:		kern/14966
Reviewed by:	dillon@freebsd.org
Submitted by:	Kelly Yancey kbyanc@posi.net
1999-11-18 08:14:20 +00:00
Matthew Dillon 151f7a5d8a Only bother converting the stat structure if we intend to return it,
when no error occurs.

PR:		kern/14966
Reviewed by:	dillon@freebsd.org
Submitted by:	Kelly Yancey kbyanc@posi.net
1999-11-18 08:08:28 +00:00
Peter Wemm e79f2d5bfc Remove cdevsw_add() as the make_dev()'s are done in a clone-like fashion.
(ie: the next device is created with make_dev as the first is opened
and so on)
1999-11-18 06:41:30 +00:00
Peter Wemm e92f63a277 Remove cdevsw_add() - the make_dev() calls are already there.
Don't '#if NSNP > 0' around the thing as it's silly and not required.
config(8) only causes it to be compiled if NSNP is > 0 by definition.
1999-11-18 06:39:47 +00:00
Peter Wemm 7fb0a8412a Remove cdevsw_add() - the necessary make_dev() is already there. 1999-11-18 06:37:00 +00:00
Peter Wemm 2c77a71d3d Remove cdevsw_add() - the necessary make_dev() calls appear to be there
already.
1999-11-18 06:34:47 +00:00
Peter Wemm eed9fd425d Fix a warning. 1999-11-18 06:29:57 +00:00
Peter Wemm efa726dd8f 'const'ify a bunch of pointers in the resource_*() functions for accessing
the config hint tables.  This fixes a few warnings elsewhere (eg: fd).
1999-11-18 06:05:30 +00:00
Brian Somers b08210f5fa modfind(char *) -> modfind(const char *)
Reminded by:	dfr
1999-11-17 21:32:40 +00:00
Peter Wemm e29e202c41 Add e_stats (p->p_stats, from struct user->u_stats) to eproc so it's
fetchable via sysctl.  This saves ps having to read the u-area for stats.
Be sure to recompile libkvm, ps, w, top and the usual suspects.
1999-11-17 12:49:22 +00:00
Poul-Henning Kamp b9df5231ca Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
        sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.
1999-11-16 20:31:58 +00:00
Poul-Henning Kamp 1b7277516b Commit the remaining part of PR14914:
Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
   structures for list operations.  This patch makes all list operations
   in sys/kern use the queue(3) macros, rather than directly accessing the
   *Q_{HEAD,ENTRY} structures.

Reviewed by:    phk
Submitted by:   Jake Burkholder <jake@checker.org>
PR:     14914
1999-11-16 16:28:58 +00:00
Poul-Henning Kamp 2e3c8fcbd0 This is a partial commit of the patch from PR 14914:
Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
   structures for list operations.  This patch makes all list operations
   in sys/kern use the queue(3) macros, rather than directly accessing the
   *Q_{HEAD,ENTRY} structures.

This batch of changes compile to the same object files.

Reviewed by:    phk
Submitted by:   Jake Burkholder <jake@checker.org>
PR:     14914
1999-11-16 10:56:05 +00:00
Marcel Moolenaar 0917704bd4 ${MACHINE} -> ${MACHINE_ARCH}
All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
	sys/boot/Makefile
	sys/boot/arc/loader/Makefile
	sys/kern/Makefile
	usr.bin/cpp/Makefile
	usr.bin/gcore/Makefile
	usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
	fixed typo: MACHINDE -> MACHINE_ARCH
1999-11-14 13:54:44 +00:00
Eivind Eklund dd8c04f4c7 Remove WILLRELE from VOP_SYMLINK
Note: Previous commit to these files (except coda_vnops and devfs_vnops)
that claimed to remove WILLRELE from VOP_RENAME actually removed it from
VOP_MKNOD.
1999-11-13 20:58:17 +00:00
Eivind Eklund 020024f3d2 Fix style bugs from last commit 1999-11-13 14:35:50 +00:00
Eivind Eklund edfe736df9 Remove WILLRELE from VOP_RENAME 1999-11-12 03:34:28 +00:00
Alan Cox 99c9d3490b Correct a locking error in apause: It should always hold
the simple lock when it returns.

Also, eliminate spinning on a uniprocessor.  It's pointless.

Submitted by:	bde,
		Assar Westerlund <assar@sics.se>
1999-11-11 03:02:03 +00:00
Doug Rabson c29ab9feec Fix a warning. 1999-11-09 21:35:10 +00:00
Poul-Henning Kamp 698f9cf828 Next step in the device cleanup process.
Correctly lock vnodes when calling VOP_OPEN() from filesystem mount code.

Unify spec_open() for bdev and cdev cases.

Remove the disabled bdev specific read/write code.
1999-11-09 14:15:33 +00:00
Alan Cox b561683329 Passing "0" or "FALSE" as the fourth argument to vm_fault is wrong. It
should be "VM_FAULT_NORMAL".
1999-11-09 01:44:28 +00:00
Poul-Henning Kamp 9c111b31ce A little bit of nitpicking in the 'syncing disks...' end of a shutdown. 1999-11-08 19:36:45 +00:00
Poul-Henning Kamp 325f13989b Ignore leading 'r' in base of root device name. 1999-11-08 11:44:51 +00:00
Peter Wemm 900942ba53 Zap devsw_module_handler(). 1999-11-08 08:10:00 +00:00
Poul-Henning Kamp 44d1184e81 Rename remove_dev() to destroy_dev().
Nagged about by:        msmith
1999-11-08 07:44:01 +00:00
Peter Wemm 845ccef4b8 A hack basically.. We have a bunch of code that used to call
devsw_module_handler() indirectly and not use the chain arguments.  To
eliminate this indirection via that function (which does nothing now)
without duplicating a modevent handler into all the routines that don't
presently have one, supply a NOP (do nothing, return OK) routine which
is functionally equivalent to what's there now.  This is a hack and is
still wrong, because there doesn't appear to be anything to reclaim
resources on an unload of a module with one of these in it.  I'm not
sure whether to make the NOP handler refuse a MOD_UNLOAD event or what.
1999-11-08 06:53:30 +00:00
Peter Wemm b127fae405 Add a vnode fo_stat() entry point. 1999-11-08 03:32:15 +00:00
Peter Wemm 0ba80ba6a1 Update socket file type for fo_stat(). soo_stat() becomes a fileops
switch entry point rather than being used externally with knowledge of the
internals of the DTYPE_SOCKET f_data contents.
1999-11-08 03:31:01 +00:00
Peter Wemm 29e040e5c1 Update pipe code for fo_stat() entry point - pipe_stat() is now no longer
used outside the pipe code.
1999-11-08 03:28:49 +00:00
Peter Wemm cf87559cab Use fo_stat() rather than duplicating knowledge of file type internals
in here for stat(2) and friends.  Update the badops entries accordingly.
1999-11-08 03:27:14 +00:00
Poul-Henning Kamp 0c974a1f16 Make vop_panic() a little more informative. 1999-11-07 15:09:49 +00:00
Poul-Henning Kamp 008626c39e Simplify and de-bogotify check for raw disk. 1999-11-07 13:09:09 +00:00
Poul-Henning Kamp d53dedee55 Remove the devsw magic from DEV_MODULE() 1999-11-07 10:01:17 +00:00
Brian Feldman d91e41c8c9 Fix the advisory file locking by restoring previous ordering in closef()/
fdrop().  This only showed up when a file descriptor was duplicated
and then closed once, where the lock would be released on the first close().
1999-11-07 05:58:38 +00:00
Matt Jacob c1dc94eeb5 add in actual getenv_quad function 1999-11-07 01:10:30 +00:00
Poul-Henning Kamp 8db34b3a11 Put a lock on the disk structure while we open to avoid races.
PR:		14486
1999-11-06 10:25:58 +00:00
Mike Smith 91eef0b873 Clean up a couple of initialisations in order to suppress a correct
but un-useful warning.
1999-11-06 07:43:22 +00:00
Mike Smith c161a8754f Guard against freeing NULL if vfs_mountroot_try is called with NULL
as an argument (this is legal to make other code simpler).
1999-11-05 19:28:07 +00:00
Mike Smith 7a0beaf12d Expand the sscanf buffer to 32 bytes to make room for the expanded
pattern, with some space left over to avoid this mistake next time it's
improved.

Submitted by:	luoqi
1999-11-05 02:45:50 +00:00
Mike Smith 586aaa0f6b Allow vfs names to include the digits 0-9 as well as the letters a-z.
This should let 'cd9660' filesystems be allowed.

Submitted by:	ghelmer
1999-11-04 17:48:11 +00:00
Mike Smith 90ebaea979 Re-implement the handing of RB_CDROM in a machine-independant fashion.
We currently only search SCSI and IDE CDROMs; if there's felt to be a
need for supporting the very old and rare soundcard etc. drives for this
application they can be trivially added.
1999-11-04 01:40:18 +00:00
Poul-Henning Kamp 1a4e73ba51 Move strto{u}[ql]() into their own libkern files.
Urged by:	bde
1999-11-03 18:20:59 +00:00
Poul-Henning Kamp 5b664c7c13 Move isfoo() and friends to the newly created sys/ctype.h.
Urged by:       bde
1999-11-03 17:54:26 +00:00
Mike Smith 88d4183b84 Make MFS work with the new root filesystem search process.
In order to achieve this, root filesystem mount is moved from
SI_ORDER_FIRST to SI_ORDER_SECOND in the SI_SUB_MOUNT_ROOT sysinit
group.  Now, modules which wish to usurp the default root mount
can use SI_ORDER_FIRST.

A compiled-in or preloaded MFS filesystem will become the root
filesystem unless the vfs.root.mountfrom environment variable refers
to a valid bootable device.  This will normally only be the case when
the kernel and MFS image have been loaded from a disk which has a
valid /etc/fstab file.  In this case, the variable should be manually
overridden in the loader, or the kernel booted with -a.  In either
case "mfs:" should be supplied as the new value.

Also fix a typo in one DFLTROOT case that would not have compiled.
1999-11-03 11:02:47 +00:00
Archie Cobbs 44b4dd855d Consolidate some of the various ctype(3) macros in one location. 1999-11-02 22:50:34 +00:00
Mike Smith b676e48c98 Move a couple of globals here where they are initialised, rather than
orphaning them in vfs_conf.c
1999-11-01 23:54:07 +00:00
Mike Smith 92b3c1b050 swapinit isn't called from vfs_mountroot, so don't complain about it in
a #if 0'ed comment.

Call the machine-dependant cpu_rootconf functions from sysinits in their
respective areas, don't do it from a stub here.
1999-11-01 23:53:27 +00:00
Mike Smith ed9f9797bb This is a complete rewrite of vfs_conf.c, which changes the way the root
filesystem is discovered.  Preference is given to using the kernel
environment variable vfs.root.mountfrom, which is set by the loader
according to the contents of /etc/fstab.  Changes in the MD code
provide fallback mechanisms for systems not using the loader.

A more robust fallback path is also provided, with the last recourse
being to prompt on the console for a root device.

These changes drastically simplify the machine-dependant parts of
the root configuration process.  In addition, support for CDROM root
devices has been removed; it was a nasty hack and didn't work.
1999-11-01 23:51:00 +00:00
Poul-Henning Kamp bf9deaba10 Add strtol & strtoul to kernel. Derived from libc versions. 1999-11-01 15:04:04 +00:00
Poul-Henning Kamp ce4a64f787 New function:
m_print(struct mbuf *);
hexdumps a mbuf.
1999-11-01 15:03:20 +00:00
Julian Elischer 5b42dac8ec Most modern OSs have the ability to flag certain mounts as ones to
be ignored by default by the df(1) program.  This is used mostly to
avoid stat()-ing entries that do not represent "real" disk mount
points (such as those made by an automounter such as amd.)  It is
also useful not to have to stat() these entries because it takes
longer to report them that for other file systems, being that these
mount points are served by a user-level file server and resulting in
several context switches.  Worse, if the automounter is down
unexpectedly, a causal df(1) will hang in an interruptible way.

PR:		kern/9764
Submitted by:	Erez Zadok <ezk@cs.columbia.edu>
1999-11-01 04:57:43 +00:00
Sean Eric Fagan 35a2598f80 Bail out of the process early if the coredumpfile limit is 0.
PR:	kern/14540
Reviewed by:	Nate Williams
1999-10-30 18:55:11 +00:00
Poul-Henning Kamp 3f5bbb089a Remove a #define which doesn't do miracles anymore. 1999-10-30 09:31:52 +00:00
Poul-Henning Kamp 02c58685a4 Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.

Fix two bugs (physio & cam) resulting by the confusion caused by this.

Submitted by:   Tor.Egge@fast.no
Reviewed by:    alc, ken (partly)
1999-10-30 06:32:05 +00:00
Poul-Henning Kamp 923502ff91 useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
1999-10-29 18:09:36 +00:00
Brian Feldman 56f0bef78c Remove a KASSERT() that has fulfilled its purpose. Note that it did
cause problems by tripping on shutdown (reboot(), not the socket
operation :).  Cause is still uncertain, but the panic isn't really
necessary here.
1999-10-24 08:37:21 +00:00
Matthew Dillon 9782fb6209 Adjust the buffer cache to better handle small-memory machines. A
slightly older version of this code was tested by BDE and I.

    Also fixes a lockup situation when kva gets too fragmented.

    Remove the maxvmiobufspace variable and sysctl, they are no longer
    used.  Also cleanup (remove) #if 0 sections from prior commits.

    This code is more of a hack, but presumably the whole buffer cache
    implementation is going to be rewritten in the next year so it's no
    big deal.
1999-10-24 03:27:28 +00:00
Julian Elischer b58a8a3b1d Now that Netgraph is in the system there are some cleanups we can do.
Also save a slightly closer to completion version of the PPPOE code.

Submitted by: Archie Cobbs <archie@freebsd.org>
1999-10-23 04:28:11 +00:00
Tor Egge 64793e7fe2 Eliminate remaining part of incorrect PCI bus numbering sanity check on systems with more than one PCI bus. 1999-10-15 21:38:15 +00:00
Brian Feldman d817743797 Missed the second argument of fdrop().
Submitted by:	jhay
1999-10-14 10:50:06 +00:00