summaryrefslogtreecommitdiff
path: root/include/linux/coda_linux.h
diff options
context:
space:
mode:
authorYoshihisa Abe <yoshiabe@cs.cmu.edu>2010-10-25 02:03:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 08:02:40 -0700
commitb5ce1d83a62fc109d8e815b1fc71dcdb0d26bc49 (patch)
treeea537c1b6436c36bee3b33d8b4f750124fd7d661 /include/linux/coda_linux.h
parent3a99c6319064af3f2e18eb929f638d555dbf7a62 (diff)
Coda: add spin lock to protect accesses to struct coda_inode_info.
We mostly need it to protect cached user permissions. The c_flags field is advisory, reading the wrong value is harmless and in the worst case we hit a slow path where we have to make an extra upcall to the userspace cache manager when revalidating a dentry or inode. Signed-off-by: Yoshihisa Abe <yoshiabe@cs.cmu.edu> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/coda_linux.h')
-rw-r--r--include/linux/coda_linux.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index dcc228aa335a..2e914d0771b9 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -89,7 +89,11 @@ static __inline__ char *coda_i2s(struct inode *inode)
/* this will not zap the inode away */
static __inline__ void coda_flag_inode(struct inode *inode, int flag)
{
- ITOC(inode)->c_flags |= flag;
+ struct coda_inode_info *cii = ITOC(inode);
+
+ spin_lock(&cii->c_lock);
+ cii->c_flags |= flag;
+ spin_unlock(&cii->c_lock);
}
#endif