diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-01-24 13:54:37 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-01-24 18:46:48 -0500 |
commit | 40dd4b7aee1a8c3b8dac7b67ba710692d7691b77 (patch) | |
tree | 43d0c0de69e2d95331f62e1150dcfab70f5ec5b2 /fs/nfs/pnfs.h | |
parent | b4019c0e219bb1301865f8b2efedb4773526ed91 (diff) | |
download | linux-40dd4b7aee1a8c3b8dac7b67ba710692d7691b77.tar.gz linux-40dd4b7aee1a8c3b8dac7b67ba710692d7691b77.tar.bz2 linux-40dd4b7aee1a8c3b8dac7b67ba710692d7691b77.zip |
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>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 9ae5b765b073..a98d8fd9637f 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -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) { } |