NFSv4.1: Optimise layout return-on-close

Optimise the layout return on close code by ensuring that

1) Add a check for whether we hold a layout before taking any spinlocks
2) Only take the spin lock once
3) Use nfs_state->state to speed up open file checks

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Trond Myklebust
2015-01-24 13:54:37 -05:00
parent b4019c0e21
commit 40dd4b7aee
3 changed files with 31 additions and 40 deletions

View File

@@ -275,6 +275,11 @@ void nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node);
bool nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node);
void nfs4_deviceid_purge_client(const struct nfs_client *);
static inline bool nfs_have_layout(struct inode *inode)
{
return NFS_I(inode)->layout != NULL;
}
static inline struct nfs4_deviceid_node *
nfs4_get_deviceid(struct nfs4_deviceid_node *d)
{
@@ -427,6 +432,11 @@ static inline void nfs4_print_deviceid(const struct nfs4_deviceid *dev_id)
#endif /* NFS_DEBUG */
#else /* CONFIG_NFS_V4_1 */
static inline bool nfs_have_layout(struct inode *inode)
{
return false;
}
static inline void pnfs_destroy_all_layouts(struct nfs_client *clp)
{
}