diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:38:55 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:38:55 -0500 |
commit | de395b8ac25da56893d83cd5da67cf927dfa7e4d (patch) | |
tree | 90d869f19305422e13d084854e13f245fc1732bf /fs/hpfs | |
parent | 4ac8489a7294dcf92127825d74f2d981143e825d (diff) |
CRED: Wrap task credential accesses in the HPFS 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: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/namei.c | 24 | ||||
-rw-r--r-- | fs/hpfs/super.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 10783f3d265..b649232dde9 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -92,11 +92,11 @@ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
92 | inc_nlink(dir); | 92 | inc_nlink(dir); |
93 | insert_inode_hash(result); | 93 | insert_inode_hash(result); |
94 | 94 | ||
95 | if (result->i_uid != current->fsuid || | 95 | if (result->i_uid != current_fsuid() || |
96 | result->i_gid != current->fsgid || | 96 | result->i_gid != current_fsgid() || |
97 | result->i_mode != (mode | S_IFDIR)) { | 97 | result->i_mode != (mode | S_IFDIR)) { |
98 | result->i_uid = current->fsuid; | 98 | result->i_uid = current_fsuid(); |
99 | result->i_gid = current->fsgid; | 99 | result->i_gid = current_fsgid(); |
100 | result->i_mode = mode | S_IFDIR; | 100 | result->i_mode = mode | S_IFDIR; |
101 | hpfs_write_inode_nolock(result); | 101 | hpfs_write_inode_nolock(result); |
102 | } | 102 | } |
@@ -184,11 +184,11 @@ static int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struc | |||
184 | 184 | ||
185 | insert_inode_hash(result); | 185 | insert_inode_hash(result); |
186 | 186 | ||
187 | if (result->i_uid != current->fsuid || | 187 | if (result->i_uid != current_fsuid() || |
188 | result->i_gid != current->fsgid || | 188 | result->i_gid != current_fsgid() || |
189 | result->i_mode != (mode | S_IFREG)) { | 189 | result->i_mode != (mode | S_IFREG)) { |
190 | result->i_uid = current->fsuid; | 190 | result->i_uid = current_fsuid(); |
191 | result->i_gid = current->fsgid; | 191 | result->i_gid = current_fsgid(); |
192 | result->i_mode = mode | S_IFREG; | 192 | result->i_mode = mode | S_IFREG; |
193 | hpfs_write_inode_nolock(result); | 193 | hpfs_write_inode_nolock(result); |
194 | } | 194 | } |
@@ -247,8 +247,8 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t | |||
247 | result->i_mtime.tv_nsec = 0; | 247 | result->i_mtime.tv_nsec = 0; |
248 | result->i_atime.tv_nsec = 0; | 248 | result->i_atime.tv_nsec = 0; |
249 | hpfs_i(result)->i_ea_size = 0; | 249 | hpfs_i(result)->i_ea_size = 0; |
250 | result->i_uid = current->fsuid; | 250 | result->i_uid = current_fsuid(); |
251 | result->i_gid = current->fsgid; | 251 | result->i_gid = current_fsgid(); |
252 | result->i_nlink = 1; | 252 | result->i_nlink = 1; |
253 | result->i_size = 0; | 253 | result->i_size = 0; |
254 | result->i_blocks = 1; | 254 | result->i_blocks = 1; |
@@ -325,8 +325,8 @@ static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *sy | |||
325 | result->i_atime.tv_nsec = 0; | 325 | result->i_atime.tv_nsec = 0; |
326 | hpfs_i(result)->i_ea_size = 0; | 326 | hpfs_i(result)->i_ea_size = 0; |
327 | result->i_mode = S_IFLNK | 0777; | 327 | result->i_mode = S_IFLNK | 0777; |
328 | result->i_uid = current->fsuid; | 328 | result->i_uid = current_fsuid(); |
329 | result->i_gid = current->fsgid; | 329 | result->i_gid = current_fsgid(); |
330 | result->i_blocks = 1; | 330 | result->i_blocks = 1; |
331 | result->i_nlink = 1; | 331 | result->i_nlink = 1; |
332 | result->i_size = strlen(symlink); | 332 | result->i_size = strlen(symlink); |
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 29ad461d568..0d049b8919c 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -475,8 +475,8 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
475 | 475 | ||
476 | init_MUTEX(&sbi->hpfs_creation_de); | 476 | init_MUTEX(&sbi->hpfs_creation_de); |
477 | 477 | ||
478 | uid = current->uid; | 478 | uid = current_uid(); |
479 | gid = current->gid; | 479 | gid = current_gid(); |
480 | umask = current->fs->umask; | 480 | umask = current->fs->umask; |
481 | lowercase = 0; | 481 | lowercase = 0; |
482 | conv = CONV_BINARY; | 482 | conv = CONV_BINARY; |