NFS: Use an atomic_long_t to count the number of requests

Rather than forcing us to take the inode->i_lock just in order to bump
the number.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Trond Myklebust
2017-08-01 15:39:46 -04:00
parent e824f99ada
commit a6b6d5b85a
6 changed files with 13 additions and 24 deletions

View File

@@ -154,7 +154,7 @@ struct nfs_inode {
*/
__be32 cookieverf[2];
unsigned long nrequests;
atomic_long_t nrequests;
struct nfs_mds_commit_info commit_info;
/* Open contexts for shared mmap writes */
@@ -511,7 +511,7 @@ extern void nfs_commit_free(struct nfs_commit_data *data);
static inline int
nfs_have_writebacks(struct inode *inode)
{
return NFS_I(inode)->nrequests != 0;
return atomic_long_read(&NFS_I(inode)->nrequests) != 0;
}
/*