aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index dc52793ff8f8..d22eb383e1cf 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -908,21 +908,16 @@ static int nfs_size_need_update(const struct inode *inode, const struct nfs_fatt
908 return nfs_size_to_loff_t(fattr->size) > i_size_read(inode); 908 return nfs_size_to_loff_t(fattr->size) > i_size_read(inode);
909} 909}
910 910
911static unsigned long nfs_attr_generation_counter; 911static atomic_long_t nfs_attr_generation_counter;
912 912
913static unsigned long nfs_read_attr_generation_counter(void) 913static unsigned long nfs_read_attr_generation_counter(void)
914{ 914{
915 smp_rmb(); 915 return atomic_long_read(&nfs_attr_generation_counter);
916 return nfs_attr_generation_counter;
917} 916}
918 917
919unsigned long nfs_inc_attr_generation_counter(void) 918unsigned long nfs_inc_attr_generation_counter(void)
920{ 919{
921 unsigned long ret; 920 return atomic_long_inc_return(&nfs_attr_generation_counter);
922 smp_rmb();
923 ret = ++nfs_attr_generation_counter;
924 smp_wmb();
925 return ret;
926} 921}
927 922
928void nfs_fattr_init(struct nfs_fattr *fattr) 923void nfs_fattr_init(struct nfs_fattr *fattr)