summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* NFS: Allocate parsed mount data directly to the nfs_mount_info structureBryan Schumaker2012-05-141-9/+7
| | | | | Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a single nfs_validate_mount_data() functionBryan Schumaker2012-05-141-6/+30
| | | | | | | | This new function chooses between the v2/3 parser and the v4 parser by filesystem type. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a single function for text mount dataBryan Schumaker2012-05-142-81/+71
| | | | | | | | The v2/3 and v4 cases were very similar, with just a few parameters changed. This makes it easy to share code. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a new nfs_try_mount()Bryan Schumaker2012-05-141-19/+27
| | | | | | | | This function returns the same same return type as nfs4_try_mount() so they two can be more easily substituted. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Let mount data parsing set the NFS versionBryan Schumaker2012-05-141-4/+3
| | | | | | | | This field is unconditionally set while parsing mount data, so there is no need to fill it in here. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use nfs_fs_mount_common() for remote referral mountsBryan Schumaker2012-05-141-76/+13
| | | | | Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use nfs_fs_mount_common() for xdev mountsBryan Schumaker2012-05-141-67/+29
| | | | | | | | | At this point, there are only a few small differences between these two functions. I can set a few function pointers in the nfs_mount_info struct to get around these differences. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a common xdev_mount() functionBryan Schumaker2012-05-141-90/+32
| | | | | | | | | | The only difference between nfs_xdev_mount() and nfs4_xdev_mount() is the clone_super() function called to clone the super block. I can combine these two functions by using the fill_super field in the mount_info structure. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a common fs_mount() functionBryan Schumaker2012-05-141-109/+76
| | | | | | | | | | The nfs4_remote_mount() function was only slightly different from the nfs_fs_mount() function used by the generic client. I created a new nfs_mount_info structure to set different parameters to help combine these functions. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove NFS4_MOUNT_UNSHAREDBryan Schumaker2012-05-141-3/+3
| | | | | | | | This flag is numerically equivalent to NFS_MOUNT_UNSHARED, so I can remove it to make collapsing functions more straightforward. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't pass mount data to nfs_fscache_get_super_cookie()Bryan Schumaker2012-05-143-21/+29
| | | | | | | | | | I intend on creating a single nfs_fs_mount() function used by all our mount paths. To avoid checking between new mounts and clone mounts, I instead pass both structures to a new function in super.c that finds the cache key and then looks up the super cookie. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Create a single nfs_get_root()Bryan Schumaker2012-05-143-87/+30
| | | | | | | | | | | | | | This patch splits out the NFS v4 specific functionality of nfs4_get_root() into its own rpc_op called by the generic client, and leaves nfs4_proc_get_rootfh() as its own stand alone function. This also allows me to change nfs4_remote_mount(), nfs4_xdev_mount() and nfs4_remote_referral_mount() to use the generic client's nfs_get_root() function. Later patches in this series will collapse these functions into one common function, so using the same get_root() function everywhere simplifies future changes. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Rename nfs4_proc_get_root()Bryan Schumaker2012-05-143-4/+5
| | | | | | | | | | This function is really getting the root filehandle and not the root dentry of the filesystem. I also removed the rpc_ops lookup from nfs4_get_rootfh() under the assumption that if we reach this function then we already know we are using NFS v4. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up - Simplify reference counting in fs/nfs/direct.cTrond Myklebust2012-05-091-11/+4
| | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
* 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>
OpenPOWER on IntegriCloud