Commit Graph

2685 Commits

Author SHA1 Message Date
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
Brian Feldman 1aa3e7ddd0 Fix a race condition with shared fd tables and writev(). It's
still not safe to consider file table sharing secure.
Submitted by:	Ville-Pertti Keinonen <will@iki.fi>
1999-10-14 05:37:52 +00:00