aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs
Commit message (Collapse)AuthorAgeFilesLines
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileRuslan Ermilov2001-05-2337-14328/+0
| | | | | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles. Notes: svn path=/head/; revision=77031
* Sort includes from previous commit.John Baldwin2001-05-211-1/+1
| | | | Notes: svn path=/head/; revision=76945
* Introduce a global lock for the vm subsystem (vm_mtx).Alfred Perlstein2001-05-194-1/+17
| | | | | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb Notes: svn path=/head/; revision=76827
* Currently there is no way to tell if write operation invoked viaBoris Popov2001-05-181-1/+1
| | | | | | | | | | vn_start_write() on the given vnode will be successful. VOP_LEASE() may help to solve this problem, but its return value ignored nearly everywhere. For now just assume that the missing upper layer on write means insufficient access rights (which is correct for most cases). Notes: svn path=/head/; revision=76797
* VOP getwritemount() can be invoked on vnodes with VFREE flag set (used inBoris Popov2001-05-171-4/+12
| | | | | | | snapshots code). At this point upper vp may not exist. Notes: svn path=/head/; revision=76718
* Use vop_*vobject() VOPs to get reference to VM object from upper or lower fs.Boris Popov2001-05-173-60/+60
| | | | Notes: svn path=/head/; revision=76716
* Do not leave an extra reference on vnode.Boris Popov2001-05-171-6/+2
| | | | | | | | | PR: kern/27250 Submitted by: "Vladimir B. Grebenschikov" <vova@express.ru> MFC after: 2 weeks Notes: svn path=/head/; revision=76715
* Change the second argument of vflush() to an integer that specifiesIan Dowse2001-05-165-86/+16
| | | | | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp Notes: svn path=/head/; revision=76688
* GC prototype for procfs_bmap() missed during a previous commit.John Baldwin2001-05-111-1/+0
| | | | Notes: svn path=/head/; revision=76491
* Implement vop_std{get|put}pages() and add them to the default vop[].Poul-Henning Kamp2001-05-011-32/+0
| | | | | | | | Un-copy&paste all the VOP_{GET|PUT}PAGES() functions which do nothing but the default. Notes: svn path=/head/; revision=76167
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-0120-68/+120
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Backed out previous commit. It cause massive filesystem corruption,Bruce Evans2001-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | not to mention a compile-time warning about the critical function becoming unused, by replacing spec_bmap() with vop_stdbmap(). ntfs seems to have the same bug. The factor for converting specfs block numbers to physical block numbers is 1, but vop_stdbmap() uses the bogus factor btodb(ap->a_vp->v_mount->mnt_stat.f_iosize), which is 16 for ffs with the default block size of 8K. This factor is bogus even for vop_stdbmap() -- the correct factor is related to the filesystem blocksize which is not necessarily the same to the optimal i/o size. vop_stdbmap() was apparently cloned from nfs where these sizes happen to be the same. There may also be a problem with a_vp->v_mount being null. spec_bmap() still checks for this, but I think the checks in specfs are dead code which used to support block devices. Notes: svn path=/head/; revision=76146
* Add a vop_stdbmap(), and make it part of the default vop vector.Poul-Henning Kamp2001-04-296-89/+1
| | | | | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations. Notes: svn path=/head/; revision=76131
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-293-6/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Change the pfind() and zpfind() functions to lock the process that theyJohn Baldwin2001-04-246-55/+50
| | | | | | | | | find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake Notes: svn path=/head/; revision=75893
* fix it so it compiles againMatt Jacob2001-04-232-0/+4
| | | | Notes: svn path=/head/; revision=75877
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-234-0/+8
| | | | Notes: svn path=/head/; revision=75858
* - Various style fixes.John Baldwin2001-03-291-7/+3
| | | | | | | | | | - Fix a silly bug so that we return the actual error code if a procfs attach fails rather than always returning 0. Reported by: bde Notes: svn path=/head/; revision=74996
* Convert the allproc and proctree locks from lockmgr locks to sx locks.John Baldwin2001-03-282-13/+14
| | | | Notes: svn path=/head/; revision=74927
* Catch up to header include changes:John Baldwin2001-03-283-0/+3
| | | | | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h> Notes: svn path=/head/; revision=74914
* o Change the API and ABI of the Extended Attribute kernel interfaces toRobert Watson2001-03-152-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a new argument, "namespace", rather than relying on a first- character namespace indicator. This is in line with more recent thinking on EA interfaces on various mailing lists, including the posix1e, Linux acl-devel, and trustedbsd-discuss forums. Two namespaces are defined by default, EXTATTR_NAMESPACE_SYSTEM and EXTATTR_NAMESPACE_USER, where the primary distinction lies in the access control model: user EAs are accessible based on the normal MAC and DAC file/directory protections, and system attributes are limited to kernel-originated or appropriately privileged userland requests. o These API changes occur at several levels: the namespace argument is introduced in the extattr_{get,set}_file() system call interfaces, at the vnode operation level in the vop_{get,set}extattr() interfaces, and in the UFS extended attribute implementation. Changes are also introduced in the VFS extattrctl() interface (system call, VFS, and UFS implementation), where the arguments are modified to include a namespace field, as well as modified to advoid direct access to userspace variables from below the VFS layer (in the style of recent changes to mount by adrian@FreeBSD.org). This required some cleanup and bug fixing regarding VFS locks and the VFS interface, as a vnode pointer may now be optionally submitted to the VFS_EXTATTRCTL() call. Updated documentation for the VFS interface will be committed shortly. o In the near future, the auto-starting feature will be updated to search two sub-directories to the ".attribute" directory in appropriate file systems: "user" and "system" to locate attributes intended for those namespaces, as the single filename is no longer sufficient to indicate what namespace the attribute is intended for. Until this is committed, all attributes auto-started by UFS will be placed in the EXTATTR_NAMESPACE_SYSTEM namespace. o The default POSIX.1e attribute names for ACLs and Capabilities have been updated to no longer include the '$' in their filename. As such, if you're using these features, you'll need to rename the attribute backing files to the same names without '$' symbols in front. o Note that these changes will require changes in userland, which will be committed shortly. These include modifications to the extended attribute utilities, as well as to libutil for new namespace string conversion routines. Once the matching userland changes are committed, a buildworld is recommended to update all the necessary include files and verify that the kernel and userland environments are in sync. Note: If you do not use extended attributes (most people won't), upgrading is not imperative although since the system call API has changed, the new userland extended attribute code will no longer compile with old include files. o Couple of minor cleanups while I'm there: make more code compilation conditional on FFS_EXTATTR, which should recover a bit of space on kernels running without EA's, as well as update copyright dates. Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=74273
* Fixes to track snapshot copy-on-write checking in the specinfoKirk McKusick2001-03-071-2/+2
| | | | | | | | | structure rather than assuming that the device vnode would reside in the FFS filesystem (which is obviously a broken assumption with the device filesystem). Notes: svn path=/head/; revision=73942
* Proc locking identical to that of linprocfs' vnops except that we hold theJohn Baldwin2001-03-071-18/+59
| | | | | | | proc lock while calling psignal. Notes: svn path=/head/; revision=73920
* Protect read to p_pptr with proc lock rather than proctree lock.John Baldwin2001-03-071-2/+2
| | | | Notes: svn path=/head/; revision=73919
* Proc locking. Lock around psignal() and also ensure both an exclusiveJohn Baldwin2001-03-071-20/+34
| | | | | | | | | proctree lock and the process lock are held when updating p_pptr and p_oppid. When we are just reaading p_pptr we only need the proc lock and not a proctree lock as well. Notes: svn path=/head/; revision=73918
* Protect p_flag with the proc lock.John Baldwin2001-03-073-3/+18
| | | | Notes: svn path=/head/; revision=73906
* Remove the copyinstr call which was trying to copy the pathname in fromDoug Rabson2001-03-031-3/+0
| | | | | | | | | | | | user space. It has already been copied in and mp->mnt_stat.f_mntonname has already been initialised by the caller. This fixes a panic on the alpha caused by the fact that the variable 'size' wasn't initialised because the call to copyinstr() bailed out with an EFAULT error. Notes: svn path=/head/; revision=73383
* Reviewed by: jlemonAdrian Chadd2001-03-015-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount. Notes: svn path=/head/; revision=73286
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectRobert Watson2001-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=72786
* Extend kqueue down to the device layer.Jonathan Lemon2001-02-152-30/+55
| | | | | | | Backwards compatible approach suggested by: peter Notes: svn path=/head/; revision=72521
* Change and clean the mutex lock interface.Bosko Milekic2001-02-094-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order) Notes: svn path=/head/; revision=72200
* Another round of the <sys/queue.h> FOREACH transmogriffer.Poul-Henning Kamp2001-02-041-2/+1
| | | | | | | | Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=72012
* Mechanical change to use <sys/queue.h> macro API instead ofPoul-Henning Kamp2001-02-045-6/+6
| | | | | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=71999
* Use <sys/queue.h> macro API.Poul-Henning Kamp2001-02-041-2/+1
| | | | Notes: svn path=/head/; revision=71998
* Add a BUF_KERNPROC() in the BIO_DELETE path.Poul-Henning Kamp2001-01-301-0/+1
| | | | | | | This seems to fix the problem which md(4) backed filesystems exposed. Notes: svn path=/head/; revision=71829
* This patch reestablishes the spec_fsync() guarentee that synchronousMatthew Dillon2001-01-291-7/+16
| | | | | | | | | | | | | | | | | | | fsyncs, which typically occur during unmounting, will drain all dirty buffers even if it takes multiple passes to do so. The guarentee was mangled by the last patch which solved a problem due to -current disabling interrupts while holding giant (which caused an infinite spin loop waiting for I/O to complete). -stable does not have either patch, but has a similar bug in the original spec_fsync() code which is triggered by a bug in the softupdates umount code, a fix for which will be committed to -current as soon as Kirk stamps it. Then both solutions will be MFC'd to -stable. -stable currently suffers from a combination of the softupdates bug and a small window of opportunity in the original spec_fsync() code, and -stable also suffers from the spin-loop bug but since interrupts are enabled the spin resolves itself in a few milliseconds. Notes: svn path=/head/; revision=71777
* - Catch up to proc flag changes.John Baldwin2001-01-241-2/+6
| | | | Notes: svn path=/head/; revision=71569
* Fix breakage unconvered by LINT - dont refer to undefined variables inPeter Wemm2001-01-171-0/+2
| | | | | | | KASSERT() Notes: svn path=/head/; revision=71138
* Don't compile a dead variable declaration.Garrett Wollman2001-01-091-0/+2
| | | | Notes: svn path=/head/; revision=70829
* Use macro API to <sys/queue.h>Poul-Henning Kamp2000-12-311-4/+4
| | | | Notes: svn path=/head/; revision=70536
* Fix a lockup problem that occurs with 'cvs update'. specfs's fsync canMatthew Dillon2000-12-301-0/+13
| | | | | | | | | get into the same sort of infinite loop that ffs's fsync used to get into, probably due to background bitmap writes. The solution is the same. Notes: svn path=/head/; revision=70528
* Retire kernfs (kernel part).Dag-Erling Smørgrav2000-12-283-902/+0
| | | | Notes: svn path=/head/; revision=70426
* This implements a better launder limiting solution. There was a solutionMatthew Dillon2000-12-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | in 4.2-REL which I ripped out in -stable and -current when implementing the low-memory handling solution. However, maxlaunder turns out to be the saving grace in certain very heavily loaded systems (e.g. newsreader box). The new algorithm limits the number of pages laundered in the first pageout daemon pass. If that is not sufficient then suceessive will be run without any limit. Write I/O is now pipelined using two sysctls, vfs.lorunningspace and vfs.hirunningspace. This prevents excessive buffered writes in the disk queues which cause long (multi-second) delays for reads. It leads to more stable (less jerky) and generally faster I/O streaming to disk by allowing required read ops (e.g. for indirect blocks and such) to occur without interrupting the write stream, amoung other things. NOTE: eventually, filesystem write I/O pipelining needs to be done on a per-device basis. At the moment it is globalized. Notes: svn path=/head/; revision=70374
* Protect proc.p_pptr and proc.p_children/p_sibling with theJake Burkholder2000-12-232-0/+16
| | | | | | | | | | | proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@ Notes: svn path=/head/; revision=70317
* o Tighten restrictions on use of /proc/pid/ctl and move access checksRobert Watson2000-12-131-4/+10
| | | | | | | | | | in ctl to using centralized p_can() inter-process access control interface. Reviewed by: sef Notes: svn path=/head/; revision=69958
* - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), insteadJake Burkholder2000-12-131-1/+4
| | | | | | | | | | | of explicit calls to lockmgr. Also provides macros for the flags pased to specify shared, exclusive or release which map to the lockmgr flags. This is so that the use of lockmgr can be easily replaced with optimized reader-writer locks. - Add some locking that I missed the first time. Notes: svn path=/head/; revision=69947
* Add a module version (so that linprocfs can properly depend on procfs)Dag-Erling Smørgrav2000-12-091-0/+1
| | | | Notes: svn path=/head/; revision=69798
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-3/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Protect p_stat with the sched_lock.John Baldwin2000-12-021-1/+18
| | | | | | | Reviewed by: jake Notes: svn path=/head/; revision=69507
* Update to reflect the disappearance of getsock().Jonathan Lemon2000-11-251-2/+6
| | | | | | | Found by: LINT Notes: svn path=/head/; revision=69149