Commit d017c467 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/sparc-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents cbe54598 57f33dca
......@@ -37,6 +37,7 @@
#include <linux/string.h>
#include <linux/smp_lock.h>
#include <linux/genhd.h>
#include <linux/blkdev.h>
#define MAJOR_NR JSFD_MAJOR
......@@ -187,7 +188,7 @@ static void jsfd_read(char *buf, unsigned long p, size_t togo) {
static void jsfd_do_request(request_queue_t *q)
{
struct request *req;
while ((req = elv_next_request(q)) != NULL) {
struct jsfd_part *jdp = req->rq_disk->private_data;
unsigned long offset = req->sector << 9;
......@@ -198,16 +199,11 @@ static void jsfd_do_request(request_queue_t *q)
continue;
}
if (req->cmd == WRITE) {
if (rq_data_dir(req) != READ) {
printk(KERN_ERR "jsfd: write\n");
end_request(req, 0);
continue;
}
if (req->cmd != READ) {
printk(KERN_ERR "jsfd: bad req->cmd %d\n", req->cmd);
end_request(req, 0);
continue;
}
if ((jdp->dbase & 0xff000000) != 0x20000000) {
printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase);
......@@ -215,7 +211,6 @@ static void jsfd_do_request(request_queue_t *q)
continue;
}
/* printk("%s: read buf %p off %x len %x\n", req->rq_disk->disk_name, req->buffer, (int)offset, (int)len); */ /* P3 */
jsfd_read(req->buffer, jdp->dbase + offset, len);
end_request(req, 1);
......@@ -265,9 +260,6 @@ static ssize_t jsf_read(struct file * file, char * buf,
unsigned int n;
} b;
if (verify_area(VERIFY_WRITE, buf, togo))
return -EFAULT;
if (p < JSF_BASE_ALL || p >= JSF_BASE_TOP) {
return 0;
}
......@@ -298,7 +290,8 @@ static ssize_t jsf_read(struct file * file, char * buf,
while (togo >= 4) {
togo -= 4;
b.n = jsf_inl(p);
copy_to_user(tmp, b.s, 4);
if (copy_to_user(tmp, b.s, 4))
return -EFAULT;
tmp += 4;
p += 4;
}
......@@ -374,19 +367,17 @@ static int jsf_ioctl_program(unsigned long arg)
char s[4];
} b;
if (verify_area(VERIFY_READ, (void *)arg, JSFPRGSZ))
if (copy_from_user(&abuf, (char *)arg, JSFPRGSZ))
return -EFAULT;
copy_from_user(&abuf, (char *)arg, JSFPRGSZ);
p = abuf.off;
togo = abuf.size;
if ((togo & 3) || (p & 3)) return -EINVAL;
uptr = (char *) (unsigned long) abuf.data;
if (verify_area(VERIFY_READ, uptr, togo))
return -EFAULT;
while (togo != 0) {
togo -= 4;
copy_from_user(&b.s[0], uptr, 4);
if (copy_from_user(&b.s[0], uptr, 4))
return -EFAULT;
jsf_write4(p, b.n);
p += 4;
uptr += 4;
......@@ -404,10 +395,8 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
return -EPERM;
switch (cmd) {
case JSFLASH_IDENT:
if (verify_area(VERIFY_WRITE, (void *)arg, JSFIDSZ))
return -EFAULT;
copy_to_user(arg, &jsf0.id, JSFIDSZ);
error = 0;
if (copy_to_user((void *)arg, &jsf0.id, JSFIDSZ))
return -EFAULT;
break;
case JSFLASH_ERASE:
error = jsf_ioctl_erase(arg);
......
......@@ -551,8 +551,8 @@ int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
if (ver == SMB_MOUNT_OLDVERSION) {
mnt->version = oldmnt->version;
mnt->uid = low2highuid(oldmnt->uid);
mnt->gid = low2highuid(oldmnt->gid);
mnt->uid = OLD_TO_NEW_UID(oldmnt->uid);
mnt->gid = OLD_TO_NEW_GID(oldmnt->gid);
mnt->file_mode = (oldmnt->file_mode & S_IRWXUGO) | S_IFREG;
mnt->dir_mode = (oldmnt->dir_mode & S_IRWXUGO) | S_IFDIR;
......
......@@ -17,7 +17,8 @@
andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \
be,pt %icc, 297f; \
sethi %hi(297f), %g7; \
ba,pt %xcc, VISenter; \
sethi %hi(VISenter), %g1; \
jmpl %g1 + %lo(VISenter), %g0; \
or %g7, %lo(297f), %g7; \
297: wr %g0, FPRS_FEF, %fprs; \
......@@ -32,7 +33,8 @@
andcc %o5, FPRS_FEF, %g0; \
be,pt %icc, 297f; \
sethi %hi(298f), %g7; \
ba,pt %xcc, VISenterhalf; \
sethi %hi(VISenterhalf), %g1; \
jmpl %g1 + %lo(VISenterhalf), %g0; \
or %g7, %lo(298f), %g7; \
clr %o5; \
297: wr %o5, FPRS_FEF, %fprs; \
......@@ -48,7 +50,8 @@ static __inline__ void save_and_clear_fpu(void) {
" andcc %%o5, %0, %%g0\n"
" be,pt %%icc, 299f\n"
" sethi %%hi(298f), %%g7\n"
" ba VISenter ! Note. This cannot be bp, as it may be too far from VISenter.\n"
" sethi %%hi(VISenter), %%g1\n"
" jmpl %%g1 + %%lo(VISenter), %%g0\n"
" or %%g7, %%lo(298f), %%g7\n"
" 298: wr %%g0, 0, %%fprs\n"
" 299:\n"
......
......@@ -56,6 +56,8 @@ extern int overflowgid;
#define SET_GID16(var, gid) var = high2lowgid(gid)
#define NEW_TO_OLD_UID(uid) high2lowuid(uid)
#define NEW_TO_OLD_GID(gid) high2lowgid(gid)
#define OLD_TO_NEW_UID(uid) low2highuid(uid)
#define OLD_TO_NEW_GID(gid) low2highgid(gid)
/* specific to fs/stat.c */
#define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid)
......@@ -69,6 +71,8 @@ extern int overflowgid;
#define SET_GID16(var, gid) do { ; } while (0)
#define NEW_TO_OLD_UID(uid) (uid)
#define NEW_TO_OLD_GID(gid) (gid)
#define OLD_TO_NEW_UID(uid) (uid)
#define OLD_TO_NEW_GID(gid) (gid)
#define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = (uid)
#define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = (gid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment