summaryrefslogtreecommitdiffstats
path: root/sys/miscfs/devfs
Commit message (Collapse)AuthorAgeFilesLines
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-1/+1
| | | | Suggested by: bde
* Eliminate unused variableseivind1999-12-201-3/+1
|
* Second pass commit to introduce new ACL and Extended Attribute systemrwatson1999-12-191-1/+3
| | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-22/+0
|
* Lock reporting and assertion changes.eivind1999-12-111-1/+1
| | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter
* Remove unused #includes.phk1999-12-081-3/+0
| | | | Obtained from: http://bogon.freebsd.dk/include
* Report swapdevices as cdevs rather than bdevs.phk1999-11-291-0/+2
| | | | Remove unused dev2budev() function.
* s/p_cred->pc_ucred/p_ucred/gphk1999-11-211-2/+2
|
* Get rid of calls to vfinddev() by doing like specfs.phk1999-11-201-15/+7
|
* struct mountlist and struct mount.mnt_list have no business beingphk1999-11-201-1/+1
| | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967
* Remove WILLRELE from VOP_SYMLINKeivind1999-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.
* Remove the iskmemdev() function. Make it the responsibility of the mem.cphk1999-11-071-3/+1
| | | | drivers to enforce the securelevel checks.
* useracc() the prequel:phk1999-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.
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-0/+1
| | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
* All unimplemented VFS ops now have entries in kern/vfs_default.c that returnalfred1999-09-071-48/+5
| | | | | | | | | | | | | reasonable defaults. This avoids confusing and ugly casting to eopnotsupp or making dummy functions. Bogus casting of filesystem sysctls to eopnotsupp() have been removed. This should make *_vfsops.c more readable and reduce bloat. Reviewed by: msmith, eivind Approved by: phk Tested by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
* Make bdev userland access work like cdev userland access unlessphk1999-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.
* Fix various trivial warnings from LINTphk1999-08-281-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-284-4/+4
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Make a place to store the devfs hook for the block device, as the samejulian1999-08-251-3/+2
| | | | specinfo is used to identify both raw and block version sof a device.
* Make DEVFS use PHK's specinfo struct as the source of dev_t and devsw.julian1999-08-253-128/+120
| | | | | | | | 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.
* Make DEVFS ops reflect some of the changes that have recently occured in thejulian1999-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.
* Devfs now adds itself to the hook that PHK supplies.julian1999-08-241-1/+21
| | | | | block devices are still not handled correctly, though a kludge may make them "ok".
* Add the (inline) function vm_page_undirty for clearing the dirty bitmaskalc1999-08-171-3/+3
| | | | | | | | of a vm_page. Use it. Submitted by: dillon
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-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.
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-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.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-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).
* remove b_proc from struct buf, it's (now) unused.phk1999-05-061-3/+2
| | | | Reviewed by: dillon, bde
* This Implements the mumbled about "Jail" feature.phk1999-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/
* Suser() simplification:phk1999-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.
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-251-1/+2
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-1/+4
| | | | kernel compile
* Fix but in devfs_strategy(). Switch cases were falling throughdillon1999-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.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-273-59/+63
| | | | kernel compile
* This is a rather large commit that encompasses the new swapper,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>
* Remove declarations for undefined functions and a couple of unusedeivind1999-01-121-11/+1
| | | | enotsupp implementations.
* Avoid NULL-pointer dereference on error condition.eivind1998-12-151-2/+2
|
* Rename one of the two devfs_link's to devfs_makelink.eivind1998-12-101-2/+2
|
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-072-14/+8
| | | | and local variables, goto labels, and functions declared but not defined.
* Staticize.eivind1998-11-261-2/+2
|
* Delete stray extern declaration for non-existing variables.peter1998-11-091-2/+1
|
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-312-6/+6
| | | | rather than abusing the list next pointer with a magic number.
* Make devfs update the atime timestamp so that 'w' works when usingsos1998-09-302-5/+12
| | | | options DEVFS.
* Oops, don't assume that the environment is normal in devfs_mount().bde1998-09-081-4/+6
| | | | | It isn't for the hidden mountpoint. The static vfs's haven't been attached then, so mp->mnt_vfc can't be valid.
* Removed statically configured mount type numbers (MOUNT_*) and allbde1998-09-071-6/+6
| | | | | | | | | references to them. The change a couple of days ago to ignore these numbers in statically configured vfsconf structs was slightly premature because the cd9660, cfs, devfs, ext2fs, nfs vfs's still used MOUNT_* instead of the number in their vfsconf struct.
* Cosmetic changes to the PAGE_XXX macros to make them consistent withdfr1998-09-041-2/+2
| | | | the other objects in vm.
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-162-11/+10
| | | | integers. Don't forget to cast to (void *) as well.
* Fixed printf format errors.bde1998-07-301-2/+2
|
* DEVFS completely bypasses the cdevsw and bdevsw tables now.julian1998-07-053-232/+804
| | | | | | | | 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..
* There is no such thing any more as "struct bdevsw".julian1998-07-042-5/+5
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
OpenPOWER on IntegriCloud