aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Make vm_page's PG_ZERO flag immutable between the time of the page'sAlan Cox2004-05-061-2/+0
| | | | | | | | | | | | | allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@ Notes: svn path=/head/; revision=128992
* Let the NFS client notice a file's size changing as a modification.Peter Edwards2004-04-143-3/+13
| | | | | | | | | | | | This avoids presenting invalid data to the client's applications when the file is modified, and then extended within the window of the resolution of the modifcation timestamp. Reviewed By: iedowse PR: kern/64091 Notes: svn path=/head/; revision=128263
* Unbreak build: s/TAILQ_ISEMPTY/TAILQ_EMPTY/gMarcel Moolenaar2004-04-111-1/+1
| | | | Notes: svn path=/head/; revision=128126
* Clean up properly when unloading NFS client module.Peter Edwards2004-04-114-2/+35
| | | | | | | | | | | | This includes a modified form of some code from Thomas Moestl (tmm@) to properly clean up the UMA zone and the "nfsnodehashtbl" hash table. Reviewed By: iedowse PR: 16299 Notes: svn path=/head/; revision=128111
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-0715-60/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=127977
* Spell 2 as SHUT_RDWR when used as an argument to soshutdown().Robert Watson2004-04-041-1/+1
| | | | Notes: svn path=/head/; revision=127857
* Flush cached access mode after modifying a files attributes forPeter Edwards2004-04-031-0/+2
| | | | | | | | | | | | | NFSv3. It's likely that modifying the attributes will affect the file's accessibility. This version of the patch is one suggested by Ian Dowse after reviewing my original attempt in the PR Reviewed By: iedowse PR: kern/44336 MFC after: 3 days Notes: svn path=/head/; revision=127797
* Reset callout if in nfs_timeout and rpcclnt_timeout functions. TimerAlexander Kabaev2004-03-281-0/+1
| | | | | | | | | | | | are supposed to continue firing as long as there is work to do, not stop after the first invocation. This is damage control after a patch that has been committed prematurely. Tested by: kris Notes: svn path=/head/; revision=127515
* only do nfs rpc callouts if there is work to do.Jim Rees2004-03-253-6/+8
| | | | | | | | Submitted by: kan Approved by: alfred Notes: svn path=/head/; revision=127421
* Add a comment with an explanation why we don't report EPIPE errors onPawel Jakub Dawidek2004-03-171-0/+5
| | | | | | | | | nfs sockets. Requested by: ru Notes: svn path=/head/; revision=127144
* Don't report EPIPE errors on nfs sockets. These can be due to idle tcpPawel Jakub Dawidek2004-03-171-2/+5
| | | | | | | | | mounts which will be closed by netapp, solaris, etc. if left idle too long. Obtained from: NetBSD Notes: svn path=/head/; revision=127137
* Calculate NFS timeouts in units of 10ms, not 5ms. This matches the defaultPeter Wemm2004-03-141-1/+1
| | | | | | | | | clock precision on i386. This is a NOP change on i386. But this stops the mount_nfs units from suddenly changing to units of 1/20 of a second (vs the normal 1/10 of a second) if HZ is increased. Notes: svn path=/head/; revision=126962
* Allow kernel with the BOOTP option to boot when DHCP/BOOTP sets the rootBrooks Davis2004-03-121-11/+37
| | | | | | | | | | | | | path to an absolute path without a host name. Previously, there was a nasty POLA violation where a system would PXE boot until you added the BOOTP option and then it would panic instead. Reviewed by: tegge, Dirk-Willem van Gulik <dirkx at webweaving.org> (a previous version) Submitted by: tegge (getip function) Notes: svn path=/head/; revision=126888
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathPoul-Henning Kamp2004-03-112-3/+3
| | | | | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite(). Notes: svn path=/head/; revision=126853
* Remove unused second arg to vfinddev().Poul-Henning Kamp2004-03-111-3/+4
| | | | | | | Don't call addaliasu() on VBLK nodes. Notes: svn path=/head/; revision=126851
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherRobert Watson2004-03-011-1/+1
| | | | | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam Notes: svn path=/head/; revision=126425
* NFSv4 fixes from Connectathon 2004:Jim Rees2004-02-271-2/+0
| | | | | | | | | | | | | | | remove unused pid field of file context struct map nfs4 error codes to errnos eliminate redundant code from nfs4_request use zero stateid on setattr that doesn't set file size use same clientid on all mounts until reboot invalidate dirty bufs in nfs4_close, to play it safe open file for writing if truncating and it's not already open Approved by: alfred Notes: svn path=/head/; revision=126330
* If mountnfs returns an error, it will have already freed nam; no need toColin Percival2004-02-221-1/+0
| | | | | | | | | | free it again. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor) Notes: svn path=/head/; revision=126105
* Locking for the per-process resource limits structure.John Baldwin2004-02-041-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64 Notes: svn path=/head/; revision=125454
* Bump the NFCv3/TCP defaults for rsize and wsize from 8K to 32K to matchDavid E. O'Brien2004-01-311-5/+21
| | | | | | | | | | Solaris and HP-UX. This increases read performance for large files across NFS. PR: 62024 & 26324 Submitted by: Bjoern Groenvall <bg@sics.se> Notes: svn path=/head/; revision=125263
* Use function pointers to remove the depenancy cross dependancy on nfs4Alfred Perlstein2003-11-226-28/+36
| | | | | | | | | | | and the nfs3 client. Also fix some bugs that happen to be causing crashes in both v3 and v4 introduced by the v4 import. Submitted by: Jim Rees <rees@umich.edu> Approved by: re Notes: svn path=/head/; revision=122953
* Move the declaration for "struct nfs4_fctx" out from under #ifdef KERNELAlfred Perlstein2003-11-151-14/+14
| | | | | | | for fstat(1). Notes: svn path=/head/; revision=122736
* unbreak LINT.Alfred Perlstein2003-11-151-7/+7
| | | | Notes: svn path=/head/; revision=122719
* University of Michigan's Citi NFSv4 kernel client code.Alfred Perlstein2003-11-1416-15/+148
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=122698
* 1. Consolidate mount struct allocation/destruction into a common code inAlexander Kabaev2003-11-121-23/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | vfs_mount_alloc/vfs_mount_destroy functions and take care to completely destroy the mount point along with its locks. Mount struct has grown in coplexity recently and depending on each failure path to destroy it completely isn't working anymore. 2. Eliminate largely identical vfs_mount and vfs_unmount question by moving the code to handle both cases into a newly introduced vfs_domount function. 3. Simplify nfs_mount_diskless to always expect an allocated mount struct and never attempt an allocation/destruction itself. The vfs_allocroot allocation was there to support 'magic' swap space configuration for diskless clients that was already removed by PHK some time ago. 4. Include a vfs_buildopts cleanups by Peter Edwards to validate the sanity of nmount parameters passed from userland. Submitted by: (4) Peter Edwards <peter.edwards@openet-telecom.com> Reviewed by: rwatson Notes: svn path=/head/; revision=122523
* Stop using shared locks for nfs vop locks.Alfred Perlstein2003-11-111-3/+0
| | | | | | | | | | | | | | | | The reason this was done was to avoid a race to the root when an NFS server went down. However a semi-recent change to the way that the kernel's lookup() routine traverses mount points prevents this. Rev 1.39 of vfs_lookup.c changed the ordering of locks such that we aquire a shared lock on the mount point being accessed and then drop the directory vnode lock before requesting the target lock. With that in place we no longer need shared locks for NFS to prevent race to the root lockups. Notes: svn path=/head/; revision=122450
* Assert GIANT_REQUIRED where sockets are manipulated. This isSam Leffler2003-11-074-0/+16
| | | | | | | | | | preparatory for MPSAFE network commits and ongoing socket locking work. Supported by: FreeBSD Foundation Notes: svn path=/head/; revision=122261
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.Alexander Kabaev2003-11-052-10/+11
| | | | | | | | | | | | | Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to operate on this mutex transparently. Eventually new mutex will be protecting more fields in struct mount, not only vnode list. Discussed with: jeff Notes: svn path=/head/; revision=122091
* Take care not to call vput if thread used in corresponding vgetAlexander Kabaev2003-11-021-1/+2
| | | | | | | | | | | | | wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported. Notes: svn path=/head/; revision=121874
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-312-8/+6
| | | | | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname) Notes: svn path=/head/; revision=121816
* DuH!Poul-Henning Kamp2003-10-181-1/+1
| | | | | | | | bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in the file) Notes: svn path=/head/; revision=121205
* Initialize bp->b_offset before calling VOP_STRATEGY().Poul-Henning Kamp2003-10-182-8/+1
| | | | | | | Remove KASSERTS and panics with B_PHYS checks which no longer apply. Notes: svn path=/head/; revision=121201
* We do not get B_PHYS buffers here anymore. /dev/drum is long gone.Poul-Henning Kamp2003-10-181-24/+2
| | | | Notes: svn path=/head/; revision=121191
* Since the addition of the VI_DOINGINACT flag some time ago,Ian Dowse2003-10-051-15/+1
| | | | | | | | | | VOP_INACTIVE routines need not worry about their vnode getting recycled if they block. Remove the code from nfs_inactive() that used vget() to get an extra vnode reference that was held during the nfs_vinvalbuf() call. Notes: svn path=/head/; revision=120812
* - Remove an incorrect XXX comment. This code does respect the XLOCK sinceJeff Roberson2003-10-051-1/+0
| | | | | | | it uses vget() which will fail if the identity changes. Notes: svn path=/head/; revision=120788
* - Check the XLOCK before we inspect the vnode.Jeff Roberson2003-10-051-0/+4
| | | | Notes: svn path=/head/; revision=120787
* - We don't need to cache_purge() in nfs_reclaim(), vclean() does it for us.Jeff Roberson2003-10-051-2/+0
| | | | Notes: svn path=/head/; revision=120786
* - Consistently set sopt_dir.Jeff Roberson2003-10-043-0/+4
| | | | | | | Pointed out by: pete@isilon.com Notes: svn path=/head/; revision=120755
* - Acquire the vnode interlock prior to dropping the mntvnode_mtx.Jeff Roberson2003-10-041-1/+2
| | | | | | | | - Make a note of the lack of XLOCK protection in this code. We would access a vnode while it is changing identities without Giant. Notes: svn path=/head/; revision=120736
* - Remove the backtrace() call from the *_vinvalbuf() functions. Thanks to aJeff Roberson2003-10-041-5/+6
| | | | | | | | | | | stack trace supplied by phk, I now understand what's going on here. The check for VI_XLOCK stops us from calling vinvalbuf once the vnode has been partially torn down in vclean(). It is not clear that this would cause a problem. Document this in nfs_bio.c, which is where the other two filesystems copied this code from. Notes: svn path=/head/; revision=120730
* - Remove interlock protection around VI_XLOCK. The interlock is notJeff Roberson2003-09-191-4/+3
| | | | | | | | | | | | | | | | sufficient to guarantee that this race is not hit. The XLOCK will likely have to be redesigned due to the way reference counting and mutexes work in FreeBSD. We currently can not be guaranteed that xlock was not set and cleared while we were blocked on the interlock while waiting to check for XLOCK. This would lead us to reference a vnode which was not the vnode we requested. - Add a backtrace() call inside of INVARIANTS in the hopes of finding out if this condition is ever hit. It should not, since we should be retaining a reference to the vnode in these cases. The reference would be sufficient to block recycling. Notes: svn path=/head/; revision=120264
* Name the vnode method vectors consistently with the rest of the filesystems.Poul-Henning Kamp2003-09-124-21/+21
| | | | | | | This improves the output of src/tools/tools/vop_table Notes: svn path=/head/; revision=120003
* Remove now unused BOOTP tags related to NFS swap device.Poul-Henning Kamp2003-09-051-3/+0
| | | | Notes: svn path=/head/; revision=119766
* KNF: parentheses around return values.Diomidis Spinellis2003-09-041-4/+4
| | | | | | | | | Suggested by: bde Approved by: schweikh (mentor - blanket) MFC after: 6 weeks Notes: svn path=/head/; revision=119735
* Fix errno return values to better represent failure reasons forDiomidis Spinellis2003-09-021-4/+9
| | | | | | | | | | | read and open. Approved by: schweikh (mentor) Agreed: bde MFC after: 6 weeks Notes: svn path=/head/; revision=119687
* Remove the magic way of configuring NFS backed swap.Poul-Henning Kamp2003-08-154-243/+1
| | | | | | | | | | | | | | | | This code dates back to the very first diskless support on FreeBSD, back when swapon(8) couldn't simply be run on a NFS backed file. Suggested replacement command sequence on the client: dd if=/dev/zero of=/swapfile bs=1k count=1 oseek=100000 swapon /swapfile rm -f /swapfile For whatever value of 100000 you want. Notes: svn path=/head/; revision=118944
* 0) preallocate per-interface context structures without the ifnet lock heldBill Fumerola2003-08-071-25/+38
| | | | | | | | | | | 1) avoid immediately calling bzero() after malloc() by passing M_ZERO 2) do not initialize individual members of the global context to zero 3) remove an unused assignment of ifctx in bootpc_init() Reviewed by: tegge Notes: svn path=/head/; revision=118639
* Fix a problem that occurs when truncating files on NFSv3 mounts: we needTim J. Robbins2003-07-291-1/+7
| | | | | | | | | | | | | | | to set np->n_size back to the desired size again after calling nfs_meta_setsize(), since it could end up in nfs_loadattrcache() getting called, which would change n_size back to the value it had before the truncate request was issued. The result of this bug is that the size info cached in the nfsnode becomes incorrect, lseek(fd, ofs, SEEK_END) seeks past the end of the file, stat() returns the wrong size, etc. PR: 41792 MFC after: 2 weeks Notes: svn path=/head/; revision=118135
* Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.Poul-Henning Kamp2003-07-271-1/+1
| | | | Notes: svn path=/head/; revision=118094
* Change idle sleep indentifier to "-" for nfsiodPoul-Henning Kamp2003-07-021-1/+1
| | | | Notes: svn path=/head/; revision=117152