aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-11-26NFS: make nfs_wb_page_priority() staticAdrian Bunk1-1/+0
nfs_wb_page_priority() can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-19NFS: Fix a race in sillyrenameTrond Myklebust1-0/+8
lookup() and sillyrename() can race one another because the sillyrename() completion cannot take the parent directory's inode->i_mutex since the latter may be held by whoever is calling dput(). We therefore have little option but to add extra locking to ensure that nfs_lookup() and nfs_atomic_open() do not race with the sillyrename completion. If somebody has looked up the sillyrenamed file in the meantime, we just transfer the sillydelete information to the new dentry. Please refer to the bug-report at http://bugzilla.linux-nfs.org/show_bug.cgi?id=150 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Add a boot parameter to disable 64 bit inode numbersTrond Myklebust1-0/+1
This boot parameter will allow legacy 32-bit applications which call stat() to continue to function even if the NFSv3/v4 server uses 64-bit inode numbers. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09[23/37] Clean up duplicate includes inJesper Juhl1-2/+0
Hi, This patch cleans up duplicate includes in include/linux/nfs_fs.h Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Get rid of some obsolete macrosTrond Myklebust1-4/+0
- NFS_READTIME, NFS_CHANGE_ATTR are completely unused. - Inline the few remaining uses of NFS_ATTRTIMEO, and remove. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFSv4: Fix nfs_atomic_open() to set the verifier on negative dentries tooTrond Myklebust1-0/+5
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Remove nfs_begin_data_update/nfs_end_data_updateTrond Myklebust1-12/+0
The lower level routines in fs/nfs/proc.c, fs/nfs/nfs3proc.c and fs/nfs/nfs4proc.c should already be dealing with the revalidation issues. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Remove NFS_I(inode)->data_updatesTrond Myklebust1-8/+6
We have no more users... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: NFS_CACHEINV() should not test for nfs_caches_unstable()Trond Myklebust1-6/+0
The fact that we're in the process of modifying the inode does not mean that we should not invalidate the attribute and data caches. The defensive thing is to always invalidate when we're confronted with inode mtime/ctime or change_attribute updates that we do not immediately recognise. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: nfs_mark_for_revalidate don't update cache_change_attributeTrond Myklebust1-3/+1
Just let the subsequent inode revalidation do the update... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Fix nfs_verify_change_attribute()Trond Myklebust1-7/+7
We don't care about whether or not some other process on our client is changing the directory while we're in nfs_lookup_revalidate(), because the dcache will take care of ensuring local atomicity. We can therefore remove the test for nfs_caches_unstable(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Fix the sign of the return value of nfs_save_change_attribute()Trond Myklebust1-3/+3
Also fix up the comments. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Fake up 'wcc' attributes to prevent cache invalidation after writeTrond Myklebust1-0/+1
NFSv2 and v4 don't offer weak cache consistency attributes on WRITE calls. In NFSv3, returning wcc data is optional. In all cases, we want to prevent the client from invalidating our cached data whenever ->write_done() attempts to update the inode attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Fix atime revalidation in readdir()Trond Myklebust1-0/+1
NFSv3 will correctly update atime on a readdir call, so there is no need to set the NFS_INO_INVALID_ATIME flag unless the call to nfs_refresh_inode() fails. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Don't force a dcache revalidation if nfs_wcc_update_inode succeedsTrond Myklebust1-1/+3
The reason is that if the weak cache consistency update was successful, then we know that our client must be the only one that changed the directory, and we've already updated the dcache to reflect the change. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: fix nfs_verify_change_attributeTrond Myklebust1-1/+1
We always want to check that the verifier and directory cache_change_attribute match. This also allows us to remove the 'wraparound hack' for the cache_change_attribute. If we're only checking for equality, then we don't care about wraparound issues. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFSv4: Simplify _nfs4_do_access()Trond Myklebust1-3/+2
Currently, _nfs4_do_access() is just a copy of nfs_do_access() with added conversion of the open flags into an access mask. This patch merges the duplicate functionality. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Replace file->private_data with calls to nfs_file_open_context()Trond Myklebust1-6/+2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Add a helper to extract the nfs_open_context from a struct fileTrond Myklebust1-0/+5
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Fall back to synchronous writes when a background write errors...Trond Myklebust1-0/+3
This helps prevent huge queues of background writes from building up whenever the server runs out of disk or quota space, or if someone changes the file access modes behind our backs. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Clean up NFS writeback flush codeTrond Myklebust1-1/+1
The only user of nfs_sync_mapping_range() is nfs_getattr(), which uses it to flush out the entire inode without sending a commit. We therefore replace nfs_sync_mapping_range with a more appropriate helper. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-10-09NFS: Clean up write code...Trond Myklebust1-1/+0
The addition of nfs_page_mkwrite means that We should no longer need to create requests inside nfs_writepage() Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-09-01NFS: Fix a write request leak in nfs_invalidate_page()Trond Myklebust1-0/+1
Ryusuke Konishi says: The recent truncate_complete_page() clears the dirty flag from a page before calling a_ops->invalidatepage(), ^^^^^^ static void truncate_complete_page(struct address_space *mapping, struct page *page) { ... cancel_dirty_page(page, PAGE_CACHE_SIZE); <--- Inserted here at kernel 2.6.20 if (PagePrivate(page)) do_invalidatepage(page, 0); ---> will call a_ops->invalidatepage() ... } and this is disturbing nfs_wb_page_priority() from calling nfs_writepage_locked() that is expected to handle the pending request (=nfs_page) associated with the page. int nfs_wb_page_priority(struct inode *inode, struct page *page, int how) { ... if (clear_page_dirty_for_io(page)) { ret = nfs_writepage_locked(page, &wbc); if (ret < 0) goto out; } ... } Since truncate_complete_page() will get rid of the page after a_ops->invalidatepage() returns, the request (=nfs_page) associated with the page becomes a garbage in nfs_inode->nfs_page_tree. ------------------------ Fix this by ensuring that nfs_wb_page_priority() recognises that it may also need to clear out non-dirty pages that have an nfs_page associated with them. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-08-07NFS: Fix put_nfs_open_contextTrond Myklebust1-1/+1
We need to grab the inode->i_lock atomically with the last reference put in order to remove the open context that is being freed from the nfsi->open_files list. Fix by converting the kref to a standard atomic counter and then using atomic_dec_and_lock()... Thanks to Arnd Bergmann for pointing out the problem. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-19SUNRPC: Clean up the sillyrename codeTrond Myklebust1-2/+2
Fix a couple of bugs: - Don't rely on the parent dentry still being valid when the call completes. Fixes a race with shrink_dcache_for_umount_subtree() - Don't remove the file if the filehandle has been labelled as stale. Fix a couple of inefficiencies - Remove the global list of sillyrenamed files. Instead we can cache the sillyrename information in the dentry->d_fsdata - Move common code from unlink_setup/unlink_done into fs/nfs/unlink.c Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Remake nfsroot_mount as a permanent part of NFS clientChuck Lever1-3/+2
In preparation for supporting NFSv2 and NFSv3 mount option handling in the kernel NFS client, convert mount_clnt.c to be a permanent part of the NFS client, instead of built only when CONFIG_ROOT_NFS is enabled. In addition, we also replace the "struct sockaddr_in *" argument with something more generic, to help support IPv6 at some later point. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Add a new NFS debugging flag just for mount processingChuck Lever1-0/+1
Note to self: fix up /usr/sbin/rpcdebug too Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Clean up nfs_size_to_loff_t()Chuck Lever1-5/+3
Use the same file size limit that lockd uses. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Defer inode revalidation when setting up a delegationTrond Myklebust1-0/+1
Currently we force a synchronous call to __nfs_revalidate_inode() in nfs_inode_set_delegation(). This not only ensures that we cannot call nfs_inode_set_delegation from an asynchronous context, but it also slows down any call to open(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Replace NFS_I(inode)->req_lock with inode->i_lockTrond Myklebust1-1/+0
There is no justification for keeping a special spinlock for the exclusive use of the NFS writeback code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Convert struct nfs_open_context to use a krefTrond Myklebust1-1/+2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Prevent integer overflow in nfs_scan_list()Trond Myklebust1-1/+1
Also ensure that nfs_inode ncommit and npages are large enough to represent all possible values for the number of pages. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Remove the redundant 'dirty' and 'commit' lists from nfs_inodeTrond Myklebust1-4/+1
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Replace vfsmount and dentry in nfs_open_context with struct pathTrond Myklebust1-2/+2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-04-30NFS: Fix a buffer overflow in the allocation of struct nfs_read/writedataTrond Myklebust1-2/+2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-03-16[PATCH] nfs: fix congestion controlPeter Zijlstra1-0/+1
The current NFS client congestion logic is severly broken, it marks the backing device congested during each nfs_writepages() call but doesn't mirror this in nfs_writepage() which makes for deadlocks. Also it implements its own waitqueue. Replace this by a more regular congestion implementation that puts a cap on the number of active writeback pages and uses the bdi congestion waitqueue. Also always use an interruptible wait since it makes sense to be able to SIGKILL the process even for mounts without 'intr'. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Christoph Lameter <clameter@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12Merge branch 'master' of /home/trondmy/kernel/linux-2.6/Trond Myklebust1-7/+7
Conflicts: net/sunrpc/auth_gss/gss_krb5_crypto.c net/sunrpc/auth_gss/gss_spkm3_token.c net/sunrpc/clnt.c Merge with mainline and fix conflicts.
2007-02-12[PATCH] mark struct inode_operations const 3Arjan van de Ven1-7/+7
Many struct inode_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-03NFS: move NFS_DEBUG definitionBenny Halevy1-8/+9
Trond, looks like the changes to include/linux/nfs_fs.h in 2.6.18 that moved the #include's of sunrpc header files into the #ifdef __KERNEL__ block disabled nfs debugging for all nfs c file not including any sunrpc header. The following patch moves the definition down, right before its use for defining ifdebug. Signed-off-by: Benny Halevy <bhalevy@panasas.com> (Moved definition further down into the __KERNEL__ section: Trond) Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-01-24[PATCH] NFS: Fix races in nfs_revalidate_mapping()Trond Myklebust1-0/+1
Prevent the call to invalidate_inode_pages2() from racing with file writes by taking the inode->i_mutex across the page cache flush and invalidate. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-12-06NFS: Ensure we only call set_page_writeback() under the page lockTrond Myklebust1-0/+1
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-06NFS: Ensure that nfs_wb_page() calls writepage when necessary.Trond Myklebust1-0/+1
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-06NFS: Add nfs_set_page_dirty()Trond Myklebust1-0/+1
We will want to allow nfs_writepage() to distinguish between pages that have been marked as dirty by the VM, and those that have been marked as dirty by nfs_updatepage(). In the former case, the entire page will want to be written out, and so any requests that were pending need to be flushed out first. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-06NFS: cleanup of nfs_sync_inode_wait()Trond Myklebust1-23/+4
Allow callers to directly pass it a struct writeback_control. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-06NFS: Clean up nfs_scan_dirty()Trond Myklebust1-1/+1
Pass down struct writeback control. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-06SUNRPC: Fix a potential race in rpc_wake_up_task()Trond Myklebust1-5/+2
Use RCU to ensure that we can safely call rpc_finish_wakeup after we've called __rpc_do_wake_up_task. If not, there is a theoretical race, in which the rpc_task finishes executing, and gets freed first. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2006-12-02[NET]: ipconfig and nfsroot annotationsAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-10-20[PATCH] nfs: verifier is network-endianAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-20[PATCH] NFS: Deal with failure of invalidate_inode_pages2()Trond Myklebust1-0/+1
If invalidate_inode_pages2() fails, then it should in principle just be because the current process was signalled. In that case, we just want to ensure that the inode's page cache remains marked as invalid. Also add a helper to allow the O_DIRECT code to simply mark the page cache as invalid once it is finished writing, instead of calling invalidate_inode_pages2() itself. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-01[PATCH] Vectorize aio_read/aio_write fileop methodsBadari Pulavarty1-4/+6
This patch vectorizes aio_read() and aio_write() methods to prepare for collapsing all aio & vectored operations into one interface - which is aio_read()/aio_write(). Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Michael Holzheu <HOLZHEU@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>