aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:38:47 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:38:47 -0500
commita001e5b558f25eb1e588522d73ac949b643b7a37 (patch)
tree96370a4535bd0d7b3e9908f04b58a8b3e94ed908 /fs/cifs/inode.c
parent1109b07b7dcb938de7a0d65efc1b4739dc4e9787 (diff)
CRED: Wrap task credential accesses in the CIFS 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: Steve French <sfrench@samba.org> Cc: linux-cifs-client@lists.samba.org Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ff8c68de4a92..8b7305e73d7e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1143,11 +1143,11 @@ mkdir_get_info:
1143 .device = 0, 1143 .device = 0,
1144 }; 1144 };
1145 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 1145 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
1146 args.uid = (__u64)current->fsuid; 1146 args.uid = (__u64)current_fsuid();
1147 if (inode->i_mode & S_ISGID) 1147 if (inode->i_mode & S_ISGID)
1148 args.gid = (__u64)inode->i_gid; 1148 args.gid = (__u64)inode->i_gid;
1149 else 1149 else
1150 args.gid = (__u64)current->fsgid; 1150 args.gid = (__u64)current_fsgid();
1151 } else { 1151 } else {
1152 args.uid = NO_CHANGE_64; 1152 args.uid = NO_CHANGE_64;
1153 args.gid = NO_CHANGE_64; 1153 args.gid = NO_CHANGE_64;
@@ -1184,13 +1184,13 @@ mkdir_get_info:
1184 if (cifs_sb->mnt_cifs_flags & 1184 if (cifs_sb->mnt_cifs_flags &
1185 CIFS_MOUNT_SET_UID) { 1185 CIFS_MOUNT_SET_UID) {
1186 direntry->d_inode->i_uid = 1186 direntry->d_inode->i_uid =
1187 current->fsuid; 1187 current_fsuid();
1188 if (inode->i_mode & S_ISGID) 1188 if (inode->i_mode & S_ISGID)
1189 direntry->d_inode->i_gid = 1189 direntry->d_inode->i_gid =
1190 inode->i_gid; 1190 inode->i_gid;
1191 else 1191 else
1192 direntry->d_inode->i_gid = 1192 direntry->d_inode->i_gid =
1193 current->fsgid; 1193 current_fsgid();
1194 } 1194 }
1195 } 1195 }
1196 } 1196 }