Commit Graph

568 Commits

Author SHA1 Message Date
David Greenman
083c109df6 The generated VCALL always uses the first vp which in the case of /link/
might not be handled by the same FS as the directory (e.g. special device
files)...so it must be special-cased. This bug is seen when doing
"ln /dev/console /dev/foo" or equivilent and first appeared after I fixed
the argument order of VOP_LINK.  YUCK! There really needs to be a way of
specifying what vp to use in the VCALL; doing this could fix the strategy
and bwrite special-cases, too.
1995-07-07 13:41:28 +00:00
David Greenman
3d5e37c501 Removed "GATEWAY" consideration when calculating number of mbuf clusters.
It now always uses the value that was used for the GATEWAY case.
1995-06-29 08:21:32 +00:00
David Greenman
ac7e6123a6 Killed "TIMEZONE" and "DST" options. They have been forced to 0 by config
for more than a year now. Moved the declaration of 'tz' into kern_time.c.
1995-06-29 07:07:00 +00:00
David Greenman
6663c3d522 Removed extra semicolon. 1995-06-28 12:32:47 +00:00
David Greenman
b619731843 Don't include vm_pageout.h. 1995-06-28 12:31:47 +00:00
David Greenman
aa2cabb958 1) Converted v_vmdata to v_object.
2) Removed unnecessary vm_object_lookup()/pager_cache(object, TRUE) pairs
   after vnode_pager_alloc() calls - the object is already guaranteed to be
   persistent.
3) Removed some gratuitous casts.
1995-06-28 12:01:13 +00:00
David Greenman
9879652657 Fixed VOP_LINK argument order botch. 1995-06-28 07:06:55 +00:00
Bruce Evans
6acceb40dc Pass the correct nonblocking flag to VOP_CLOSE() in vclean().
VOP_CLOSE() takes `F' (file) flags, not `IO' flags.  At least that's
what close() passes.  I previously fixed ttylclose() to check
FNONBLOCK instead of IO_NDELAY.  This broke the call from vclean()
and cleaning of ptys sometimes deadlocked.
1995-06-27 21:29:08 +00:00
Bruce Evans
9207f00ac0 The pessimistic rounding in hzto() was too pessimistic for realitimexpire(). 1995-06-26 07:48:50 +00:00
Bruce Evans
4ebf8117df Partially fix `sysctl machdep.console_device'. The fix will be complete
when syscons stops mapping the console to minor MAXCONS.  There is
usually no corresponding device in /dev, and the correct device has
minor 0.

cons.c:
Initialize cn_tty properly, so that CPU_CONSDEV can work.
Comment about too many variants of the console tty pointer.

machdep.c:
Return device NODEV and not error EFAULT when there is no console device.
1995-06-26 07:39:52 +00:00
Andrey A. Chernov
a526d6bb67 ttywait: convert EWOULDBLOCK to EIO, when t_timeout expired 1995-06-24 16:28:20 +00:00
Andrey A. Chernov
13cf82d487 Replace EWOULDBLOCK to EIO in ttwrite, when t_timeout expired 1995-06-23 21:20:10 +00:00
Andrey A. Chernov
00999cd623 Optimized and simplified version of setreuid/gid
Fixed: lack of crcopy in certain conditions, lack
of setting sv[ug]id in certain conditions. Fixes non-critical.
1995-06-15 22:32:03 +00:00
Bruce Evans
f53dbe9765 Convert %p to 0x%x instead of to 0x%8x. The latter gives blank padding
in the wrong place.  Blank padding in the right place or zero padding
would be inconsistent with user mode.

Put case 'p' in alphabetical order.

Implement %p in sprintf() too.  I'd like only a single, more complete
printf() core, perhaps one based on vsnprintf().
1995-06-14 07:55:07 +00:00
Bruce Evans
39a7e2a41a Output \n as \r\n, not as \n\r. 1995-06-14 04:52:39 +00:00
Rodney W. Grimes
d3628763db Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
David Greenman
cddc961a83 Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network "hang" when the mbuf cluster pool runs out.

Reviewed by:	John Dyson
1995-05-25 07:36:24 +00:00
David Greenman
d53eacdf28 This should fix PR 438. Apparently I never tested disklabel on the block
device.

v_numoutput wasn't incremented to match the b_iodone nesting.  It's still
fishy that vwakeup() clears B_WRITEINPROG before biodone() has finished;
however, B_WRITEINPROG seems to be never used.

Submitted by:	Bruce Evans
1995-05-24 23:33:42 +00:00
David Greenman
61f5d51062 Changes to fix the following bugs:
1) Files weren't properly synced on filesystems other than UFS. In some
   cases, this lead to lost data. Most likely would be noticed on NFS.
   The fix is to make the VM page sync/object_clean general rather than
   in each filesystem.
2) Mixing regular and mmaped file I/O on NFS was very broken. It caused
   chunks of files to end up as zeroes rather than the intended contents.
   The fix was to fix several race conditions and to kludge up the
   "b_dirtyoff" and "b_dirtyend" that NFS relies upon - paying attention
   to page modifications that occurred via the mmapping.

Reviewed by:	David Greenman
Submitted by:	John Dyson
1995-05-21 21:39:31 +00:00
David Greenman
2976b7f19f NFS diskless operation was broken because swapdev_vp wasn't initialized.
These changes solve the problem in a general way by moving the
initialization out of the individual fs_mountroot's and into swaponvp().

Submitted by:	Poul-Henning Kamp
1995-05-19 03:27:08 +00:00
Poul-Henning Kamp
4977228d33 Make the "information" slice printfs if(bootverbose).
Fix the message about Ontrack.
1995-05-18 22:45:35 +00:00
David Greenman
1469eec81e Fixed incompleteness that would allow dirty filesystems to get mounted
when the single user shell was terminated. These changes disallow mounting
or R/W upgrading filesystems that are dirty unless "-f" (force) option
is used with mount. /etc/rc has been modified to abort the startup if
one or more non-nfs partitions fail to mount.

Reviewed by:	Poul-Henning Kamp, Rod Grimes
1995-05-15 08:39:37 +00:00
David Greenman
a401ebbe32 Changed swap partition handling/allocation so that it doesn't
require specific partitions be mentioned in the kernel config
file ("swap on foo" is now obsolete).

From Poul-Henning:

The visible effect is this:

As default, unless
        options "NSWAPDEV=23"
is in your config, you will have four swap-devices.
You can swapon(2) any block device you feel like, it doesn't have
to be in the kernel config.

There is a performance/resource win available by getting the NSWAPDEV right
(but only if you have just one swap-device ??), but using that as default
would be too restrictive.

The invisible effect is that:

Swap-handling disappears from the $arch part of the kernel.
It gets a lot simpler (-145 lines) and cleaner.

Reviewed by:	John Dyson, David Greenman
Submitted by:	Poul-Henning Kamp, with minor changes by me.
1995-05-14 03:00:10 +00:00
David Greenman
c4cf09ffe6 pread/pwrite() should be static.
Submitted by:	sef
1995-05-12 21:39:48 +00:00
Garrett Wollman
5bb4f73817 The death of `options NODUMP'. Now the dump area can be dynamically
configured (and unconfigured) on the fly.  A sysctl(3) MIB variable is
provided to inspect and modify the dump device setting.
1995-05-12 19:17:31 +00:00
David Greenman
15f1b09648 Increased ratio of allowed vnodes on freelist to 1/4th of the total. This
is more representative of worst case situations of 4 files/directory. (If
that last sentence doesn't make any sense, I'm not surprised. It's rather
compilcated how this all fits together....).
This should fix a problem that Ed Hudson has been complaining about where
directories with lots of symlinks could cause excessive disk I/O.
1995-05-12 04:24:53 +00:00
Rodney W. Grimes
b2b795f07c Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
Garrett Wollman
c9cd353a18 Delete two debugging printfs that mistakenly crept in. 1995-05-11 00:16:44 +00:00
Garrett Wollman
748e0b0acc Make networking domains drop-ins, through the magic of GNU ld. (Some day,
there may even be LKMs.)  Also, change the internal name of `unixdomain'
to `localdomain' since AF_LOCAL is now the preferred name of this family.
Declare netisr correctly and in the right place.
1995-05-11 00:13:26 +00:00
David Greenman
54ea0c000f Unlock the vnode before sleeping on an OBJ_DEAD object. Should fix Bruce's
hang. Fixed some formatting anomolies and removed some unneeded casts.
1995-05-10 18:59:11 +00:00
David Greenman
6c206048ae Improved hashinit panic strings. 1995-05-08 23:11:12 +00:00
Bruce Evans
599eb538d8 Fix reopening of open subdevices for DIOCSYNCSLICEINFO:
Reopen the bdev for the raw partition and not the cdev if only the bdev
was open.
Don't use a bogus limit for the number of partitions to possibly reopen
(bug found by Julian).

Add function dssize() to help fix wdsize() and sdsize().  The slice
layer knows more about (un)open partitions and partition sizes than
the driver layer.
1995-05-08 16:24:08 +00:00
Andrey A. Chernov
3cfa74c35f Make two "ttyout" ttysleep wmesg unique
Add t_timeout to ttysleep call into ttywrite
1995-05-07 23:53:36 +00:00
Bruce Evans
ee4415d3df Fix style inconsistencies in the last few commits. 1995-05-07 07:06:36 +00:00
Bruce Evans
65e8f11839 Test the correct nonblocking flag in ttylclose(). IO_NDELAY is only valid
in read() and write().  FNONBLOCK is valid in ioctl() and close().

The bug caused hung ptys when a process talked to itself using nonblocking
i/o and exited while the slave pty had output to flush.  ttywait() was
called and hung.  Signals didn't work because the process was exiting.
`comcontrol /dev/ttyp0 drainwait 1' worked to terminate the wait.  This
shows that comcontrol is not limited to hardware control.  It has no i386
or driver dependencies and doesn't belong in src/sbin/i386.

Bruce
1995-05-07 06:32:28 +00:00
David Greenman
2384fde587 Kludged around a problem with "cat /proc/0/regs" causing a panic by
initializing proc0's frame base, too, using cpu_set_init_frame(). It's
a kludge because that macro is intended to be used only for init, but
does what we want nonetheless.
1995-05-04 08:21:24 +00:00
David Greenman
c9ae46b1ad Removed unused variable caused by last commit. 1995-05-02 09:06:04 +00:00
David Greenman
beef0195c9 Fix for sync() to close a potential panic with accessing a mount struct
that had been freed.

Submitted by:	John Dyson
1995-05-02 08:44:31 +00:00
Poul-Henning Kamp
ee1cbe818e When past cyl 1024 it's ok if CHS is (0xff,0xff,0xff).
It's actually recommended it seems...
1995-05-01 00:45:33 +00:00
Bruce Evans
0c3f2f6436 Change dsioctl() interface to allow DIOCSYNCSLICEINFO to update the caller's
slice pointer and to print the device name in error messages.

Finishing implementing DIOCSYNCSLICEINFO (except for locking).
1995-04-30 15:16:02 +00:00
David Greenman
af9c31e108 Added UIO_NOCOPY case to ureadc() to quiet gcc. 1995-04-30 05:11:46 +00:00
David Greenman
fc3d49a9dc Check for curproc != NULL before dereferencing it. 1995-04-30 05:09:13 +00:00
Andrey A. Chernov
2c3be6c34e set[ug]id(): call suser() only when neccesarry
Submitted by: bde
1995-04-29 11:46:15 +00:00
Jordan K. Hubbard
bcac561761 Bruce is right - ENOTTY is more appropriate than EINVAL in this case. 1995-04-29 11:36:47 +00:00
Jordan K. Hubbard
65b36cbb7d fixes the ioctl routine to not chew up massive amounts of kernel time
if an invalid ioctl is done on /dev/klog.  logioctl() needs to return
an errno instead of -1 on a failed ioctl.
Submitted by:	Mike Pritchard <mpp@mpp.com>
1995-04-29 05:09:19 +00:00
Andrey A. Chernov
d3cdb93dd8 Implement POSIX SAVED_IDS for setuid/setgid 1995-04-28 18:17:29 +00:00
Andrey A. Chernov
611d721e70 setre*(): simplify return scheme, pointed by Bruce 1995-04-28 17:00:27 +00:00
Andrey A. Chernov
4bc8f31ff3 Implement setreuid/setregid according to SunOS manpage 1995-04-27 19:23:24 +00:00
Bruce Evans
48b2a92193 Add ioctls DIOCGSLICEINFO and DIOCSYNCSLICEINFO. The latter isn't
finished or tested.
1995-04-24 17:07:08 +00:00
Bruce Evans
0f1a48177b Undo the move of `#include "sc.h"' etc. to cons.h. It broke anything
that includes <machine/cons.h>.
1995-04-24 16:43:01 +00:00
Bruce Evans
b0ba7f5601 Make bad144 debugging code conditional on ds_debug. 1995-04-24 06:04:36 +00:00
Bruce Evans
e770b51673 Declare the console switch functions completely.
Move declarations of console functions to cons.h (they should be
config(8)ed).
1995-04-23 12:55:55 +00:00
Andrey A. Chernov
e876c909da Make setreuid/setregid active syscalls 1995-04-23 12:22:06 +00:00
Bruce Evans
453de7da68 Correct the type of the `acflag' arg to suser(). 1995-04-23 08:31:02 +00:00
Poul-Henning Kamp
453e527dcb We will use /sbin/init on cdrom too. 1995-04-23 04:13:51 +00:00
Poul-Henning Kamp
f4d1e3d1e7 Remove the slice for the first 63 sectors for the OnTrack case, it's useless
and nobody care about it anyway.
1995-04-20 06:01:51 +00:00
Bill Paul
de2a1afc47 Undo the stupidity I inflicted on these files and replace it with
some (hopefully) less offensive stupidity:

If we detect that a user has loaded a module that fails to initialize
itself correctly, panic. There really isn't a safe way to recover from
something like this; we can't know that the module is bad until after
the entry point is called, by which time it's too late to do anything
about it.
1995-04-20 05:08:53 +00:00
Poul-Henning Kamp
0e175c5ef0 Added support for disks which "OnTrack Disk Manager" has munged.
I suggest you do all partitioning using the OnTrack SW, to avoid
confusing it.
1995-04-20 01:21:51 +00:00
Bill Paul
e1797c1a96 Couple of small cosmetic changes:
- Add $Id$ string.
- Fix comment ("we might *not* be able to unload the
module afterwards without panicking...")
- Get rid of variable 'j' that I used in name checking
for(;;) loop and use 'i' instead (I thought there'd be
a problem with this, but there isn't).
1995-04-18 14:10:21 +00:00
Bill Paul
f13524346b Fix module handling to stop oddball modules (if_ppp_mod, if_sl_mod,
if_tun_mod, etc...) from crashing the system. These modules are useful,
but because they don't yet have proper load()/unload() functions,
they can lead to panics: if, for example, you load the if_ppp module,
any user can panic the system by running modstat.

You can also hang the system outright if you try to unload the PPP
module too.

Changes are as follows:

- Save the name passed to us during the RESERVE stage for name matching
(we can't load if_ppp_mod twice: we've have two ppp0's and two ppp1's,
which is beyond strange). This makes the lkmexists() cheks somewhat
redundant, but there's no way around it that I can see.

- If we call the module entry point and find that we have no lkm_any
structure in our 'private' section, create a fake one. This keeps
modstat happy. We mark such modules as LM_UNKNOWN.

- Don't allow LM_UNLOAD modules to be unloaded: it just ain't
possible. (Unless someone wants to write a pppunattach() function. :( )

- In lkmunreserve(), mark private.lkm_any as NULL so we don't get
confused later. I think this is bogus, but I can't prove it.

XXX: the name matching used to keep the user from loading two
instances of the same module can easily be defeated simply by
changing the module name or, in the case of the oddball modules,
simply by renaming the module files. I haven't found a nice simple
way to tell one module from another.
1995-04-18 02:29:26 +00:00
David Greenman
5baf11ce97 Removed unused & empty bufstats() function. 1995-04-16 12:02:42 +00:00
David Greenman
cece489df8 Killed gratuitous b_vp=NULL in bufinit. The entire buffer is already
bzero()'d.
1995-04-16 11:45:30 +00:00
David Greenman
1a477b0c27 Changed #ifdef around printlockedvnodes() from DEBUG to DDB. 1995-04-16 11:33:33 +00:00
David Greenman
5124d59831 Make vegetarian and animal rights people happy and use 0xdeadc0de instead
of 0xdeadbeef as the fill pattern. Decreased MAX_COPY to 64 (256 was a bit
overzealous in most cases).
1995-04-16 11:25:15 +00:00
David Greenman
d94a4c0434 1) Check for curproc != NULL in bread/bwrite. John convinced me that this
is necessary in order for panic+sync to work. Will also gloss over a panic
that Jordan was having with the install floppies that remains unexplainable.
2) Handle "bogus_page" a little better.
3) Set page protection to VM_PROT_NONE if the entire page has become !valid.

Submitted by:	John Dyson (2&3), me (1).
1995-04-16 05:11:14 +00:00
Bruce Evans
e2f03b0df0 Speed up ttnread() in the !(ICANON | ISIG) case by copying to user space
through a temporary buffer instead of one character at a time.  The old
method takes about 6 usec/char on a 486DX2/66.  This is larger than than
the combined interrupt and PIO overhead for a 16550!

This change was first implemented in 1.1.5.  It was rewritten for 2.1.
The clist access functions allow a simpler implementation at some cost
in correctness and speed.  There needs to be an ungetc() function to
recover from EFAULT, and it wastes time to copy through a temporary
buffer.

Don't snoop on single characters that weren't read due to EFAULT.
Rewrite a snoop comment in my approximation to English.

Undo bogus exportation of ttnread().
1995-04-15 21:04:58 +00:00
Poul-Henning Kamp
194c19ed17 Changes needed for kzip to work. 1995-04-15 06:54:13 +00:00
David Greenman
cf8ad5100d Fixed serious off by one bug I introduced that will likely cause the
machine to panic whenever the name cache fills up.

Submitted by:	John Dyson
1995-04-15 00:49:35 +00:00
David Greenman
f153fb6e99 Backed out previous change - it reduces performance. (oops). 1995-04-13 18:24:33 +00:00
Garrett Wollman
ef46188e27 Actually copy the class field over from the kernel to the user structure. 1995-04-13 15:33:14 +00:00
David Greenman
cf0ec51aec Slight optimization to select(). 1995-04-13 15:27:51 +00:00
Andrey A. Chernov
0a247e7d30 Extract "set" family functions to separate module, needed for
locking in sio f.e.
1995-04-11 17:54:25 +00:00
Poul-Henning Kamp
17755ac806 Changes to make FreeBSD use a CDROM as rootdev, for installation purposes.
If "BOOTCDROM" is defined, you get this pretty special case stuff.
1995-04-10 07:44:31 +00:00
Andrey A. Chernov
83d05492ed Call ptsstop in ptsclose instead of ptcwakeup 1995-04-10 01:45:43 +00:00
Andrey A. Chernov
9d9cea2bce ptcwakeup() was called from wrong places 1995-04-09 22:28:24 +00:00
David Greenman
213fd1b6e8 Changes from John Dyson and myself:
Fixed remaining known bugs in the buffer IO and VM system.

vfs_bio.c:
Fixed some race conditions and locking bugs. Improved performance
by removing some (now) unnecessary code and fixing some broken
logic.
Fixed process accounting of # of FS outputs.
Properly handle NFS interrupts (B_EINTR).

(various)
Replaced calls to clrbuf() with calls to an optimized routine
call vfs_bio_clrbuf().

(various FS sync)
Sync out modified vnode_pager backed pages.

ffs_vnops.c:
Do two passes: Sync out file data first, then indirect blocks.

vm_fault.c:
Fixed deadly embrace caused by acquiring locks in the wrong order.

vnode_pager.c:
Changed to use buffer I/O system for writing out modified pages. This
should fix the problem with the modification date previous not getting
updated. Also dramatically simplifies the code. Note that this is
going to change in the future and be implemented via VOP_PUTPAGES().

vm_object.c:
Fixed a pile of bugs related to cleaning (vnode) objects. The performance
of vm_object_page_clean() is terrible when dealing with huge objects,
but this will change when we implement a binary tree to keep the object
pages sorted.

vm_pageout.c:
Fixed broken clustering of pageouts. Fixed race conditions and other
lockup style bugs in the scanning of pages. Improved performance.
1995-04-09 06:02:46 +00:00
David Greenman
17792ebcb7 Added a few more entries to the list of prime numbers. 1995-04-09 01:19:25 +00:00
Joerg Wunsch
4fb0b0de3e Implement a simple hook (or hack?) to allow graphics device console
drivers to protect DDB from being invoked while the console is in
process-controlled (i.e., graphics) mode.

Implement the logic to use this hook from within pcvt.  (I'm sure
Søren will do the syscons part RSN).

I've still got one occasion where the system stalled, but my attempts
to trigger the situation artificially resulted int the expected
behaviour.  It's hard to track bugs without the console and DDB
available. :-/
1995-04-08 21:32:11 +00:00
David Greenman
bb2d12a636 Check for case of blkno already known to avoid unnecessary VOP_BMAP's.
Submitted by:	John Dyson
1995-04-04 02:10:17 +00:00
David Greenman
22e53424b2 kern_subr.c:
Added a new type to uiomove - "UIO_NOCOPY" which causes it to update
pointers and counts, but doesn't do any data copying. This is needed
for upcoming changes to the way that the vnode pager does its page
outs.
Added a new hash init function call "phashinit" that allocates and
initializes a prime number sized hash table.

vfs_cache.c:
Changed hashing algorithm to use the remainder of dividing by a prime
number to improve the distribution characteristcs. Uses new phashinit
function in kern_subr.c.
1995-04-04 02:01:13 +00:00
Andrey A. Chernov
efb76ea60f Back out changes related to locked bits until more elegant solution will be
found. Fix flags declarations.
1995-04-02 19:26:50 +00:00
Joerg Wunsch
9bb751a368 Attempt to fix the `you can log into console only once' problem (PR
#179).  The fix implements a ttyhalfclose() (sort of), resetting the
session and pgrp pointers when the physical device is about to be
closed.

Suggested by: bde
1995-04-02 16:14:51 +00:00
Andrey A. Chernov
c6345bc1b6 Fix error in TIOCSETC/TIOCSLTC, they need to call TIOCSETA.
Remove static from some functions, needed in sio (later)
1995-04-02 04:15:08 +00:00
Andrey A. Chernov
1ef5e50eee Return EINVAL instead of setting wrong in/out speed
Fix declaration of cc arrays
Remove static from compatspcodes, will needed in sio (later)
1995-04-02 03:51:53 +00:00
Joerg Wunsch
76e2642ce4 subr_prf.c used to provide an exported function kprintf(), but only had
a private declaration for it.  Declare the function publically instead.
1995-04-01 20:19:00 +00:00
Andrey A. Chernov
f1e302d4cc c_iflag handling in setting compat modes now more close to V7 1995-03-29 19:50:58 +00:00
Andrey A. Chernov
64a49d2d33 Oops, fix typing error in prev. commit 1995-03-29 19:24:46 +00:00
Andrey A. Chernov
668a9ccefc Handle TTY_BI now instead of TTY_FE && c == 0 1995-03-29 19:22:37 +00:00
Andrey A. Chernov
532f5941b0 Move parmark 0377 double code after control chars processing 1995-03-29 18:55:20 +00:00
David Greenman
2547597bf4 Added a set of braces to make the compiler happy. 1995-03-29 11:54:02 +00:00
Andrey A. Chernov
702c5e7e17 ttyinput() fixes:
1) Preserve old buffer contents when input buffer overflows.

Old code clear buffer and rewrite it again, if !MAXBEL
(for MAXBEL it does right thing :-).
F.e. if you type too long string, last chars passed,
not first ones as expected.
Moreover, it flush output queue too in this case without any needs.

2) Don't do IXOFF, if IGNCR and c==\r, ignore completely.

3) If PARMRK is active and !ISTRIP and char == 0377
put yet one 0377 to distinguish it from parity mark sequence.
POSIX standard (thanx Bruce).

Reviewed by:
Submitted by:
Obtained from:
CVS:
1995-03-28 15:25:13 +00:00
Andrey A. Chernov
63cadaef19 Bug fixed:
parity/framing/break not completely ignored when IGN* is set
but cause output restarted.
CVS:
1995-03-28 11:09:35 +00:00
Bruce Evans
3aa12267a5 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) that I didn't notice when I fixed
"all" such warnings before.
1995-03-28 07:58:53 +00:00
David Greenman
6e14d964ac Removed some redundant 'vmio' checks. 1995-03-27 00:11:45 +00:00
David Greenman
f57459b632 Removed third arg (vmio) to allocbuf() that was added with the original
merged cache changes, and figure it out based on the B_VMIO buffer flag.
Fixes a problem where delayed write VMIO buffers would sometimes get
recopied into kernel-alloced memory.

Submitted by:	John Dyson
1995-03-26 23:29:13 +00:00
David Greenman
bc4c84cf7e Added a third "flags" argument to msync() ...as other systems have. 1995-03-25 16:52:24 +00:00
Bruce Evans
a7d783dddb Add more compatibility cruft:
- ignore the partition table if it is identical with the bogus one in
  /usr/src/sys/i386/boot/biosboot/start.S.  Honoring the bogus size
  field was fatal.  The error is detected but other compatibilty
  cruft weakens the error handling too much for this case.
- weaken the partition entry checking to allow the following treatments
  of C/H/S addresses when C should be >= 1024:
    (1) allow C = 1023, H = max, S = max.
    (2) allow C to be correct modulo 1024.
  Other compatibilty cruft weakens the error handling to allow all
  C/H/S addresses, but there too many errors were reported.

Improve error messages:
- print C/H/S addresses if relevant.
- distinguish primary partition table from extended partition tables.
- don't use diskerr() except for i/o errors.
1995-03-25 12:07:31 +00:00
David Greenman
3ed8a40336 Use 'p' rather than 'curproc' when appropriate. 1995-03-25 01:34:21 +00:00
David Greenman
b35ba931bd Use NDINIT macro to initialize fields for namei. 1995-03-25 01:20:38 +00:00
Peter Dufault
3749fcff67 Set it so you can add and remove line disciplines without replicating
code for looking for open slots in table (and you could hide the table
if you wanted to).
1995-03-21 11:24:05 +00:00
David Greenman
f550a707bd Added a new version of trap_pfault() that disallows kernel page faults
to the user address space unless pcb_onfault is set. The code is currently
commented out because iBCS2 and process debugging parts of the kernel
need to be changed/fixed first.
1995-03-21 07:16:12 +00:00
David Greenman
c6d5f3ac3e Changed some #ifdef DIAGNOSTIC code that I added to be #ifdef DEBUG. 1995-03-21 07:02:51 +00:00
David Greenman
b946193056 Fixed vinvalbuf() to work like NFS wants it to. The previous code wouldn't
flush pages in the vm object if V_SAVE was true.
1995-03-21 01:13:16 +00:00
David Greenman
62b71ed629 Don't gain/lose a reference to the object when yanking its pages in
vinvalbuf()...it will cause vnode locking problems in vm_object_terminate,
and isn't necessary anyway.
1995-03-20 10:19:09 +00:00
David Greenman
ff769afc81 Don't attempt to sync pages in the V_SAVE case of vinvalbuf; doing so can
lead to a deadlock. Just let the VM system deal with it.
1995-03-20 02:08:24 +00:00
David Greenman
9022e4ad9c Fixed bug introduced in the previous commit - the lock must be held until
after the call to exec_check_permissions().
1995-03-19 23:27:57 +00:00
David Greenman
f5277ae71e Lose the lock on the vnode. Changes to implement proper locking in the
vnode pager now require this.

Submitted by:	John Dyson
1995-03-19 23:08:12 +00:00
David Greenman
edf8a81561 Removed redundant newlines that were in some panic strings. 1995-03-19 14:29:26 +00:00
David Greenman
967a3bf893 Fix from Doug Rabson: Don't try to release a pbuf we didn't get.
Minor style change by me.
1995-03-19 13:28:54 +00:00
David Greenman
50475e8bd3 Removed unnecessary call to vnode_pager_uncache(). We automatically clear
the VTEXT flag after all mappers have finished with the object.
1995-03-19 12:08:03 +00:00
David Greenman
ab828ab8bd Moved call to vnode_pager_uncache in rename() to before the VOP_RENAME.
It was previously after the VOP_RENAME and the reference and lock on
the vnode had already been lost, allowing interesting internel
inconsistencies. This is one of the two reasons why freefall was crashing
every hour or two (the other being nullfs bugs).
Don't call vnode_pager_uncache in revoke(). revoke() is only allowed on
VCHR and VBLK vnodes.
1995-03-19 11:16:58 +00:00
David Greenman
d7e3d98a5e Patch from Kirk McKusick to fix a bug introduced in the Poul's vfs_cache
rewrite.
1995-03-19 09:33:51 +00:00
David Greenman
0338878131 Woops, add back that #define...it's used later in the file. 1995-03-18 07:06:51 +00:00
David Greenman
9e4817309b Fixed comments and removed b_cylinder #define. 1995-03-18 06:38:04 +00:00
David Greenman
89247e0412 Integrated change from 1.1.5: Fixed broken disksort to sort by pblkno
rather than by cylinder.
1995-03-18 06:32:48 +00:00
David Greenman
6a21a04a14 Changed names of goaway routines into shutdown routines. 1995-03-17 04:18:07 +00:00
Bruce Evans
b5e8ce9f12 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.
1995-03-16 18:17:34 +00:00
Bruce Evans
fe7172b1a6 Fix support for extended partitions (forgot to release the buffer). 1995-03-15 16:25:08 +00:00
David Greenman
5eb7d0cd2e Special cased the handling of mb_map in the M_WAITOK case. kmem_malloc()
now returns NULL and sets a global 'mb_map_full' when the map is full.
m_clalloc() has further been taught to expect this and do the right thing.
This should fix the "mb_map full" panics that several people have reported.
1995-03-15 07:52:06 +00:00
Bruce Evans
ec00834c18 Finish the previous change. The device name got lost in diskerr(). 1995-03-12 08:17:30 +00:00
Poul-Henning Kamp
47f196941e Update a couple of counters. 1995-03-12 02:01:20 +00:00
David Greenman
3d2a8cf3d9 Added a comment. 1995-03-11 22:29:07 +00:00
David Greenman
17dda4c929 Added some additional DIAGNOSTIC code that makes sure that freed
memory addresses and types are with the valid range. Increased
MAX_COPY to 256 (used to verify no freed memory use with DIAGNOSTIC).
1995-03-11 22:28:16 +00:00
David Greenman
f8a0b2dd88 Reorganized an if() expression for efficiency. 1995-03-10 21:18:24 +00:00
David Greenman
914e6eb70d Whoops, back out that last change - I misread what Poul had done there. 1995-03-10 20:29:51 +00:00
David Greenman
dbd90d413f Don't thrash the name cache while trying to fill up the object cache.
(Make a new cache entry until desiredvnodes is reached).
1995-03-10 20:26:29 +00:00
David Greenman
a74a73d96c Removed some #include's of unnecessary include files. 1995-03-10 08:44:20 +00:00
Poul-Henning Kamp
fbd6e6c9ef Clean up and improve the namecache.
1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
Clean up and improve the namecache.

1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
gets forced out of the VM/cache.  The latter is not numerous enough to keep
the pool of vnodes needed for the namecache sufficiently big.

2. Purge invalid entries in the namecache as soon as we notice them.  This
avoids a stale entry pushing out a valid entry on the LRU list.

3. Speed up the lookup in the namecache by avoid a special case branch.

4. Make the cache purge routines do the thing they're supposed to, and in
a decently efficient manner.

5. Make the size of the namecache follow the number of vnodes, so that we
can always point to all the vnodes we have in core.

6. Readability has gone way up.

7. Added a "options NCH_STATISTICS" feature that will gather more
detailed statistics on the performance of the namecache.

Reviewed by:    davidg

(cvs is dumping core on me :-(  )
1995-03-09 20:27:04 +00:00
Poul-Henning Kamp
b2e10d6d6f Clean up and improve the namecache.
1. We always keep one 16th of the vnodes on the freelist, so that the
namecache doesn't get trashed.  It used to be that it wasn't a problem, but
the only vnodes getting released these days are directories and things which
gets forced out of the VM/cache.  The latter is not numerous enough to keep
the pool of vnodes needed for the namecache sufficiently big.

2. Purge invalid entries in the namecache as soon as we notice them.  This
avoids a stale entry pushing out a valid entry on the LRU list.

3. Speed up the lookup in the namecache by avoid a special case branch.

4. Make the cache purge routines do the thing they're supposed to, and in
a decently efficient manner.

5. Make the size of the namecache follow the number of vnodes, so that we
can always point to all the vnodes we have in core.

6. Readability has gone way up.

7. Added a "options NCH_STATISTICS" feature that will gather more
detailed statistics on the performance of the namecache.

Reviewed by:	davidg
1995-03-09 20:23:45 +00:00
Poul-Henning Kamp
a0e8a1e29b Another little optimization to the nameicache.
If an entry is stale, ditch it.
1995-03-08 01:40:44 +00:00
Poul-Henning Kamp
2425396b27 Improve the quality of the hash used in the namei-cache. 1995-03-08 01:08:03 +00:00
David Greenman
5dcf309046 Removed most of the special policy regarding the seperation of VMIO and
dir/metadata buffers as it seems to have anomolous effects.
1995-03-07 19:53:27 +00:00
David Greenman
acc835fd3f Put VAGE vnodes at the head of the free list. 1995-03-07 18:59:45 +00:00
Poul-Henning Kamp
30f467d84a Update vfs_cache.c to use the <sys/queue.h> macros. This makes it easier
to read, but doesn't change the speed.

Reviewed by:	phk
Obtained from:	via NetBSD
1995-03-06 06:45:52 +00:00
David Greenman
9bd1697199 Added some more of John's "anti-chatter" fixes - set the page activation
count to 0 after activating the page; the previous behavior biased the
pages too high in some cases.

Submitted by:	John Dyson
1995-03-04 15:16:07 +00:00
Bruce Evans
7262c5ee2c Support extended DOSpartitions.
Accept even suspicious partitions.

Moved most handling of the compatibility slice to dsopen().

Report i/o errors.
1995-03-04 11:44:05 +00:00
Bruce Evans
2973a0eba4 Don't warn about missing labels for non-BSD slices.
Don't print debugging messages by default.

Initialize the compatibility slice here and not in the machine-dependent
code.

Fix initialization of the label for the whole disk slice.

Make it clear that write protection of labels doesn't apply when there is
no label.
1995-03-04 11:42:27 +00:00
David Greenman
403ef252fa Removed obsolete vtrace() remnants. 1995-03-04 03:24:45 +00:00
David Greenman
22470903a0 Fixes from John Dyson to work around vnode lock hang. Basically, remove
the VOP_BMAP calls, and add one to bdwrite.

Submitted by:	John Dyson
1995-03-03 22:13:16 +00:00
David Greenman
9d55322b75 Don't try to cluster busy buffers.
Submitted by:	John Dyson
1995-03-02 19:36:50 +00:00
David Greenman
fde2cdc48a Various changes from John and myself that do the following:
New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that
are used to reduce the actual number of wakeups.
New function vm_page_protect which is used in conjuction with some new
page flags to reduce the number of calls to pmap_page_protect.
Minor changes to reduce unnecessary spl nesting.
Rewrote vm_page_alloc() to improve readability.
Various other mostly cosmetic changes.
1995-03-01 22:08:55 +00:00
David Greenman
3aed948b88 No longer assume that a process's address space can be directly written to. 1995-03-01 04:09:50 +00:00
Andrey A. Chernov
5d8619d1f2 Workaround IXOFF bug when output queue is full && RTS control is on 1995-02-28 23:21:33 +00:00
David Greenman
519b3d1aa6 Do a vnode_pager_uncache after the VOP_RENAME to lose the remaining
reference to the old vnode.

Suggested by:	Bruce Evans
1995-02-28 02:52:48 +00:00
Paul Traina
8c5c37cd75 Incorporate bde's code-review comments.
(a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous.
(b) remove all of the wrappers that have been replaced by ttselect
(c) fix formatting in syscons.c and definition in syscons.h
(d) add cxdevtotty

NOT DONE:
(e) make pcvt work... it was already broken...when someone fixes pcvt to
	link properly, just rename get_pccons to xxxdevtotty and we're done
1995-02-28 00:21:11 +00:00
Ugen J.S. Antsilevich
0739a0dc6e same 1995-02-27 19:47:53 +00:00
David Greenman
7500ed1d63 Backed out previous change. I forgot (for about the fourth time) that
v_rdev is a #define which is dereferenced through v_specinfo->si_rdev,
and that isn't initialized until later in checkalias().
1995-02-27 10:15:38 +00:00
David Greenman
f9ceb7c7b5 Initialize v_rdev in getnewvnode() - it appears that some filesystems
may not properly initialize this field in all cases, and this would
result in very anti-social behavior (overwriting on some other random
device/location).

Submitted by:	John Dyson
1995-02-27 06:50:08 +00:00
Bruce Evans
0fe414febc Eliminate my private type `bool_t'. 1995-02-26 03:15:36 +00:00