summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
Commit message (Collapse)AuthorAgeFilesLines
* Make a SYSCTL_NODE staticphk2005-02-101-1/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Remove buf->b_dev field.phk2004-11-041-1/+0
|
* Give dev_strategy() an explict cdev argument in preparation for removingphk2004-10-291-1/+1
| | | | | | | | | | | buf->b-dev. Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf. Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
* Put the I/O block size in bufobj->bo_bsize.phk2004-10-261-1/+1
| | | | | | | We keep si_bsize_phys around for now as that is the simplest way to pull the number out of disk device drivers in devfs_open(). The correct solution would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth when filesystems sit on GEOM, so don't bother for now.
* cover soreadable and sowriteable with the corresponding socketbuffer locks.alfred2004-10-011-9/+9
|
* Eliminate DEV_STRATEGY() macro: call dev_strategy() directly.phk2004-09-231-1/+1
| | | | Make dev_strategy() handle errors and departing devices properly.
* Tag AIO as requiring Giant over the network stack usingrwatson2004-09-031-0/+2
| | | | | | NET_NEEDS_GIANT(). RELENG_5 candidate.
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-151-10/+15
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* clean up whitespace...jmg2004-08-131-55/+55
|
* - Use atomic ops for updating the vmspace's refcnt and exitingcnt.alc2004-07-271-1/+1
| | | | | | | | - Push down Giant into shmexit(). (Giant is acquired only if the vmspace contains shm segments.) - Eliminate the acquisition of Giant from proc_rwmem(). - Reduce the scope of Giant in exit1(), uncovering the destruction of the address space.
* Merge additional socket buffer locking from rwatson_netperf:rwatson2004-06-171-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | - Lock down low hanging fruit use of sb_flags with socket buffer lock. - Lock down low hanging fruit use of so_state with socket lock. - Lock down low hanging fruit use of so_options. - Lock down low-hanging fruit use of sb_lowwat and sb_hiwat with socket buffer lock. - Annotate situations in which we unlock the socket lock and then grab the receive socket buffer lock, which are currently actually the same lock. Depending on how we want to play our cards, we may want to coallesce these lock uses to reduce overhead. - Convert a if()->panic() into a KASSERT relating to so_state in soaccept(). - Remove a number of splnet()/splx() references. More complex merging of socket and socket buffer locking to follow.
* Add missing #include <sys/module.h>phk2004-05-301-0/+1
|
* Make the process_exit eventhandler run without Giant. Add Giant hookspeter2004-03-141-0/+2
| | | | | | in the two consumers that need it.. processes using AIO and netncp. Update docs. Say that process_exec is called with Giant, but not to depend on it. All our consumers can handle it without Giant.
* Send B_PHYS out to pasture, it no longer serves any function.phk2003-11-151-1/+0
|
* don't allow reading from files that haven't been open'd for reading.jmg2003-10-241-2/+3
|
* We need to initialize bp->b_offset and bp->b_iooffsetsimokawa2003-10-211-0/+2
| | | | becuase bp->b_blkno is ignored now.
* Fix asynchronous physio breakage introduced in rev 1.163.simokawa2003-09-101-4/+3
| | | | We cannnot use bp->b_caller2 because DEV_STRATEGY will overwrite it.
* Add a f_vnode field to struct file.phk2003-06-221-2/+2
| | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
* Get rid of the b_spc specialty field in struct buf by using an alreadyphk2003-06-161-2/+2
| | | | available caller private field.
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* - kthread's don't have p_textvp set to anything, so replace code thatjhb2003-04-171-7/+1
| | | | | dealt with that possibility with a KASSERT(). - No need to set P_SYSTEM, kthread_create() does that for us.
* Don't reinitialize fields that are already initialized by getpbuf().alc2003-04-051-1/+1
|
* o Remove useracc() calls from aio_qphysio(); they are redundantalc2003-04-041-20/+1
| | | | | | given the checks performed by vmapbuf(). Reviewed by: tegge
* Replace the at_fork, at_exec, and at_exit functions with the slightly morejhb2003-03-241-6/+11
| | | | | | | | | flexible process_fork, process_exec, and process_exit eventhandlers. This reduces code duplication and also means that I don't have to go duplicate the eventhandler locking three more times for each of at_fork, at_exec, and at_exit. Reviewed by: phk, jake, almost complete silence on arch@
* Back out M_* changes, per decision of the TRB.imp2003-02-191-8/+8
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-8/+8
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Close the remaining user address mapping races for physicaldillon2003-01-201-2/+13
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* style(9) fixes, mostly add parens around return arguments.alfred2003-01-131-63/+65
|
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-131-6/+6
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Allowing nent < 0 in aio_suspend() and lio_listio() is just asking fortjr2003-01-121-2/+2
| | | | trouble. Return EINVAL instead.
* Remove "XXX undocumented" comment from lio_listio().tjr2003-01-121-1/+1
|
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-121-6/+6
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* Remove unused second argument from DEV_STRATEGY().phk2003-01-031-1/+1
|
* Lock filedesc while performing a range check on the file descriptor.alfred2002-12-271-0/+4
| | | | Reviewed by: alc
* Rework the sysconf(3) interaction with aio:alfred2002-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | sysconf.c: Use 'break' rather than 'goto yesno' in sysconf.c so that we report a '0' return value from the kernel sysctl. vfs_aio.c: Make aio reset its configuration parameters to -1 after unloading instead of 0. posix4_mib.c: Initialize the aio configuration parameters to -1 to indicate that it is not loaded. Add a facility (p31b_iscfg()) to determine if a posix4 facility has been initialized to avoid having to re-order the SYSINITs. Use p31b_iscfg() to determine if aio has had a chance to run yet which is likely if it is compiled into the kernel and avoid spamming its values. Introduce a macro P31B_VALID() instead of doing the same comparison over and over. posix4.h: Prototype p31b_iscfg().
* Export the values for _SC_AIO_MAX and _SC_AIO_PRIO_DELTA_MAX via the p1003balfred2002-11-161-0/+4
| | | | sysctl interface.
* Call 'p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, AIO_LISTIO_MAX)'alfred2002-11-161-0/+3
| | | | | | when AIO is initialized so that sysconf() gives correct results. Reported by: Craig Rodrigues <rodrigc@attbi.com>
* Do a bit more work in the aio code to simulate the credential environmentrwatson2002-11-071-0/+7
| | | | | | | | | | | | | | | of the original AIO request: save and restore the active thread credential as well as using the file credential, since MAC (and some other bits of the system) rely on the thread credential instead of/as well as the file credential. In brief: cache td->td_ucred when the AIO operation is queued, temporarily set and restore the kernel thread credential, and release the credential when done. Similar to ktrace credential management. Reviewed by: alc Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Change the way support for asynchronous I/O is indicated to applicationswollman2002-10-271-0/+2
| | | | | | | | | | to conform to 1003.1-2001. Make it possible for applications to actually tell whether or not asynchronous I/O is supported. Since FreeBSD's aio implementation works on all descriptor types, don't call down into file or vnode ops when [f]pathconf() is asked about _PC_ASYNC_IO; this avoids the need for every file and vnode op to know about it.
* fdfree() clears p_fd for us, no need to do it again.jhb2002-10-181-1/+0
|
* Eliminate the unnecessary clearing of flag bits that are already clearalc2002-10-141-4/+1
| | | | in lio_listio(2).
* Some kernel threads try to do significant work, and the default KSTACK_PAGESscottl2002-10-021-1/+1
| | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb
* Replace (ab)uses of "NULL" where "0" is really meant.archie2002-08-221-1/+1
|
* o Remove the AIOCBLIST_ASYNCFREE flag and related code. It's never set.alc2002-08-221-19/+2
| | | | Submitted by: Romer Gil <rgil@cs.rice.edu>
* o Make a correction to the last change: In aio_cancel(2) return AIO_ALLDONEalc2002-08-111-2/+2
| | | | instead of EINVAL if p->p_aioinfo is NULL.
* o In aio_cancel(2), make sure that p->p_aioinfo isn't NULL beforealc2002-08-111-0/+2
| | | | | | dereferencing it. Submitted by: saureen <sshah@apple.com>
* Set the ident field of the struct kevent that is registered by _aio_aqueue()alc2002-08-061-4/+5
| | | | | | | | to the address of the user's aiocb rather than the kernel's aiocb. (In other words, prior to this change, the ident field returned by kevent(2) on completion of an AIO was effectively garbage.) Submitted by: Romer Gil <rgil@cs.rice.edu>
* o The introduction of kevent() broke lio_listio(): _aio_aqueue() thoughtalc2002-08-051-6/+6
| | | | | | | | | | | | | that LIO_READ and LIO_WRITE were requests for kevent()-based notification of completion. Modify _aio_aqueue() to recognize LIO_READ and LIO_WRITE. Notes: (1) The patch provided by the PR perpetuates a second bug in this code, a direct access to user-space memory. This change fixes that bug as well. (2) This change is to code that implements a deprecated interface. It should probably be removed after an MFC. PR: kern/39556
OpenPOWER on IntegriCloud