summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* - Denote a few places where kobj class references are manipulated withoutjhb2005-03-312-4/+6
| | | | | | holding the appropriate lock. - Add a comment explaining why we bump a driver's kobj class reference when loading a module.
* Drop a bogus mp_fixme(). Adding a lock would do nothing to reduce userlandjhb2005-03-311-2/+0
| | | | races regarding changing of jail-related sysctls.
* Don't recursively panic when we call mi_switch() in a critical section,jhb2005-03-311-1/+1
| | | | | even though calling mi_switch() after a panic is likely a bug anyway as the recursive panic only serves to make things worse.
* Add a check for cpufreq_unregister() being called with no cpufreq devicenjl2005-03-311-0/+5
| | | | | | | active. Note that the logic indicates this should not be possible so generate a warning if this ever happens. Found by: Coverity Prevent (via sam)
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-312-0/+2
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* cdev (still) needs per instance uid/gid/modephk2005-03-311-9/+15
| | | | | | Add unlocked version of dev_ref() Clean up various stuff in sys/conf.h
* Rename dev_ref() to dev_refl()phk2005-03-311-1/+1
|
* - Disable vfs shared locks by default. They must be specifically enabledjeff2005-03-311-1/+5
| | | | | | | on filesystems which safely support them. It appears that many network filesystems specifically are not shared lock safe. Sponsored by: Isilon Systems, Inc.
* - Add a LK_NOSHARE flag which forces all shared lock requests to bejeff2005-03-311-1/+5
| | | | | | treated as exclusive lock requests. Sponsored by: Isilon Systems, Inc.
* - LK_NOPAUSE is a nop now.jeff2005-03-314-7/+7
| | | | Sponsored by: Isilon Systems, Inc.
* - Remove apause(). It makes no sense with our present mutex implementationjeff2005-03-311-40/+0
| | | | | | | | | since simply unlocking a mutex does not ensure that one of the waiters will run and acquire it. We're more likely to reacquire the mutex before anyone else has a chance. It has also bit me three times now, as it's not safe to drop the interlock before sleeping in many cases. Sponsored by: Isilon Systems, Inc.
* Eliminate v_id and v_ddid. The name cache now holds references todas2005-03-302-38/+11
| | | | | | | | | | vnodes whose names it caches, so we no longer need a `generation number' to tell us if a referenced vnode is invalid. Replace the use of the parent's v_id in the hash function with the address of the parent vnode. Tested by: Peter Holm Glanced at by: jeff, phk
* Merge kern___cwd() and vn_fullpath(), which were virtually identical,das2005-03-301-132/+89
| | | | | | | | | | | | | | | | | | | | | | except for places where people forget to update one of them. We now collect only one set of stats for both of these routines. Other changes in this commit include: - Start acquiring Giant again in vn_fullpath(), since it is required when crossing a mount point. - Expand the scope of the cache lock to avoid dropping it and picking it up again for every pathname component. This also makes it trivial to avoid races in stats collection. - Assert that nc_dvp == v_dd for directories instead of returning an error to userland when this is not true. AFAIK, it should always be true when v_dd is non-null. - For vn_fullpath(), handle the first (non-directory) vnode separately. Glanced at by: jeff, phk
* - Move the logic that locks and refs the new vnode from vfs_cache_lookup()jeff2005-03-291-35/+33
| | | | | | | | to cache_lookup(). This allows us to acquire the vnode interlock before dropping the cache lock. This protects the vnodes identity until we have locked it. Sponsored by: Isilon Systems, Inc.
* Remove the global cdev hash and use the cdevsw list instead.phk2005-03-291-29/+2
| | | | | | | | Don't remove the now unused element from cdev yet, wait until we have a better reason to bump the version. There is now no longer any upper limit on how many device drivers a FreeBSD kernel can have.
* - Get rid of the old LOOKUP_SHARED code. namei() now supplies thejeff2005-03-291-30/+6
| | | | | | proper lock flags via cn_lkflag. Sponsored by: Isilon Systems, Inc.
* - Set cn_lkflags to LK_SHARED in the LOOKUP_SHARED case so that we onlyjeff2005-03-291-5/+29
| | | | | | | | | acquire shared locks on intermediate directories. - For the LASTCN, we may have to LK_UPGRADE the parent directory before we lookup the last component. - Acquire VFS_ROOT and dp locks based on the cn_lkflag. Sponsored by: Isilon Systems, Inc.
* - Dont clear OWEINACT in vbusy(), we still owe an inactive call if someonejeff2005-03-291-11/+16
| | | | | | | | | | vhold()s us. - Avoid an extra mutex acquire and release in the common case of vgonel() by checking for OWEINACT at the start of the function. - Fix the case where we set OWEINACT in vput(). LK_EXCLUPGRADE drops our shared lock if it fails. Sponsored by: Isilon Systems, Inc.
* - Don't initial v_dd here, let cache_purge() do it for us.jeff2005-03-291-1/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Invalidate the childrens v_dd pointers when we cache_purge() a directory.jeff2005-03-291-8/+15
| | | | | | Otherwise the stale pointer may be accessed after a vnode is freed. Sponsored by: Isilon Systems, Inc.
* Remove the global cdev hash and use the cdevsw list instead.phk2005-03-291-37/+9
| | | | | Don't remove the now unused element from cdev yet, wait until we have a better reason to bump the version.
* Privatize major().phk2005-03-291-1/+1
|
* Print name of device instead of useless major/minor numbers.phk2005-03-291-3/+2
|
* - Remove an unused variable from relookup().jeff2005-03-281-5/+2
| | | | | | | - Assert that REMOVE, CREATE, and RENAME callers have WANTPARENT or LOCKPARENT set. You can't complete any of these operations without at least a reference to the parent. Many filesystems check for this case even though it isn't possible in the current system.
* - Remove an unused variable.jeff2005-03-281-2/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Rev 1.83 of kern_lock.c fixes the td_locks assert, reenable it here.jeff2005-03-281-3/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Don't bump the count twice in the LK_DRAIN case.jeff2005-03-281-2/+0
| | | | Sponsored by: Isilon Systems, Inc.
* - Move code that should probably be an assert above the main body ofjeff2005-03-281-15/+14
| | | | | | | vrele so that we can decrease the indentation of the real work and make things slightly more clear. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-21/+4
| | | | Sponsored by: Isilon Systems, Inc.
* - Adjust asserts in vop_lookup_post() to match the new post PDIRUNLOCKjeff2005-03-281-11/+8
| | | | | | vfs. Sponsored by: Isilon Systems, Inc.
* - Get rid of PDIRUNLOCK, instead, we fixup the lock state immediately afterjeff2005-03-281-13/+51
| | | | | | | | | | | | | calling VOP_LOOKUP(). Rather than having each filesystem check the LOCKPARENT flag, we simply check it once here and unlock as required. The only unusual case is ISDOTDOT, where we require an unlocked vnode on return. Relocking this vnode with the child locked is allowed since the child is actually its parent. - Add a few asserts for some unusual conditions that I do not believe can happen. These will later go away and turn into implementations for these conditions. Sponsored by: Isilon Systems, Inc.
* Remove another ';' after if().phk2005-03-271-1/+1
| | | | Also spotted by: bz
* Remove extra ; at end of if().phk2005-03-271-1/+1
| | | | Found by: bz
* Make (some) serial ports implement the PPS-API again. This changephk2005-03-261-0/+6
| | | | appearantly fell out during the tty code cleanup.
* s/ENOTTY/ENOIOCTL/phk2005-03-261-1/+1
|
* - The td_locks check is currently broken with snapshots and possiblyjeff2005-03-251-0/+3
| | | | | | | some case in unmount. Disable the KASSERT until these problems can be diagnosed. Sponsored by: Isilon Systems, Inc.
* - Don't recycle vnodes anymore. Free them once they are dead. getnewvnodejeff2005-03-251-121/+116
| | | | | | | | | | | | | | | | now always allocates a new vnode. - Define a new function, vnlru_free, which frees vnodes from the free list. It takes as a parameter the number of vnodes to free, which is wantfreevnodes - freevnodes when called from vnlru_proc or 1 when called from getnewvnode(). For now, getnewvnode() still tries to reclaim a free vnode before creating a new one when we are near the limit. - Define a function, vdestroy, which handles the actual release of memory and teardown of locks, etc. This could become a uma_dtor() routine. - Get rid of minvnodes. Now wantfreevnodes is 1/4th the max vnodes. This keeps more unreferenced vnodes around so that files which have only been stat'd are less likely to be kicked out of the system before we have a chance to read them, etc. These vnodes may still be freed via the normal vnlru_proc() routines which may some day become a real lru.
* Fix inittodr() invocation. Now that devfs is mounted before themarcel2005-03-251-3/+17
| | | | | | | | | actual root file system is mounted, the first entry on the mountlist is not the root file system and the timestamp for that entry is typically 0. Passing that to inittodr() caused annoying errors on alpha and ia64. So, call inittodr() for all file systems on mountlist, but only when the timestamp (mnt_time) is non-zero.
* - Add information about the buf lock to db_show_buffer.jeff2005-03-251-0/+18
| | | | | | - Add a 'show lockedbufs' command that is similar to show lockedvnods. Sponsored by: Isilon Systems, Inc.
* - Restore COUNT() in all of its original glory. Don't make it dependentjeff2005-03-251-17/+19
| | | | | | | on DEBUG as ufs will soon grow a dependency on this count. Discussed with: bde Sponsored by: Isilon Systems, Inc.
* Don't set ret_namelen and ret_resnamelen in res_find() unless both thejhb2005-03-241-2/+2
| | | | | | | corresponding pointer to the buffer (ret_name and ret_resname) is non-NULL to avoid possible NULL pointer derefs. Reported by: Coverity via sam
* Move implementation of hw.bus.rman sysctl to subr_rman.c so thatphk2005-03-242-87/+87
| | | | | | subr_bus.c doesn't need to peek inside struct resource. OK from: imp
* - Fail an assert if we attempt to return with any lockmgr locks held injeff2005-03-241-0/+2
| | | | | | userret(). Sponsored by: Isilon Systems, Inc.
* - Complete the implementation of td_locks. Track the number of outstandingjeff2005-03-241-0/+11
| | | | | | | lockmgr locks that this thread owns. This is complicated due to LK_KERNPROC and because lockmgr tolerates unlocking an unlocked lock. Sponsored by: Isilon Systes, Inc.
* - Pass LK_EXCLUSIVE to VFS_ROOT() to satisfy the new flags argument. Forjeff2005-03-246-10/+12
| | | | | | now, all calls to VFS_ROOT() should still acquire exclusive locks. Sponsored by: Isilon Systems, Inc.
* - Fixup the default vfs_root function to match the new prototype.jeff2005-03-241-1/+2
| | | | Sponsored by: Isilon Systems, Inc.
* - Grab the lock type that the caller requests in vfs_hash_insert().jeff2005-03-241-1/+1
| | | | Sponsored by: Isilon Systems, Inc.
* - If vput() is called with a shared lock it must upgrade to an exclusivejeff2005-03-241-3/+12
| | | | | | | | | | | before it can call VOP_INACTIVE(). This must use the EXCLUPGRADE path because we may violate some lock order with another locked vnode if we drop and reacquire the lock. If EXCLUPGRADE fails, we mark the vnode with VI_OWEINACT. This case should be very rare. - Clear VI_OWEINACT in vinactive() and vbusy(). - If VI_OWEINACT is set in vgone() do the VOP_INACTIVE call here as well. Sponsored by: Isilon Systems, Inc.
* - Remove some long dead LOOKUP_SHARED code that tracked the lock state.jeff2005-03-241-14/+0
| | | | | | | - Always pass LOCKSHARED and rely on namei() to ignore it when LOOKUP_SHARED is not set. Sponsored by: Isilon Systems, Inc.
* - Remove the #ifdef LOOKUP_SHARED from some calls to NDINIT. Thejeff2005-03-242-14/+2
| | | | | | | LOCKSHARED flag is simply ignored in namei() if LOOKUP_SHARED is not enabled. Sponsored by: Isilon Systems, Inc.
OpenPOWER on IntegriCloud