summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_serv.c
AgeCommit message (Collapse)Author
2010-09-09Rename lookup/relookup to vfs_lookup/vfs_relookup.Thordur I. Bjornsson
OK oga@, beck@, matthew@
2010-03-29Initialize various uninitialized variables. Found by jsg@ via Clang.Kenneth R Westerback
Feedback from miod@ and kettenis@. ok beck@
2009-10-19antsyJonathan Gray
no binary change apart from nfsm_reqhead() which is clearly correct. ok thib@
2009-08-30if nfs_namei() fails, there's no ni_startdir and the pathname buffer hasThordur I. Bjornsson
already been freed, thus make the callers of nfs_namei() bail out early, instead of jumping to nfsmout as there they will try to vrele() vnodes that don't exists (NULL pointers) and free the pathname buffer. this is way nicer then adding checks after the nfsmout label. OK blambert@
2009-08-14Avoid double-release of vnodes in several functionsBret Lambert
ok thib@
2009-08-14Initialize len variable; found by Martynas VenckusBret 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-11Fix a few bugs in nfsrv_rename() error recovery code.Thordur I. Bjornsson
- Prevent a double vrele() by setting the vnode pointer to NULL. - Check if vnode pointers have been set to NULL before trying to vrele(). - don't double free the component path name buffer. - Add a workaround for multiple vnode pointers all pointing to the same vnode and the code doing vrele() on all of them, leading to botched refcounts. This is a horrible hack, but a real fix is being worked on. OK blambert@
2009-08-10AnotherBret Lambert
error = operation(); memory = malloc(); if (error) free(memory); gets relegated to the dustbin of history ok thib@
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-09MLEN < NFS_MAXPATHLEN < MCLBYTES, so there's no need toBret Lambert
loop over allocating a chain of mbufs to store <= NFS_MAXPATHLEN bytes. Clean up some variables, which thib@ likes. ok thib@
2009-08-09error = operation();Bret Lambert
memory = malloc(); if (error) free(memory); makes no sense; move error checking to above memory allocation ok thib@
2009-08-09set the mrq pointer (request) in the nfsm_reply() macro, as we can return ↵Thordur I. Bjornsson
from it. This can cause us to follow garbage in the nfsd loop, causing two kinds of hell. problem noticed by nicm@. 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-17Initialize a variable that was previously using a mystery value inBret Lambert
some error cases ok thib@
2009-06-06Don't allocate an mbuf cluster without checking to see if it willBret Lambert
actually get us anything. ok thib@
2009-06-06Consolidate error handling in read case.Bret Lambert
ok thib@
2009-06-06Consolidate error handling code. Much less atrocious than before.Bret Lambert
"get it in" thib@
2009-06-05bring back rev1.70Thordur I. Bjornsson
2009-06-05revert to 1.67 to unbreak NFS writes; ok beck@ thib@Christian Weisgerber
2009-06-05EPERM from VOP_ACCESS() is always an error, so don't hide it.Thordur I. Bjornsson
Diff from FreeBSD. OK blambert@
2009-06-04the following:Bret Lambert
error = foo(); if (!error) bar(); is an alien construct; replace with one from this planet ok thib@
2009-06-04Move code that logically belongs together to be together.Bret Lambert
ok thib@
2009-05-21IO_METASYNC has been a noop since around 4.4BSD-Lite, theThordur I. Bjornsson
idea never really caught on anywhere so retire it. "gank this shizzle", 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-03-15Introduce splsoftassert(), similar to splassert() but for soft interruptMiod Vallat
levels. This will allow for platforms where soft interrupt levels do not map to real hardware interrupt levels to have soft ipl values overlapping hard ipl values without breaking spl asserts.
2009-01-27Correct my timeradd() thinko in nfsrv_writegather()Bret Lambert
pointed out by bluhm@, "obvious" thib@
2009-01-24Use a timespec for the server write deadline and procrastinationThordur I. Bjornsson
timeouts. Rrids us of the ugly cur_sec variable, and some shadows. Also helps with granularity. Diff from blambert@ who asked me to commit this since he's away for some days and we wanted to put this in with the timespec changes in the nfsnode.
2009-01-18Perform the same access enforcements for set attributesThordur I. Bjornsson
as for open/read/write etc, that is assume that the file as already been opened proper, this fixes an ancient ftruncate bug, that is if ftruncate was called on a file with no write modes, we'd return EACCES, this breaks posixy behavior. however, for e.g. truncate() we'll return EACCESS as we should. Diff from PR5880 by mickey. I had forgotten about this PR, and the fix but niklas@ ran into similar issues which prompted another review of this. OK kettenis@
2008-12-24Low hanging macro fruit. Inline the nfsm_srvstrsiz macro sinceThordur I. Bjornsson
its used only once and nuke its definition. Stolen from blambert's bag'o'diffs. OK blambert@.
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-07-06remove #ifndef nolint gooThordur I. Bjornsson
ok blambert@
2008-06-15unroll the NFSMADV() macro and nuke itThordur 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-14use nfsm_padlen() where appropriate;Thordur I. Bjornsson
ok blambert@
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-11Canonical for() -> queue.h FOREACH macro conversions.Bret Lambert
Also, it is historical practice to #include <sys/queue.h> when using queue.h macros. ok thib@ krw@ special thanks to krw@ for reminders vice violence
2008-05-27Remove bloated and nasty nfsm_clget macro; while here, replace someBret Lambert
handrolled loops with nfsm_strtombuf and nfsm_buftombuf. ok deraadt@ via thib@; ok 'nfs buddy' thib@ testing johan@, merdely@; thanks
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-03-16Widen some struct statfs fields to support large filesystem stataOtto Moerbeek
and add some to be able to support statvfs(2). Do the compat dance to provide backward compatibility. ok thib@ miod@
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-27Fix for PR5365.Thordur I. Bjornsson
Use the va_blocksize, that is the blocksize of the underlying exported file system instead of the DIRBLKSIZ constant to size the chunks. Diff from Enache Adrian <3n4ch3@gmail.com> Tested by myself and a few others.
2007-11-08Fix unsafe queue macro useBret Lambert
ok thib@ 'emphatic' ok beck@
2007-11-07more low hanging fruit; Expand the nfsm_srvwcc_data() macroThordur I. Bjornsson
and nuke it's definition. OK krw@, blamers@
2007-11-06Expand the nfsm_srvfillattr() macro andThordur I. Bjornsson
nuke it's definition. OK krw@, blambert@
2007-10-28Remove the "frev" argument from nfs_rephead(); and clean up the "frev"Thordur I. Bjornsson
variables, that are declared all over, since they are passed via macros to nfs_rephead(); which doesn't do anything with it. OK krw@
2007-09-20MALLOC/FREE -> malloc/free + M_ZERO.Thordur I. Bjornsson
Uneeded includes and casts... ok krw@