summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_vnops.c
AgeCommit message (Collapse)Author
2012-11-17buf_acquire() can sleep, so advance down b_vnbufs afterwardsTheo de Raadt
ok beck guenther
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
2011-07-09KNFBob Beck
ok md5 "can't be worse" thib@
2011-07-08fix nfs pending writes, which were not handled correctly in the commitBob Beck
case. ok guenther@ thib@
2011-07-05When calling nfs_request() for what could be an async request, passPhilip Guenthe
down curproc instead of the struct proc from the I/O request...which may gone away behind our back. Assert that the supplied request *is* curproc in a couple other places. Reproduction and testing by sthen@ ok deraadt@, beck@, art@
2011-07-04move the specfs code to a place people can see it; ok guenther thib krwTheo de Raadt
2011-04-05Every single vop_default is set to eopnotsupp, so retire itThordur I. Bjornsson
and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
2010-12-21Bring back the "End the VOP experiment." diff, naddy's issues whereThordur I. Bjornsson
unrelated, and his alpha is much happier now. OK deraadt@
2010-09-10Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)Thordur I. Bjornsson
have been resolved.
2010-09-06End the VOP experiment. Instead of the ridicolusly complicated operationThordur I. Bjornsson
vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.
2010-05-19clean up a few things that where left to rot after bob's vfs cache work.Thordur I. Bjornsson
sync a few comments to reality (or remove them), remove the cn_hash member from struct componentname, spacing. ok beck@
2010-04-12Don't jump the queue if we have to wait on the client side becauseBob Beck
the nfs_bufq is full - instead tsleep waiting for one of our nfsiod's to free up space for us in the queue so we can enqueue on the end. ok blambert@, tedu@, oga@
2010-03-29Initialize various uninitialized variables. Found by jsg@ via Clang.Kenneth R Westerback
Feedback from miod@ and kettenis@. ok beck@
2009-12-15Make sillyrename not so damn silly. The kindergarten algorithm here forBob Beck
picking a name meant that more than 58 sillys in a directory and we fail with EINVAL, resulting in strange problems for nfs which in turn causes pain and stress in building, and PTSD in nfs and vfs hackers. Has bit us in the butt since the vienna f2k7 hackathon. good suggestions from deraadt@ guenther@ and otto@ ok deraadt@,oga@,blambert@,krw@,guenther@, and a "very special ok" tedu@ Oh god, I'm an nfs hacker..
2009-12-10"fix" from freebsd to hide potential race in silly renames, whereBob Beck
a directory gets reclaimed on a forced unmount before the silly file in it gets blown away... fixes an issue seen by phessler@ ok oga@, art@
2009-10-19antsyJonathan Gray
no binary change apart from nfsm_reqhead() which is clearly correct. ok thib@
2009-09-02Backout the asyncio/aiod change, as it causes buf's to get hung.Thordur I. Bjornsson
problem noticed by deraadt@ ok beck@
2009-08-20Rework the way we do async I/O in nfs. Introduce separate buf queues forThordur I. Bjornsson
each mount, and when work is "found", peg an aiod to that mount todo the I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio and when to force it sync, this is done by keeping the aiod's one two lists, an "idle" and an "all" list, so asyncio is only done when there are aiods hanging around todo it for us or are already pegged to the mount. Idea liked by at least beck@ (and I think art@). Extensive testing done by myself and jasper and a few others on various arch's. Ideas/Code from Net/Free. OK blambert@.
2009-08-13Teach nfsm_fhtom about nfsm_info structsBret Lambert
ok thib@
2009-08-13- remove super-obvious comments from $fs_vnodeop_entries[]Jasper Lievisse Adriaanse
prodded by and ok thib@ agreed by art@ and blambert@
2009-08-04group all of the on-stack variables that are uses by the nfsm_macrosThordur I. Bjornsson
to keep the data munging "state" into an nfsm_info structure. Each function now has this structure on its stack, and it and its members are now passed around so that the macros/functions can work there magic. this will make removing the nfsm_* macros way easier. Idea/code picked up from DragonflyBSD. Tested by krw@, jacekm@ and myself. OK blambert@.
2009-07-20(struct foo *)0 -> NULL, every where I could find it.Thordur I. Bjornsson
OK blambert@
2009-07-18Fixes for the NFSERR_RETERR commit.Thordur I. Bjornsson
- Make sure to set the mbuf pointers and the dpos pointer correctly in nfs_request() before returning an error. - Fix potential mbufs leaks in nfs_{read,write}rpc for v2. The reply mbuf was not being freed before the jump to nfsmout. - Reorder error handling to prevent an error case being treated as a non-error case. Fixes issues noticed by sthen@ and ajacoutot@. Tested by both of them. Reviewd by oga@ OK blambert@
2009-07-13Make the callers of nfs_request() responsible for freeing the reply mbuf,Thordur I. Bjornsson
if the reply is an error and retire the NFS_RETERR hack. For NFSv3 mounts the flag was set and reply mbuf not freed to allow the callers to handle the post-op attributes, or just free the mbuf for NFSv2. Tested by myself and jasper@ on various arch's. OK blambert@.
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-06-25backout the buf_acquire() does the bremfree() since all callersThordur I. Bjornsson
where doing bremfree() befure calling buf_acquire(). This is causing us headache pinning down a bug that showed up when deraadt@ too cvs to current, and will have to be done anyway as a preperation for backouts. OK deraadt@
2009-06-06All caller of buf_acquire were doing bremfree before the call.Artur Grabowski
Just put it in the buf_acquire function. oga@ ok
2009-06-04Demacro nfsm_lookup for great justice.Bret Lambert
Thanks to ckuethe for saving much typing with a drive-by perl script. ok thib@
2009-04-13Convert macros to functions to reduce kernel memory usage.Bret Lambert
In snaps for a while (way too long, according to deraadt@)
2009-01-24oops. forgot to remove a debug printf from the diff.Thordur I. Bjornsson
(that I applied to a clean tree to commit)
2009-01-24Use a timespec instead of a time_t for the clients nfsnodeThordur I. Bjornsson
mtime, gives us better granularity, helps with cache consistency. Idea lifted from NetBSD. OK blambert@
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@
2009-01-19Introduce a macro to invalidate the attributeThordur I. Bjornsson
cache instead of setting n_attrstamp to 0 directly. Lift the macro name from NetBSD. prompted by and OK blambert@
2009-01-18Replace #ifndef DIAGNOSTIC with #ifdef to make the additional checksAlexander Bluhm
in diagnostic kernels. The typo comes from 4.4BSD-Lite2 via NetBSD. Found with pedro@, ok pedro@, blambert@, thib@
2009-01-13Trivial lvalue abuse fixes, no binary changes.Alexander Yurchenko
ok millert@ tedu@
2008-12-24Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tThordur I. Bjornsson
hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
2008-10-16Don't hide the fact that NFS uses vop_generic_* functions behindBret Lambert
#define's in nfs_var.h ok thib@
2008-09-12provide a NOTE_TRUNCATED kq hint in nfs_setattr() if the fileThordur I. Bjornsson
shrinks, same thing as UFS does. ok/pointers pedro@ ok blambert@
2008-08-21Fix 'if ();' construction introduced in last commit, okay deraadt@Pedro Martelletto
2008-08-09o nfs_vinvalbuf() is always called with the intrflag as 1, and thenThordur I. Bjornsson
checks if the mount is actually interrutable, and if not sets it 0. remove this argument from nfs_vinvalbuf and just do the checking inside the function. o give nfs_vinvalbuf() a makeover so it looks nice. (spacing, casts, &c); o Actually pass PCATCH too tsleep() if the mount it interrutable. ok art@, blambert@
2008-08-08After beck@ changed the way nfsiod's are notified of work, theBret Lambert
nfs_iodwant array became unused. Garbage collect and free up a few bytes. ok thib@
2008-08-08Remove code for variable-sized allocations of NFS filehandles by malloc(),Bret Lambert
as it was never used because there were 64-bit buffers already allocated for filehandles in nfsnode structs. ok thib@
2008-07-25much more correct way of dealing with nfs pending reads/writesBob Beck
ok thib@
2008-07-23make this real CTheo de Raadt
2008-07-23Correct cases of mishandling of pending reads and writes to preventBob Beck
them going negative - this consists of identifying a number of cases of IO not going through the buffer cache and marking those buffers with B_RAW - as well as fixing nfs_bio to show pending writes and reads through the buffer cache via NFS still has a problem with mishandling the counters I believe in the async/sync fallback case where counters stay positive which will be addressed seperately. ok tedu@ deraadt@
2008-07-23 - in nfs_mknodrpc - initialize the node we pass to nfs_lookitup. It'sArtur Grabowski
not just a return value, nfs_lookitup treats it specially when *npp is not NULL. - nfs_lookitup - When we match the file handle to the directory filehandle (lookup on '.'), initialize np so that we don't return stack garbage to the caller. The function shouldn't ever be called with '.' at this moment, but that's no reason to not do the right thing in case future callers use it that way. blambert@ thib@ ok
2008-07-06remove #ifndef nolint gooThordur I. Bjornsson
ok blambert@
2008-06-14Replace nfsm_build/bcopy with nfsm_{buf,str}tombuf functions inBret Lambert
filehandle -> mbuf write macros. Removes `magic' variable cp which was used only in these macros, and should lead to marginally better mbuf packing as well. `slap it in' thib@
2008-06-13Kill one-liner macro which obfuscated mbuf pointer assignment.Bret Lambert
Rescue nfsm_reqhead macro name and rename nfsm_reqh. End of one-liners from nfsm_subs.h. ok thib@
2008-06-13nuke a bunch of bogus ARGSUSED;Thordur I. Bjornsson
ok blambert@