summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
Commit message (Collapse)AuthorAgeFilesLines
* Free mount credentials (mnt_cred) when freeing the mount structtjr2003-04-241-0/+5
| | | | | in failure cases to avoid leaking struct ucreds, and ultimately leaking struct uidinfo references.
* Add /dev to the Alpha manual mount root example.obrien2003-04-231-1/+1
|
* Adjust the number of vnodes scanned by vlrureclaim() according to thetegge2003-03-261-0/+3
| | | | size of the vnode list.
* Export the name of the device used to mount the root file system asrwatson2003-02-221-0/+24
| | | | | | | kern.rootdev. If rootdev is undefined (NFS mount, etc), export an empty string. Desired by: peter
* Back out M_* changes, per decision of the TRB.imp2003-02-191-17/+17
| | | | Approved by: trb
* Fix LOR with PROC/filedesc. Introduce fdesc_mtx that will be used as aalfred2003-02-151-3/+3
| | | | | | barrier between free'ing filedesc structures. Basically if you want to access another process's filedesc, you want to hold this mutex over the entire operation.
* Style nit.des2003-02-141-4/+2
|
* KASSERT format string does not need newline terminationalfred2003-02-141-2/+2
|
* Add kasserts to catch bad API usage.alfred2003-02-141-0/+6
| | | | Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-17/+17
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* When compiling the kernel do not implicitly include filedesc.h from proc.h,alfred2003-01-011-0/+1
| | | | | | this was causing filedesc work to be very painful. In order to make this work split out sigio definitions to thier own header (sigio.h) which is included from proc.h for the time being.
* unwrap lines made short enough by SCARGS removalalfred2002-12-141-4/+2
|
* remove syscallarg().alfred2002-12-141-9/+9
| | | | Suggested by: peter
* SCARGS removal take II.alfred2002-12-141-8/+8
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-131-8/+8
|
* Remove SCARGS.alfred2002-12-131-8/+8
| | | | Reviewed by: md5
* - Use a better definition for MNAMELEN which doesn't requiremux2002-11-071-1/+1
| | | | | | | to have one #ifdef per architecture. - Change a space to a tab after a nearby #define. Obtained from: bde
* #include <geom/geom.h> to get proper prototypes. Contrary to my fears wephk2002-10-251-10/+12
| | | | | | | | | | | seem to have all the prerequisites already. Call g_waitidle() as the first thing in vfs_mountroot() so that we have it out of the way before we even decide if we should call .._ask() or .._try(). Call the g_dev_print() function to provide better guidance for the root-mount prompt.
* Make sure GEOM has stopped rattling the disks before we try to mountphk2002-10-241-0/+4
| | | | the root filesystem, this may be implicated in the PC98 issue.
* This update removes a race between unmount and lookup. The lookupmckusick2002-10-221-4/+1
| | | | | | | | | | | locks the mount point directory while waiting for vfs_busy to clear. Meanwhile the unmount which holds the vfs_busy lock tried to lock the mount point vnode. The fix is to observe that it is safe for the unmount to remove the vnode from the mount point without locking it. The lookup will wait for the unmount to complete, then recheck the mount point when the vfs_busy lock clears. Sponsored by: DARPA & NAI Labs.
* GEOM does not (and shall not) propagate flags like D_MEMDISK, so we willphk2002-10-211-11/+11
| | | | | | | revert to checking the name to determine if our root device is a ramdisk, md(4) specifically to determine if we should attempt the root-mount RW Sponsored by: DARPA & NAI Labs.
* - Don't protect mountedhere with the vn interlock.jeff2002-09-251-5/+7
| | | | - Protect mountedhere with the vn lock.
* Switch to using strlcpy() in several places. It seems theremux2002-09-191-7/+7
| | | | were cases where we could get unterminated strings before.
* Keep a copy of the credential used to mount filesystems around sophk2002-08-191-3/+7
| | | | | | | | | | | | | | | | | we can check and use it later on. Change the pieces of code which relied on mount->mnt_stat.f_owner to check which user mounted the filesystem. This became needed as the EA code needs to be able to allocate blocks for "system" EA users like ACLs. There seems to be some half-baked (probably only quarter- actually) notion that the superuser for a given filesystem is the user who mounted it, but this has far from been carried through. It is unclear if it should be. Sponsored by: DARPA & NAI Labs.
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-47/+50
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Make the consumers of the linker_load_file() function usemux2002-08-021-2/+2
| | | | | | | | | | | | | linker_load_module() instead. This fixes a bug where the kernel was unable to properly locate and load a kernel module in vfs_mount() (and probably in the netgraph code as well since it was using the same function). This is because the linker_load_file() does not properly search the module path. Problem found by: peter Reviewed by: peter Thanks to: peter
* Include file cleanup; mac.h and malloc.h at one point had orderingrwatson2002-08-011-1/+1
| | | | | | relationship requirements, and no longer do. Reminded by: bde
* Introduce support for Mandatory Access Control and extensiblerwatson2002-07-311-1/+33
| | | | | | | | | | | | | | | kernel access control. Invoke the necessary MAC entry points to maintain labels on mount structures. In particular, invoke entry points for intialization and destruction in various scenarios (root, non-root). Also introduce an entry point in the boot procedure following the mount of the root file system, but prior to the start of the userland init process to permit policies to perform further initialization. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* - Backout the patch made in revision 1.75 of vfs_mount.c. The vputs herejeff2002-07-291-3/+3
| | | | | | | were hiding the real problem of the missing unlock in sync_inactive. - Add the missing unlock in sync_inactive. Submitted by: iedowse
* Fix a stupid bug where I wasn't initializing the namesmux2002-07-241-9/+10
| | | | of 0-length mount options.
* - Merge the mount options at MNT_UPDATE time with vfs_mergeopts().mux2002-07-191-19/+113
| | | | | | | | - Sanity check the mount options list (remove duplicates) with vfs_sanitizeopts(). - Fix some malloc(0)/free(NULL) bugs. Reviewed by: rwatson (some time ago)
* - Use standard locking functions in syncer's opvjeff2002-07-091-3/+3
| | | | | - vput instead of vrele syncer vnodes in vfs_mount - Add vop_lookup_{pre,post} to verify locking in VOP_LOOKUP
* Add a VFS_START() call in vfs_mountroot_try() for the sakemux2002-07-081-1/+2
| | | | | | | | | of being correct. None of the root mountable filesystems do something at VFS_START(). Shorten a comment to fix a style bug while I'm here. PR: kern/18505
* Include systm.h before vnode.h so Debugger() and printf() are available whenjeff2002-07-051-1/+1
| | | | full vnode lock debugging is enabled.
* Move vfs_rootmountalloc() in vfs_mount.c and remove lite2_vfs_mountroot()mux2002-07-031-0/+44
| | | | which was #if 0'd and is not likely to be used now.
* Remove an unused argument in vfs_mountroot().mux2002-07-031-1/+1
|
* I didn't pay enough attention when copy/pasting disclaimers.mux2002-07-021-2/+2
| | | | The disclaimer in vfs_conf.c was slightly different. Fix this.
* Move every code related to mount(2) in a new file, vfs_mount.c.mux2002-07-021-37/+1213
| | | | | | | | | | The file vfs_conf.c which was dealing with root mounting has been repo-copied into vfs_mount.c to preserve history. This makes nmount related development easier, and help reducing the size of vfs_syscalls.c, which is still an enormous file. Reviewed by: rwatson Repo-copy by: peter
* Rework the kernel environment subsystem. We now convert the staticmux2002-04-171-3/+8
| | | | | | | | | | | | | | | | | environment needed at boot time to a dynamic subsystem when VM is up. The dynamic kernel environment is protected by an sx lock. This adds some new functions to manipulate the kernel environment : freeenv(), setenv(), unsetenv() and testenv(). freeenv() has to be called after every getenv() when you have finished using the string. testenv() only tests if an environment variable is present, and doesn't require a freeenv() call. setenv() and unsetenv() are self explanatory. The kenv(2) syscall exports these new functionalities to userland, mainly for kenv(1). Reviewed by: peter
* Centralize the "bootdev" and "dumpdev" variables. They are still prettyphk2002-03-311-0/+1
| | | | | bogus all things considered, but at least now they don't camouflage as being MD variables.
* Move the mount of the root filesystem to happen in the init process beforephk2002-03-081-5/+2
| | | | | | | the exec if /sbin/init. This allows the scheduler to get started and kthreads a chance to run before we start filesystem operations.
* Document all functions, global and static variables, and sysctls.eivind2002-03-051-0/+8
| | | | | | | | Includes some minor whitespace changes, and re-ordering to be able to document properly (e.g, grouping of variables and the SYSCTL macro calls for them, where the documentation has been added.) Reviewed by: phk (but all errors are mine)
* Remove the use of _PATH_DEV in the example.obrien2001-11-241-2/+2
| | | | | | | | | | | | The kernel certainly doesn't use _PATH_DEV or even /dev/ to find the device. It cannot, since "/" has not been mounted. Maybe the only affect of using /dev/ is that it gets put in the mounted-from name for "/", so that mount(8), etc., display an absolute path before "/" has been remounted. Many have never bothered typing the full path, and code that constructs a path in rootdevnames[] never bothered to construct a full path, so the example shouldn't have it. Submitted by: bde
* We only have slices on i386 and IA-64.obrien2001-11-201-1/+5
|
* KSE Milestone 2julian2001-09-121-3/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-2/+7
| | | | | | | | | | | 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)
* Revert consequences of changes to mount.h, part 2.grog2001-04-291-2/+0
| | | | Requested by: bde
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* Reviewed by: jlemonadrian2001-03-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Change and clean the mutex lock interface.bmilekic2001-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
OpenPOWER on IntegriCloud