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:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user