summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* NFS: Clean up - Rename nfs_unlock_request and nfs_unlock_request_dont_releaseTrond Myklebust2012-05-093-16/+17
| | | | | | | | | Function rename to ensure that the functionality of nfs_unlock_request() mirrors that of nfs_lock_request(). Then let nfs_unlock_and_release_request() do the work of what used to be called nfs_unlock_request()... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Clean up - simplify nfs_lock_request()Trond Myklebust2012-05-092-5/+7
| | | | | | | | We only have two places where we need to grab a reference when trying to lock the nfs_page. We're better off making that explicit. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: nfs_set_page_writeback no longer needs to reference the pageTrond Myklebust2012-05-091-8/+3
| | | | | | | | | We now hold a reference to the nfs_page across the calls to nfs_set_page_writeback and nfs_end_page_writeback, and that means we already have a reference to the struct page. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Prevent a deadlock in the new writeback codeTrond Myklebust2012-05-092-4/+14
| | | | | | | | | | | | | | | | We have to unlock the nfs_page before we call nfs_end_page_writeback to avoid races with functions that expect the page to be unlocked when PG_locked and PG_writeback are not set. The problem is that nfs_unlock_request also releases the nfs_page, causing a deadlock if the release of the nfs_open_context triggers an iput() while the PG_writeback flag is still set... The solution is to separate the unlocking and release of the nfs_page, so that we can do the former before nfs_end_page_writeback and the latter after. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFSv4: nfs_client_return_marked_delegations can't flush dataTrond Myklebust2012-05-081-3/+7
| | | | | | | | | Since even filemap_flush() needs to lock pages that are dirty, we cannot risk calling it from the state manager context. Therefore, we need to move the call to filemap_flush() to nfs_async_inode_return_delegation(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: nfs_inode_return_delegation() should always flush dirty dataTrond Myklebust2012-05-082-1/+6
| | | | | | | | The assumption is that if you are in a situation where you need to return the delegation, then you should probably stop caching the data anyway. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't do a full flush to disk on close() if we hold a delegationTrond Myklebust2012-05-081-0/+7
| | | | | | | | | | If we hold a delegation then we know that it should be safe to continue to cache the data beyond the close(). However since the process that wrote the data may die after close(), we may still want to send the data to server before those RPCSEC_GSS credentials expire. We therefore compromise by starting writeback to the server, but don't wait for completion. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix sparse warningsTrond Myklebust2012-05-043-3/+3
| | | | | | | | | | | | | | | | Fix the following sparse warnings: fs/nfs/direct.c:221:6: warning: symbol 'nfs_direct_readpage_release' was not declared. Should it be static? fs/nfs/read.c:38:43: warning: non-ANSI function declaration of function 'nfs_readhdr_alloc' fs/nfs/objlayout/objio_osd.c:214:5: warning: symbol '__alloc_objio_seg' was not declared. Should it be static? Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com> Cc: Boaz Harrosh <bharrosh@panasas.com>
* NFS: Fix O_DIRECT compile warningsTrond Myklebust2012-05-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following compile warnings: fs/nfs/direct.c: In function 'nfs_direct_read_schedule_segment': fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:352:27: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c: In function 'nfs_direct_write_schedule_segment': fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:650:27: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
* NFS: Adapt readdirplus to application usage patternsTrond Myklebust2012-05-012-4/+31
| | | | | | | | | | | | | | | | | | | | | | While the use of READDIRPLUS is significantly more efficient than READDIR followed by many LOOKUP calls, it is still less efficient than just READDIR if the attributes are not required. This patch tracks when lookups are attempted on the directory, and uses that information to selectively disable READDIRPLUS on that directory. The first 'readdir' call is always served using READDIRPLUS. Subsequent calls only use READDIRPLUS if there was a successful lookup or revalidation on a child in the mean time. Credit for the original idea should go to Neil Brown. See: http://www.spinics.net/lists/linux-nfs/msg19996.html However, the implementation in this patch differs from Neil's in that it focuses on tracking lookups rather than calls to stat(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Neil Brown <neilb@suse.de>
* NFSv4: COMMIT does not need post-op attributesTrond Myklebust2012-05-012-16/+2
| | | | | | | No attributes are supposed to change during a COMMIT call, so there is no need to request post-op attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Don't request cache consistency attributes on some writesTrond Myklebust2012-05-011-2/+17
| | | | | | | We don't need cache consistency information when we're doing O_DIRECT writes. Ditto for the case of delegated writes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Simplify the NFSv4 REMOVE, LINK and RENAME compoundsTrond Myklebust2012-05-012-64/+7
| | | | | | | Get rid of the post-op GETATTR on the directory in order to reduce the amount of processing done on the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Simplify the NFSv4 CREATE compoundTrond Myklebust2012-05-012-22/+1
| | | | | | | Get rid of the post-op GETATTR on the directory in order to reduce the amount of processing done on the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Simplify the NFSv4 OPEN compoundTrond Myklebust2012-05-012-27/+2
| | | | | | | | | | Get rid of the post-op GETATTR on the directory in order to reduce the amount of processing done on the server. The cost is that if we later need to stat() the directory, then we know that the ctime and mtime are likely to be invalid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Simplify the cache invalidation codeTrond Myklebust2012-05-011-26/+3
| | | | | | | | | Now that NFSv2 and NFSv3 have simulated change attributes, instead of using all three of mtime, ctime and change attribute to manage data cache consistency, we can simplify the code to just use the change attribute. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv2/v3: Simulate the change attributeTrond Myklebust2012-05-014-1/+18
| | | | | | Use the ctime to simulate a change attribute for NFSv2 and NFSv3. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Change attribute updates should set NFS_INO_REVAL_PAGECACHETrond Myklebust2012-05-011-1/+5
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Simplify nfs_fhget()Trond Myklebust2012-05-011-17/+6
| | | | | | | | | If the inode is being initialised, there is no point in setting flags such as NFS_INO_INVALID_ACCESS, NFS_INO_INVALID_ACL or NFS_INO_INVALID_DATA since there are no cached access calls, acls or data caches to invalidate. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Always trust the PageUptodate flag when we have a delegationTrond Myklebust2012-05-011-3/+7
| | | | | | | We can always use the optimal full page write if we know that we hold a delegation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Optimise away nfs_check_inode_attributes() when holding a delegationTrond Myklebust2012-05-011-0/+2
| | | | | | We already know that the attribute cache is valid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't force page cache revalidations when holding a delegationTrond Myklebust2012-05-011-3/+10
| | | | | | | If we're holding a delegation, then we already know that our page cache is valid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Retrieve attributes _before_ calling delegreturnTrond Myklebust2012-05-012-6/+7
| | | | | | | | | | | | In order to retrieve cache consistency attributes before anyone else has a chance to change the inode, we need to put the GETATTR op _before_ the DELEGRETURN op. We can then use that as part of a 'nfs_post_op_update_inode_force_wcc()' call, to ensure that we update the attributes without clearing our cached data. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Delegreturn only needs the cache consistency bitmaskTrond Myklebust2012-05-011-1/+1
| | | | | | | | In order to do close-to-open cache consistency checking after a delegreturn, we don't need to retrieve the full set of attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix a typo in NFS4_enc_link_szTrond Myklebust2012-05-011-2/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Simplify the nfs_read_completion functionsTrond Myklebust2012-05-012-54/+38
| | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Clean up nfs read and write error pathsTrond Myklebust2012-05-013-42/+44
| | | | | | | | Move the error handling for nfs_generic_pagein() into a single function. Ditto for nfs_generic_flush(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Read cleanupsTrond Myklebust2012-05-011-9/+4
| | | | | | | Remove unused variables, and reformat some code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Use kmem_cache_zalloc() in nfs_direct_req_allocTrond Myklebust2012-04-301-11/+1
| | | | | | | Simplify the initialisation of O_DIRECT requests. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Simplify O_DIRECT page referencingTrond Myklebust2012-04-301-16/+6
| | | | | | | | The O_DIRECT code shouldn't need to hold 2 references to each page. The reference held by the struct nfs_page should suffice. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: O_DIRECT pgio_completion_ops error_cleanup must unlock the requestTrond Myklebust2012-04-301-3/+15
| | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Ensure that we break out of read/write_schedule_segment on errorTrond Myklebust2012-04-301-2/+3
| | | | | | | | Currently we do break out of the for() loop, but we also need to break out of the enclosing do {} while()... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* NFS: Define dummy nfs_init_cinfo() and nfs_init_cinfo_from_inode()Bryan Schumaker2012-04-301-0/+11
| | | | | | | These are needed when v3 and v4 are not enabled. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Define nfs_direct_write_schedule_work() when v3 and v4 are disabledBryan Schumaker2012-04-301-0/+3
| | | | | | | v2 doesn't have commits, so this function can be a no-op. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: pnfs_pageio_init_read() and init_write() need an extra argumentBryan Schumaker2012-04-301-2/+4
| | | | | | | | This is only when CONFIG_NFS_V4_1 isn't enabled. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Acked-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a use-before-initialised warning in fs/nfs/write.c and fs/nfs/pnfs.cTrond Myklebust2012-04-272-2/+2
| | | | | | | | | If the allocation of nfs_write_header fails, the list of nfs_pages that needs to be cleaned up is still on desc->pg_list... Reported-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: Fred Isaman <iisaman@netapp.com>
* NFS: Remove extra rpc_clnt argument to proc_lookupBryan Schumaker2012-04-275-8/+7
| | | | | | | | Now that I'm doing secinfo automatically in the v4 code this extra argument isn't needed. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a submount rpc_opBryan Schumaker2012-04-277-67/+52
| | | | | | | | This simplifies the code for v2 and v3 and gives v4 a chance to decide on referrals without needing to modify the generic client. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove secinfo knowledge out of the generic clientBryan Schumaker2012-04-275-33/+30
| | | | | | | And also remove the unneeded rpc_op. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Prevent garbage cinfo->ds from leaking outFred Isaman2012-04-271-1/+6
| | | | | | | | This is a bugfix that applies on top of the previous directio patches, that fixes a bug introduced in "NFS: create struct nfs_commit_info". Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: rewrite directio write to use async coalesce codeFred Isaman2012-04-275-323/+319
| | | | | | | This also has the advantage that it allows directio to use pnfs. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: avoid some stat gathering for direct ioFred Isaman2012-04-271-6/+12
| | | | | Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: add dreq to nfs_commit_infoFred Isaman2012-04-271-0/+2
| | | | | | | | Need this to pass into nfs_commitdata_init, in order to keep data->dreq accurate. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: create nfs_commit_completion_opsFred Isaman2012-04-273-21/+27
| | | | | | | | Factors out the code that needs to change when directio starts using these code paths. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: create struct nfs_commit_infoFred Isaman2012-04-276-161/+220
| | | | | | | | | | | | | | It is COMMIT that is handled the most differently between the paged and direct paths. Create a structure that encapsulates everything either path needs to know about the commit state. We could use void to hide some of the layout driver stuff, but Trond suggests pulling it out to ensure type checking, given the huge changes being made, and the fact that it doesn't interfere with other drivers. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: create nfs_generic_commit_listFred Isaman2012-04-271-3/+12
| | | | | | | Simple refactoring. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: rewrite directio read to use async coalesce codeFred Isaman2012-04-274-142/+135
| | | | | | | This also has the advantage that it allows directio to use pnfs. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: prepare coalesce testing for directioFred Isaman2012-04-273-2/+22
| | | | | | | | | The coalesce code made assumptions that will no longer be true once non-page aligned io occurs. This introduces no change in current behavior, but allows for more general situations to come. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: remove unused wb_complete field from struct nfs_pageFred Isaman2012-04-272-2/+0
| | | | | Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: create completion structure to pass into page_init functionsFred Isaman2012-04-276-51/+85
| | | | | | | | | Factors out the code that will need to change when directio starts using these code paths. This will allow directio to use the generic pagein and flush routines Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
OpenPOWER on IntegriCloud