aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/devfs/devfs_vnops.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)Poul-Henning Kamp2000-08-201-2014/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC Notes: svn path=/head/; revision=64880
* Introduce vop_stdinactive() and make it the default if no vop_inactivePoul-Henning Kamp2000-08-181-17/+0
| | | | | | | | | is declared. Sort and prune a few vop_op[]. Notes: svn path=/head/; revision=64819
* Virtualizes & untangles the bioops operations vector.Poul-Henning Kamp2000-06-161-3/+2
| | | | | | | Ref: Message-ID: <18317.961014572@critter.freebsd.dk> To: current@ Notes: svn path=/head/; revision=61724
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-0/+1
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-3/+3
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-1/+1
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()Poul-Henning Kamp2000-03-201-2/+2
| | | | | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts. Notes: svn path=/head/; revision=58349
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Eliminate the undocumented, experimental, non-delivering and highlyPoul-Henning Kamp2000-03-161-2/+0
| | | | | | | dangerous MAX_PERF option. Notes: svn path=/head/; revision=58132
* Give vn_isdisk() a second argument where it can return a suitable errno.Poul-Henning Kamp2000-01-101-1/+1
| | | | | | | Suggested by: bde Notes: svn path=/head/; revision=55756
* Eliminate unused variablesEivind Eklund1999-12-201-3/+1
| | | | Notes: svn path=/head/; revision=54907
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-151-22/+0
| | | | Notes: svn path=/head/; revision=54655
* Remove unused #includes.Poul-Henning Kamp1999-12-081-3/+0
| | | | | | | Obtained from: http://bogon.freebsd.dk/include Notes: svn path=/head/; revision=54292
* Report swapdevices as cdevs rather than bdevs.Poul-Henning Kamp1999-11-291-0/+2
| | | | | | | Remove unused dev2budev() function. Notes: svn path=/head/; revision=53899
* Get rid of calls to vfinddev() by doing like specfs.Poul-Henning Kamp1999-11-201-15/+7
| | | | Notes: svn path=/head/; revision=53457
* Remove WILLRELE from VOP_SYMLINKEivind Eklund1999-11-131-5/+3
| | | | | | | | | 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. Notes: svn path=/head/; revision=53131
* Remove the iskmemdev() function. Make it the responsibility of the mem.cPoul-Henning Kamp1999-11-071-3/+1
| | | | | | | drivers to enforce the securelevel checks. Notes: svn path=/head/; revision=52967
* useracc() the prequel:Poul-Henning Kamp1999-10-291-1/+0
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=52635
* Make bdev userland access work like cdev userland access unlessPoul-Henning Kamp1999-08-301-182/+6
| | | | | | | | | | | | | the highly non-recommended option ALLOW_BDEV_ACCESS is used. (bdev access is evil because you don't get write errors reported.) Kill si_bsize_best before it kills Matt :-) Use the specfs routines rather having cloned copies in devfs. Notes: svn path=/head/; revision=50623
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Make DEVFS use PHK's specinfo struct as the source of dev_t and devsw.Julian Elischer1999-08-251-102/+102
| | | | | | | | | | | In lookup() however it's the other way around as we need to supply the dev_t for the vnode, so devfs still has a copy of it stashed away. Sourcing it from the vnode in the vnops however is useful as it makes a lot of the code almost the same as that in specfs. Notes: svn path=/head/; revision=50334
* Make DEVFS ops reflect some of the changes that have recently occured in theJulian Elischer1999-08-251-60/+173
| | | | | | | | | | | | | | specfs version of the same ops. Merging with phk's dev_t changes is not yet complete. i.e. devfs still uses it's own devsw pointer rather than following devsw(a_vp->v_rdev), and it's own copy of the dev_t. This fixes some broken actions re: syscons and DEVFS due to bitrot in devfs vops. Notes: svn path=/head/; revision=50330
* Add the (inline) function vm_page_undirty for clearing the dirty bitmaskAlan Cox1999-08-171-3/+3
| | | | | | | | | | | of a vm_page. Use it. Submitted by: dillon Notes: svn path=/head/; revision=49945
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,Poul-Henning Kamp1999-08-081-2/+1
| | | | | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part. Notes: svn path=/head/; revision=49535
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingKirk McKusick1999-06-261-4/+4
| | | | | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits. Notes: svn path=/head/; revision=48225
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledPoul-Henning Kamp1999-05-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=47028
* remove b_proc from struct buf, it's (now) unused.Poul-Henning Kamp1999-05-061-3/+2
| | | | | | | Reviewed by: dillon, bde Notes: svn path=/head/; revision=46580
* This Implements the mumbled about "Jail" feature.Poul-Henning Kamp1999-04-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/ Notes: svn path=/head/; revision=46155
* Suser() simplification:Poul-Henning Kamp1999-04-271-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. Notes: svn path=/head/; revision=46112
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).Bruce Evans1999-02-251-1/+2
| | | | Notes: svn path=/head/; revision=44273
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-281-1/+4
| | | | | | | kernel compile Notes: svn path=/head/; revision=43311
* Fix but in devfs_strategy(). Switch cases were falling throughMatthew Dillon1999-01-271-1/+3
| | | | | | | | instead of breaking out, so a VCHR devices would run the VCHR routine and then fall through and run the VBLK routine. Fixed. Notes: svn path=/head/; revision=43310
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-271-40/+42
| | | | | | | kernel compile Notes: svn path=/head/; revision=43305
* This is a rather large commit that encompasses the new swapper,Matthew Dillon1999-01-211-4/+4
| | | | | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com> Notes: svn path=/head/; revision=42957
* Remove declarations for undefined functions and a couple of unusedEivind Eklund1999-01-121-11/+1
| | | | | | | enotsupp implementations. Notes: svn path=/head/; revision=42568
* Avoid NULL-pointer dereference on error condition.Eivind Eklund1998-12-151-2/+2
| | | | Notes: svn path=/head/; revision=41834
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticArchie Cobbs1998-12-071-12/+5
| | | | | | | and local variables, goto labels, and functions declared but not defined. Notes: svn path=/head/; revision=41591
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagsPeter Wemm1998-10-311-4/+4
| | | | | | | rather than abusing the list next pointer with a magic number. Notes: svn path=/head/; revision=40790
* Make devfs update the atime timestamp so that 'w' works when usingSøren Schmidt1998-09-301-4/+10
| | | | | | | options DEVFS. Notes: svn path=/head/; revision=39836
* Cosmetic changes to the PAGE_XXX macros to make them consistent withDoug Rabson1998-09-041-2/+2
| | | | | | | the other objects in vm. Notes: svn path=/head/; revision=38799
* Use [u]intptr_t instead of [u_]long for casts between pointers andBruce Evans1998-08-161-8/+7
| | | | | | | integers. Don't forget to cast to (void *) as well. Notes: svn path=/head/; revision=38354
* Fixed printf format errors.Bruce Evans1998-07-301-2/+2
| | | | Notes: svn path=/head/; revision=37977
* DEVFS completely bypasses the cdevsw and bdevsw tables now.Julian Elischer1998-07-051-227/+799
| | | | | | | | | | | Each devfs node has (and has had fro a while) a pointer directly to the correct cdefsw entry so just use it instead of doing the lookup. There are several other places in the kernel that still use the tables however, so they can't go away yet.. Notes: svn path=/head/; revision=37407
* Don't silently accept attempts to change flags where they are notPeter Wemm1998-06-101-2/+4
| | | | | | | supported. Notes: svn path=/head/; revision=36840
* In the words of the submitter:Mike Smith1998-05-071-26/+11
| | | | | | | | | | | | | | | | | | | | | | --------- Make callers of namei() responsible for releasing references or locks instead of having the underlying filesystems do it. This eliminates redundancy in all terminal filesystems and makes it possible for stacked transport layers such as umapfs or nullfs to operate correctly. Quality testing was done with testvn, and lat_fs from the lmbench suite. Some NFS client testing courtesy of Patrik Kudo. vop_mknod and vop_symlink still release the returned vpp. vop_rename still releases 4 vnode arguments before it returns. These remaining cases will be corrected in the next set of patches. --------- Submitted by: Michael Hancock <michaelh@cet.co.jp> Notes: svn path=/head/; revision=35823
* Add changes and code to implement a functional DEVFS.Julian Elischer1998-04-191-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned. Notes: svn path=/head/; revision=35319
* Add two new functions, get{micro|nano}time.Poul-Henning Kamp1998-03-261-10/+8
| | | | | | | | | | | | | | | They are atomic, but return in essence what is in the "time" variable. gettime() is now a macro front for getmicrotime(). Various patches to use the two new functions instead of the various hacks used in their absence. Some puntuation and grammer patches from Bruce. A couple of XXX comments. Notes: svn path=/head/; revision=34901
* Free the vnode in the failure case of vop_symlink()Julian Elischer1998-03-101-1/+2
| | | | | | | Suggested by: Michaelh@cet.co.jp Notes: svn path=/head/; revision=34457
* add copyrightsJulian Elischer1998-01-021-5/+25
| | | | Notes: svn path=/head/; revision=32176
* Don't include <sys/lock.h> in headers when only `struct simplelock' isBruce Evans1997-12-051-1/+2
| | | | | | | required. Fixed everything that depended on the pollution. Notes: svn path=/head/; revision=31561