mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[PATCH] VFS: change struct file to use struct path
This patch changes struct file to use struct path instead of having independent pointers to struct dentry and struct vfsmount, and converts all users of f_{dentry,vfsmnt} in fs/ to use f_path.{dentry,mnt}. Additionally, it adds two #define's to make the transition easier for users of the f_dentry and f_vfsmnt. Signed-off-by: Josef "Jeff" Sipek <jsipek@cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b65d34fd46
commit
0f7fc9e4d0
32 changed files with 141 additions and 139 deletions
10
fs/exec.c
10
fs/exec.c
|
@ -912,7 +912,7 @@ EXPORT_SYMBOL(flush_old_exec);
|
|||
int prepare_binprm(struct linux_binprm *bprm)
|
||||
{
|
||||
int mode;
|
||||
struct inode * inode = bprm->file->f_dentry->d_inode;
|
||||
struct inode * inode = bprm->file->f_path.dentry->d_inode;
|
||||
int retval;
|
||||
|
||||
mode = inode->i_mode;
|
||||
|
@ -922,7 +922,7 @@ int prepare_binprm(struct linux_binprm *bprm)
|
|||
bprm->e_uid = current->euid;
|
||||
bprm->e_gid = current->egid;
|
||||
|
||||
if(!(bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)) {
|
||||
if(!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)) {
|
||||
/* Set-uid? */
|
||||
if (mode & S_ISUID) {
|
||||
current->personality &= ~PER_CLEAR_ON_SETID;
|
||||
|
@ -1519,10 +1519,10 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
|
|||
0600);
|
||||
if (IS_ERR(file))
|
||||
goto fail_unlock;
|
||||
inode = file->f_dentry->d_inode;
|
||||
inode = file->f_path.dentry->d_inode;
|
||||
if (inode->i_nlink > 1)
|
||||
goto close_fail; /* multiple links - don't dump */
|
||||
if (!ispipe && d_unhashed(file->f_dentry))
|
||||
if (!ispipe && d_unhashed(file->f_path.dentry))
|
||||
goto close_fail;
|
||||
|
||||
/* AK: actually i see no reason to not allow this for named pipes etc.,
|
||||
|
@ -1533,7 +1533,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
|
|||
goto close_fail;
|
||||
if (!file->f_op->write)
|
||||
goto close_fail;
|
||||
if (!ispipe && do_truncate(file->f_dentry, 0, 0, file) != 0)
|
||||
if (!ispipe && do_truncate(file->f_path.dentry, 0, 0, file) != 0)
|
||||
goto close_fail;
|
||||
|
||||
retval = binfmt->core_dump(signr, regs, file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue