summaryrefslogtreecommitdiffstats
path: root/sys/sys/file.h
Commit message (Collapse)AuthorAgeFilesLines
* remove bogus comment, select/poll do NOT need to fhold as they hold thealfred2002-06-171-1/+4
| | | | | filedesc lock. style(9) fixes, add blank line at start of functions with no local variables.
* Removed some namespace pollution (unnecessary nested includes).bde2002-03-261-2/+0
|
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-231-15/+12
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __Palfred2002-03-191-35/+35
|
* Fix namespace pollution introduced in previous commit.des2002-02-231-4/+1
|
* Lock struct pgrp, session and sigio.tanimura2002-02-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* use mutex pools for "struct file" locking.alfred2002-01-201-5/+5
| | | | fix indentation of FILE_LOCK/UNLOCK macros while I'm here.
* Remove requirement for queue.h by consumers by moving its inclusionalfred2002-01-141-1/+1
| | | | | | before other headers that require it. Pointed out by: ru, bde
* Replace ffind_* with fget calls.alfred2002-01-141-2/+0
| | | | | | | | 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-131-27/+14
| | | | Requested by: jhb
* Remove file locking debug cruft.alfred2002-01-131-14/+0
|
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-38/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Give struct socket structures a ref counting interface similar todillon2001-11-171-0/+4
| | | | | | | vnodes. This will hopefully serve as a base from which we can expand the MP code. We currently do not attempt to obtain any mutex or SX locks, but the door is open to add them when we nail down exactly how that part of it is going to work.
* remove holdfp()dillon2001-11-141-0/+8
| | | | | | | | | | | | | | | | | | | Replace uses of holdfp() with fget*() or fgetvp*() calls as appropriate introduce fget(), fget_read(), fget_write() - these functions will take a thread and file descriptor and return a file pointer with its ref count bumped. introduce fgetvp(), fgetvp_read(), fgetvp_write() - these functions will take a thread and file descriptor and return a vref()'d vnode. *_read() requires that the file pointer be FREAD, *_write that it be FWRITE. This continues the cleanup of struct filedesc and struct file access routines which, when are all through with it, will allow us to then make the API calls MP safe and be able to move Giant down into the fo_* functions.
* Re-apply rev 1.178 -- style(9) the structure definitions.obrien2001-09-131-1/+1
| | | | I have to wonder how many other changes were lost in the KSE mildstone 2 merge.
* KSE Milestone 2julian2001-09-121-37/+37
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* This patch implements O_DIRECT about 80% of the way. It takes a patchsetdillon2001-05-241-1/+2
| | | | | | | | | | | | | | | | 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
* Extend kqueue down to the device layer.jlemon2001-02-151-0/+13
| | | | Backwards compatible approach suggested by: peter
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Change f_count and f_msgcount from short to int, solving the rolloverdillon2000-05-151-2/+2
| | | | | | problem demonstrated by the PR. MFC to follow. PR: kern/18346
* Introduce kqueue() and kevent(), a kernel event notification facility.jlemon2000-04-161-0/+1
|
* Change the write-behind code to take more care when startingdillon2000-04-021-2/+2
| | | | | | | | | | | | | | async I/O's. The sequential read heuristic has been extended to cover writes as well. We continue to call cluster_write() normally, thus blocks in the file will still be reallocated for large (but still random) I/O's, but I/O will only be initiated for truely sequential writes. This solves a number of annoying situations, especially with DBM (hash method) writes, and also has the side effect of fixing a number of (stupid) benchmarks. Reviewed-by: mckusick
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-3/+3
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Create a fileops fo_stat() entry point. This will enable collectionpeter1999-11-081-0/+19
| | | | | of a bunch of duplicated code that breaks (read: panic) when a new file type is added and some switch/case entries are missed.
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-191-2/+96
| | | | | | | | | | | | | | | | | far-reaching in fd-land, so you'll want to consult the code for changes. The biggest change is that now, you don't use fp->f_ops->fo_foo(fp, bar) but instead fo_foo(fp, bar), which increments and decrements the fp refcount upon entry and exit. Two new calls, fhold() and fdrop(), are provided. Each does what it seems like it should, and if fdrop() brings the refcount to zero, the fd is freed as well. Thanks to peter ("to hell with it, it looks ok to me.") for his review. Thanks to msmith for keeping me from putting locks everywhere :) Reviewed by: peter
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix fd race conditions (during shared fd table usage.) Badfileops isgreen1999-08-041-1/+2
| | | | | | | | | | | | now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
* Add standard padding argument to pread and pwrite syscall. That should make themdt1999-04-041-3/+4
| | | | | | | | | NetBSD compatible. Add parameter to fo_read and fo_write. (The only flag FOF_OFFSET mean that the offset is set in the struct uio). Factor out some common code from read/pread/write/pwrite syscalls.
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Fixed duplicate definitions of M_FILE (one static).bde1997-11-231-1/+5
|
* Update interfaces for poll()peter1997-09-141-3/+3
|
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* This commit is the embodiment of some VFS read clustering improvements.dyson1996-12-291-1/+8
| | | | | | | | | | | | Firstly, now our read-ahead clustering is on a file descriptor basis and not on a per-vnode basis. This will allow multiple processes reading the same file to take advantage of read-ahead clustering. Secondly, there previously was a problem with large reads still using the ramp-up algorithm. Of course, that was bogus, and now we read the entire "chunk" off of the disk in one operation. The read-ahead clustering algorithm should use less CPU than the previous also (I hope :-)). NOTE: THAT LKMS MUST BE REBUILT!!!
* Fixed lseek() on named pipes. It always succeeded but should always fail.bde1996-12-191-2/+3
| | | | | | | | | | Broke locking on named pipes in the same way as locking on non-vnodes (wrong errno). This will be fixed later. The fix involves negative logic. Named pipes are now distinguished from other types of files with vnodes, and there is additional code to handle vnodes and named pipes in the same way only where that makes sense (not for lseek, locking or TIOCSCTTY).
* Eliminated nested include of <sys/unistd.h> in <sys/file.h> in the kernel.bde1996-09-031-3/+5
| | | | | | | Include it directly in the few places where it is used. Reduced some #includes of <sys/file.h> to #includes of <sys/fcntl.h> or nothing.
* Merge in Lite2: LIST replacement for f_filef, f_fileb, and filehead.hsu1996-03-111-5/+7
| | | | | Did not accept change of second argument to ioctl from int to u_long. Reviewed by: davidg & bde
* Enable the new fast pipe code. The old pipes can be used with thedyson1996-01-281-1/+2
| | | | "OLD_PIPE" config option.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-1/+2
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* Implement maxprocperuid and maxfilesperproc. They are tunableguido1995-02-201-1/+2
| | | | | | | | | | | | via sysctl(8). The initial value of maxprocperuid is maxproc-1, that of maxfilesperproc is maxfiles (untill maxfile will disappear) Now it is at least possible to prohibit one user opening maxfiles -Guido Submitted by: Obtained from:
* Made them all idempotent.paul1994-08-211-1/+6
| | | | | Reviewed by: Submitted by:
* Added $Id$dg1994-08-021-0/+1
|
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+76
OpenPOWER on IntegriCloud