Commit d0b87be0 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://cifs.bkbits.net/linux-2.5cifs

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 20b5050b 1230e437
...@@ -447,6 +447,16 @@ sys_call_table: ...@@ -447,6 +447,16 @@ sys_call_table:
.quad sys_stat64 /* 425 */ .quad sys_stat64 /* 425 */
.quad sys_lstat64 .quad sys_lstat64
.quad sys_fstat64 .quad sys_fstat64
.quad sys_ni_syscall /* sys_vserver */
.quad sys_ni_syscall /* sys_mbind */
.quad sys_ni_syscall /* sys_get_mempolicy */
.quad sys_ni_syscall /* sys_set_mempolicy */
.quad sys_mq_open
.quad sys_mq_unlink
.quad sys_mq_timedsend
.quad sys_mq_timedreceive /* 435 */
.quad sys_mq_notify
.quad sys_mq_getsetattr
.size sys_call_table, . - sys_call_table .size sys_call_table, . - sys_call_table
.type sys_call_table, @object .type sys_call_table, @object
......
...@@ -430,6 +430,7 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, ...@@ -430,6 +430,7 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
regs->gpr[1] = newsp; regs->gpr[1] = newsp;
err |= get_user(regs->gpr[2], &funct_desc_ptr->toc); err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);
regs->gpr[3] = signr; regs->gpr[3] = signr;
regs->result = 0;
if (ka->sa.sa_flags & SA_SIGINFO) { if (ka->sa.sa_flags & SA_SIGINFO) {
err |= get_user(regs->gpr[4], (unsigned long *)&frame->pinfo); err |= get_user(regs->gpr[4], (unsigned long *)&frame->pinfo);
err |= get_user(regs->gpr[5], (unsigned long *)&frame->puc); err |= get_user(regs->gpr[5], (unsigned long *)&frame->puc);
......
...@@ -676,6 +676,7 @@ static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, ...@@ -676,6 +676,7 @@ static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
regs->nip = (unsigned long) ka->sa.sa_handler; regs->nip = (unsigned long) ka->sa.sa_handler;
regs->link = (unsigned long) frame->tramp; regs->link = (unsigned long) frame->tramp;
regs->trap = 0; regs->trap = 0;
regs->result = 0;
return; return;
...@@ -784,7 +785,6 @@ long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, ...@@ -784,7 +785,6 @@ long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
*/ */
sys32_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs); sys32_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs);
regs->result &= 0xFFFFFFFF;
ret = regs->result; ret = regs->result;
return ret; return ret;
...@@ -841,6 +841,7 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka, ...@@ -841,6 +841,7 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka,
regs->nip = (unsigned long) ka->sa.sa_handler; regs->nip = (unsigned long) ka->sa.sa_handler;
regs->link = (unsigned long) frame->mctx.tramp; regs->link = (unsigned long) frame->mctx.tramp;
regs->trap = 0; regs->trap = 0;
regs->result = 0;
return; return;
...@@ -885,7 +886,6 @@ long sys32_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, ...@@ -885,7 +886,6 @@ long sys32_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|| restore_user_regs(regs, sr, 1)) || restore_user_regs(regs, sr, 1))
goto badframe; goto badframe;
regs->result &= 0xFFFFFFFF;
ret = regs->result; ret = regs->result;
return ret; return ret;
......
...@@ -81,10 +81,6 @@ static const char *mcdx_c_version ...@@ -81,10 +81,6 @@ static const char *mcdx_c_version
#define mcdx_drive_map mcdx #define mcdx_drive_map mcdx
#include "mcdx.h" #include "mcdx.h"
#if BITS_PER_LONG != 32
# error FIXME: this driver only works on 32-bit platforms
#endif
#ifndef HZ #ifndef HZ
#error HZ not defined #error HZ not defined
#endif #endif
...@@ -189,12 +185,12 @@ struct s_drive_stuff { ...@@ -189,12 +185,12 @@ struct s_drive_stuff {
#endif /* AK2 */ #endif /* AK2 */
/* adds and odds */ /* adds and odds */
void *wreg_data; /* w data */ unsigned wreg_data; /* w data */
void *wreg_reset; /* w hardware reset */ unsigned wreg_reset; /* w hardware reset */
void *wreg_hcon; /* w hardware conf */ unsigned wreg_hcon; /* w hardware conf */
void *wreg_chn; /* w channel */ unsigned wreg_chn; /* w channel */
void *rreg_data; /* r data */ unsigned rreg_data; /* r data */
void *rreg_status; /* r status */ unsigned rreg_status; /* r status */
int irq; /* irq used by this drive */ int irq; /* irq used by this drive */
int present; /* drive present and its capabilities */ int present; /* drive present and its capabilities */
...@@ -274,7 +270,7 @@ static void log2msf(unsigned int, struct cdrom_msf0 *); ...@@ -274,7 +270,7 @@ static void log2msf(unsigned int, struct cdrom_msf0 *);
static unsigned int msf2log(const struct cdrom_msf0 *); static unsigned int msf2log(const struct cdrom_msf0 *);
static unsigned int uint2bcd(unsigned int); static unsigned int uint2bcd(unsigned int);
static unsigned int bcd2uint(unsigned char); static unsigned int bcd2uint(unsigned char);
static char *port(int *); static unsigned port(int *);
static int irq(int *); static int irq(int *);
static void mcdx_delay(struct s_drive_stuff *, long jifs); static void mcdx_delay(struct s_drive_stuff *, long jifs);
static int mcdx_transfer(struct s_drive_stuff *, char *buf, int sector, static int mcdx_transfer(struct s_drive_stuff *, char *buf, int sector,
...@@ -868,7 +864,7 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -868,7 +864,7 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs)
#endif /* AK2 */ #endif /* AK2 */
/* get the interrupt status */ /* get the interrupt status */
b = inb((unsigned int) stuffp->rreg_status); b = inb(stuffp->rreg_status);
stuffp->introk = ~b & MCDX_RBIT_DTEN; stuffp->introk = ~b & MCDX_RBIT_DTEN;
/* NOTE: We only should get interrupts if the data we /* NOTE: We only should get interrupts if the data we
...@@ -882,7 +878,7 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -882,7 +878,7 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs)
xtrace(IRQ, "intr() irq %d hw status 0x%02x\n", irq, b); xtrace(IRQ, "intr() irq %d hw status 0x%02x\n", irq, b);
if (~b & MCDX_RBIT_STEN) { if (~b & MCDX_RBIT_STEN) {
xinfo("intr() irq %d status 0x%02x\n", xinfo("intr() irq %d status 0x%02x\n",
irq, inb((unsigned int) stuffp->rreg_data)); irq, inb(stuffp->rreg_data));
} else { } else {
xinfo("intr() irq %d ambiguous hw status\n", irq); xinfo("intr() irq %d ambiguous hw status\n", irq);
} }
...@@ -945,7 +941,7 @@ static int mcdx_talk(struct s_drive_stuff *stuffp, ...@@ -945,7 +941,7 @@ static int mcdx_talk(struct s_drive_stuff *stuffp,
char *bp = (char *) buffer; char *bp = (char *) buffer;
size_t sz = size; size_t sz = size;
outsb((unsigned int) stuffp->wreg_data, cmd, cmdlen); outsb(stuffp->wreg_data, cmd, cmdlen);
xtrace(TALK, "talk() command sent\n"); xtrace(TALK, "talk() command sent\n");
/* get the status byte */ /* get the status byte */
...@@ -1049,8 +1045,7 @@ void __exit mcdx_exit(void) ...@@ -1049,8 +1045,7 @@ void __exit mcdx_exit(void)
continue; continue;
} }
put_disk(stuffp->disk); put_disk(stuffp->disk);
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE);
free_irq(stuffp->irq, NULL); free_irq(stuffp->irq, NULL);
if (stuffp->toc) { if (stuffp->toc) {
xtrace(MALLOC, "cleanup_module() free toc @ %p\n", xtrace(MALLOC, "cleanup_module() free toc @ %p\n",
...@@ -1116,8 +1111,7 @@ int __init mcdx_init_drive(int drive) ...@@ -1116,8 +1111,7 @@ int __init mcdx_init_drive(int drive)
/* setup our irq and i/o addresses */ /* setup our irq and i/o addresses */
stuffp->irq = irq(mcdx_drive_map[drive]); stuffp->irq = irq(mcdx_drive_map[drive]);
stuffp->wreg_data = stuffp->rreg_data = stuffp->wreg_data = stuffp->rreg_data = port(mcdx_drive_map[drive]);
port(mcdx_drive_map[drive]);
stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1; stuffp->wreg_reset = stuffp->rreg_status = stuffp->wreg_data + 1;
stuffp->wreg_hcon = stuffp->wreg_reset + 1; stuffp->wreg_hcon = stuffp->wreg_reset + 1;
stuffp->wreg_chn = stuffp->wreg_hcon + 1; stuffp->wreg_chn = stuffp->wreg_hcon + 1;
...@@ -1127,10 +1121,9 @@ int __init mcdx_init_drive(int drive) ...@@ -1127,10 +1121,9 @@ int __init mcdx_init_drive(int drive)
init_waitqueue_head(&stuffp->sleepq); init_waitqueue_head(&stuffp->sleepq);
/* check if i/o addresses are available */ /* check if i/o addresses are available */
if (!request_region((unsigned int) stuffp->wreg_data, MCDX_IO_SIZE, if (!request_region(stuffp->wreg_data, MCDX_IO_SIZE, "mcdx")) {
"mcdx")) { xwarn("0x%03x,%d: Init failed. "
xwarn("0x%3p,%d: Init failed. " "I/O ports (0x%03x..0x%03x) already in use.\n",
"I/O ports (0x%3p..0x%3p) already in use.\n",
stuffp->wreg_data, stuffp->irq, stuffp->wreg_data, stuffp->irq,
stuffp->wreg_data, stuffp->wreg_data,
stuffp->wreg_data + MCDX_IO_SIZE - 1); stuffp->wreg_data + MCDX_IO_SIZE - 1);
...@@ -1141,7 +1134,7 @@ int __init mcdx_init_drive(int drive) ...@@ -1141,7 +1134,7 @@ int __init mcdx_init_drive(int drive)
return 0; /* next drive */ return 0; /* next drive */
} }
xtrace(INIT, "init() i/o port is available at 0x%3p\n", xtrace(INIT, "init() i/o port is available at 0x%03x\n"
stuffp->wreg_data); stuffp->wreg_data);
xtrace(INIT, "init() hardware reset\n"); xtrace(INIT, "init() hardware reset\n");
mcdx_reset(stuffp, HARD, 1); mcdx_reset(stuffp, HARD, 1);
...@@ -1149,9 +1142,8 @@ int __init mcdx_init_drive(int drive) ...@@ -1149,9 +1142,8 @@ int __init mcdx_init_drive(int drive)
xtrace(INIT, "init() get version\n"); xtrace(INIT, "init() get version\n");
if (-1 == mcdx_requestversion(stuffp, &version, 4)) { if (-1 == mcdx_requestversion(stuffp, &version, 4)) {
/* failed, next drive */ /* failed, next drive */
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE); xwarn("%s=0x%03x,%d: Init failed. Can't get version.\n",
xwarn("%s=0x%3p,%d: Init failed. Can't get version.\n",
MCDX, stuffp->wreg_data, stuffp->irq); MCDX, stuffp->wreg_data, stuffp->irq);
xtrace(MALLOC, "init() free stuffp @ %p\n", stuffp); xtrace(MALLOC, "init() free stuffp @ %p\n", stuffp);
kfree(stuffp); kfree(stuffp);
...@@ -1181,9 +1173,8 @@ int __init mcdx_init_drive(int drive) ...@@ -1181,9 +1173,8 @@ int __init mcdx_init_drive(int drive)
stuffp->playcmd = READ1X; stuffp->playcmd = READ1X;
if (!stuffp->present) { if (!stuffp->present) {
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE); xwarn("%s=0x%03x,%d: Init failed. No Mitsumi CD-ROM?.\n",
xwarn("%s=0x%3p,%d: Init failed. No Mitsumi CD-ROM?.\n",
MCDX, stuffp->wreg_data, stuffp->irq); MCDX, stuffp->wreg_data, stuffp->irq);
kfree(stuffp); kfree(stuffp);
put_disk(disk); put_disk(disk);
...@@ -1192,8 +1183,7 @@ int __init mcdx_init_drive(int drive) ...@@ -1192,8 +1183,7 @@ int __init mcdx_init_drive(int drive)
xtrace(INIT, "init() register blkdev\n"); xtrace(INIT, "init() register blkdev\n");
if (register_blkdev(MAJOR_NR, "mcdx")) { if (register_blkdev(MAJOR_NR, "mcdx")) {
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE);
kfree(stuffp); kfree(stuffp);
put_disk(disk); put_disk(disk);
return 1; return 1;
...@@ -1202,8 +1192,7 @@ int __init mcdx_init_drive(int drive) ...@@ -1202,8 +1192,7 @@ int __init mcdx_init_drive(int drive)
mcdx_queue = blk_init_queue(do_mcdx_request, &mcdx_lock); mcdx_queue = blk_init_queue(do_mcdx_request, &mcdx_lock);
if (!mcdx_queue) { if (!mcdx_queue) {
unregister_blkdev(MAJOR_NR, "mcdx"); unregister_blkdev(MAJOR_NR, "mcdx");
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE);
kfree(stuffp); kfree(stuffp);
put_disk(disk); put_disk(disk);
return 1; return 1;
...@@ -1212,9 +1201,8 @@ int __init mcdx_init_drive(int drive) ...@@ -1212,9 +1201,8 @@ int __init mcdx_init_drive(int drive)
xtrace(INIT, "init() subscribe irq and i/o\n"); xtrace(INIT, "init() subscribe irq and i/o\n");
mcdx_irq_map[stuffp->irq] = stuffp; mcdx_irq_map[stuffp->irq] = stuffp;
if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", NULL)) { if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", NULL)) {
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE); xwarn("%s=0x%03x,%d: Init failed. Can't get irq (%d).\n",
xwarn("%s=0x%3p,%d: Init failed. Can't get irq (%d).\n",
MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq); MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq);
stuffp->irq = 0; stuffp->irq = 0;
blk_cleanup_queue(mcdx_queue); blk_cleanup_queue(mcdx_queue);
...@@ -1228,13 +1216,13 @@ int __init mcdx_init_drive(int drive) ...@@ -1228,13 +1216,13 @@ int __init mcdx_init_drive(int drive)
int i; int i;
mcdx_delay(stuffp, HZ / 2); mcdx_delay(stuffp, HZ / 2);
for (i = 100; i; i--) for (i = 100; i; i--)
(void) inb((unsigned int) stuffp->rreg_status); (void) inb(stuffp->rreg_status);
} }
#if WE_KNOW_WHY #if WE_KNOW_WHY
/* irq 11 -> channel register */ /* irq 11 -> channel register */
outb(0x50, (unsigned int) stuffp->wreg_chn); outb(0x50, stuffp->wreg_chn);
#endif #endif
xtrace(INIT, "init() set non dma but irq mode\n"); xtrace(INIT, "init() set non dma but irq mode\n");
...@@ -1252,15 +1240,14 @@ int __init mcdx_init_drive(int drive) ...@@ -1252,15 +1240,14 @@ int __init mcdx_init_drive(int drive)
disk->flags = GENHD_FL_CD; disk->flags = GENHD_FL_CD;
stuffp->disk = disk; stuffp->disk = disk;
sprintf(msg, " mcdx: Mitsumi CD-ROM installed at 0x%3p, irq %d." sprintf(msg, " mcdx: Mitsumi CD-ROM installed at 0x%03x, irq %d."
" (Firmware version %c %x)\n", " (Firmware version %c %x)\n",
stuffp->wreg_data, stuffp->irq, version.code, version.ver); stuffp->wreg_data, stuffp->irq, version.code, version.ver);
mcdx_stuffp[drive] = stuffp; mcdx_stuffp[drive] = stuffp;
xtrace(INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp); xtrace(INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp);
if (register_cdrom(&stuffp->info) != 0) { if (register_cdrom(&stuffp->info) != 0) {
printk("Cannot register Mitsumi CD-ROM!\n"); printk("Cannot register Mitsumi CD-ROM!\n");
release_region((unsigned long) stuffp->wreg_data, release_region(stuffp->wreg_data, MCDX_IO_SIZE);
MCDX_IO_SIZE);
free_irq(stuffp->irq, NULL); free_irq(stuffp->irq, NULL);
kfree(stuffp); kfree(stuffp);
put_disk(disk); put_disk(disk);
...@@ -1413,19 +1400,17 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp, ...@@ -1413,19 +1400,17 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp,
const int HEAD = const int HEAD =
CD_FRAMESIZE_RAW - CD_XA_TAIL - CD_FRAMESIZE_RAW - CD_XA_TAIL -
CD_FRAMESIZE; CD_FRAMESIZE;
insb((unsigned int) stuffp->rreg_data, p, insb(stuffp->rreg_data, p, HEAD);
HEAD);
} }
/* now actually read the data */ /* now actually read the data */
insb((unsigned int) stuffp->rreg_data, p, 512); insb(stuffp->rreg_data, p, 512);
/* test if it's the last sector of a block, /* test if it's the last sector of a block,
* if so, we have to handle XA special */ * if so, we have to handle XA special */
if ((3 == (stuffp->pending & 3)) && stuffp->xa) { if ((3 == (stuffp->pending & 3)) && stuffp->xa) {
char dummy[CD_XA_TAIL]; char dummy[CD_XA_TAIL];
insb((unsigned int) stuffp->rreg_data, insb(stuffp->rreg_data, &dummy[0], CD_XA_TAIL);
&dummy[0], CD_XA_TAIL);
} }
if (stuffp->pending == sector) { if (stuffp->pending == sector) {
...@@ -1493,7 +1478,7 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp, ...@@ -1493,7 +1478,7 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp,
stuffp->busy = 1; stuffp->busy = 1;
/* Now really issue the request command */ /* Now really issue the request command */
outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); outsb(stuffp->wreg_data, cmd, sizeof cmd);
} }
#ifdef AK2 #ifdef AK2
...@@ -1514,9 +1499,9 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp, ...@@ -1514,9 +1499,9 @@ static int mcdx_xfer(struct s_drive_stuff *stuffp,
/* Access to elements of the mcdx_drive_map members */ /* Access to elements of the mcdx_drive_map members */
static char *port(int *ip) static unsigned port(int *ip)
{ {
return (char *) ip[0]; return ip[0];
} }
static int irq(int *ip) static int irq(int *ip)
{ {
...@@ -1682,7 +1667,7 @@ mcdx_playmsf(struct s_drive_stuff *stuffp, const struct cdrom_msf *msf) ...@@ -1682,7 +1667,7 @@ mcdx_playmsf(struct s_drive_stuff *stuffp, const struct cdrom_msf *msf)
"%02x:%02x:%02x -- %02x:%02x:%02x\n", "%02x:%02x:%02x -- %02x:%02x:%02x\n",
cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6]); cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6]);
outsb((unsigned int) stuffp->wreg_data, cmd, sizeof cmd); outsb(stuffp->wreg_data, cmd, sizeof cmd);
if (-1 == mcdx_getval(stuffp, 3 * HZ, 0, NULL)) { if (-1 == mcdx_getval(stuffp, 3 * HZ, 0, NULL)) {
xwarn("playmsf() timeout\n"); xwarn("playmsf() timeout\n");
...@@ -1910,8 +1895,8 @@ static int mcdx_requestversion(struct s_drive_stuff *stuffp, struct s_version *v ...@@ -1910,8 +1895,8 @@ static int mcdx_requestversion(struct s_drive_stuff *stuffp, struct s_version *v
static int mcdx_reset(struct s_drive_stuff *stuffp, enum resetmodes mode, int tries) static int mcdx_reset(struct s_drive_stuff *stuffp, enum resetmodes mode, int tries)
{ {
if (mode == HARD) { if (mode == HARD) {
outb(0, (unsigned int) stuffp->wreg_chn); /* no dma, no irq -> hardware */ outb(0, stuffp->wreg_chn); /* no dma, no irq -> hardware */
outb(0, (unsigned int) stuffp->wreg_reset); /* hw reset */ outb(0, stuffp->wreg_reset); /* hw reset */
return 0; return 0;
} else } else
return mcdx_talk(stuffp, "\x60", 1, NULL, 1, 5 * HZ, tries); return mcdx_talk(stuffp, "\x60", 1, NULL, 1, 5 * HZ, tries);
...@@ -1945,13 +1930,13 @@ mcdx_getval(struct s_drive_stuff *stuffp, int to, int delay, char *buf) ...@@ -1945,13 +1930,13 @@ mcdx_getval(struct s_drive_stuff *stuffp, int to, int delay, char *buf)
if (!buf) if (!buf)
buf = &c; buf = &c;
while (inb((unsigned int) stuffp->rreg_status) & MCDX_RBIT_STEN) { while (inb(stuffp->rreg_status) & MCDX_RBIT_STEN) {
if (time_after(jiffies, timeout)) if (time_after(jiffies, timeout))
return -1; return -1;
mcdx_delay(stuffp, delay); mcdx_delay(stuffp, delay);
} }
*buf = (unsigned char) inb((unsigned int) stuffp->rreg_data) & 0xff; *buf = (unsigned char) inb(stuffp->rreg_data) & 0xff;
return 0; return 0;
} }
......
...@@ -363,7 +363,18 @@ ...@@ -363,7 +363,18 @@
#define __NR_stat64 425 #define __NR_stat64 425
#define __NR_lstat64 426 #define __NR_lstat64 426
#define __NR_fstat64 427 #define __NR_fstat64 427
#define NR_SYSCALLS 428 #define __NR_vserver 428
#define __NR_mbind 429
#define __NR_get_mempolicy 430
#define __NR_set_mempolicy 431
#define __NR_mq_open 432
#define __NR_mq_unlink 433
#define __NR_mq_timedsend 434
#define __NR_mq_timedreceive 435
#define __NR_mq_notify 436
#define __NR_mq_getsetattr 437
#define NR_SYSCALLS 438
#if defined(__GNUC__) #if defined(__GNUC__)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/compiler.h> /* for inline */
#include <linux/types.h> /* for size_t */ #include <linux/types.h> /* for size_t */
#include <linux/stddef.h> /* for NULL */ #include <linux/stddef.h> /* for NULL */
......
...@@ -1479,7 +1479,7 @@ static void neigh_app_notify(struct neighbour *n) ...@@ -1479,7 +1479,7 @@ static void neigh_app_notify(struct neighbour *n)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
struct neigh_sysctl_table { static struct neigh_sysctl_table {
struct ctl_table_header *sysctl_header; struct ctl_table_header *sysctl_header;
ctl_table neigh_vars[17]; ctl_table neigh_vars[17];
ctl_table neigh_dev[2]; ctl_table neigh_dev[2];
......
...@@ -280,7 +280,7 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) ...@@ -280,7 +280,7 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
return err; return err;
} }
int rtnetlink_dump_all(struct sk_buff *skb, struct netlink_callback *cb) static int rtnetlink_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
{ {
int idx; int idx;
int s_idx = cb->family; int s_idx = cb->family;
...@@ -553,7 +553,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi ...@@ -553,7 +553,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
return NOTIFY_DONE; return NOTIFY_DONE;
} }
struct notifier_block rtnetlink_dev_notifier = { static struct notifier_block rtnetlink_dev_notifier = {
.notifier_call = rtnetlink_event, .notifier_call = rtnetlink_event,
}; };
......
...@@ -144,7 +144,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu); ...@@ -144,7 +144,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu);
static int rt_garbage_collect(void); static int rt_garbage_collect(void);
struct dst_ops ipv4_dst_ops = { static struct dst_ops ipv4_dst_ops = {
.family = AF_INET, .family = AF_INET,
.protocol = __constant_htons(ETH_P_IP), .protocol = __constant_htons(ETH_P_IP),
.gc = rt_garbage_collect, .gc = rt_garbage_collect,
...@@ -1525,7 +1525,7 @@ static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr, ...@@ -1525,7 +1525,7 @@ static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr,
* 2. IP spoofing attempts are filtered with 100% of guarantee. * 2. IP spoofing attempts are filtered with 100% of guarantee.
*/ */
int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr, static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
u8 tos, struct net_device *dev) u8 tos, struct net_device *dev)
{ {
struct fib_result res; struct fib_result res;
...@@ -1910,7 +1910,7 @@ int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr, ...@@ -1910,7 +1910,7 @@ int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr,
* Major route resolver routine. * Major route resolver routine.
*/ */
int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
{ {
u32 tos = oldflp->fl4_tos & (IPTOS_RT_MASK | RTO_ONLINK); u32 tos = oldflp->fl4_tos & (IPTOS_RT_MASK | RTO_ONLINK);
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .nl_u = { .ip4_u =
......
...@@ -2137,46 +2137,6 @@ static inline struct tcp_tw_bucket *tw_next(struct tcp_tw_bucket *tw) ...@@ -2137,46 +2137,6 @@ static inline struct tcp_tw_bucket *tw_next(struct tcp_tw_bucket *tw)
hlist_entry(tw->tw_node.next, typeof(*tw), tw_node) : NULL; hlist_entry(tw->tw_node.next, typeof(*tw), tw_node) : NULL;
} }
static void *listening_get_first(struct seq_file *seq)
{
struct tcp_iter_state* st = seq->private;
void *rc = NULL;
for (st->bucket = 0; st->bucket < TCP_LHTABLE_SIZE; ++st->bucket) {
struct open_request *req;
struct tcp_opt *tp;
struct sock *sk = sk_head(&tcp_listening_hash[st->bucket]);
if (!sk)
continue;
if (sk->sk_family == st->family) {
rc = sk;
goto out;
}
tp = tcp_sk(sk);
read_lock_bh(&tp->syn_wait_lock);
if (tp->listen_opt && tp->listen_opt->qlen) {
st->uid = sock_i_uid(sk);
st->syn_wait_sk = sk;
st->state = TCP_SEQ_STATE_OPENREQ;
for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE;
++st->sbucket) {
for (req = tp->listen_opt->syn_table[st->sbucket];
req; req = req->dl_next) {
if (req->class->family != st->family)
continue;
rc = req;
goto out;
}
}
st->state = TCP_SEQ_STATE_LISTENING;
}
read_unlock_bh(&tp->syn_wait_lock);
}
out:
return rc;
}
static void *listening_get_next(struct seq_file *seq, void *cur) static void *listening_get_next(struct seq_file *seq, void *cur)
{ {
struct tcp_opt *tp; struct tcp_opt *tp;
...@@ -2184,6 +2144,12 @@ static void *listening_get_next(struct seq_file *seq, void *cur) ...@@ -2184,6 +2144,12 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
struct sock *sk = cur; struct sock *sk = cur;
struct tcp_iter_state* st = seq->private; struct tcp_iter_state* st = seq->private;
if (!sk) {
st->bucket = 0;
sk = sk_head(&tcp_listening_hash[0]);
goto get_sk;
}
++st->num; ++st->num;
if (st->state == TCP_SEQ_STATE_OPENREQ) { if (st->state == TCP_SEQ_STATE_OPENREQ) {
...@@ -2237,7 +2203,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur) ...@@ -2237,7 +2203,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
static void *listening_get_idx(struct seq_file *seq, loff_t *pos) static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
{ {
void *rc = listening_get_first(seq); void *rc = listening_get_next(seq, NULL);
while (rc && *pos) { while (rc && *pos) {
rc = listening_get_next(seq, rc); rc = listening_get_next(seq, rc);
......
...@@ -539,7 +539,7 @@ struct proto_ops inet6_dgram_ops = { ...@@ -539,7 +539,7 @@ struct proto_ops inet6_dgram_ops = {
.sendpage = sock_no_sendpage, .sendpage = sock_no_sendpage,
}; };
struct net_proto_family inet6_family_ops = { static struct net_proto_family inet6_family_ops = {
.family = PF_INET6, .family = PF_INET6,
.create = inet6_create, .create = inet6_create,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -1418,7 +1418,7 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, ...@@ -1418,7 +1418,7 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE; return NOTIFY_DONE;
} }
struct notifier_block ndisc_netdev_notifier = { static struct notifier_block ndisc_netdev_notifier = {
.notifier_call = ndisc_netdev_event, .notifier_call = ndisc_netdev_event,
}; };
......
...@@ -809,7 +809,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, ...@@ -809,7 +809,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
return err ? : copied; return err ? : copied;
} }
void netlink_data_ready(struct sock *sk, int len) static void netlink_data_ready(struct sock *sk, int len)
{ {
struct netlink_opt *nlk = nlk_sk(sk); struct netlink_opt *nlk = nlk_sk(sk);
...@@ -1126,7 +1126,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v) ...@@ -1126,7 +1126,7 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
return 0; return 0;
} }
struct seq_operations netlink_seq_ops = { static struct seq_operations netlink_seq_ops = {
.start = netlink_seq_start, .start = netlink_seq_start,
.next = netlink_seq_next, .next = netlink_seq_next,
.stop = netlink_seq_stop, .stop = netlink_seq_stop,
...@@ -1159,7 +1159,7 @@ int netlink_unregister_notifier(struct notifier_block *nb) ...@@ -1159,7 +1159,7 @@ int netlink_unregister_notifier(struct notifier_block *nb)
return notifier_chain_unregister(&netlink_chain, nb); return notifier_chain_unregister(&netlink_chain, nb);
} }
struct proto_ops netlink_ops = { static struct proto_ops netlink_ops = {
.family = PF_NETLINK, .family = PF_NETLINK,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.release = netlink_release, .release = netlink_release,
...@@ -1180,7 +1180,7 @@ struct proto_ops netlink_ops = { ...@@ -1180,7 +1180,7 @@ struct proto_ops netlink_ops = {
.sendpage = sock_no_sendpage, .sendpage = sock_no_sendpage,
}; };
struct net_proto_family netlink_family_ops = { static struct net_proto_family netlink_family_ops = {
.family = PF_NETLINK, .family = PF_NETLINK,
.create = netlink_create, .create = netlink_create,
.owner = THIS_MODULE, /* for consistency 8) */ .owner = THIS_MODULE, /* for consistency 8) */
......
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