new helper: file_inode(file)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2013-01-23 17:07:38 -05:00
parent 57eccb830f
commit 496ad9aa8e
306 changed files with 696 additions and 717 deletions

View File

@@ -1792,14 +1792,14 @@ SYSCALL_DEFINE1(umask, int, mask)
static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
{
struct fd exe;
struct dentry *dentry;
struct inode *inode;
int err;
exe = fdget(fd);
if (!exe.file)
return -EBADF;
dentry = exe.file->f_path.dentry;
inode = file_inode(exe.file);
/*
* Because the original mm->exe_file points to executable file, make
@@ -1807,11 +1807,11 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
* overall picture.
*/
err = -EACCES;
if (!S_ISREG(dentry->d_inode->i_mode) ||
if (!S_ISREG(inode->i_mode) ||
exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC)
goto exit;
err = inode_permission(dentry->d_inode, MAY_EXEC);
err = inode_permission(inode, MAY_EXEC);
if (err)
goto exit;