summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-07-05 23:09:37 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-07-05 23:09:37 +0000
commitaba344fdfed81b2c03d6114c54cfd73a486aa10b (patch)
treed032d8430bf1234c3ecc6f6330d6de6e887e5963 /arch/sparc64/kernel
parent40c138bfc6d37dbff5339f84575db1e3cec6e34e (diff)
Merge with Linux 2.3.9.
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/binfmt_aout32.c11
-rw-r--r--arch/sparc64/kernel/process.c2
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c1
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c26
-rw-r--r--arch/sparc64/kernel/sys_sunos32.c2
5 files changed, 21 insertions, 21 deletions
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index e852ca8f8..7d638c5da 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -55,8 +55,15 @@ static void set_brk(unsigned long start, unsigned long end)
* These are the only things you should do on a core-file: use only these
* macros to write out all the necessary info.
*/
-#define DUMP_WRITE(addr,nr) \
-while (file->f_op->write(file,(char *)(addr),(nr),&file->f_pos) != (nr)) goto close_coredump
+
+static int dump_write(struct file *file, const void *addr, int nr)
+{
+ return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
+}
+
+#define DUMP_WRITE(addr, nr) \
+ if (!dump_write(file, (void *)(addr), (nr))) \
+ goto close_coredump;
#define DUMP_SEEK(offset) \
if (file->f_op->llseek) { \
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 1abe767e9..ace0c1dc0 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -392,7 +392,7 @@ void show_thread(struct thread_struct *tss)
}
printk("flags: 0x%08x\n", tss->flags);
- printk("current_ds: 0x%016lx\n", tss->current_ds.seg);
+ printk("current_ds: 0x%x\n", tss->current_ds.seg);
}
/* Free current thread data structures etc.. */
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 305f37ad8..6d6043617 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -206,6 +206,7 @@ EXPORT_SYMBOL(die_if_kernel);
/* Kernel thread creation. */
EXPORT_SYMBOL(kernel_thread);
+EXPORT_SYMBOL(init_mm);
/* prom symbols */
EXPORT_SYMBOL(idprom);
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 79ce3db45..77d2ddc6c 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -855,17 +855,15 @@ asmlinkage long sys32_readv(int fd, struct iovec32 *vector, u32 count)
long ret = -EBADF;
lock_kernel();
+
file = fget(fd);
if(!file)
goto bad_file;
- if(!(file->f_mode & 1))
- goto out;
-
- ret = do_readv_writev32(VERIFY_WRITE, file,
- vector, count);
-out:
+ if (file->f_op && file->f_op->read && (file->f_mode & FMODE_READ))
+ ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
fput(file);
+
bad_file:
unlock_kernel();
return ret;
@@ -877,19 +875,14 @@ asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count)
int ret = -EBADF;
lock_kernel();
+
file = fget(fd);
if(!file)
goto bad_file;
-
- if(!(file->f_mode & 2))
- goto out;
-
- down(&file->f_dentry->d_inode->i_sem);
- ret = do_readv_writev32(VERIFY_READ, file,
- vector, count);
- up(&file->f_dentry->d_inode->i_sem);
-out:
+ if (file->f_op && file->f_op->write && (file->f_mode & FMODE_WRITE))
+ ret = do_readv_writev32(VERIFY_READ, file, vector, count);
fput(file);
+
bad_file:
unlock_kernel();
return ret;
@@ -2335,7 +2328,7 @@ static void scm_detach_fds32(struct msghdr *kmsg, struct scm_cookie *scm)
break;
}
/* Bump the usage count and install the file. */
- fp[i]->f_count++;
+ atomic_inc(&fp[i]->f_count);
current->files->fd[new_fd] = fp[i];
}
@@ -2841,7 +2834,6 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
bprm.dentry = dentry;
bprm.filename = filename;
bprm.sh_bang = 0;
- bprm.java = 0;
bprm.loader = 0;
bprm.exec = 0;
if ((bprm.argc = count32(argv)) < 0) {
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index d375dc26b..9ea1ffcc2 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -163,7 +163,7 @@ asmlinkage int sunos_brk(u32 baddr)
* simple, it hopefully works in most obvious cases.. Easy to
* fool it, but this should catch most mistakes.
*/
- freepages = buffermem >> PAGE_SHIFT;
+ freepages = atomic_read(&buffermem) >> PAGE_SHIFT;
freepages += atomic_read(&page_cache_size);
freepages >>= 1;
freepages += nr_free_pages;