diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 12:51:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 12:51:42 -0700 |
commit | 1b2d3d94ec878c3529153061cd8cceb876e01a3e (patch) | |
tree | 93adaf1666942024cce4e3aa0bc58f0f1095bd2f /fs | |
parent | 8bd93ca7b03f38a7bc1a4ed9e93e8c006e753d5b (diff) | |
parent | 5f707eb429e2c98dfd564ffbbd9f536bf493d869 (diff) | |
download | op-kernel-dev-1b2d3d94ec878c3529153061cd8cceb876e01a3e.zip op-kernel-dev-1b2d3d94ec878c3529153061cd8cceb876e01a3e.tar.gz |
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
SUNRPC: Fix potential race in put_rpccred()
SUNRPC: Fix rpcauth_prune_expired
NFS: Convert nfs_attr_generation_counter into an atomic_long
SUNRPC: Respond promptly to server TCP resets
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/inode.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index dc52793..d22eb38 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 return nfs_size_to_loff_t(fattr->size) > i_size_read(inode); } -static unsigned long nfs_attr_generation_counter; +static atomic_long_t nfs_attr_generation_counter; static unsigned long nfs_read_attr_generation_counter(void) { - smp_rmb(); - return nfs_attr_generation_counter; + return atomic_long_read(&nfs_attr_generation_counter); } unsigned long nfs_inc_attr_generation_counter(void) { - unsigned long ret; - smp_rmb(); - ret = ++nfs_attr_generation_counter; - smp_wmb(); - return ret; + return atomic_long_inc_return(&nfs_attr_generation_counter); } void nfs_fattr_init(struct nfs_fattr *fattr) |