diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:38:56 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:38:56 -0500 |
commit | 77c70de15a74801f427ee5fb85ddfdde48ed84f2 (patch) | |
tree | dfa723b0489291e8a6d01a6a18d99c965bc2bd20 | |
parent | de395b8ac25da56893d83cd5da67cf927dfa7e4d (diff) |
CRED: Wrap task credential accesses in the hugetlbfs 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: William Irwin <wli@holomorphy.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | fs/hugetlbfs/inode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 61edc701b0e6..08ad76c79b49 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -551,9 +551,9 @@ static int hugetlbfs_mknod(struct inode *dir, | |||
551 | if (S_ISDIR(mode)) | 551 | if (S_ISDIR(mode)) |
552 | mode |= S_ISGID; | 552 | mode |= S_ISGID; |
553 | } else { | 553 | } else { |
554 | gid = current->fsgid; | 554 | gid = current_fsgid(); |
555 | } | 555 | } |
556 | inode = hugetlbfs_get_inode(dir->i_sb, current->fsuid, gid, mode, dev); | 556 | inode = hugetlbfs_get_inode(dir->i_sb, current_fsuid(), gid, mode, dev); |
557 | if (inode) { | 557 | if (inode) { |
558 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; | 558 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; |
559 | d_instantiate(dentry, inode); | 559 | d_instantiate(dentry, inode); |
@@ -586,9 +586,9 @@ static int hugetlbfs_symlink(struct inode *dir, | |||
586 | if (dir->i_mode & S_ISGID) | 586 | if (dir->i_mode & S_ISGID) |
587 | gid = dir->i_gid; | 587 | gid = dir->i_gid; |
588 | else | 588 | else |
589 | gid = current->fsgid; | 589 | gid = current_fsgid(); |
590 | 590 | ||
591 | inode = hugetlbfs_get_inode(dir->i_sb, current->fsuid, | 591 | inode = hugetlbfs_get_inode(dir->i_sb, current_fsuid(), |
592 | gid, S_IFLNK|S_IRWXUGO, 0); | 592 | gid, S_IFLNK|S_IRWXUGO, 0); |
593 | if (inode) { | 593 | if (inode) { |
594 | int l = strlen(symname)+1; | 594 | int l = strlen(symname)+1; |
@@ -854,8 +854,8 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent) | |||
854 | 854 | ||
855 | config.nr_blocks = -1; /* No limit on size by default */ | 855 | config.nr_blocks = -1; /* No limit on size by default */ |
856 | config.nr_inodes = -1; /* No limit on number of inodes by default */ | 856 | config.nr_inodes = -1; /* No limit on number of inodes by default */ |
857 | config.uid = current->fsuid; | 857 | config.uid = current_fsuid(); |
858 | config.gid = current->fsgid; | 858 | config.gid = current_fsgid(); |
859 | config.mode = 0755; | 859 | config.mode = 0755; |
860 | config.hstate = &default_hstate; | 860 | config.hstate = &default_hstate; |
861 | ret = hugetlbfs_parse_options(data, &config); | 861 | ret = hugetlbfs_parse_options(data, &config); |
@@ -970,8 +970,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size) | |||
970 | goto out_shm_unlock; | 970 | goto out_shm_unlock; |
971 | 971 | ||
972 | error = -ENOSPC; | 972 | error = -ENOSPC; |
973 | inode = hugetlbfs_get_inode(root->d_sb, current->fsuid, | 973 | inode = hugetlbfs_get_inode(root->d_sb, current_fsuid(), |
974 | current->fsgid, S_IFREG | S_IRWXUGO, 0); | 974 | current_fsgid(), S_IFREG | S_IRWXUGO, 0); |
975 | if (!inode) | 975 | if (!inode) |
976 | goto out_dentry; | 976 | goto out_dentry; |
977 | 977 | ||