Skip to content

Commit 97b7702

Browse files
dhowellsxjamesmorris
authored andcommitted
CRED: Wrap task credential accesses in the Coda filesystem
Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Cc: Jan Harkes <jaharkes@cs.cmu.edu> Cc: codalist@coda.cs.cmu.edu Signed-off-by: James Morris <jmorris@namei.org>
1 parent a001e5b commit 97b7702

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎fs/coda/cache.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ void coda_cache_enter(struct inode *inode, int mask)
3232
struct coda_inode_info *cii = ITOC(inode);
3333

3434
cii->c_cached_epoch = atomic_read(&permission_epoch);
35-
if (cii->c_uid != current->fsuid) {
36-
cii->c_uid = current->fsuid;
35+
if (cii->c_uid != current_fsuid()) {
36+
cii->c_uid = current_fsuid();
3737
cii->c_cached_perm = mask;
3838
} else
3939
cii->c_cached_perm |= mask;
@@ -60,7 +60,7 @@ int coda_cache_check(struct inode *inode, int mask)
6060
int hit;
6161

6262
hit = (mask & cii->c_cached_perm) == mask &&
63-
cii->c_uid == current->fsuid &&
63+
cii->c_uid == current_fsuid() &&
6464
cii->c_cached_epoch == atomic_read(&permission_epoch);
6565

6666
return hit;

‎fs/coda/upcall.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void *alloc_upcall(int opcode, int size)
5252
inp->ih.opcode = opcode;
5353
inp->ih.pid = current->pid;
5454
inp->ih.pgid = task_pgrp_nr(current);
55-
inp->ih.uid = current->fsuid;
55+
inp->ih.uid = current_fsuid();
5656

5757
return (void*)inp;
5858
}

0 commit comments

Comments
 (0)