summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Add a line discipline close routine which restores some functionalitydd2001-06-051-5/+21
| | | | | I accidently nuked in rev. 1.54. Also rework the error handling in snplwrite a little.
* Style and cosmetic cleanups. This driver is now reasonably stlye(9)dd2001-06-051-111/+127
| | | | | | | | | compliant. All the variable definitions and function names are reasonably consistent, and the functions which should be static (i.e., all of them) are. Other assorted fixes were made. The majority of the delta is indentation fixes. Partially reviewed by: bde
* Use the l_nullioctl exported from tty_conf.c rather than rolling our own.dd2001-06-041-10/+0
|
* Unstaticize l_nullioctl; it is needed elsewhere (like in tty_snoop.c).dd2001-06-041-2/+1
| | | | Suggested by: bde
* The pipe_write() code was locking the pipe without busying it first indillon2001-06-041-5/+20
| | | | | | | certain cases, and a close() by another process could potentially rip the pipe out from under the (blocked) locking operation. Reported-by: Alexander Viro <viro@math.psu.edu>
* Remove unused includes, use *min() inline functions rather than add2001-06-031-26/+8
| | | | | | | home-grown macro, rewrite a confusing conditional in snpdevtotty(), and change ibuf to 512 bytes instead of 1024 bytes in dsnwrite(). Reviewed by: bde
* When tring to find out if this is a request for a write indd2001-06-031-2/+2
| | | | | kernel_sysctl and userland_sysctl, check for whether new is NULL, not whether newlen is 0. This allows one to set a string sysctl to "".
* Include sys/mutex.h to silence a warning.dd2001-06-032-0/+2
|
* Revert the last bits of my bogus move of NMBCLUSTERSjesper2001-06-013-0/+3
| | | | to <sys/param.h>
* Clean up the code exporting interrupt statistics via sysctl a bit:tmm2001-06-011-0/+30
| | | | | | | | | | | | | - move the sysctl code to kern_intr.c - do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine the length of the intrcnt array - move the declarations of intrnames, eintrnames, intrcnt and eintrcnt from machine-dependent include files to sys/interrupt.h - remove the hw.nintr sysctl, it is not needed. - fix various style bugs Requested by: bde Reviewed by: bde (some time ago)
* Remove vestiges of MFS.ru2001-06-012-3/+1
|
* Back out jesper's 2001/05/31 14:58:11 PDT commit. It does not compile.obrien2001-06-011-0/+5
|
* Move the definition of NMBCLUSTERS from src/sys/kern/uipc_mbuf.cjesper2001-05-314-8/+0
| | | | | | | to <sys/param.h>, so it's available to src/sys/netinet/ip_input.c, and remove the now unneeded includes of "opt_param.h". MFC after: 1 week
* Export via sysctl:dd2001-05-303-0/+39
| | | | | | | | | | | * all members of msginfo from sysv_msg.c; * msqids from sysv_msg.c; * sema from sysv_sem.c; and * shmsegs from sysv_shm.c; These will be used by ipcs(1) in non-kvm mode. Reviewed by: tmm
* Remove the hack-around for the slice/label code, it didn'tphk2001-05-291-11/+1
| | | | cover the hole.
* Since the netexport struct was centralised to 'struct mount',iedowse2001-05-291-1/+1
| | | | | | | | | | | | | attempting to remove nonexistant exports with MNT_DELEXPORT returns an error; before this change it always succeeded. This caused mountd(8) to log "can't delete exports for /whatever" warnings. Change the error code from EINVAL to a more specific ENOENT, and make mountd ignore this error when deleting the export list. I could have just restored the previous behaviour of returning success, but I think an error return is a useful diagnostic. Reviewed by: phk
* Remove a comment which was past its shelf life.phk2001-05-291-1/+0
| | | | | PR: 18750 Submitted by: Tony Finch <dot@dotat.at>
* With the new kernel dev_t conversions done at release 4.X,phk2001-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | it becomes possible to trap in ptsstop() in kern/tty_pty.c if the slave side has never been opened during the life of a kernel. What happens is that calls to ttyflush() done from ptyioctl() for the controlling side end up calling ptsstop() [via (*tp->t_stop)(tp, <X>)] which evaluates the following: struct pt_ioctl *pti = tp->t_dev->si_drv1; In order for tp->t_dev to be set, the slave device must first be opened in ttyopen() [kern/tty.c]. It appears that the only problem is calls to (*tp->t_stop)(tp, <n>), so this could also happen with other ioctls initiated by the controlling side before the slave has been opened. PR: 27698 Submitted by: David Bein bein@netapp.com MFC after: 6 days
* The disklabel/slice code is more twisted than I thought. Revert tophk2001-05-281-0/+1
| | | | calling the cdevsw_add() unconditionally.
* Handle NULL struct device *sbrian2001-05-281-2/+2
|
* o uifree() the cr_ruidinfo in crfree() as well as cr_uidinfo now that the ↵rwatson2001-05-271-0/+2
| | | | | | | | real uid info is in the credential also. Submitted by: egge
* o pcred-removal changes included modifications to optimize the setting ofrwatson2001-05-261-7/+8
| | | | | | | | | | | | the saved uid and gid during execve(). Unfortunately, the optimizations were incorrect in the case where the credential was updated, skipping the setting of the saved uid and gid when new credentials were generated. This change corrects that problem by handling the newcred!=NULL case correctly. Reported/tested by: David Malone <dwmalone@maths.tcd.ie> Obtained from: TrustedBSD Project
* Create a general facility for making dev_t's depend on anotherphk2001-05-265-41/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | dev_t. The dev_depends(dev_t, dev_t) function is for tying them to each other. When destroy_dev() is called on a dev_t, all dev_t's depending on it will also be destroyed (depth first order). Rewrite the make_dev_alias() to use this dependency facility. kern/subr_disk.c: Make the disk mini-layer use dependencies to make sure all relevant dev_t's are removed when the disk disappears. Make the disk mini-layer precreate some magic sub devices which the disk/slice/label code expects to be there. kern/subr_disklabel.c: Remove some now unneeded variables. kern/subr_diskmbr.c: Remove some ancient, commented out code. kern/subr_diskslice.c: Minor cleanup. Use name from dev_t instead of dsname()
* Add vm locking to sendfile(2) and sf_buf_free().jhb2001-05-251-5/+13
| | | | | Reported by: Tamiji Homma <thomma@BayNetworks.com> Tested by: Tamiji Homma <thomma@BayNetworks.com>
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-2514-266/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Make the PTY drivers cloning algorithm create "CHEAPCLONE" dev_t,phk2001-05-251-11/+12
| | | | so that some twit cannot allocate all 256 PTY's with "ls -l".
* Use the name given to the dev_t, rather than creating our own.phk2001-05-251-1/+2
| | | | | This makes it possible to give sensible information for /dev/fd.720 and similar "special" devices.
* - sys/msdosfs moved to sys/fs/msdosfsru2001-05-251-2/+2
| | | | | - msdos.ko renamed to msdosfs.ko - /usr/include/msdosfs moved to /usr/include/fs/msdosfs
* Don't rely on cdevsw_add() when we hack about with dev_t's.phk2001-05-241-0/+2
|
* Don't take the detour around devsw() to find out if the proto-cdevswphk2001-05-241-3/+1
| | | | is already initialized.
* whitespace/stylealfred2001-05-241-1/+2
|
* This patch implements O_DIRECT about 80% of the way. It takes a patchsetdillon2001-05-243-2/+20
| | | | | | | | | | | | | | | | Tor created a while ago, removes the raw I/O piece (that has cache coherency problems), and adds a buffer cache / VM freeing piece. Essentially this patch causes O_DIRECT I/O to not be left in the cache, but does not prevent it from going through the cache, hence the 80%. For the last 20% we need a method by which the I/O can be issued directly to buffer supplied by the user process and bypass the buffer cache entirely, but still maintain cache coherency. I also have the code working under -stable but the changes made to sys/file.h may not be MFCable, so an MFC is not on the table yet. Submitted by: tegge, dillon
* Correct style bugs with regards to long lines and comments.dd2001-05-231-15/+22
| | | | Reviewed by: bde
* Don't acquire Giant just to call trap_fatal(), we are about to panicjhb2001-05-231-4/+0
| | | | | anyway so we'd rather see the printf's then block if the system is hosed.
* Don't release Giant around vm_oject_page_clean() in fsync() as the pagerjhb2001-05-232-4/+0
| | | | putpages called will need Giant.
* - Always call bfreekva() w/o vm_mtx held.jhb2001-05-231-28/+12
| | | | | | | - Always call vfs_setdirty() with vm_mtx held. - Fix an old comment: vm_hold_unload_pages is called vm_hold_free_pages() nowadays. - Always call vm_hold_free_pages() w/o vm_mtx held.
* - Lock the VM when initializing the vmspace for proc0.jhb2001-05-231-2/+2
| | | | | | - Don't bother releasing Giant while doing a lookup on the vm_map of initproc while starting up init. We have to grab it again right after the lookup anyways.
* Lock the VM while twiddling the vmspace.jhb2001-05-231-1/+2
|
* Increment mbstat.m_mpfail, not mbstat.m_mcfail, when m_pullup() fails.bmilekic2001-05-231-1/+1
| | | | This slipped in accidently a few commits back.
* Don't release the vm lock just to turn around and grab it again.jhb2001-05-231-3/+0
|
* Add in assertions to ensure that we always call msleep or mawait withjhb2001-05-231-0/+4
| | | | | | | either a timeout or a held mutex to detect unprotected infinite sleeps that can easily lead to deadlock. Submitted by: alfred
* syslogd gets kernel log messages only once every 30 seconds orphk2001-05-231-4/+7
| | | | | | | | | | | at the top of the minute, whichever comes first. It seems logtimeout() is only called once after the kernel log is opened and then never again after that. So I guess syslogd only gets kernel log messages by virtue of syncer(4)'s flushes ...? PR: 27361 Submitted by: pkern@utcc.utoronto.ca MFC after: 1 week
* aquire vm_mutex a little bit earlier to protect a pmap call.alfred2001-05-231-1/+1
|
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-235-25/+23
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Unifdef DEV_SNP; snp(4) no longer requires these ugly hacks.dd2001-05-221-27/+0
| | | | Silence by: -hackers, -audit
* Convert this driver to (ab?)use line disciplines to get the input itdd2001-05-221-17/+84
| | | | | | | needs instead of relying on idiosyncratic hacks in the tty subsystem. Also add module code since this can now be compiled as a module. Silence by: -hackers, -audit
* Convert npx interrupts into traps instead of vice versa. This is muchbde2001-05-221-0/+22
| | | | | | | | simpler for npx exceptions that start as traps (no assembly required...) and works better for npx exceptions that start as interrupts (there is no longer a problem for nested interrupts). Submitted by: original (pre-SMPng) version by luoqi
* Correct the vm_mtx handling; specifically, don't acquire it indd2001-05-221-5/+13
| | | | | | | | shm_deallocate_segment because shmexit_myhook calls it, and the latter should always be called with it already held. Submitted by: dwmalone, dd Approved by: alfred
* Remove KASSERT test for sleeping on mv_mtx, instead let WITNESS catchalfred2001-05-221-2/+0
| | | | | | it. Requested by: jhb
* Sort includes.jhb2001-05-211-1/+1
|
OpenPOWER on IntegriCloud