Commit 97b7702cd1bdb8e89bde6c70aa983e7b82a52ec6

Authored by David Howells
Committed by James Morris
1 parent a001e5b558

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>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -32,8 +32,8 @@
32 32 struct coda_inode_info *cii = ITOC(inode);
33 33  
34 34 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();
37 37 cii->c_cached_perm = mask;
38 38 } else
39 39 cii->c_cached_perm |= mask;
... ... @@ -60,7 +60,7 @@
60 60 int hit;
61 61  
62 62 hit = (mask & cii->c_cached_perm) == mask &&
63   - cii->c_uid == current->fsuid &&
  63 + cii->c_uid == current_fsuid() &&
64 64 cii->c_cached_epoch == atomic_read(&permission_epoch);
65 65  
66 66 return hit;
... ... @@ -52,7 +52,7 @@
52 52 inp->ih.opcode = opcode;
53 53 inp->ih.pid = current->pid;
54 54 inp->ih.pgid = task_pgrp_nr(current);
55   - inp->ih.uid = current->fsuid;
  55 + inp->ih.uid = current_fsuid();
56 56  
57 57 return (void*)inp;
58 58 }