summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* - Clear LOCKSHARED if LOOKUP_SHARED is not enabled. This is not strictlyjeff2005-03-241-0/+3
| | | | | | | | necessary since we disable the shared locks in vfs_cache, but it is prefered that the option not leak out into filesystems when it is disabled. Sponsored by: Isilon Systems, Inc.
* - All of the bugs which lead to the complication of the LOOKUP_SHAREDjeff2005-03-241-52/+10
| | | | | | | config option have now been fixed. All filesystems are properly locked and checked via DEBUG_VFS_LOCKS. Remove the workaround code. Sponsored by: Isilon Systems, Inc.
* Fix code freeing wrong cred pointer.julian2005-03-211-2/+4
| | | | | | | | | Submitted by: das Noticed by: Coverity tool MFC after: 3 days Note: usually the two pointers point to the same thing but it was still a bug.
* Add a read-only kern.sched.preemption sysctl so that user space can tellrwatson2005-03-201-0/+13
| | | | if "options PREEMPTION" is compiled into the kernel.
* Add ki_jid field to the kinfo_proc structure and store jail ID there.pjd2005-03-201-1/+5
| | | | | Reviewed by: gad MFC after: 3 days
* Sleeping is not allowed in uma->finiphk2005-03-191-4/+4
|
* check copyin return valuesam2005-03-191-1/+1
| | | | Noticed by: Coverity Prevent analysis tool
* Add missing cases for PT_SYSCALL.das2005-03-181-0/+2
| | | | Found by: Coverity Prevent analysis tool
* Impose the upper limit on signals that are allowed between kernel threadssobomax2005-03-181-2/+2
| | | | | | | in set[ug]id program for compatibility with Linux. Linuxthreads uses 4 signals from SIGRTMIN to SIGRTMIN+3. Pointed out by: rwatson
* Use subr_unit to allocate thread ID's with.phk2005-03-181-78/+6
| | | | Tested by: davidxu
* Linuxthreads uses not only signal 32 but several signals >= 32.sobomax2005-03-181-5/+5
| | | | | PR: kern/72922 Submitted by: Andriy Gapon <avg@icyb.net.ua>
* Fix a bad copy&paste mistake I made.phk2005-03-181-1/+1
| | | | Spotted by: truckman
* Use STAILQ in preference to SLIST for the resources. Insert new resourcesimp2005-03-181-7/+7
| | | | | | | | | last in the list rather than first. This makes the resouces print in the 4.x order rather than the 5.x order (eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x). This also means that the pci code will once again print the resources in BAR ascending order.
* fix aio+kq... I've been running ambrisko's test program for much longerjmg2005-03-182-9/+12
| | | | | | | | | | | | w/o problems than I was before... This simply brings back the knote_delete as knlist_delete which will also drop the knote's, instead of just clearing the list and seeing _ONESHOT... Fix a race where if a note was _INFLUX and _DETACHED, it could end up being modified... whoopse.. MFC after: 1 week Prodded by: ambrisko and dwhite
* add m_copyup function.. This can be used to help make our ip stack lessjmg2005-03-171-0/+48
| | | | | | | | | | alignment restrictive, and help performance on some ethernet cards which currently copy the entire packet a couple bytes to get the packet aligned properly... Wordsmithing by: dwhite Obtained from: NetBSD (code only) I'll clean it up later: rwatson
* A further step on the journey of meaking panics and debugging more reliable:rwatson2005-03-171-2/+3
| | | | | | | | | | | | | | | in the window between the beginning of panic() and entering the debugger, it's possible to receive interrupts. If we receive an interrupt, don't preempt if panicstr != NULL, as the system is in the process of failing, and the preempting thread is likely to stumble over the failure. The typical scenario is during the printf() in panic() prior to entering the debugger, but when running with a slower console type such as serial console. It could be that the panic string should be passed to the debugger to print, so that it can run from the debugger's environment rather than a regular kernel printf. Glanced at by: jhb
* Kill MAJOR_AUTOphk2005-03-171-3/+3
|
* Prepare for the final onslaught on devices:phk2005-03-171-5/+9
| | | | | | | | Move uid/gid/mode from cdev to cdevsw. Add kind field to use for devd(8) later. Bump both D_VERSION and __FreeBSD_version
* In stange circumstances we may end up being the last reference to aphk2005-03-172-14/+18
| | | | | | | | | | | session in tprintf(). SESSRELE() needs to properly dispose of the sessions mutex. Add sessrele() which does the proper cleanup and have SESSRELE() call it. Use SESSRELE also in pgdelete(). Found by: Coverity (ID:526)
* Add two arguments to the vfs_hash() KPI so that filesystems which dophk2005-03-161-2/+6
| | | | not have unique hashes (NFS) can also use it.
* Fix a memoryleak in case of failed root filesystem mount.phk2005-03-161-1/+4
| | | | Spotted by: Coverity via sam
* MFp4: print a more useful error when we don't have a /dev to mount devfsjmg2005-03-161-1/+1
| | | | on..
* Add mnt_hashseed to struct mount and initialize it witn PRNG bits, usephk2005-03-162-15/+18
| | | | | | | | | | it to get better hashing in vfs_hash. In case of an insert collision in vfs_hash_insert(), put the loosing vnode on a special list so that vfs_hash_remove() can just assume that it is on a list. Drop the VI_HASHED flag.
* Sometimes, when asked to return region A..C, we'd return A+N..C+Nimp2005-03-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of failing. When looking for a region to allocate, we used to check to see if the start address was < end. In the case where A..B is allocated already, and one wants to allocate A..C (B < C), then this test would improperly fail (which means we'd examine that region as a possible one), and we'd return the region B+1..C+(B-A+1) rather than NULL. Since C+(B-A+1) is necessarily larger than C (end argument), this is incorrect behavior for rman_reserve_resource_bound(). The fix is to exclude those regions where r->r_start + count - 1 > end rather than r->r_start > end. This bug has been in this code for a very long time. I believe that all other tests against end are correctly done. This is why sio0 generated a message about interrupts not being enabled properly for the device. When fdc had a bug that allocated from 0x3f7 to 0x3fb, sio0 was then given 0x3fc-0x404 rather than the 0x3f8-0x3ff that it wanted. Now when fdc has the same bug, sio0 fails to allocate its ports, which is the proper behavior. Since the probe failed, we never saw the messed up resources reported. I suspect that there are other places in the tree that have weird looping or other odd work arounds to try to cope with the observed weirdness this bug can introduce. These workarounds should be located and eliminated. Minor debug write fix to match the above test done as well. 'nice' by: mdodd Sponsored by: timing solutions (http://www.timing.com/)
* Fix a debugging printf. The order of start/end was inconsistant withimp2005-03-151-1/+1
| | | | | all the other start/end debugs, causing momentary confusion when the output was examined.
* Improve the vfs_hash() API: vput() the unneeded vnode centrally tophk2005-03-151-4/+4
| | | | avoid replicating the vput in all the filesystems.
* - Now that there are no external users of vfree() make it static.jeff2005-03-151-48/+12
| | | | | | | | | | | | | | | | - Move VSHOULDBUSY, VSHOULDFREE, and VTRYRECYCLE into vfs_subr.c so no one else attempts to grow a dependency on them. - Now that objects with pages hold the vnode we don't have to do unlocked checks for the page count in the vm object in VSHOULDFREE. These three macros could simply check for holdcnt state transitions to determine whether the vnode is on the free list already, but the extra safety the flag affords us is probably worth the minimal cost. - The leafonly sysctl and code have been dead for several years now, remove the sysctl and the code that employed it from vtryrecycle(). - vtryrecycle() also no longer has to check the object's page count as the object holds the vnode until it reaches 0. Sponsored by: Isilon Systems, Inc.
* Fix a debug message to print a usable device name rather than uselessphk2005-03-151-3/+2
| | | | major+minor tupple.
* - Expose vholdl() so it may be used outside of vfs_subr.cjeff2005-03-151-2/+1
|
* Remove findcdev().phk2005-03-151-19/+0
|
* Rename cdev->si_udev to cdev->si_drv0 to reflect the new nature ofphk2005-03-151-6/+6
| | | | the field.
* - transferlockers() requires the interlock to be SMP safe.jeff2005-03-151-2/+8
| | | | Sponsored by: Isilon Systems, Inc.
* Simplify the vfs_hash calling convention.phk2005-03-151-1/+2
|
* Cleanup accidentally include #if 0 section.phk2005-03-141-35/+0
|
* Currently (almost) all filesystems maintain a local inode hash tablephk2005-03-141-0/+184
| | | | | | | | | | | | | | | | | | to get from (mount + inode) to vnode. These tables are mostly copy&pasted from UFS, sized based on desiredvnodes and therefore quite large (128K-512K). Several filesystems are buggy enough that they allocate the hash table even before they know if they will ever be used or not. Add "vfs_hash", a system wide hash table, which will replace all the per-filesystem hash-tables. The fields we add to struct vnode will more or less be saved in the respective filesystems inodes. Having one central implementation will save code and will allow us to justify the complexity of code to dynamically (re)size the hash at a later point.
* - Increment the holdcnt once for each usecount reference. This allows usjeff2005-03-141-3/+4
| | | | | | | to use only the holdcnt to determine whether a vnode may be recycled, simplifying the V* macros as well as vtryrecycle(), etc. Sponsored by: Isilon Systems, Inc.
* - We do not have to check the object's ref_count in VSHOULDFREE orjeff2005-03-141-3/+3
| | | | | | | | vtryrecycle(). All obj refs also ref the vnode. - Consistently use v_incr_usecount() to increment the usecount. This will be more important later. Sponsored by: Isilon Systems, Inc.
* - Slightly rearrange vrele() to move the common case in one indentationjeff2005-03-141-20/+17
| | | | | | level. Sponsored by: Isilon Systems, Inc.
* - Rework vget() so we drop the usecount in two failure cases that werejeff2005-03-141-24/+24
| | | | | | missed by my last commit. Sponsored by: Isilon Systems, Inc.
* Remove debugging printfs.phk2005-03-141-8/+3
|
* - Do a vn_start_write in vn_close, we may write if this is the last refjeff2005-03-131-21/+20
| | | | | | | | | | on an unlinked file. We can't know if this is the case until after we have the lock. - Lock the vnode in vn_close, many filesystems had code which was unsafe without the lock held, and holding it greatly simplifies vgone(). - Adjust vn_lock() to check for the VI_DOOMED flag where appropriate. Sponsored by: Isilon Systems, Inc.
* - Remove vx_lock, vx_unlock, vx_wait, etc.jeff2005-03-131-225/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a vn_start_write/vn_finished_write around vlrureclaim so we don't do writing ops without suspending. This could suspend the vlruproc which should not be a problem under normal circumstances. - Manually implement VMIGHTFREE in vlrureclaim as this was the only instance where it was used. - Acquire a lock before calling vgone() as it now requires it. - Move the acquisition of the vnode interlock from vtryrecycle() to getnewvnode() so that if it fails we don't drop and reacquire the vnode_free_list_mtx. - Check for a usecount or holdcount at the end of vtryrecycle() in case someone grabbed a ref while we were recycling. Abort the recycle, and on the final ref drop this vnode will be placed on the head of the free list. - Move the redundant VOP_INACTIVE protection code into the local vinactive() routine to avoid code bloat. - Keep the vnode lock held across calls to vgone() in several places. - vgonel() no longer uses XLOCK, instead callers must hold an exclusive vnode lock. The VI_DOOMED flag is set to allow other threads to detect a vnode which is no longer valid. This flag is set until the last reference is gone, and there are no chances for a new ref. vgonel() holds this lock across the entire function, which greatly simplifies logic. _ Only vfree() in one place in vgone() not three. - Adjust vget() to check the VI_DOOMED flag prior to waiting on the lock in the LK_NOWAIT case. In other cases, check after we have slept and acquired an exlusive lock. This will simulate the old vx_wait() behavior. Sponsored by: Isilon Systems, Inc.
* - A lock is required before calling VOP_REVOKE. Our reference protects usjeff2005-03-131-1/+2
| | | | | | from accessing another vnode so a naked VOP_LOCK is sufficient. Sponsored by: Isilon Systems, Inc.
* - Don't VOP_UNLOCK prior to VOP_REVOKE. The lock is required now.jeff2005-03-132-20/+10
| | | | Sponsored by: Isilon Systems, Inc.
* - Don't drop the lock in the default inactive handler anymore, VOP_NULLjeff2005-03-131-14/+1
| | | | | | will do for vop_stdinactive now. Sponsored by: Isilon Systems, Inc.
* - CLOSE, REVOKE, INACTIVE, and RECLAIM are not L L L, that's a locked vnodejeff2005-03-131-4/+4
| | | | | | on enter, exit, error. This allows for the removal of the XLOCK. Sponsored by: Isilon Systems, Inc.
* Function jailed() looks into ucred strcture, so be sure ucred is not NULL.pjd2005-03-121-4/+4
| | | | | Reviewed by: rwatson MFC after: 1 week
* Clean up a bit.pjd2005-03-121-11/+12
| | | | | Reviewed by: rwatson MFC after: 1 week
* Extend the coverage of the accept and socket mutexes in soisconnected()rwatson2005-03-122-6/+6
| | | | | | so that the socket lock is held over the test-and-set removal of the accept filter option during connect, and the two socket mutex regions (transition to connected, perform accept filter) are combined.
* Move the logic implementing retrieval of the SO_ACCEPTFILTER socket optionrwatson2005-03-122-18/+28
| | | | | | | from uipc_socket.c to uipc_accf.c in do_getopt_accept_filter(), so that it now matches do_setopt_accept_filter(). Slightly reformulate the logic to match the optimistic allocation of storage for the argument in advance, and slightly expand the coverage of the socket lock.
OpenPOWER on IntegriCloud