aboutsummaryrefslogtreecommitdiff
path: root/fs/coda/inode.c
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 /fs/coda/inode.c
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 'fs/coda/inode.c')
-rw-r--r--fs/coda/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index bfe8179b129..0553f3bd7b1 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/smp_lock.h>
+#include <linux/spinlock.h>
#include <linux/file.h>
#include <linux/vfs.h>
#include <linux/slab.h>
@@ -51,6 +52,7 @@ static struct inode *coda_alloc_inode(struct super_block *sb)
ei->c_flags = 0;
ei->c_uid = 0;
ei->c_cached_perm = 0;
+ spin_lock_init(&ei->c_lock);
return &ei->vfs_inode;
}