patch-2.1.45 linux/arch/sparc64/kernel/binfmt_aout32.c
Next file: linux/arch/sparc64/kernel/cpu.c
Previous file: linux/arch/sparc64/defconfig
Back to the patch index
Back to the overall index
- Lines: 122
- Date:
Wed Jul 16 19:22:50 1997
- Orig file:
v2.1.44/linux/arch/sparc64/kernel/binfmt_aout32.c
- Orig date:
Mon Jul 7 08:18:54 1997
diff -u --recursive --new-file v2.1.44/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
@@ -78,6 +78,7 @@
static inline int
do_aout32_core_dump(long signr, struct pt_regs * regs)
{
+ struct dentry * dentry = NULL;
struct inode * inode = NULL;
struct file file;
unsigned short fs;
@@ -103,10 +104,12 @@
#else
corefile[4] = '\0';
#endif
- if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode,NULL)) {
- inode = NULL;
+ dentry = open_namei(corefile,O_CREAT | 2 | O_TRUNC, 0600);
+ if (IS_ERR(dentry)) {
+ dentry = NULL;
goto end_coredump;
}
+ inode = dentry->d_inode;
if (!S_ISREG(inode->i_mode))
goto end_coredump;
if (!inode->i_op || !inode->i_op->default_file_ops)
@@ -116,7 +119,7 @@
file.f_mode = 3;
file.f_flags = 0;
file.f_count = 1;
- file.f_inode = inode;
+ file.f_dentry = dentry;
file.f_pos = 0;
file.f_reada = 0;
file.f_op = inode->i_op->default_file_ops;
@@ -169,7 +172,6 @@
/* Finally dump the task struct. Not be used by gdb, but could be useful */
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
- inode->i_status |= ST_MODIFIED;
close_coredump:
if (file.f_op->release)
file.f_op->release(inode,&file);
@@ -177,7 +179,7 @@
put_write_access(inode);
end_coredump:
set_fs(fs);
- iput(inode);
+ dput(dentry);
return has_dumped;
}
@@ -259,7 +261,7 @@
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||
N_TRSIZE(ex) || N_DRSIZE(ex) ||
- bprm->inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
+ bprm->dentry->d_inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
return -ENOEXEC;
}
@@ -297,12 +299,12 @@
error = do_mmap(NULL, N_TXTADDR(ex), ex.a_text,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_FIXED|MAP_PRIVATE, 0);
- read_exec(bprm->inode, fd_offset, (char *) N_TXTADDR(ex),
+ read_exec(bprm->dentry, fd_offset, (char *) N_TXTADDR(ex),
ex.a_text, 0);
error = do_mmap(NULL, N_DATADDR(ex), ex.a_data,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_FIXED|MAP_PRIVATE, 0);
- read_exec(bprm->inode, fd_offset + ex.a_text, (char *) N_DATADDR(ex),
+ read_exec(bprm->dentry, fd_offset + ex.a_text, (char *) N_DATADDR(ex),
ex.a_data, 0);
goto beyond_if;
}
@@ -312,14 +314,14 @@
ex.a_text+ex.a_data + PAGE_SIZE - 1,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_FIXED|MAP_PRIVATE, 0);
- read_exec(bprm->inode, fd_offset, (char *) N_TXTADDR(ex),
+ read_exec(bprm->dentry, fd_offset, (char *) N_TXTADDR(ex),
ex.a_text+ex.a_data, 0);
} else {
if ((ex.a_text & 0xfff || ex.a_data & 0xfff) &&
(N_MAGIC(ex) != NMAGIC))
printk(KERN_NOTICE "executable not page aligned\n");
- fd = open_inode(bprm->inode, O_RDONLY);
+ fd = open_dentry(bprm->dentry, O_RDONLY);
if (fd < 0)
return fd;
@@ -329,7 +331,7 @@
do_mmap(NULL, 0, ex.a_text+ex.a_data,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_FIXED|MAP_PRIVATE, 0);
- read_exec(bprm->inode, fd_offset,
+ read_exec(bprm->dentry, fd_offset,
(char *) N_TXTADDR(ex), ex.a_text+ex.a_data, 0);
goto beyond_if;
}
@@ -396,17 +398,20 @@
{
struct file * file;
struct exec ex;
- struct inode * inode;
+ struct dentry * dentry;
+ struct inode * inode;
unsigned int len;
unsigned int bss;
unsigned int start_addr;
unsigned long error;
file = current->files->fd[fd];
- inode = file->f_inode;
if (!file || !file->f_op)
return -EACCES;
+
+ dentry = file->f_dentry;
+ inode = dentry->d_inode;
/* Seek into the file */
if (file->f_op->llseek) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov