summaryrefslogtreecommitdiffstats
path: root/sys/gnu
Commit message (Collapse)AuthorAgeFilesLines
* Add a vnode argument to VOP_BWRITE to get rid of the last vnodemckusick1999-06-162-8/+8
| | | | | operator special case. Delete special case code from vnode_if.sh, vnode_if.src, umap_vnops.c, and null_vnops.c.
* Simplify cdevsw registration.phk1999-05-314-40/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* This commit should be a extensive NO-OP:phk1999-05-302-14/+42
| | | | | | | | | | | | | 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.
* Fixed printing of a dev_t in a panic message. Fixed the function namebde1999-05-132-4/+4
| | | | in this message.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Fix some of the places where too much inside knowledge about major/minorphk1999-05-082-8/+6
| | | | layout and dev_t structure is being (ab)used.
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-084-22/+22
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-074-22/+22
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Add an additional probe, hopefully allowing me to distinguishbrian1999-05-031-6/+10
| | | | | between the PC/Xi and PC/Xem boards. Now all I need is for someone with a PC/Xem to tell me what the probe says....
* The VFS/BIO subsystem contained a number of hacks in order to optimizealc1999-05-022-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | piecemeal, middle-of-file writes for NFS. These hacks have caused no end of trouble, especially when combined with mmap(). I've removed them. Instead, NFS will issue a read-before-write to fully instantiate the struct buf containing the write. NFS does, however, optimize piecemeal appends to files. For most common file operations, you will not notice the difference. The sole remaining fragment in the VFS/BIO system is b_dirtyoff/end, which NFS uses to avoid cache coherency issues with read-merge-write style operations. NFS also optimizes the write-covers-entire-buffer case by avoiding the read-before-write. There is quite a bit of room for further optimization in these areas. The VM system marks pages fully-valid (AKA vm_page_t->valid = VM_PAGE_BITS_ALL) in several places, most noteably in vm_fault. This is not correct operation. The vm_pager_get_pages() code is now responsible for marking VM pages all-valid. A number of VM helper routines have been added to aid in zeroing-out the invalid portions of a VM page prior to the page being marked all-valid. This operation is necessary to properly support mmap(). The zeroing occurs most often when dealing with file-EOF situations. Several bugs have been fixed in the NFS subsystem, including bits handling file and directory EOF situations and buf->b_flags consistancy issues relating to clearing B_ERROR & B_INVAL, and handling B_DONE. getblk() and allocbuf() have been rewritten. B_CACHE operation is now formally defined in comments and more straightforward in implementation. B_CACHE for VMIO buffers is based on the validity of the backing store. B_CACHE for non-VMIO buffers is based simply on whether the buffer is B_INVAL or not (B_CACHE set if B_INVAL clear, and vise-versa). biodone() is now responsible for setting B_CACHE when a successful read completes. B_CACHE is also set when a bdwrite() is initiated and when a bwrite() is initiated. VFS VOP_BWRITE routines (there are only two - nfs_bwrite() and bwrite()) are now expected to set B_CACHE. This means that bowrite() and bawrite() also set B_CACHE indirectly. There are a number of places in the code which were previously using buf->b_bufsize (which is DEV_BSIZE aligned) when they should have been using buf->b_bcount. These have been fixed. getblk() now clears B_DONE on return because the rest of the system is so bad about dealing with B_DONE. Major fixes to NFS/TCP have been made. A server-side bug could cause requests to be lost by the server due to nfs_realign() overwriting other rpc's in the same TCP mbuf chain. The server's kernel must be recompiled to get the benefit of the fixes. Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
* s/size == 0;/size = 0;/peter1999-05-022-6/+6
| | | | | PR: 11409 Submitted by: Christopher Peterson <cpeterso@cs.washington.edu>
* This Implements the mumbled about "Jail" feature.phk1999-04-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-282-4/+4
| | | | (Edited automatically)
* Suser() simplification:phk1999-04-274-10/+10
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Fix so that this driver works again when compiled with EGCS (whichdavidn1999-04-221-31/+31
| | | | | apparently has a much better optimiser, requiring 'volatile' memory to be declared as such).
* Remove unused function int fi() {return 0;}eivind1999-04-111-4/+1
|
* Staticize.eivind1999-04-111-2/+2
|
* Make NDGBPORTS an official option.joerg1999-03-131-1/+2
|
* Don't depend on <ufs/ufs/quota.h> or another (old) prerequisite includingbde1999-03-062-2/+4
| | | | | <sys/queue.h>. This fixes my recent breakage of biosboot by unpolluting <ufs/ufs/quota.h> in the !KERNEL case.
* Merge patch to ufs_vnops.c's ufs_rename to the copy of ufs_rename thatimp1999-03-022-0/+10
| | | | | | lives in ext2_vnops.c for ext2fs. Also remove cast from comparision. Bruce pointed out that it was bogus since we'd force a signed comparision when we really wanted an unsigned comparison.
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-252-0/+2
|
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-302-4/+6
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Fixed parenthesization botch in previous commit. Async update of inodesbde1999-01-292-2/+2
| | | | was broken.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-282-4/+4
| | | | kernel compile
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-272-4/+4
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-2718-124/+124
| | | | kernel compile
* Remove LKM support, src/lkm that built it is gone and it never worked as anpeter1999-01-171-35/+1
| | | | LKM anyway. It does work as a preloaded KLD module though.
* Avoid warning for unused variable.eivind1999-01-112-4/+4
|
* Don't pass unused unused timestamp args to UFS_UPDATE() or wastebde1999-01-0712-82/+42
| | | | | time initializing them. This almost finishes centralizing (in-core) timestamp updates in ufs_itimes().
* UFS_UPDATE() takes a boolean `waitfor' arg, so don't pass it the valuebde1999-01-062-2/+2
| | | | | | MNT_WAIT when we mean boolean `true' or check for that value not being passed. There was no problem in practice because MNT_WAIT had the magic value of 1.
* Ifdefed conditionally used simplock variables.bde1999-01-021-1/+3
|
* PR: kern/8819dillon1998-12-131-55/+55
| | | | | Trivial change of macro name from DEBUG to AWE_DEBUG to avoid conflict with kernel DEBUG option.
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-076-30/+16
| | | | and local variables, goto labels, and functions declared but not defined.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-1/+1
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Fixed a misspelling of boolean true as MNT_WAIT.bde1998-11-152-2/+2
|
* Finished updating module event handlers to be compatible withbde1998-11-151-2/+2
| | | | modeventhand_t.
* add #include <sys/kernel.h> where it's needed by MALLOC_DEFINE()peter1998-11-101-1/+2
|
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-316-14/+12
| | | | rather than abusing the list next pointer with a magic number.
* error return assignment was less than ideal. Fix the part that causedpeter1998-10-292-4/+4
| | | | | warnings to be the same as the ffs code. Previously, any error from the UFS_UPDATE() call was lost (I think).
* Use vtruncbuf() to clean out cached blocks on a file shorten rather thanpeter1998-10-292-6/+8
| | | | | the more expensive vinvalbuf(), based on the FFS version of the same routine. I don't have any ext2fs filesystems to test this on.
* Oops, the redundant tests for major numbers weren't redundant here.bde1998-10-272-4/+6
| | | | | | | They checked for the magic major number for the "device" behind mfs mount points. Use a more obvious check for this device. Debugged by: Andrew Gallatin <gallatin@cs.duke.edu>
* Removed redundant bitrotted checks for major numbers instead of updatingbde1998-10-262-8/+4
| | | | them.
* Don't follow null bdevsw pointers. The `major(dev) < nblkdev' test rottedbde1998-10-252-2/+4
| | | | | when bdevsw[] became sparse. We still depend on magic to avoid having to check that (v_rdev) device numbers in vnodes are not NODEV.
* Initialize earlier (ie: before npx) in case it makes any difference.peter1998-10-181-4/+8
| | | | | Print a message when it attaches to pmath_emulate if bootverbose so that we can be sure it's online.
* OOPS!peter1998-10-181-2/+2
| | | | | | Supply the moduledata handle rather than the event dispatcher function. This should explain the panic on boot problem that's been discussed in -current at the moment. Both machines had GNU_MATH_EMULATE.
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-9/+29
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Fixed bloatage of `struct inode'. We used 5 "spare" fields for ext2fs,bde1998-10-138-16/+16
| | | | | | | | | | | | | | but when i_effnlink was added to support soft updates, there was only room for 4 spares. The number of spares was not reduced, so the inode size became 260 (on i386's), or 512 after rounding up by malloc(). Use one spare field in `struct dinode' instead of the 5th spare field in the inode and reduced to 4 spares in the inode so that the size is 256 again. Changed the types of the spares in the inode from int to u_int32_t so that the inode size has more chance of being <= 256 under other arches, and downdated ext2fs to match (it was broken to use ints before rev.1.1).
* Quick fix for not being able to sync all the buffers in boot() ifbde1998-10-034-16/+20
| | | | | | | | | | | | | an ext2fs file system is mounted. The soft update changes added a check for B_DELWRI buffers. This exposed the complete brokenness of the previous quick fix for failing syncs (PR 3571, committed on 1997/08/04). Use a new buffer flag B_DIRTY and don't abuse B_DELWRI. B_DIRTY buffers are still written too late, as broken in the previous fix. This is fairly harmless, because B_DIRTY is only used for bitmap buffers and fsck.ext2 can fix up the bitmaps perfectly. Fixed a race in ULCK_BUF() (bremfree() was outside of the splbio() section).
* Fixed initialization of new inodes. ext2fs doesn't clear inodes whenbde1998-09-292-2/+6
| | | | | | they are deleted, so inodes must be cleared when they are reused, but we didn't clear the indirect blocks. This caused serious filesystem corruption.
* Updated ext2_reload() and ext2_sync(). Locking was broken, and MNT_LAZYbde1998-09-262-84/+126
| | | | | | | | | syncs weren't optimized properly (they probably still aren't, but are bug for bug compatible with ffs). These fixes are mostly academic, since ext2fs is too broken to mount read-write (it apparently doesn't clear indirect blocks). Obtained from: mostly from Lite2
OpenPOWER on IntegriCloud