summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs
Commit message (Collapse)AuthorAgeFilesLines
* 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-40/+7
| | | | | | | | | | | | | 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>
* $Id$ -> $FreeBSD$peter1999-08-2815-15/+15
|
* 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>
* Fixed printf format errors (%qu -> %llu; the arg was already unsigned longbde1999-08-081-5/+3
| | | | long to hide problems on alphas).
* 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>
* Eliminate the bogus procfs private almost struct dirent structure.phk1999-06-133-43/+27
| | | | | Spotted by: Lars Hamren Reviewed by: bde
* Don't call calcru() on a swapped-out process. calcru() access p_stats, whichdt1999-05-221-16/+10
| | | | is in U-area.
* 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-283-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-273-8/+7
| | | | | | | | | | | | | | | | | | | 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.
* 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-272-9/+9
| | | | kernel compile
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-6/+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>
* A partial implementation of the procfs cmdline pseudo-file. Thispeter1999-01-054-5/+51
| | | | | | | | is enough to satisfy things like StarOffice. This is a hack, but doing it properly would be a LOT of work, and would require extensive grovelling around in the user address space to find the argv[]. Obtained from: Mostly from Andrzej Bialecki <abial@nask.pl>.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-042-5/+6
| | | | | | | | | | | | | | 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>
* Added a second argument, "activate" to the vm_page_unwire() call so thatdg1998-10-281-2/+2
| | | | the caller can select either inactive or active queue to put the page on.
* Removed statically configured mount type numbers (MOUNT_*) and allbde1998-09-071-2/+2
| | | | | | | | | 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.
* Style fixes and a bug fix: don't remove the exit handler if unmountalex1998-07-271-5/+6
| | | | | | fails. Submitted by: bde
* A better solution to the rm_at_exit problem: Register the exit functionalex1998-07-271-23/+10
| | | | | | | | during first mount. Unregister the exit function at last unmount. Concept by: sef Reviewed by: sef Implemented by: alex
* Override the default VFS LKM dispatch functions so that a modulealex1998-07-251-4/+19
| | | | | unload function can be provided (this is necessary to unregister the at_exit handler).
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Fixed printf format errors.bde1998-07-112-9/+9
|
* Quick fix for type mismatches which were fatal if longs aren't 32bde1998-07-071-5/+5
| | | | | | | | bits. We used a private, wrong, version of `struct dirent' to help break getdirentries(), and we use a silly check that the size of this struct is a power of 2 to help break mount() if getdirentries() would not work. This fix just changes the struct to match `struct dirent' (except for the name length).
* Remove "not hungly" panics. Cookies now used by the linux and ibcs2dt1998-06-251-10/+3
| | | | | | | emulators. The emulators assume that filesystem may just ignore cookies, and handle this case correctly. So we just ignore cookies. Also sync *_readdir "prototypes" with reality.
* Avoid a 64-bit division in procfs_readdir(). Fixed related overflows.bde1998-06-141-10/+6
| | | | | | | | | | | | Check args using the same expression as in fdesc and kernfs. The check was actually already correct, modulo overflow. It could be tightened up to either allow huge (aligned) offsets, treating them as EOF, or disallow all offsets beyond EOF. Didn't fix invalid address calculation &foo[i] where i may be out of bounds. Didn't fix shooting of foot using a private unportable dirent struct.
* Don't silently accept attempts to change flags where they are notpeter1998-06-101-1/+5
| | | | supported.
* This commit fixes various 64bit portability problems required fordfr1998-06-072-4/+4
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Disallow reading the current kernel stack. Only the user structure andtegge1998-05-193-10/+38
| | | | | the current registers should be accessible. Reviewed by: David Greenman <dg@root.com>
* As described by the submitter:msmith1998-05-061-4/+1
| | | | | | | | | | | | | Reverse the VFS_VRELE patch. Reference counting of vnodes does not need to be done per-fs. I noticed this while fixing vfs layering violations. Doing reference counting in generic code is also the preference cited by John Heidemann in recent discussions with him. The implementation of alternative vnode management per-fs is still a valid requirement for some filesystems but will be revisited sometime later, most likely using a different framework. Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Tighten up management of memory and swap space during map allocation,dyson1998-04-291-13/+27
| | | | | | | deallocation cycles. This should provide a measurable improvement on swap and memory allocation on loaded systems. It is unlikely a complete solution. Also, provide more map info with procfs. Chuck Cranor spurred on this improvement.
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-171-2/+2
|
* Add two new functions, get{micro|nano}time.phk1998-03-261-6/+2
| | | | | | | | | | | | 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.
* The intent is to get rid of WILLRELE in vnode_if.src by makingmsmith1998-03-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a complement to all ops that return a vpp, VFS_VRELE. This is initially only for file systems that implement the following ops that do a WILLRELE: vop_create, vop_whiteout, vop_mknod, vop_remove, vop_link, vop_rename, vop_mkdir, vop_rmdir, vop_symlink This is initial DNA that doesn't do anything yet. VFS_VRELE is implemented but not called. A default vfs_vrele was created for fs implementations that use the standard vnode management routines. VFS_VRELE implementations were made for the following file systems: Standard (vfs_vrele) ffs mfs nfs msdosfs devfs ext2fs Custom union umapfs Just EOPNOTSUPP fdesc procfs kernfs portal cd9660 These implementations may change as VOP changes are implemented. In the next phase, in the vop implementations calls to vrele and the vrele part of vput will be moved to the top layer vfs_vnops and made visible to all layers. vput will be replaced by unlock in these cases. Unlocking will still be done in the per fs layer but the refcount decrement will be triggered at the top because it doesn't hurt to hold a vnode reference a little longer. This will have minimal impact on the structure of the existing code. This will only be done for vnode arguments that are released by the various fs vop implementations. Wider use of VFS_VRELE will likely require restructuring of the code. Reviewed by: phk, dyson, terry et. al. Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Staticize.eivind1998-02-091-2/+2
|
* Back out DIAGNOSTIC changes.eivind1998-02-063-9/+3
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-043-3/+9
|
* VM level code cleanups.dyson1998-01-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
* Make our v_usecount vnode reference count work identically to thedyson1998-01-062-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible.
* Use CHECKIO in procfs_ioctl() to ensure that any changes in UID/GID resultsef1998-01-061-1/+4
| | | | in the expected failure.
* Fixed a missing/misplaced/misstyled prototype.bde1997-12-302-4/+4
|
* Unspammed nested include of <vm/vm_zone.h>.bde1997-12-271-2/+2
|
OpenPOWER on IntegriCloud