summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_subs.c
AgeCommit message (Collapse)Author
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-25move to having requests on a per nfsmount tailq instead of one global one.Thordur I. Bjornsson
also make the rexmit timeout per nfsmount, and make sure to start/stop the timer appropriately. now the nfs_timer() only fires if there is work todo, not always at nfs_ticks (it did, even if there where no nfsmounts in the system!). OK blambert@
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-13change version 3 post-operation attribute building function to notBret Lambert
use mbufs directly, but the shiny new nfsm_info struct ok thib@
2009-08-10Use an RB tree instead of a hashtable for fh/node lookups.Thordur I. Bjornsson
Idea from NetBSD. OK blambert@
2009-08-10Remove the v2 writegather code. It did help alot back in the 80sThordur I. Bjornsson
but extensive performance benchmarking done by myself and jasper@ has shown that it doesn't help, at all - even on vaxens and in some cases it makes things significantly slower. "this excites me sexually" jetpack@ Tested by jasper@. OK 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-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-05-30Remove unused procnums (NQNFS leftovers) and cleanup.Thordur I. Bjornsson
OK blambert@ sometime ago
2009-05-22retire the nfs rtt log code, this isnt really all thatThordur I. Bjornsson
usefull, and has been disabled for a long long time. Cleans house a bit. OK blambert@
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-03-30Convert a sizeable macro to a much-leaner function. Saves (IIRC) 5k on i386.Bret Lambert
In snaps for a while.
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-20Start reworking NFS client mbuf handling by creating an interface whichBret Lambert
requires well-formed mbuf chains to work. Existing function name is now a wrapper to this interface. Much, much more work to follow which will build on this. Truly change we can believe in. ok thib@, who would have preferred this in two commits, but I'm impatient :) testing on multiple arches (i386, arm, amd64, and sparc64 at least) by many, thanks to all who did so
2009-01-13Trivial lvalue abuse fixes, no binary changes.Alexander Yurchenko
ok millert@ tedu@
2008-12-24fix a typo made in last commit, also slightly better wording forThordur I. Bjornsson
another comment.
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-11-24use the shiny new nitems macroThordur I. Bjornsson
2008-08-25Correctly invalidate attribute cache entries in case the vnode modePedro Martelletto
changes, okay beck@, tedu@ and thib@.
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-06-15unroll the NFSMADV() macro and nuke itThordur I. Bjornsson
ok blambert@
2008-06-14use nfsm_padlen() where appropriate;Thordur I. Bjornsson
ok blambert@
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-13remove rpc_auth_kerb variable, its now unused...Thordur I. Bjornsson
2008-06-13Replace one-line macro which only obfuscated the fact thatBret Lambert
the function it was named after took 4 arguments instead of 2. "get it in; get it in; get it in" thib@
2008-06-12Remove now-vestigial bpos pointer from NFS. For building outgoingBret Lambert
NFS mbufs, mbufs now contain all their internal buffer state internally, the way god intended. ok thib@ testing johan@ (and possibly merdely@; this diff's been around for a bit...)
2008-06-11return an XDR'rd xid from nfs_get_xid() and kill the nfs_xid globalThordur I. Bjornsson
variable; ok & feedback deraadt@
2008-06-10o Avoid putting duplicate entries into the name cache,Thordur I. Bjornsson
add a function to handle cache_enter()'s for us since we need to update the appropriate timestamps so we don't miss on lookup; o Do not purge the dvp in nfs_rmdir(), since there's no need; o cache the new entry created in nfs_mkdir(); o Do caching of the access modes, this drastically reduces the amount of over the wire access RPCs we do in the NFSv3 case. This diff was written by Pedro Martelletto, sometime in 2004. A lot of people have been running with it at one time or another, this includes at least markus and matthieu. OK deraadt@, blambert@
2008-06-09nfsm_get_xid() => nfs_get_xid() after thib@ informed me that theDamien Miller
nfsm_* functions are for mbufs
2008-06-09Introduce a facility to generate unpredictable 32 bit numbers withDamien Miller
near maximal (2^32) cycle times. These are useful for network IDs in cases where there are negative consequences to ID prediction and/or reuse. Use the idgen32() functions to generate IPv6 IDs and NFS client/server XIDs. Pseudorandom permutation code in crypto/idgen.c based on public domain skip32.c from Greg Rose. feedback & ok thib@ deraadt@
2008-04-22remove the "kerbflag" argument from nfsrv_fhtovp() and nfs_namei()Thordur I. Bjornsson
(the latter only had it to pass it to nfsrv_fhtovp()). appropriate cleanup also; ok blambert@
2008-04-19in nfsm_reqh(), only allocate an mbuf cluster if theThordur I. Bjornsson
len exceeds MLEN, not MINCLSIZE; inspired by a similar commit from damien. ok damien@, blambert@
2008-04-18use arc4random_uniform() for random number requests that are not aDamien Miller
power of two. use arc4random_bytes() when requesting more than a word of PRNG output. ok deraadt@
2008-04-16more efficient use of mbufs in nfsm_uiotombuf().Damien Bergamini
allocate a mbuf cluster only if length is greater than MLEN instead of MINCLSIZE. ok blambert@, thib@
2008-04-14Rework NFS mbuf write routines:Bret Lambert
nfsm_uiotombuf(): - no meaningful return, function becomes void - replace frankensteined uiomove/MGET with actual call to uiomove nfsm_strtmbuf(): - no meaningful return, becomes void - rename and reorder parameters to be consistent with other functions - becomes wrapper to nfsm_uiotombuf nfsm_buftombuf(): - new function; unused but slated for future use - wrapper to nfsm_uiotombuf As a bonus, making these functions void removes much unneeded code and garbage collects `magic' variable t2 which was only used (invisibly) by the macros from nfsm_subs.h Preps the way for removing much more NFS goo... testing by myself, thib@ and merdely@ ok thib@
2008-01-06More NFS-related kernel shrinkage...Bret Lambert
When you use a macro ~200 times, it tends to bloat your code, so make a function out of it. Shaves ~8.5 kB from my kernel. ok thib@, "looks good" krw@ In snaps for 1+ week with no negative reports.
2007-12-13convert massive (expanded to 150+ lines) nfsm_v3attr macro to a functionBret Lambert
shaves an insane (~8K) amount from an i386 kernel ok thib@
2007-11-28fill the va_blocksize with something a litte saner,Thordur I. Bjornsson
make stat(2) return st_blocksize thats a bit closer to reality. From NetBSD; OK art@, beck@, tedu@
2007-11-05deinline nfs_attrtimeo(); and remove some associatedThordur I. Bjornsson
#ifdef goo. ok krw@, blambert@
2007-10-13Remove alot of dead kerberos code (add sane comments too).Thordur I. Bjornsson
Cleanup and partly redo the way we create the RPC header, by having nfsm_rpchead() do a bit more work. Right now this is pretty RPCAUTH_UNIX centric, but since it is the only auth method we support right now thats fine. Make sure we can never generate a zero xid, thats forbidden by the RFC. Misc cleanup. tested by a few.
2007-10-08shrink nfsrv_v2errmap[] and check table size more carefully to avoidTheo de Raadt
dependency on ELAST; ok miod thib
2007-10-07Make sure nfsrv_v2errmap[] really contains ELAST initialized values.Miod Vallat
2007-09-20MALLOC/FREE -> malloc/free + M_ZERO.Thordur I. Bjornsson
Uneeded includes and casts... ok krw@
2007-04-19Replace the nfskevq_lock lockmgr lock with rwlock.Thordur I. Bjornsson
Replace nfs_kqinit() wich just calls lockinit with RWLOCK_INITALIZER. Assorted cleanup. ok tedu@ "reads good" art@
2007-04-13remove some unneeded externs and unused declerations.Thordur I. Bjornsson
There's no need to extern stuff thats declared in the same file. ok tedu@
2006-12-29Avoid void * arithmetic, okay deraadt@, suggestions from millert@Pedro Martelletto
2006-11-01move the declaration of nfsstats from nfs_bio.c toThordur I. Bjornsson
nfs_subs.c so it gets pulled in for NFSSERVER only kernels. ok deraadt@,krw@