diff options
| author | Jan Blunck <[email protected]> | 2008-02-15 03:34:32 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2008-02-15 05:13:33 +0000 |
| commit | 4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (patch) | |
| tree | f5b5d84fd12fcc2b0ba0e7ce1a79ff381ad8f5dd /security/selinux/hooks.c | |
| parent | Move struct path into its own header (diff) | |
| download | kernel-4ac9137858e08a19f29feac4e1f4df7c268b0ba5.tar.gz kernel-4ac9137858e08a19f29feac4e1f4df7c268b0ba5.zip | |
Embed a struct path into struct nameidata instead of nd->{dentry,mnt}
This is the central patch of a cleanup series. In most cases there is no good
reason why someone would want to use a dentry for itself. This series reflects
that fact and embeds a struct path into nameidata.
Together with the other patches of this series
- it enforced the correct order of getting/releasing the reference count on
<dentry,vfsmount> pairs
- it prepares the VFS for stacking support since it is essential to have a
struct path in every place where the stack can be traversed
- it reduces the overall code size:
without patch series:
text data bss dec hex filename
5321639 858418 715768 6895825 6938d1 vmlinux
with patch series:
text data bss dec hex filename
5320026 858418 715768 6894212 693284 vmlinux
This patch:
Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.
[[email protected]: coding-style fixes]
[[email protected]: fix cifs]
[[email protected]: fix smack]
Signed-off-by: Jan Blunck <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Casey Schaufler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 44f16d9041e3..ffeefa3c2c77 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2341,10 +2341,10 @@ static int selinux_mount(char * dev_name, return rc; if (flags & MS_REMOUNT) - return superblock_has_perm(current, nd->mnt->mnt_sb, + return superblock_has_perm(current, nd->path.mnt->mnt_sb, FILESYSTEM__REMOUNT, NULL); else - return dentry_has_perm(current, nd->mnt, nd->dentry, + return dentry_has_perm(current, nd->path.mnt, nd->path.dentry, FILE__MOUNTON); } |
