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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user