summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
Commit message (Collapse)AuthorAgeFilesLines
* o Change the API and ABI of the Extended Attribute kernel interfaces torwatson2001-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
* Fixes to track snapshot copy-on-write checking in the specinfomckusick2001-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).
* Proc locking identical to that of linprocfs' vnops except that we hold thejhb2001-03-071-18/+59
| | | | proc lock while calling psignal.
* Protect read to p_pptr with proc lock rather than proctree lock.jhb2001-03-071-2/+2
|
* Proc locking. Lock around psignal() and also ensure both an exclusivejhb2001-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.
* Protect p_flag with the proc lock.jhb2001-03-073-3/+18
|
* Remove the copyinstr call which was trying to copy the pathname in fromdfr2001-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.
* Reviewed by: jlemonadrian2001-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.
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-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
* Extend kqueue down to the device layer.jlemon2001-02-152-30/+55
| | | | Backwards compatible approach suggested by: peter
* Change and clean the mutex lock interface.bmilekic2001-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)
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-045-6/+6
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Use <sys/queue.h> macro API.phk2001-02-041-2/+1
|
* Add a BUF_KERNPROC() in the BIO_DELETE path.phk2001-01-301-0/+1
| | | | This seems to fix the problem which md(4) backed filesystems exposed.
* This patch reestablishes the spec_fsync() guarentee that synchronousdillon2001-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.
* - Catch up to proc flag changes.jhb2001-01-241-2/+6
|
* Fix breakage unconvered by LINT - dont refer to undefined variables inpeter2001-01-171-0/+2
| | | | KASSERT()
* Don't compile a dead variable declaration.wollman2001-01-091-0/+2
|
* Use macro API to <sys/queue.h>phk2000-12-311-4/+4
|
* Fix a lockup problem that occurs with 'cvs update'. specfs's fsync candillon2000-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.
* Retire kernfs (kernel part).des2000-12-283-902/+0
|
* This implements a better launder limiting solution. There was a solutiondillon2000-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.
* Protect proc.p_pptr and proc.p_children/p_sibling with thejake2000-12-232-0/+16
| | | | | | | | proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@
* o Tighten restrictions on use of /proc/pid/ctl and move access checksrwatson2000-12-131-4/+10
| | | | | | | in ctl to using centralized p_can() inter-process access control interface. Reviewed by: sef
* - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), insteadjake2000-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.
* Add a module version (so that linprocfs can properly depend on procfs)des2000-12-091-0/+1
|
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-3/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Protect p_stat with the sched_lock.jhb2000-12-021-1/+18
| | | | Reviewed by: jake
* Update to reflect the disappearance of getsock().jlemon2000-11-251-2/+6
| | | | Found by: LINT
* More paranoia against overflowseivind2000-11-081-18/+45
|
* Take VBLK devices further out of their missery.phk2000-11-021-9/+2
| | | | This should fix the panic I introduced in my previous commit on this topic.
* Fix overflow from jail hostname.eivind2000-11-011-1/+1
| | | | Bug found by: Esa Etelavuori <eetelavu@cc.hut.fi>
* Give vop_mmap an untimely death. The opportunity to give it a timelyeivind2000-11-012-18/+0
| | | | death timed out in 1996.
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-292-2/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-295-5/+0
|
* Rev 1.41 was committed from wrong diff, now do it right.bp2000-10-221-1/+1
|
* Release and unlock vnode if resource deadlock detected.bp2000-10-221-0/+1
|
* Fix nullfs breakage caused by incomplete migration of v_interlock frombp2000-10-151-3/+5
| | | | | | simple_lock to mutex. Reset LK_INTERLOCK flag when interlock released manually.
* o Move from Alfred Perstein's "exclusion" technique of handling specialchris2000-10-093-78/+58
| | | | | | | | | file types to requiring all file types to properly implement fo_stat. This makes any new file type additions much easier as this code no longer has to be modified to accomodate it. o Instead of using curproc in fdesc_allocvp, pass a `struct proc' pointer as a new fifth parameter.
* Blow away the v_specmountpoint define, replacing it with what it waseivind2000-10-091-5/+5
| | | | defined as (rdev->si_mountpoint)
* return correct type for process directory entries, DT_DIR not DT_REGalfred2000-10-051-1/+1
|
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-10-043-2/+7
| | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
* Prevent dereference of NULL pointer when null_lock() and null_unlock()bp2000-10-031-1/+7
| | | | called and there is no underlying vnode.
* Fix vnode locking bugs in the nullfs.bp2000-09-253-98/+286
| | | | | | | | | | | | Add correct support for v_object management, so mmap() operation should work properly. Add support for extattrctl() routine (submitted by semenu). At this point nullfs can be considered as functional and much more stable. In fact, it should behave as a "hard" "symlink" to underlying filesystem. Reviewed in general by: mckusick, dillon Parts of logic obtained from: NetBSD
* Fix a 64-bitism, use size_t instead of u_int for 4th arg to copyinstr.jhb2000-09-111-1/+1
|
* Various cleanups towards make nullfs functional (it is still brokenbp2000-09-054-38/+130
| | | | | | | | | | | | | | | | | | | | at this point): Replace all '#ifdef DEBUG' with '#ifdef NULLFS_DEBUG' and add NULLFSDEBUG macro. Protect nullfs hash table with lockmgr. Use proper order of operations when freeing mnt_data. Return correct fsid in the null_getattr(). Add null_open() function to catch MNT_NODEV (obtained from NetBSD). Add null_rename() to catch cross-fs rename operations (submitted by Ustimenko Semen <semen@iclub.nsu.ru>) Remove duplicate $FreeBSD$ tags.
* Get rid from the __P() macros.bp2000-09-054-37/+36
| | | | Encouraged by: peter
* Remove a comment that has been not only obsolete but patently wrong for thedes2000-09-041-8/+0
| | | | last 31 revisions (almost three years).
* o Simplify if/then clause equating ESRCH with ENOENT when hiding a processrwatson2000-09-011-5/+2
| | | | Submitted by: des
OpenPOWER on IntegriCloud