aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-26 17:42:42 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-03-01 23:23:05 -0500
commit140e049c64ce848392adbf4678983ecc76888dde (patch)
tree1a278473e70aec757b36a2a2b4d7382e52f7b5b8 /fs
parentaa5accea404b2b92d39c1924cfeb90f6082f6389 (diff)
NFS: Add a helper to set attribute barriers
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/inode.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 83107be3dd01..b0cbc1ba82da 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1260,6 +1260,22 @@ void nfs_fattr_init(struct nfs_fattr *fattr)
1260} 1260}
1261EXPORT_SYMBOL_GPL(nfs_fattr_init); 1261EXPORT_SYMBOL_GPL(nfs_fattr_init);
1262 1262
1263/**
1264 * nfs_fattr_set_barrier
1265 * @fattr: attributes
1266 *
1267 * Used to set a barrier after an attribute was updated. This
1268 * barrier ensures that older attributes from RPC calls that may
1269 * have raced with our update cannot clobber these new values.
1270 * Note that you are still responsible for ensuring that other
1271 * operations which change the attribute on the server do not
1272 * collide.
1273 */
1274void nfs_fattr_set_barrier(struct nfs_fattr *fattr)
1275{
1276 fattr->gencount = nfs_inc_attr_generation_counter();
1277}
1278
1263struct nfs_fattr *nfs_alloc_fattr(void) 1279struct nfs_fattr *nfs_alloc_fattr(void)
1264{ 1280{
1265 struct nfs_fattr *fattr; 1281 struct nfs_fattr *fattr;