summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
Commit message (Collapse)AuthorAgeFilesLines
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-41/+10
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Fix fd race conditions (during shared fd table usage.) Badfileops isgreen1999-08-041-6/+64
| | | | | | | | | | | | now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
* From the submitter:msmith1999-06-071-6/+6
| | | | | | | | | | | | | | | | | - this causes POSIX locking to use the thread group leader (p->p_leader) as the locking thread for all advisory locks. In non-kernel-threaded code p->p_leader == p, so this will have no effect. This results in (more) correct POSIX threaded flock-ing semantics. It also prevents the leader from exiting before any of the children. (so that p->p_leader will never be stale) in exit1(). We have been running this patch for over a month now in our lab under load and at customer sites. Submitted by: John Plevyak <jplevyak@inktomi.com>
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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-301-5/+22
| | | | | | | | | | | | | 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.
* 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).
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-5/+6
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-081-2/+2
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* I got another batch of suggestions for cosmetic changes from bde.truckman1998-11-111-4/+7
|
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-20/+122
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* Fixed printf format errors.bde1998-07-291-4/+4
|
* Cast longs to intptr_t before casting them to pointers.bde1998-07-151-5/+8
| | | | | Fixed bitrot in pseudo-declaration of `struct fcntl_args'. fcntl() is now broken in some cases when ints are larger than longs.
* 64bit fixes: p->p_retval is a register_t[] not an int[].dfr1998-06-101-3/+4
|
* Fix the futimes/undelete/utrace conflict with other BSD's. Note thatdyson1998-05-111-1/+51
| | | | | | | the only common usage of utrace (the possible problem with this commit) is with malloc, so this should be a real problem. Add the various NetBSD syscalls that allow full emulation of their development environment.
* Make the rootdir handling more consistent. Now, processes alwaysdyson1998-02-151-7/+4
| | | | | | have a root vnode associated with them, and no special checks for the null case are needed. Submitted by: terry@freebsd.org
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+2
|
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+2
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+3
|
* Fix and complete the AIO syscalls. There are some performance enhancementsdyson1997-11-291-1/+19
| | | | coming up soon, but the code is functional. Docs will be forthcoming.
* Fixed a missing conversion of retval to p_retval in disabled code.bde1997-11-231-3/+3
| | | | | | | | Fixed overflow of FFLAGS() in fcntl(F_SETFL, ...). This was not a security hole, but gave wrong results for silly flags values. E.g., it make fcntl(F_SETFL, -1) equivalent to fcntl(F_SETFL, 0). POSIX requires ignoring the open mode bits in fcntl() (even if they would be invalid for open()).
* Fixed duplicate definitions of M_FILE (one static).bde1997-11-231-2/+2
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-31/+23
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+4
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Various select -> poll changespeter1997-09-141-2/+2
|
* Removed some stale comments.bde1997-08-261-4/+4
| | | | Fixed a gratuitous ANSIism.
* Removed support for OLD_PIPE. <sys/stat.h> is now missing the hack thatbde1997-04-091-7/+1
| | | | | supported nameless pipes being indistinguishable from fifos. We're not going back.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* This commit is the embodiment of some VFS read clustering improvements.dyson1996-12-291-1/+2
| | | | | | | | | | | | Firstly, now our read-ahead clustering is on a file descriptor basis and not on a per-vnode basis. This will allow multiple processes reading the same file to take advantage of read-ahead clustering. Secondly, there previously was a problem with large reads still using the ramp-up algorithm. Of course, that was bogus, and now we read the entire "chunk" off of the disk in one operation. The read-ahead clustering algorithm should use less CPU than the previous also (I hope :-)). NOTE: THAT LKMS MUST BE REBUILT!!!
* Fixed nonexistent checking of lock types for F_GETLK.bde1996-12-191-1/+4
| | | | Found by: NIST-PCTS
* Fixed lseek() on named pipes. It always succeeded but should always fail.bde1996-12-191-1/+4
| | | | | | | | | | Broke locking on named pipes in the same way as locking on non-vnodes (wrong errno). This will be fixed later. The fix involves negative logic. Named pipes are now distinguished from other types of files with vnodes, and there is additional code to handle vnodes and named pipes in the same way only where that makes sense (not for lseek, locking or TIOCSCTTY).
* Fixed bitrot in the read-only attribute:bde1996-09-281-5/+4
| | | | | | - kern.maxfilesperproc was read-only (and thus essentially useless). Removed unused #includes. Strength-reduced used #includes.
* Fix fdavail() so that correctly pays attention to the rlimit.smpatel1996-08-151-3/+5
| | | | | | | | Fixes unp_externalize panic which occurs when a process is at it's ulimit for file descriptors and tries to receive a file descriptor from another process. Reviewed by: wollman
* Add a couple of #ifdef DEVFS/#endif clauses to slence the followingwpaul1996-06-171-1/+5
| | | | | | | | | | | | | | | | | compiler warnings which occur if you don't have 'options DEVFS' in your kernel config file: ../../kern/kern_descrip.c: In function `fildesc_drvinit': ../../kern/kern_descrip.c:1103: warning: unused variable `fd' ../../kern/kern_descrip.c: At top level: ../../kern/kern_descrip.c:1095: warning: `devfs_token_stdin' defined but not use d ../../kern/kern_descrip.c:1096: warning: `devfs_token_stdout' defined but not us ed ../../kern/kern_descrip.c:1097: warning: `devfs_token_stderr' defined but not us ed ../../kern/kern_descrip.c:1098: warning: `devfs_token_fildesc' defined but not u sed
* Clean up -Wunused warnings.gpalmer1996-06-121-3/+1
| | | | Reviewed by: bde
* Fixed the unit numbers of the devfs `fd' devices.bde1996-03-271-12/+16
| | | | | | | | | Made the devfs `fd' devices bug for bug compatible with the ones created by MAKEDEV: - ownership is bin.bin, not root.wheel, except for std*. The devfsext interface doesn't seem to allow specifying the ownership of /devfs/fd, so it's still incompatible. - std* aren't links to fd/[0-2].
* Merge in Lite2: LIST replacement for f_filef, f_fileb, and filehead.hsu1996-03-111-21/+13
| | | | | Did not accept change of second argument to ioctl from int to u_long. Reviewed by: davidg & bde
* kern_descrip.c: add fdshare()/fdcopy()peter1996-02-231-1/+45
| | | | | | | | | | | | | | | | | | | | kern_fork.c: add the tiny bit of code for rfork operation. kern/sysv_*: shmfork() takes one less arg, it was never used. sys/shm.h: drop "isvfork" arg from shmfork() prototype sys/param.h: declare rfork args.. (this is where OpenBSD put it..) sys/filedesc.h: protos for fdshare/fdcopy. vm/vm_mmap.c: add minherit code, add rounding to mmap() type args where it makes sense. vm/*: drop unused isvfork arg. Note: this rfork() implementation copies the address space mappings, it does not connect the mappings together. ie: once the two processes have split, the pages may be shared, but the address space is not. If one does a mmap() etc, it does not appear in the other. This makes it not useful for pthreads, but it is useful in it's own right for having light-weight threads in a static shared address space. Obtained from: Original by Ron Minnich, extended by OpenBSD
* Improve the performance for pipe(2) again. Also include somedyson1996-02-041-1/+7
| | | | | | | | | | | | | | | | | | | | fixes for previous version of new pipes from Bruce Evans. This new version: Supports more properly the semantics of select (BDE). Supports "OLD_PIPE" correctly (kern_descrip.c, BDE). Eliminates incorrect EPIPE returns (bash 'pipe broken' messages.) Much faster yet, currently tuned relatively conservatively -- but now gives approx 50% more perf than the new pipes code did originally. (That was about 50% more perf than the original BSD pipe code.) Known bugs outstanding: No support for async io (SIGIO). Will be included soon. Next to do: Merge support for FIFOs. Submitted by: bde
* Enable the new fast pipe code. The old pipes can be used with thedyson1996-01-281-1/+11
| | | | "OLD_PIPE" config option.
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-4/+5
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Julian forgot to make the *devsw structures static.phk1995-12-081-2/+2
|
* Pass 3 of the great devsw changesjulian1995-12-081-22/+28
| | | | | | | | | | | | | | | | | | | | | | | most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+3
|
* Include <vm/vm.h> or <vm/vm_page.h> explicitly to avoid breaking whenbde1995-12-051-1/+3
| | | | vnode_if.h doesn't include vm stuff.
* A major sweep over the sysctl stuff.phk1995-12-041-12/+11
| | | | | | | | | | | | | Move a lot of variables home to their own code (In good time before xmas :-) Introduce the string descrition of format. Add a couple more functions to poke into these marvels, while I try to decide what the correct interface should look like. Next is adding vars on the fly, and sysctl looking at them too. Removed a tine bit of defunct and #ifdefed notused code in swapgeneric.
OpenPOWER on IntegriCloud