summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_vnops.c
AgeCommit message (Collapse)Author
2016-09-30Drop a now unneeded variable initialization; spotted by bluhm@Jeremie Courreges-Anglas
2016-09-30Make read(2) return EISDIR on directories.Jeremie Courreges-Anglas
Years ago Theo made read(2) return 0 on directories, instead of dumping the directory content. Another behavior is allowed as an extension by POSIX, returning an EISDIR error, as used on a few other systems. This behavior is deemed more useful as it helps spotting errors. This implies that it might break some setups. Ports bulk builds by ajacoutot@ and naddy@, ok millert@ bluhm@ naddy@ deraadt@
2016-06-19Remove the lockmgr() API. It is only used by filesystems, where it is aMartin Natano
trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
2016-03-19Remove the unused flags argument from VOP_UNLOCK().natano
torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
2016-01-06remove unnecessary casts where the incoming type is void *.Ted Unangst
2015-05-01Pass fflag to VOP_POLL so vfs fifo functions can get at the fileTodd C. Miller
flags to check FREAD/FWRITE if needed. This will be used by fifo_poll to avoid checking the write end of the fifo when the fd is read-only. OK guenther@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-16primary change: move uvm_vnode out of vnode, keeping only a pointer.Ted Unangst
objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
2014-11-03include sys/unistd.h where needed instead of indirect reliance. ok jsgTed Unangst
2014-07-13pass the size to free in some of the obvious casesTed Unangst
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-01-24Copy timespecs member by member in fo_stat callback functions, to avoidPhilip Guenther
leaking values in the padding bytes on LP64. Also, vn_stat() was lacking the zero-fill to clean its padding. ok kettenis@ deraadt@ phessler@
2013-09-14Correct the handling of I/O of >=2^32 bytes and the ktracing there ofPhilip Guenther
by using size_t/ssize_t instead of int/u_int to handle I/O lengths in uiomove(), vn_fsizechk(), and ktrgenio(). Eliminate the always-zero 'error' argument to ktrgenio() at the same time.
2013-06-05Move FHASLOCK from f_flag to f_iflags, freeing up a bit for passingPhilip Guenther
O_* flags and eliminating an XXX comment. ok matthew@ deraadt@
2013-03-30vrele() is a tricky beast. it can sleep if the refcount hits zero,Ted Unangst
leaving us with a free type function that isn't atomic. deal with this by erasing any reachable pointers to the vnode first, then free it. ok deraadt guenther
2012-07-11If the current offset is strictly less than the process filesizePhilip Guenthe
rlimit, then a write that would take it over the limit should be clamped, making it a partial write. ok beck@
2011-11-27When checking for offset wrap around in vn_read(), compare againstPhilip Guenthe
LLONG_MAX instead of SSIZE_MAX ok deraadt@
2011-11-07Make pwrite/pwritev ignore the O_APPEND flag.Philip Guenthe
Detect attempts to wrap the file offset by reading past the max (except for character devices). ok matthew@, deraadt@
2011-07-09Add support for the O_CLOEXEC and O_DIRECTORY flags introduced inMatthew Dempsky
POSIX Issue 7. Requested by oga@ (and maybe djm@); ok guenther@
2011-07-06Minor turd polishing: hold the vnode lock in vn_rdwr() only whileMatthew Dempsky
necessary. "ok ... wait wait WAIT!! ... oh, yeah, it's fine, ok" guenther@
2011-07-04move the specfs code to a place people can see it; ok guenther thib krwTheo de Raadt
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
2010-01-08As advertised in the man page, make open(2) return ELOOP (insteadStefan Sperling
of EMLINK) if the O_NOFOLLOW flag is set and the target is a symlink. Aligns with Solaris and Linux behaviour. ok tedu@ thib@ guenther@
2009-07-09Remove the VREF() macro and replaces all instances with a call to verf(),Thordur I. Bjornsson
which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
2009-01-29Switch struct stat's timespec members to the names standardized inPhilip Guenthe
POSIX 1003.1-2008, with compatibility macros for the names used in previous version of OpenBSD. Update all the references in the kernel to use the new, standard member names. ok'ed by miod@, otto@; ports build test by naddy@
2009-01-24propagate the O_EXCL flag down to the file systems, by settingThordur I. Bjornsson
VA_EXCLUSIVE. Handle this in NFS, also in NFS use arc4random() for the create verifier instead of an uninitialized long and the address of the first interface (which is likely to be lo0). Lifted from NetBSD with small tweaks; "looks good", miod@ OK blambert@
2008-09-19Fix a bunch of problems and races with posix file locking.Artur Grabowski
- file descriptor table becomes the owner of the lock instead of the proc. - When grabbing the lock, we check if the fd hasn't changed under our feet, this is more or less impossible to solve without a hack like this. I've banged my head against the wall, I figured out a solution, but implementing it correctly would cost me 12 gray hairs. Screw it, this is ugly, but it works. - Wait until usecount drains before releasing the posix lock in closef. - Add missing FREF/FRELE to sys_flock - keep the pid in the flock struct instead of abusing the fact that we used to use the proc as the lock owner. Pointed out by and discussed with Al Viro, big thanks. miod@ ok
2008-04-08bring cloning up too date; Munge it so it will work with atleastThordur I. Bjornsson
oga@'s upcoming DRM changes and too some degree ratchov@'s audio work. It still works for bpf's though. Parts from ratchov@; fstat(1) parts from Pedro Martelletto; tested by many, ok'ed by a few; "get going with cloning" deraadt@
2007-06-14Forgotten hackton diff: bounds check for seek on special devicesOtto Moerbeek
with a disklabel. Original diff from pedro@; ok pedro@ deraadt@
2007-06-01FIBMAP is used by nothing; checked by miod and pvalchevTheo de Raadt
2007-05-05vn_access hasn't been used for ages and it's just a wrapper withArtur Grabowski
locking around VOP_ACCESS. It can go.
2007-03-21Remove the v_interlock simplelock from the vnode structure.Thordur I. Bjornsson
Zap all calls to simple_lock/unlock() on it (those calls are #defined away though). Remove the LK_INTERLOCK from the calls to vn_lock() and cleanup the filesystems wich implement VOP_LOCK(). (by remvoing the v_interlock from there calls to lockmgr()). ok pedro@, art@, tedu@
2007-01-16Retire VOP_LEASE(); It was a bit for NQNFS and hasThordur I. Bjornsson
effectively been a no-op for quite some time now, without promise for future usage. ok pedro@ Testing by krw@ (earlier diff) and Johan Mson Lindman (tybollt@solace.miun.se)
2006-06-02Add a clonable devices implementation. Hacked along with thib@, inputPedro Martelletto
from krw@ and toby@, subliminal prodding from dlg@, okay deraadt@.
2006-05-01Move vn_isunder() to vfs_vnops.c, that's the place for vn_* functionsPedro Martelletto
2006-04-23'fall into' -> FALLTHROUGHPedro Martelletto
2006-04-23Remove unnecessary ARGSUSED commentPedro Martelletto
2006-04-23KNFPedro Martelletto
2005-12-04Add vn_access(), discussed with and okay uwe@Pedro Martelletto
2005-11-20Use ANSI function declarations and deregister, no binary changePedro Martelletto
2005-05-28have vn_close() lock the vnode before calling VOP_CLOSE().marius eriksen
fix the acct_*() code so that we always have a proc to lock on. ok pedro@
2004-07-13Change mode_t and nlink_t from 16bit to 32bit. This allows us toTodd C. Miller
use mode_t in syscalls.master and to use mode_t in more places in the kernel. It also makes lint much more useful on kernel code. I've also added a placeholder for st_birthtime to make a UFS2 import easier at some future date. Requested by and OK deraadt@
2003-09-23Replace select backends with poll backends. selscan() and pollscan()Todd C. Miller
now call the poll backend. With this change we implement greater poll(2) functionality instead of emulating it via the select backend. Adapted from NetBSD and including some changes from FreeBSD. Tested by many, deraadt@ OK
2003-07-21remove caddr_t casts. it's just silly to cast something when the functionTed Unangst
takes a void *. convert uiomove to take a void * as well. ok deraadt@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-03-17Since LK_RECURSEFAIL and LK_CANRECURSE contradict each otherArtur Grabowski
(although they are not opposites), avoid setting LK_CANRECURSE if LK_RECURSEFAIL is set in the caller.
2002-03-14First round of __P removal in sysTodd C. Miller
2001-12-19UBC was a disaster. It worked very good when it worked, but on someArtur Grabowski
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
2001-12-10Don't sleep on VXLOCK if LK_NOWAIT.Artur Grabowski