diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-01-30 22:36:06 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:00:54 -0500 |
commit | 17499e332962e495b3ee2e5507e09b853ed6f607 (patch) | |
tree | b3765f8203c071367f56baf547dad104c6d9297d /fs/coda/cache.c | |
parent | d83f5901bc0cd7131a3b8534169ee889efc4c257 (diff) |
coda: Cache permisions in struct coda_inode_info in a kuid_t.
- Change c_uid in struct coda_indoe_info from a vuid_t to a kuid_t.
- Initialize c_uid to GLOBAL_ROOT_UID instead of 0.
- Use uid_eq to compare cached kuids.
Cc: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/coda/cache.c')
-rw-r--r-- | fs/coda/cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/coda/cache.c b/fs/coda/cache.c index 958ae0e0ff8c..1da168c61d35 100644 --- a/fs/coda/cache.c +++ b/fs/coda/cache.c | |||
@@ -33,7 +33,7 @@ void coda_cache_enter(struct inode *inode, int mask) | |||
33 | 33 | ||
34 | spin_lock(&cii->c_lock); | 34 | spin_lock(&cii->c_lock); |
35 | cii->c_cached_epoch = atomic_read(&permission_epoch); | 35 | cii->c_cached_epoch = atomic_read(&permission_epoch); |
36 | if (cii->c_uid != current_fsuid()) { | 36 | if (!uid_eq(cii->c_uid, current_fsuid())) { |
37 | cii->c_uid = current_fsuid(); | 37 | cii->c_uid = current_fsuid(); |
38 | cii->c_cached_perm = mask; | 38 | cii->c_cached_perm = mask; |
39 | } else | 39 | } else |
@@ -65,7 +65,7 @@ int coda_cache_check(struct inode *inode, int mask) | |||
65 | 65 | ||
66 | spin_lock(&cii->c_lock); | 66 | spin_lock(&cii->c_lock); |
67 | hit = (mask & cii->c_cached_perm) == mask && | 67 | hit = (mask & cii->c_cached_perm) == mask && |
68 | cii->c_uid == current_fsuid() && | 68 | uid_eq(cii->c_uid, current_fsuid()) && |
69 | cii->c_cached_epoch == atomic_read(&permission_epoch); | 69 | cii->c_cached_epoch == atomic_read(&permission_epoch); |
70 | spin_unlock(&cii->c_lock); | 70 | spin_unlock(&cii->c_lock); |
71 | 71 | ||