summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
Commit message (Collapse)AuthorAgeFilesLines
* $Id$ -> $FreeBSD$peter1999-08-2844-45/+45
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-262-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix comment to match reality..julian1999-08-251-1/+2
| | | | vop_strategy gets a vnode argument these days.
* 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".
* Let processes retrieve their argv through procfs. Revert to the originalmarcel1999-08-191-8/+41
| | | | | | behaviour in all other cases. Submitted by: Andrew Gordon <arg@arg1.demon.co.uk>
* Remove an unused variable.billf1999-08-171-2/+1
| | | | Reviewed by: bde
* Add the (inline) function vm_page_undirty for clearing the dirty bitmaskalc1999-08-172-6/+6
| | | | | | | | of a vm_page. Use it. Submitted by: dillon
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-3/+3
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Add support for device drivers which want to track all open/closephk1999-08-131-59/+18
| | | | | | | | | | | | | | | operations. This allows a device driver better insight into what is going on that the current: proc1: open /dev/foo R/O devsw->open( R/O, proc1 ) proc2: open /dev/foo R/W devsw->open( R/W, proc2 ) proc2: close /* nothing, but device is really only R/O open */ proc1: close devsw->close( R/O, proc1 )
* Remove spec_getattr(), which as far as I can tell can never be called from ↵phk1999-08-131-3/+1
| | | | the current code-paths, and if it were, would panic on any unmounted bdev.
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-132-11/+11
|
* s/v_specinfo/v_rdev/phk1999-08-131-6/+6
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-083-81/+2
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* Fixed printf format errors (%qu -> %llu; the arg was already unsigned longbde1999-08-081-5/+3
| | | | long to hide problems on alphas).
* Now a dev_t is a pointer to struct specinfo which is shared by all specdevphk1999-07-202-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vnodes referencing this device. Details: cdevsw->d_parms has been removed, the specinfo is available now (== dev_t) and the driver should modify it directly when applicable, and the only driver doing so, does so: vn.c. I am not sure the logic in checking for "<" was right before, and it looks even less so now. An intial pool of 50 struct specinfo are depleted during early boot, after that malloc had better work. It is likely that fewer than 50 would do. Hashing is done from udev_t to dev_t with a prime number remainder hash, experiments show no better hash available for decent cost (MD5 is only marginally better) The prime number used should not be close to a power of two, we use 83 for now. Add new checkalias2() to get around the loss of info from dev2udev() in bdevvp(); The aliased vnodes are hung on a list straight of the dev_t, and speclisth[SPECSZ] is unused. The sharing of struct specinfo means that the v_specnext moves into the vnode which grows by 4 bytes. Don't use a VBLK dev_t which doesn't make sense in MFS, now we hang a dummy cdevsw on B/Cmaj 253 so that things look sane. Storage overhead from all of this is O(50k). Bump __FreeBSD_version to 400009 The next step will add the stuff needed so device-drivers can start to hang things from struct specinfo
* Allow jailed proccesses to open non-process vnodes like the root of the fs.phk1999-07-091-2/+2
|
* Use %q rather than rolling a custom routine.peter1999-07-091-51/+7
|
* Support for i386 hardware breakpoints.jlemon1999-07-091-0/+101
| | | | Submitted by: Brian Dean <brdean@unx.sas.com>
* Implement support for hardware debug registers on the i386.jlemon1999-07-093-3/+20
| | | | Submitted by: Brian Dean <brdean@unx.sas.com>
* Make sure that stat(2) and friends always return a valid st_dev field.phk1999-07-026-15/+7
| | | | | | Pseudo-FS need not fill in the va_fsid anymore, the syscall code will use the first half of the fsid, which now looks like a udev_t with major 255.
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-262-9/+9
| | | | | | | 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.
* Add a vnode argument to VOP_BWRITE to get rid of the last vnodemckusick1999-06-163-115/+8
| | | | | operator special case. Delete special case code from vnode_if.sh, vnode_if.src, umap_vnops.c, and null_vnops.c.
* Eliminate the bogus procfs private almost struct dirent structure.phk1999-06-133-43/+27
| | | | | Spotted by: Lars Hamren Reviewed by: bde
* Remove an unused variable.dt1999-06-011-2/+1
|
* Simplify cdevsw registration.phk1999-05-313-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Don't call calcru() on a swapped-out process. calcru() access p_stats, whichdt1999-05-221-16/+10
| | | | is in U-area.
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-114-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-082-23/+26
| | | | | | | | 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-072-13/+13
| | | | | | | | | | | | | | 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.)
* remove b_proc from struct buf, it's (now) unused.phk1999-05-062-6/+4
| | | | Reviewed by: dillon, bde
* Make the type and map files claim 0 bytes size. Tar doesn't get confusedphk1999-05-041-13/+10
| | | | | | now, but doesn't store any data eiter. I wonder if we shouldn't claim to be fifos instead...
* Add even more () to CHECKIO which by now feels positively LISPish.phk1999-05-041-3/+4
| | | | | Submitted by: bde Reviewed by: phk
* Add a new "file" to procfs: "rlimit" which shows the resource limits forphk1999-04-304-4/+188
| | | | | | | | the process. PR: 11342 Submitted by: Adrian Chadd adrian@freebsd.org Reviewed by: phk
* This Implements the mumbled about "Jail" feature.phk1999-04-284-11/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/
* Change suser_xxx() to suser() where it applies.phk1999-04-271-4/+5
|
* Suser() simplification:phk1999-04-275-20/+19
| | | | | | | | | | | | | | | | | | | 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.
* Catch a case spotted by Tor where files mmapped could leave garbage in thejulian1999-04-051-3/+13
| | | | | | | | | | | | unallocated parts of the last page when the file ended on a frag but not a page boundary. Delimitted by tags PRE_MATT_MMAP_EOF and POST_MATT_MMAP_EOF, in files alpha/alpha/pmap.c i386/i386/pmap.c nfs/nfs_bio.c vm/pmap.h vm/vm_page.c vm/vm_page.h vm/vnode_pager.c miscfs/specfs/spec_vnops.c ufs/ufs/ufs_readwrite.c kern/vfs_bio.c Submitted by: Matt Dillon <dillon@freebsd.org> Reviewed by: Alan Cox <alc@freebsd.org>
* Don't allow anyone except root to mount file systems that map uids.imp1999-03-121-1/+7
| | | | | | | | | This can have bad security implications, but the impact on FreeBSD systems is minimal because this fs isn't in the default kernels and it is unknown if it even works. Submitted by: Manuel Bouyer <bouyer@antioche.eu.org> and Artur Grabowski <art@stacken.kth.se>
* This code got moved as a result of confusion between union mounts andpeter1999-02-281-10/+1
| | | | | unionfs. Julian has already revived the union mount part of this move in vfs_syscalls.c rev 1.119, but forgot to take it out of here.
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-251-1/+2
|
* Reviewed by: Julian Elischer <julian@whistle.com>dillon1999-02-252-26/+46
| | | | | | | Add d_parms() to {c,b}devsw[]. If non-NULL this function points to a device routine that will properly fill in the specinfo structure. vfs_subr.c's checkalias() supplies appropriate defaults. This change should be fully backwards compatible with existing devices.
* Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). Thisluoqi1999-02-191-2/+2
| | | | | | | is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
* Remove MAP_ENTRY_IS_A_MAP 'share' maps. These maps were once used todillon1999-02-071-2/+2
| | | | | | attempt to optimize forks but were essentially given-up on due to problems and replaced with an explicit dup of the vm_map_entry structure. Prior to the removal, they were entirely unused.
* Correct a format mismatch on 64-bit architectures. This shouldjdp1999-02-051-3/+3
| | | | fix the erroneous values in the procfs "map" file on the Alpha.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-282-4/+7
| | | | 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-2712-86/+99
| | | | kernel compile
OpenPOWER on IntegriCloud