summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of the twisted MFREE() macro entirely.dillon2002-02-054-26/+15
| | | | | Reviewed by: dg, bmilekic MFC after: 3 days
* o Scatter vn_start_write() and vn_finished_write() through ACL code sorwatson2002-02-043-9/+30
| | | | | | | that it interacts properly with snapshotting. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Note that Kirk apparently missed adding vn_start_write() and friendsrwatson2002-02-043-0/+9
| | | | | to kern_acl.c when he added snapshotting. This will need to be added at some point.
* In the routines vrele() and vput(), we must lock the vnode andmckusick2002-02-021-15/+15
| | | | | | | | | | | call VOP_INACTIVE before placing the vnode back on the free list. Otherwise there is a race condition on SMP machines between getnewvnode() locking the vnode to reclaim it and vrele() locking the vnode to inactivate it. This window of vulnerability becomes exaggerated in the presence of filesystems that have been suspended as the inactive routine may need to temporarily release the lock on the vnode to avoid deadlock with the syncer process.
* Remove bogus assertion in dup2 that can lead to panics when kernelalfred2002-02-011-2/+0
| | | | | | | | | | | | | | | | | threads race for a file slot. dup2(2) incorrectly assumes that if it needs to grow the ofiles array that it will get what it wants. This assertion was valid before we allowed shared filedescriptor tables but is now incorrect. The assertion can trigger superfolous panics if the thread doing a dup2 looses a race with another thread while possibly blocked in the MALLOC call in fdalloc. Another thread may grab the slot we are requesting which makes fdalloc return something other than what we asked for, this will triggering the bogus assertion. MFC after: 2 weeks Reviewed by: phk
* Avoid lock order reversal filedesc/Giant when calling FREE() in fdallocalfred2002-02-011-0/+2
| | | | | | by unlocking the filedesc before calling FREE(). Submitted by: bde
* Don't recurse on filedesc lock in chroot_refuse_vdir_fds().alfred2002-02-012-16/+18
| | | | Noticed by: Michael Nottebrock <michaelnottebrock@gmx.net>
* Regenerate to make osigreturn standard.bde2002-02-012-4/+4
|
* Made osigreturn(2) standard so that SYS_osigreturn can be used in thebde2002-02-011-1/+1
| | | | | | | | | | | | signal trampoline for old signals. The arches that support old signals currently abuse sigreturn(2) instead. This mainly complicates things and slightly breaks the the new sigreturn(2). COMPAT is too limited to support the correct configuration of osigreturn, and this commit doesn't attempt to fix it; it just moves the bogusness: osigreturn() must now be provided unconditionally even on arches that don't really need it; previously it had to be provided under the bogus condition defined(COMPAT_43).
* GC P_BUFEXHAUST leftovers, we've had a new mechanism to avoid bufferdillon2002-01-311-1/+0
| | | | | | cache lockups for over a year now. MFC after: 0 days
* Remove unused variables in select(2) from previous delta.alfred2002-01-301-2/+1
| | | | Pointed out by: bde
* Oops, fix previous commit to not generate a C comment in syscall.mk.bde2002-01-301-1/+1
|
* Regenerate _after_ the commit to syscalls.master.bde2002-01-302-2/+2
|
* Escape $FreeBSD$ in a different way to avoid using the bogus escapes \$bde2002-01-301-5/+5
| | | | and \F. Awk just started warning about these.
* Attempt to fixup select(2) and poll(2), this should fix some races withalfred2002-01-292-125/+10
| | | | | | | | | | | | | | | | | | | other threads as well as speed up the interfaces. To fix the race and accomplish the speedup, remove selholddrop and pollholddrop. The entire concept is somewhat bogus because holding the individual struct file pointers offers us no guarantees that another thread context won't close it on us thereby removing our access to our own reference. Selholddrop and pollholddrop also would do multiple locks and unlocks of mutexes _per-file_ in the fd arrays to be scanned, this needed to be sped up. Instead of using selholddrop and pollholddrop, simply hold the filedesc lock over the selscan and pollscan functions. This should protect us against close(2)'s on the files as reduce the multiple lock/unlock pairs per fd into a single lock over the filedesc.
* Backout 1.120, EINVAL isn't a proper error return when the passed fd isalfred2002-01-291-1/+1
| | | | | | | negative, the 'pointer' referred to by the manpage is actually the struct file's f_offset field. Pointed out by: bde
* Be more conservative about interrupt latency, it aint getting better it seems.phk2002-01-251-2/+2
|
* Make st_blksize default to PAGE_SIZE instead of zero.phk2002-01-251-2/+2
|
* Make the 'maxusers 0' auto-sizing code slightly more conservative. Changedillon2002-01-251-3/+3
| | | | | | | | | | from 1 megabyte of ram per user to 2 megabytes of ram per user, and reduce the cap from 512 to 384. 512 leaves around 240 MB of KVM available while 384 leaves 270 MB of KVM available. Available KVM is important in order to deal with zalloc and kernel malloc area growth. Reviewed by: mckusick MFC: either before 4.5 if re's agree, or after 4.5
* Yet a bug with extensible sbufs being marked as OVERFLOWED. This timephk2002-01-241-1/+1
| | | | | | because of a signed/unsigned problem. Approved by: DES
* Add entry for EVFILT_NETDEV, which was inadverdently omitted back in Sept.jlemon2002-01-241-0/+1
|
* in fget() return EINVAL when the descriptor requested is negative.alfred2002-01-231-1/+1
|
* make pread use fget_read instead of holdfp.alfred2002-01-231-27/+2
|
* Fixed bug in calculation of amount of file to send when nbytes !=0 anddg2002-01-221-3/+6
| | | | | | | | | headers or trailers are supplied. Reported by Vladislav Shabanov <vs@rambler-co.ru>. PR: 33771 Submitted by: Maxim Konovalov <maxim@macomnet.ru> MFC after: 3 days
* In certain cases sbuf_printf() and sbuf_vprintf() could mistakelyphk2002-01-221-1/+1
| | | | | | make extendable sbufs as overflowed. Approved by: des
* Allow dump device be configured as early as possible using loader(8) tunable.sobomax2002-01-211-0/+11
| | | | | | | This allows obtaining crash dumps from the panics occured during late stages of kernel initialisation before system enters into single-user mode. MFC after: 2 weeks
* use mutex pools for "struct file" locking.alfred2002-01-201-2/+1
| | | | fix indentation of FILE_LOCK/UNLOCK macros while I'm here.
* use mutex pool mutexes for uidinfo locking.alfred2002-01-201-15/+15
| | | | | | | replace mutex_lock calls on uidinfo with macro calls: mtx_lock(&uidp->ui_mtx) -> UIDINFO_LOCK(uidp) Terry Lambert <tlambert2@mindspring.com> helped with this.
* o Remove the unused vestiges of JOBST_JOBQPROC andalc2002-01-201-15/+1
| | | | | the per-thread jobtorun queue. o Use TAILQ_EMPTY() instead of TAILQ_FIRST(...) == NULL.
* o Revision 1.99 ("KSE Milestone 2") left the aio daemonsalc2002-01-201-2/+2
| | | | | | | | | sleeping on a process object but changed the corresponding wakeup()s to the thread object. The result was that non-raw aio ops waited for an aio daemon to timeout before action was taken. Now, we sleep on the thread object. PR: kern/34016
* Remove 'VXLOCK: interlock avoided' warnings. This can now occur in normaldillon2002-01-192-0/+6
| | | | | | | | | | | | operation. The vgonel() code has always called vclean() but until we started proactively freeing vnodes it would never actually be called with a dirty vnode, so this situation did not occur prior to the vnlru() code. Now that we proactively free vnodes when kern.maxvnodes is hit, however, vclean() winds up with work to do and improperly generates the warnings. Reviewed by: peter Approved by: re (for MFC) MFC after: 1 day
* undo a bit of the Giant pushdown.alfred2002-01-191-5/+9
| | | | | | fdrop isn't SMP safe as it may call into the file's close routine which definetly is not SMP safe right now, so we hold Giant over calls to fdrop now.
* Explain that the admin can safely power down the system as well asnik2002-01-181-1/+2
| | | | rebooting.
* Invert the test of sx_xholder for SX_LOCKED. We need to warn if atanimura2002-01-181-3/+3
| | | | | | thread other than the curthread holds an sx. While I am here, break a line at the end of warning.
* Uninlined most of the bloated inline functions in <sys/disklabel.h>. Somebde2002-01-171-0/+18
| | | | of them need to become even larger to support devfs.
* Changed the type of pcb_flags from u_char to u_int and adjusted things.bde2002-01-171-1/+1
| | | | | This removes the only atomic operation on a char type in the entire kernel.
* o Eliminate an unused parameter from aio_fphysio().alc2002-01-171-3/+3
|
* Fix giant handling in pwrite(2), I forgot to release it when finishingalfred2002-01-161-1/+2
| | | | the syscall.
* - Attempt to help declutter kern. sysctl by moving security out fromarr2002-01-165-17/+18
| | | | | | beneath it. Reviewed by: rwatson
* Bump the limits for determining if we've held a spinlock too long as theyjhb2002-01-152-4/+4
| | | | | | | seem to be too short for the 500 Mhz DS20 I'm testing on. The rather arbitrary numbers are rather bogus anyways. We should probably have variables for these limits that are calibrated in the MD startup code somehow.
* When downgrading a filesystem from read-write to read-only, operationsmckusick2002-01-151-2/+7
| | | | | | | | | | | | | | | | | | | | involving file removal or file update were not always being fully committed to disk. The result was lost files or corrupted file data. This change ensures that the filesystem is properly synced to disk before the filesystem is down-graded. This delta also fixes a long standing bug in which a file open for reading has been unlinked. When the last open reference to the file is closed, the inode is reclaimed by the filesystem. Previously, if the filesystem had been down-graded to read-only, the inode could not be reclaimed, and thus was lost and had to be later recovered by fsck. With this change, such files are found at the time of the down-grade. Normally they will result in the filesystem down-grade failing with `device busy'. If a forcible down-grade is done, then the affected files will be revoked causing the inode to be released and the open file descriptors to begin failing on attempts to read. Submitted by: "Sam Leffler" <sam@errno.com>
* Push down Giant in dup(2) and dup2(2), Giant is only needed whenalfred2002-01-151-16/+17
| | | | | calling closef() in the case of dup2(2) duping over a descriptor and when fdalloc must grow or free a filedesc.
* Fix select on fifos.alfred2002-01-141-1/+8
| | | | | | | | | | | | | Backout revision 1.56 and 1.57 of fifo_vnops.c. Introduce a new poll op "POLLINIGNEOF" that can be used to ignore EOF on a fifo, POLLIN/POLLRDNORM is converted to POLLINIGNEOF within the FIFO implementation to effect the correct behavior. This should allow one to view a fifo pretty much as a data source rather than worry about connections coming and going. Reviewed by: bde
* Remove a bogus FILEDESC_UNLOCK.alfred2002-01-141-1/+0
| | | | Submitted by: tanimura
* o Correct the initialization of aiolio_zone: Each entry was 16 times largeralc2002-01-141-13/+5
| | | | | | | | | than necessary. o Move a rarely-used goto label inside a critical section so that we don't perform an splnet() for which there is no corresponding splx(). o Remove unnecessary splnet()/splx() around accesses to kaioinfo::kaio_jobdone in aio_return(). o Use TAILQ_FOREACH for simple cases of iteration over kaioinfo::kaio_jobdone.
* Replace ffind_* with fget calls.alfred2002-01-145-138/+81
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.alfred2002-01-133-1/+3
| | | | Requested by: jhb
* o Call the functions registered with at_exec() from exec_new_vmspace()alc2002-01-131-4/+7
| | | | | | | instead of execve(). Otherwise, the possibility still exists for a pending AIO to modify the new address space. Reviewed by: alfred
* Comment fdrop and fdrop_locked functions.alfred2002-01-131-0/+9
|
* Implement ffind_hold using ffind_lock.alfred2002-01-131-11/+3
| | | | Recommended by: jhb
OpenPOWER on IntegriCloud