Commit 1235b44f authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.40

parent 2cfdbda0
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 39 SUBLEVEL = 40
all: Version zImage all: Version zImage
......
...@@ -439,8 +439,6 @@ int vt_waitactive(void) ...@@ -439,8 +439,6 @@ int vt_waitactive(void)
#define vt_wake_waitactive() wake_up(&vt_activate_queue) #define vt_wake_waitactive() wake_up(&vt_activate_queue)
extern int kill_proc(int pid, int sig, int priv);
/* /*
* Performs the back end of a vt switch * Performs the back end of a vt switch
*/ */
......
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
# define PRINTK(x) /**/ # define PRINTK(x) /**/
#endif #endif
extern int session_of_pgrp(int pgrp);
extern int kill_pg(int pgrp, int sig, int priv);
void wait_until_sent(struct tty_struct * tty, int timeout) void wait_until_sent(struct tty_struct * tty, int timeout)
{ {
struct wait_queue wait = { current, NULL }; struct wait_queue wait = { current, NULL };
......
...@@ -85,15 +85,11 @@ int ei_debug = 1; ...@@ -85,15 +85,11 @@ int ei_debug = 1;
static int high_water_mark = 0; static int high_water_mark = 0;
/* Index to functions. */ /* Index to functions. */
int ei_open(struct device *dev); /* Put into the device structure. */
void ei_interrupt(int reg_ptr); /* Installed as the interrupt handler. */
static void ei_tx_intr(struct device *dev); static void ei_tx_intr(struct device *dev);
static void ei_receive(struct device *dev); static void ei_receive(struct device *dev);
static void ei_rx_overrun(struct device *dev); static void ei_rx_overrun(struct device *dev);
/* Routines generic to NS8390-based boards. */ /* Routines generic to NS8390-based boards. */
void NS8390_init(struct device *dev, int startp);
static void NS8390_trigger_send(struct device *dev, unsigned int length, static void NS8390_trigger_send(struct device *dev, unsigned int length,
int start_page); int start_page);
#ifdef HAVE_MULTICAST #ifdef HAVE_MULTICAST
...@@ -288,7 +284,6 @@ void ei_interrupt(int reg_ptr) ...@@ -288,7 +284,6 @@ void ei_interrupt(int reg_ptr)
if (interrupts & ENISR_TX) { if (interrupts & ENISR_TX) {
ei_tx_intr(dev); ei_tx_intr(dev);
} else if (interrupts & ENISR_COUNTERS) { } else if (interrupts & ENISR_COUNTERS) {
struct ei_device *ei_local = (struct ei_device *) dev->priv;
ei_local->stat.rx_frame_errors += inb_p(e8390_base + EN0_COUNTER0); ei_local->stat.rx_frame_errors += inb_p(e8390_base + EN0_COUNTER0);
ei_local->stat.rx_crc_errors += inb_p(e8390_base + EN0_COUNTER1); ei_local->stat.rx_crc_errors += inb_p(e8390_base + EN0_COUNTER1);
ei_local->stat.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2); ei_local->stat.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2);
......
...@@ -2737,7 +2737,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd) { ...@@ -2737,7 +2737,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd) {
* *
* Purpose : reset the SCSI bus. * Purpose : reset the SCSI bus.
* *
* Returns : 0 * Returns : SCSI_RESET_WAKEUP
* *
*/ */
...@@ -2756,6 +2756,6 @@ int NCR5380_reset (Scsi_Cmnd *cmd) { ...@@ -2756,6 +2756,6 @@ int NCR5380_reset (Scsi_Cmnd *cmd) {
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
sti(); sti();
return 0; return SCSI_RESET_WAKEUP;
} }
...@@ -1083,6 +1083,7 @@ int aha1542_reset(Scsi_Cmnd * SCpnt) ...@@ -1083,6 +1083,7 @@ int aha1542_reset(Scsi_Cmnd * SCpnt)
SCtmp->scsi_done(SCpnt); SCtmp->scsi_done(SCpnt);
HOSTDATA(SCpnt->host)->SCint[i] = NULL; HOSTDATA(SCpnt->host)->SCint[i] = NULL;
HOSTDATA(SCpnt->host)->mb[i].status = 0;
} }
return SCSI_RESET_SUCCESS; return SCSI_RESET_SUCCESS;
#else #else
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
extern void print_command(unsigned char *); extern void print_command(unsigned char *);
extern int print_msg(unsigned char *); extern int print_msg(unsigned char *);
extern void print_sense(char *, Scsi_Cmnd *); extern void print_sense(char *, Scsi_Cmnd *);
extern void print_status(int);; extern void print_status(int);
#endif /* def _CONSTANTS_H */ #endif /* def _CONSTANTS_H */
...@@ -131,7 +131,7 @@ int generic_NCR5380_detect(Scsi_Host_Template * tpnt) { ...@@ -131,7 +131,7 @@ int generic_NCR5380_detect(Scsi_Host_Template * tpnt) {
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
instance->io_port = overrides[current_override].port; instance->io_port = overrides[current_override].port;
NCR5380_init(instance); NCR5380_init(instance, 0);
if (overrides[current_override].irq != IRQ_AUTO) if (overrides[current_override].irq != IRQ_AUTO)
instance->irq = overrides[current_override].irq; instance->irq = overrides[current_override].irq;
......
...@@ -360,7 +360,7 @@ int pas16_detect(Scsi_Host_Template * tpnt) { ...@@ -360,7 +360,7 @@ int pas16_detect(Scsi_Host_Template * tpnt) {
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
instance->io_port = io_port; instance->io_port = io_port;
NCR5380_init(instance); NCR5380_init(instance, 0);
if (overrides[current_override].irq != IRQ_AUTO) if (overrides[current_override].irq != IRQ_AUTO)
instance->irq = overrides[current_override].irq; instance->irq = overrides[current_override].irq;
......
...@@ -384,7 +384,6 @@ static void scan_scsis (struct Scsi_Host * shpnt) ...@@ -384,7 +384,6 @@ static void scan_scsis (struct Scsi_Host * shpnt)
if (type != -1) if (type != -1)
{ {
struct Scsi_Device_Template * sdtpnt;
print_inquiry(scsi_result); print_inquiry(scsi_result);
for(sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next) for(sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next)
...@@ -767,7 +766,6 @@ update_timeout(SCpnt, SCpnt->timeout_per_command); ...@@ -767,7 +766,6 @@ update_timeout(SCpnt, SCpnt->timeout_per_command);
if (host->hostt->can_queue) if (host->hostt->can_queue)
{ {
extern unsigned long intr_count;
#ifdef DEBUG #ifdef DEBUG
printk("queuecommand : routine at %08x\n", printk("queuecommand : routine at %08x\n",
host->hostt->queuecommand); host->hostt->queuecommand);
......
...@@ -1014,6 +1014,7 @@ static void sd_init() ...@@ -1014,6 +1014,7 @@ static void sd_init()
rscsi_disks = (Scsi_Disk *) rscsi_disks = (Scsi_Disk *)
scsi_init_malloc(sd_template.dev_max * sizeof(Scsi_Disk)); scsi_init_malloc(sd_template.dev_max * sizeof(Scsi_Disk));
memset(rscsi_disks, 0, sd_template.dev_max * sizeof(Scsi_Disk));
sd_sizes = (int *) scsi_init_malloc((sd_template.dev_max << 4) * sd_sizes = (int *) scsi_init_malloc((sd_template.dev_max << 4) *
sizeof(int)); sizeof(int));
......
...@@ -672,7 +672,7 @@ static int internal_command(unsigned char target, unsigned char lun, const void ...@@ -672,7 +672,7 @@ static int internal_command(unsigned char target, unsigned char lun, const void
*/ */
for (clock = jiffies + 10, temp = 0; (jiffies < clock) && for (clock = jiffies + 10, temp = 0; (jiffies < clock) &&
!((temp = STATUS) & STAT_IO) || (STAT & STAT_BSY);); !((temp = STATUS) & (STAT_IO | STAT_BSY)););
if (jiffies >= clock) if (jiffies >= clock)
{ {
......
...@@ -340,6 +340,7 @@ static void sg_init() ...@@ -340,6 +340,7 @@ static void sg_init()
scsi_generics = (struct scsi_generic *) scsi_generics = (struct scsi_generic *)
scsi_init_malloc(sg_template.dev_noticed * sizeof(struct scsi_generic)); scsi_init_malloc(sg_template.dev_noticed * sizeof(struct scsi_generic));
memset(scsi_generics, 0, sg_template.dev_noticed * sizeof(struct scsi_generic));
sg_template.dev_max = sg_template.dev_noticed; sg_template.dev_max = sg_template.dev_noticed;
} }
......
...@@ -768,6 +768,7 @@ static void sr_init() ...@@ -768,6 +768,7 @@ static void sr_init()
sr_template.dev_max = sr_template.dev_noticed; sr_template.dev_max = sr_template.dev_noticed;
scsi_CDs = (Scsi_CD *) scsi_init_malloc(sr_template.dev_max * sizeof(Scsi_CD)); scsi_CDs = (Scsi_CD *) scsi_init_malloc(sr_template.dev_max * sizeof(Scsi_CD));
memset(scsi_CDs, 0, sr_template.dev_max * sizeof(Scsi_CD));
sr_sizes = (int *) scsi_init_malloc(sr_template.dev_max * sizeof(int)); sr_sizes = (int *) scsi_init_malloc(sr_template.dev_max * sizeof(int));
memset(sr_sizes, 0, sr_template.dev_max * sizeof(int)); memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));
......
...@@ -1750,6 +1750,7 @@ static void st_init() ...@@ -1750,6 +1750,7 @@ static void st_init()
for (i=0, SDp = scsi_devices; i < st_template.dev_noticed; ++i) { for (i=0, SDp = scsi_devices; i < st_template.dev_noticed; ++i) {
STp = &(scsi_tapes[i]); STp = &(scsi_tapes[i]);
STp->device = NULL;
STp->capacity = 0xfffff; STp->capacity = 0xfffff;
STp->dirty = 0; STp->dirty = 0;
STp->rw = ST_IDLE; STp->rw = ST_IDLE;
......
...@@ -289,19 +289,6 @@ pas_mixer_set (int whichDev, unsigned int level) ...@@ -289,19 +289,6 @@ pas_mixer_set (int whichDev, unsigned int level)
/*****/ /*****/
static int
getmixer (int dev, int chn)
{
if (chn == P_M_MV508_RIGHT)
{
return (levels[dev] >> 8) & 0x7f;
}
else
{
return levels[dev] & 0x7f;
}
}
static void static void
pas_mixer_reset (void) pas_mixer_reset (void)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Note 2! The CFLAGS definitions are now in the main makefile... # Note 2! The CFLAGS definitions are now in the main makefile...
SUBDIRS = minix ext ext2 msdos proc isofs nfs xiafs hpfs sysv SUBDIRS = minix ext ext2 msdos proc isofs nfs xiafs umsdos hpfs sysv
ifdef CONFIG_MINIX_FS ifdef CONFIG_MINIX_FS
FS_SUBDIRS := $(FS_SUBDIRS) minix FS_SUBDIRS := $(FS_SUBDIRS) minix
......
...@@ -48,8 +48,6 @@ ...@@ -48,8 +48,6 @@
#include <asm/system.h> #include <asm/system.h>
asmlinkage int sys_exit(int exit_code); asmlinkage int sys_exit(int exit_code);
asmlinkage int sys_close(unsigned fd);
asmlinkage int sys_open(const char *, int, int);
asmlinkage int sys_brk(unsigned long); asmlinkage int sys_brk(unsigned long);
extern void shm_exit (void); extern void shm_exit (void);
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/locks.h> #include <linux/locks.h>
extern int vsprintf (char *, const char *, va_list);
void ext2_error (struct super_block * sb, const char * function, void ext2_error (struct super_block * sb, const char * function,
const char * fmt, ...) const char * fmt, ...)
{ {
......
...@@ -57,12 +57,6 @@ struct inode_operations isofs_dir_inode_operations = { ...@@ -57,12 +57,6 @@ struct inode_operations isofs_dir_inode_operations = {
NULL /* permission */ NULL /* permission */
}; };
/* This is used to speed up lookup. Without this we would need to
make a linear search of the directory to find the file that the
directory read just returned. This is a single element cache. */
struct lookup_cache cache = {0,};
static int isofs_readdir(struct inode * inode, struct file * filp, static int isofs_readdir(struct inode * inode, struct file * filp,
struct dirent * dirent, int count) struct dirent * dirent, int count)
{ {
...@@ -75,9 +69,10 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -75,9 +69,10 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
void * cpnt = NULL; void * cpnt = NULL;
unsigned int old_offset; unsigned int old_offset;
int dlen, rrflag; int dlen, rrflag;
char * dpnt; char * dpnt, *dpnt1;
struct iso_directory_record * de; struct iso_directory_record * de;
dpnt1 = NULL;
if (!inode || !S_ISDIR(inode->i_mode)) if (!inode || !S_ISDIR(inode->i_mode))
return -EBADF; return -EBADF;
...@@ -124,20 +119,21 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -124,20 +119,21 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
filp->f_pos += *((unsigned char *) de); filp->f_pos += *((unsigned char *) de);
if (offset >= bufsize) { if (offset >= bufsize) {
cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL); unsigned int frag1;
memcpy(cpnt, bh->b_data, bufsize); frag1 = bufsize - old_offset;
de = (struct iso_directory_record *) cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
((char *)cpnt + old_offset); memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh); brelse(bh);
offset = filp->f_pos & (bufsize - 1); offset = filp->f_pos & (bufsize - 1);
block = isofs_bmap(inode,(filp->f_pos)>> bufbits); block = isofs_bmap(inode,(filp->f_pos)>> bufbits);
if (!block if (!block
|| !(bh = breada(inode->i_dev, block, bufsize, || !(bh = breada(inode->i_dev, block, bufsize,
filp->f_pos, inode->i_size))) { filp->f_pos, inode->i_size))) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
return 0; return 0;
}; };
memcpy((char *)cpnt+bufsize, bh->b_data, bufsize); memcpy((char *)cpnt+frag1, bh->b_data, offset);
} }
/* Handle the case of the '.' directory */ /* Handle the case of the '.' directory */
...@@ -186,7 +182,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -186,7 +182,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
if (rrflag) { if (rrflag) {
if (rrflag == -1) { /* This is a rock ridge reloc dir */ if (rrflag == -1) { /* This is a rock ridge reloc dir */
if (cpnt) { if (cpnt) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
cpnt = NULL; cpnt = NULL;
}; };
continue; continue;
...@@ -194,9 +190,11 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -194,9 +190,11 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
i = dlen; i = dlen;
} }
else else
if(inode->i_sb->u.isofs_sb.s_mapping == 'n') if(inode->i_sb->u.isofs_sb.s_mapping == 'n') {
dpnt1 = dpnt;
dpnt = kmalloc(dlen, GFP_KERNEL);
for (i = 0; i < dlen && i < NAME_MAX; i++) { for (i = 0; i < dlen && i < NAME_MAX; i++) {
if (!(c = dpnt[i])) break; if (!(c = dpnt1[i])) break;
if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */ if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */
if (c == '.' && i == dlen-3 && de->name[i+1] == ';' && de->name[i+2] == '1') if (c == '.' && i == dlen-3 && de->name[i+1] == ';' && de->name[i+2] == '1')
break; /* Drop trailing '.;1' (ISO9660:1988 7.5.1 requires period) */ break; /* Drop trailing '.;1' (ISO9660:1988 7.5.1 requires period) */
...@@ -204,26 +202,24 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -204,26 +202,24 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
break; /* Drop trailing ';1' */ break; /* Drop trailing ';1' */
if (c == ';') c = '.'; /* Convert remaining ';' to '.' */ if (c == ';') c = '.'; /* Convert remaining ';' to '.' */
dpnt[i] = c; dpnt[i] = c;
}; }
}
for(j=0; j<i; j++) for(j=0; j<i; j++)
put_fs_byte(dpnt[j],j+dirent->d_name); /* And save it */ put_fs_byte(dpnt[j],j+dirent->d_name); /* And save it */
if(dpnt1) {
kfree(dpnt);
dpnt = dpnt1;
}
dcache_add(inode, dpnt, i, inode_number);
}; };
#if 0 #if 0
printk("Nchar: %d\n",i); printk("Nchar: %d\n",i);
#endif #endif
if (i && i+1 < sizeof(cache.filename)) {
cache.ino = inode_number;
cache.dir = inode->i_ino;
cache.dev = inode->i_dev;
strncpy(cache.filename, dpnt, i);
cache.dlen = dlen;
};
if (rrflag) kfree(dpnt); if (rrflag) kfree(dpnt);
if (cpnt) { if (cpnt) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
cpnt = NULL; cpnt = NULL;
}; };
...@@ -239,7 +235,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -239,7 +235,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
to here at the end of the directory. */ to here at the end of the directory. */
out: out:
if (cpnt) if (cpnt)
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
brelse(bh); brelse(bh);
return 0; return 0;
} }
......
...@@ -72,14 +72,19 @@ struct inode_operations isofs_file_inode_operations = { ...@@ -72,14 +72,19 @@ struct inode_operations isofs_file_inode_operations = {
* a 0x0a. A control-Z is also turned into a linefeed. * a 0x0a. A control-Z is also turned into a linefeed.
*/ */
static inline void unixify_text_buffer(char * buffer, int chars, int mode) static inline void unixify_to_fs(char * outbuf, char * buffer, int chars,
int mode)
{ {
char outchar;
while(chars--){ while(chars--){
if(*buffer == 0x1a) *buffer = 0x0a; outchar = *buffer;
if(*buffer == 0x0d){ if(outchar == 0x1a) outchar = 0x0a;
if(mode == ISOFS_FILE_TEXT_M) *buffer = 0x0a; if(outchar == 0x0d){
if(mode == ISOFS_FILE_TEXT) *buffer = ' '; if(mode == ISOFS_FILE_TEXT_M) outchar = 0x0a;
if(mode == ISOFS_FILE_TEXT) outchar = ' ';
} }
put_fs_byte(outchar, outbuf++);
buffer++; buffer++;
} }
} }
...@@ -210,9 +215,10 @@ static int isofs_file_read(struct inode * inode, struct file * filp, char * buf, ...@@ -210,9 +215,10 @@ static int isofs_file_read(struct inode * inode, struct file * filp, char * buf,
if (*bhe) { if (*bhe) {
if (inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT || if (inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT ||
inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT_M) inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT_M)
unixify_text_buffer(offset+(*bhe)->b_data, unixify_to_fs(buf, offset+(*bhe)->b_data, chars,
chars, inode->u.isofs_i.i_file_format); inode->u.isofs_i.i_file_format);
memcpy_tofs(buf,offset+(*bhe)->b_data,chars); else
memcpy_tofs(buf,offset+(*bhe)->b_data,chars);
brelse(*bhe); brelse(*bhe);
buf += chars; buf += chars;
} else { } else {
......
...@@ -346,22 +346,26 @@ void isofs_read_inode(struct inode * inode) ...@@ -346,22 +346,26 @@ void isofs_read_inode(struct inode * inode)
high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra; high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){ if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){
cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL); int frag1, offset;
offset = (inode->i_ino & (bufsize - 1));
frag1 = bufsize - offset;
cpnt = kmalloc(*pnt,GFP_KERNEL);
if (cpnt == NULL) { if (cpnt == NULL) {
printk(KERN_INFO "NoMem ISO inode %lu\n",inode->i_ino); printk(KERN_INFO "NoMem ISO inode %lu\n",inode->i_ino);
brelse(bh); brelse(bh);
goto fail; goto fail;
} }
memcpy(cpnt, bh->b_data, bufsize); memcpy(cpnt, bh->b_data + offset, frag1);
brelse(bh); brelse(bh);
if (!(bh = bread(inode->i_dev,++block, bufsize))) { if (!(bh = bread(inode->i_dev,++block, bufsize))) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
printk("unable to read i-node block"); printk("unable to read i-node block");
goto fail; goto fail;
} }
memcpy((char *)cpnt + bufsize, bh->b_data, bufsize); offset += *pnt - bufsize;
pnt = ((unsigned char *) cpnt memcpy((char *)cpnt+frag1, bh->b_data, offset);
+ (inode->i_ino & (bufsize - 1))); pnt = ((unsigned char *) cpnt);
raw_inode = ((struct iso_directory_record *) pnt); raw_inode = ((struct iso_directory_record *) pnt);
} }
...@@ -370,8 +374,11 @@ void isofs_read_inode(struct inode * inode) ...@@ -370,8 +374,11 @@ void isofs_read_inode(struct inode * inode)
if (raw_inode->flags[-high_sierra] & 2) { if (raw_inode->flags[-high_sierra] & 2) {
inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR; inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
inode->i_nlink = 2; /* There are always at least 2. It is inode->i_nlink = 1; /* Set to 1. We know there are 2, but
hard to figure out what is correct*/ the find utility tries to optimize
if it is 2, and it screws up. It is
easier to give 1 which tells find to
do it the hard way. */
} else { } else {
inode->i_mode = S_IRUGO; /* Everybody gets to read the file. */ inode->i_mode = S_IRUGO; /* Everybody gets to read the file. */
inode->i_nlink = 1; inode->i_nlink = 1;
...@@ -491,7 +498,7 @@ void isofs_read_inode(struct inode * inode) ...@@ -491,7 +498,7 @@ void isofs_read_inode(struct inode * inode)
init_fifo(inode); init_fifo(inode);
} }
if (cpnt) { if (cpnt) {
kfree_s (cpnt, 1 << ISOFS_BLOCK_BITS); kfree (cpnt);
cpnt = NULL; cpnt = NULL;
} }
return; return;
...@@ -536,6 +543,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -536,6 +543,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
int old_offset; int old_offset;
void * cpnt = NULL; void * cpnt = NULL;
int result; int result;
int directory_size;
struct buffer_head * bh; struct buffer_head * bh;
struct iso_directory_record * de; struct iso_directory_record * de;
...@@ -564,6 +572,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -564,6 +572,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
if (de->name_len[0] == 1 && de->name[0] == 1) if (de->name_len[0] == 1 && de->name[0] == 1)
{ {
parent_dir = find_rock_ridge_relocation(de, parent); parent_dir = find_rock_ridge_relocation(de, parent);
directory_size = isonum_733 (de->size);
brelse(bh); brelse(bh);
break; break;
} }
...@@ -571,9 +580,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -571,9 +580,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
#ifdef DEBUG #ifdef DEBUG
printk("Parent dir:%x\n",parent_dir); printk("Parent dir:%x\n",parent_dir);
#endif #endif
/* Now we know the extent where the parent dir starts on. We have no /* Now we know the extent where the parent dir starts on. */
idea how long it is, so we just start reading until we either find
it or we find some kind of unreasonable circumstance. */
result = -1; result = -1;
...@@ -596,6 +603,8 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -596,6 +603,8 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
brelse(bh); brelse(bh);
offset = 0; offset = 0;
block++; block++;
directory_size -= bufsize;
if(directory_size < 0) return -1;
if((block & 1) && (ISOFS_BLOCK_BITS - bufbits)) if((block & 1) && (ISOFS_BLOCK_BITS - bufbits))
return -1; return -1;
if (!block if (!block
...@@ -613,19 +622,21 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -613,19 +622,21 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
if (offset >= bufsize) if (offset >= bufsize)
{ {
if((block & 1) != 0) return -1; unsigned int frag1;
cpnt = kmalloc(1<<ISOFS_BLOCK_BITS,GFP_KERNEL); frag1 = bufsize - old_offset;
memcpy(cpnt, bh->b_data, bufsize); cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
de = (struct iso_directory_record *) memcpy(cpnt, bh->b_data + old_offset, frag1);
((char *)cpnt + old_offset); de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh); brelse(bh);
offset -= bufsize; offset -= bufsize;
directory_size -= bufsize;
if(directory_size < 0) return -1;
block++; block++;
if (!(bh = bread(parent->i_dev,block,bufsize))) { if(!(bh = bread(parent->i_dev,block,bufsize))) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
return -1; return -1;
}; };
memcpy((char *)cpnt+bufsize, bh->b_data, bufsize); memcpy((char *)cpnt+frag1, bh->b_data, offset);
} }
if (find_rock_ridge_relocation(de, parent) == extent){ if (find_rock_ridge_relocation(de, parent) == extent){
...@@ -634,7 +645,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -634,7 +645,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
} }
if (cpnt) { if (cpnt) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
cpnt = NULL; cpnt = NULL;
} }
} }
...@@ -644,7 +655,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -644,7 +655,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
out: out:
if (cpnt) { if (cpnt) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
cpnt = NULL; cpnt = NULL;
} }
brelse(bh); brelse(bh);
......
...@@ -116,18 +116,20 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -116,18 +116,20 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
/* Handle case where the directory entry spans two blocks. /* Handle case where the directory entry spans two blocks.
Usually 1024 byte boundaries */ Usually 1024 byte boundaries */
if (offset >= bufsize) { if (offset >= bufsize) {
cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL); unsigned int frag1;
memcpy(cpnt, bh->b_data, bufsize); frag1 = bufsize - old_offset;
de = (struct iso_directory_record *) cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
((char *)cpnt + old_offset); memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) cpnt;
brelse(bh); brelse(bh);
offset = f_pos & (bufsize - 1); offset = f_pos & (bufsize - 1);
block = isofs_bmap(dir,f_pos>>bufbits); block = isofs_bmap(dir,f_pos>>bufbits);
if (!block || !(bh = bread(dir->i_dev,block,bufsize))) { if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
return 0; return 0;
}; };
memcpy((char *)cpnt+bufsize,bh->b_data,bufsize); memcpy((char *)cpnt+frag1, bh->b_data, offset);
} }
/* Handle the '.' case */ /* Handle the '.' case */
...@@ -179,7 +181,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -179,7 +181,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
} }
match = isofs_match(namelen,name,dpnt,dlen); match = isofs_match(namelen,name,dpnt,dlen);
if (cpnt) { if (cpnt) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
cpnt = NULL; cpnt = NULL;
} }
...@@ -203,7 +205,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -203,7 +205,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
} }
out: out:
if (cpnt) if (cpnt)
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
brelse(bh); brelse(bh);
return NULL; return NULL;
} }
...@@ -227,25 +229,16 @@ int isofs_lookup(struct inode * dir,const char * name, int len, ...@@ -227,25 +229,16 @@ int isofs_lookup(struct inode * dir,const char * name, int len,
} }
ino = 0; ino = 0;
if (dir->i_dev == cache.dev &&
dir->i_ino == cache.dir && if (dcache_lookup(dir, name, len, &ino)) ino_back = dir->i_ino;
len == cache.dlen &&
isofs_match(len, name, cache.filename, cache.dlen))
{
ino = cache.ino;
ino_back = dir->i_ino;
/* These two cases are special, but since they are at the start
of the directory, we can just as easily search there */
if (cache.dlen == 1 && cache.filename[0] == '.') ino = 0;
if (cache.dlen == 2 && cache.filename[0] == '.' &&
cache.filename[1] == '.') ino = 0;
};
if (!ino) { if (!ino) {
if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back))) { if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back))) {
iput(dir); iput(dir);
return -ENOENT; return -ENOENT;
} }
if (ino_back == dir->i_ino)
dcache_add(dir, name, len, ino);
brelse(bh); brelse(bh);
}; };
......
...@@ -419,16 +419,22 @@ char * get_rock_ridge_symlink(struct inode * inode) ...@@ -419,16 +419,22 @@ char * get_rock_ridge_symlink(struct inode * inode)
raw_inode = ((struct iso_directory_record *) pnt); raw_inode = ((struct iso_directory_record *) pnt);
if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){ if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){
cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL); int frag1, offset;
memcpy(cpnt, bh->b_data, bufsize);
offset = (inode->i_ino & (bufsize - 1));
frag1 = bufsize - offset;
cpnt = kmalloc(*pnt,GFP_KERNEL);
if(!cpnt) return NULL;
memcpy(cpnt, bh->b_data + offset, frag1);
brelse(bh); brelse(bh);
if (!(bh = bread(inode->i_dev,++block, bufsize))) { if (!(bh = bread(inode->i_dev,++block, bufsize))) {
kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS); kfree(cpnt);
printk("unable to read i-node block"); printk("unable to read i-node block");
return NULL; return NULL;
}; };
memcpy((char *)cpnt+bufsize, bh->b_data, bufsize); offset += *pnt - bufsize;
pnt = ((unsigned char *) cpnt) + (inode->i_ino & (bufsize - 1)); memcpy((char *)cpnt+frag1, bh->b_data, offset);
pnt = ((unsigned char *) cpnt);
raw_inode = ((struct iso_directory_record *) pnt); raw_inode = ((struct iso_directory_record *) pnt);
}; };
......
...@@ -20,10 +20,6 @@ static int msdos_dir_read(struct inode * inode,struct file * filp, char * buf,in ...@@ -20,10 +20,6 @@ static int msdos_dir_read(struct inode * inode,struct file * filp, char * buf,in
return -EISDIR; return -EISDIR;
} }
int msdos_readdir(struct inode *inode,struct file *filp,
struct dirent *dirent,int count);
static struct file_operations msdos_dir_operations = { static struct file_operations msdos_dir_operations = {
NULL, /* lseek - default */ NULL, /* lseek - default */
msdos_dir_read, /* read */ msdos_dir_read, /* read */
......
...@@ -58,7 +58,6 @@ static struct proc_dir_entry base_dir[] = { ...@@ -58,7 +58,6 @@ static struct proc_dir_entry base_dir[] = {
{ 5,4,"root" }, { 5,4,"root" },
{ 6,3,"exe" }, { 6,3,"exe" },
{ 7,2,"fd" }, { 7,2,"fd" },
{ 8,4,"mmap" },
{ 9,7,"environ" }, { 9,7,"environ" },
{ 10,7,"cmdline" }, { 10,7,"cmdline" },
{ 11,4,"stat" }, { 11,4,"stat" },
......
...@@ -66,7 +66,7 @@ static int proc_lookupfd(struct inode * dir,const char * name, int len, ...@@ -66,7 +66,7 @@ static int proc_lookupfd(struct inode * dir,const char * name, int len,
if (!dir) if (!dir)
return -ENOENT; return -ENOENT;
sb = dir->i_sb; sb = dir->i_sb;
if (!pid || ino > 1 || !S_ISDIR(dir->i_mode)) { if (!pid || ino || !S_ISDIR(dir->i_mode)) {
iput(dir); iput(dir);
return -ENOENT; return -ENOENT;
} }
...@@ -104,20 +104,12 @@ static int proc_lookupfd(struct inode * dir,const char * name, int len, ...@@ -104,20 +104,12 @@ static int proc_lookupfd(struct inode * dir,const char * name, int len,
break; break;
if (!pid || i >= NR_TASKS) if (!pid || i >= NR_TASKS)
return -ENOENT; return -ENOENT;
if (!ino) {
if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode) if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
return -ENOENT; return -ENOENT;
ino = (pid << 16) + 0x100 + fd;
} else { ino = (pid << 16) + 0x100 + fd;
int j = 0;
struct vm_area_struct * mpnt;
for (mpnt = p->mm->mmap; mpnt; mpnt = mpnt->vm_next)
if (mpnt->vm_inode)
j++;
if (fd >= j)
return -ENOENT;
ino = (pid << 16) + 0x200 + fd;
}
if (!(*result = iget(sb,ino))) if (!(*result = iget(sb,ino)))
return -ENOENT; return -ENOENT;
return 0; return 0;
...@@ -136,7 +128,7 @@ static int proc_readfd(struct inode * inode, struct file * filp, ...@@ -136,7 +128,7 @@ static int proc_readfd(struct inode * inode, struct file * filp,
pid = ino >> 16; pid = ino >> 16;
ino &= 0x0000ffff; ino &= 0x0000ffff;
ino -= 7; ino -= 7;
if (ino > 1) if (ino)
return 0; return 0;
while (1) { while (1) {
fd = filp->f_pos; fd = filp->f_pos;
...@@ -160,20 +152,12 @@ static int proc_readfd(struct inode * inode, struct file * filp, ...@@ -160,20 +152,12 @@ static int proc_readfd(struct inode * inode, struct file * filp,
break; break;
if (i >= NR_TASKS) if (i >= NR_TASKS)
return 0; return 0;
if (!ino) { if (fd >= NR_OPEN)
if (fd >= NR_OPEN) break;
break;
if (!p->files->fd[fd] || !p->files->fd[fd]->f_inode) if (!p->files->fd[fd] || !p->files->fd[fd]->f_inode)
continue; continue;
} else {
int j = 0;
struct vm_area_struct * mpnt;
for (mpnt = p->mm->mmap ; mpnt ; mpnt = mpnt->vm_next)
if (mpnt->vm_inode)
j++;
if (fd >= j)
break;
}
j = 10; j = 10;
i = 1; i = 1;
while (fd >= j) { while (fd >= j) {
...@@ -181,10 +165,8 @@ static int proc_readfd(struct inode * inode, struct file * filp, ...@@ -181,10 +165,8 @@ static int proc_readfd(struct inode * inode, struct file * filp,
i++; i++;
} }
j = i; j = i;
if (!ino) ino = (pid << 16) + 0x100 + fd;
ino = (pid << 16) + 0x100 + fd;
else
ino = (pid << 16) + 0x200 + fd;
put_fs_long(ino, &dirent->d_ino); put_fs_long(ino, &dirent->d_ino);
put_fs_word(i, &dirent->d_reclen); put_fs_word(i, &dirent->d_reclen);
put_fs_byte(0, i+dirent->d_name); put_fs_byte(0, i+dirent->d_name);
......
...@@ -152,7 +152,6 @@ void proc_read_inode(struct inode * inode) ...@@ -152,7 +152,6 @@ void proc_read_inode(struct inode * inode)
inode->i_mode = S_IFLNK | S_IRWXU; inode->i_mode = S_IFLNK | S_IRWXU;
return; return;
case 7: case 7:
case 8:
inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR; inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR;
inode->i_op = &proc_fd_inode_operations; inode->i_op = &proc_fd_inode_operations;
inode->i_nlink = 2; inode->i_nlink = 2;
......
...@@ -27,6 +27,7 @@ extern struct file_operations * get_chrfops(unsigned int); ...@@ -27,6 +27,7 @@ extern struct file_operations * get_chrfops(unsigned int);
extern void wait_for_keypress(void); extern void wait_for_keypress(void);
extern void fcntl_init_locks(void); extern void fcntl_init_locks(void);
extern int floppy_grab_irq_and_dma(void);
extern int root_mountflags; extern int root_mountflags;
......
...@@ -190,16 +190,6 @@ extern struct inode_operations isofs_chrdev_inode_operations; ...@@ -190,16 +190,6 @@ extern struct inode_operations isofs_chrdev_inode_operations;
extern struct inode_operations isofs_blkdev_inode_operations; extern struct inode_operations isofs_blkdev_inode_operations;
extern struct inode_operations isofs_fifo_inode_operations; extern struct inode_operations isofs_fifo_inode_operations;
struct lookup_cache{
unsigned long dir; /* If this matches... */
dev_t dev; /* And this matches */
unsigned short dlen; /* and this matches... */
char filename[256]; /* and this matches... */
unsigned long ino; /* Then this is the file we are looking for */
};
extern struct lookup_cache cache;
/* The following macros are used to check for memory leaks. */ /* The following macros are used to check for memory leaks. */
#ifdef LEAK_CHECK #ifdef LEAK_CHECK
#define free_s leak_check_free_s #define free_s leak_check_free_s
......
...@@ -31,6 +31,5 @@ extern struct inode_operations proc_array_inode_operations; ...@@ -31,6 +31,5 @@ extern struct inode_operations proc_array_inode_operations;
extern struct inode_operations proc_kmsg_inode_operations; extern struct inode_operations proc_kmsg_inode_operations;
extern struct inode_operations proc_link_inode_operations; extern struct inode_operations proc_link_inode_operations;
extern struct inode_operations proc_fd_inode_operations; extern struct inode_operations proc_fd_inode_operations;
extern struct inode_operations proc_net_inode_operations;
#endif #endif
...@@ -68,7 +68,6 @@ static char printbuf[1024]; ...@@ -68,7 +68,6 @@ static char printbuf[1024];
extern int console_loglevel; extern int console_loglevel;
extern char empty_zero_page[PAGE_SIZE]; extern char empty_zero_page[PAGE_SIZE];
extern int vsprintf(char *,const char *,va_list);
extern void init(void); extern void init(void);
extern void init_IRQ(void); extern void init_IRQ(void);
extern void init_modules(void); extern void init_modules(void);
......
...@@ -397,7 +397,7 @@ void NCR53c810_test(void) { ...@@ -397,7 +397,7 @@ void NCR53c810_test(void) {
} }
char *pcibios_strerror (int error) { char *pcibios_strerror (int error) {
char buf[80]; static char buf[80];
switch (error) { switch (error) {
case PCIBIOS_SUCCESFUL: case PCIBIOS_SUCCESFUL:
return "SUCCESFUL"; return "SUCCESFUL";
......
...@@ -45,26 +45,14 @@ extern void free_dma(unsigned int dmanr); ...@@ -45,26 +45,14 @@ extern void free_dma(unsigned int dmanr);
extern int do_execve(char * filename, char ** argv, char ** envp, extern int do_execve(char * filename, char ** argv, char ** envp,
struct pt_regs * regs); struct pt_regs * regs);
extern void flush_old_exec(struct linux_binprm * bprm);
extern int open_inode(struct inode * inode, int mode);
extern int read_exec(struct inode *inode, unsigned long offset,
char * addr, unsigned long count);
extern int do_signal(unsigned long oldmask, struct pt_regs * regs); extern int do_signal(unsigned long oldmask, struct pt_regs * regs);
extern void (* iABI_hook)(struct pt_regs * regs); extern void (* iABI_hook)(struct pt_regs * regs);
#ifdef CONFIG_INET #ifdef CONFIG_INET
extern int register_netdev(struct device *);
extern void unregister_netdev(struct device *);
extern void ether_setup(struct device *);
extern struct sk_buff *alloc_skb(unsigned int,int);
extern void kfree_skb(struct sk_buff *, int);
extern void snarf_region(unsigned int, unsigned int); extern void snarf_region(unsigned int, unsigned int);
extern void netif_rx(struct sk_buff *);
extern int dev_rint(unsigned char *, long, int, struct device *);
extern void dev_tint(struct device *); extern void dev_tint(struct device *);
extern struct device *irq2dev_map[]; extern struct device *irq2dev_map[];
extern void dev_kfree_skb(struct sk_buff *, int);
#endif #endif
...@@ -83,6 +71,8 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */ ...@@ -83,6 +71,8 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(do_munmap), X(do_munmap),
X(zeromap_page_range), X(zeromap_page_range),
X(unmap_page_range), X(unmap_page_range),
X(insert_vm_struct),
X(merge_segments),
/* internal kernel memory management */ /* internal kernel memory management */
X(__get_free_pages), X(__get_free_pages),
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
asmlinkage void sys_sync(void); /* it's really int */ asmlinkage void sys_sync(void); /* it's really int */
extern int vsprintf(char * buf, const char * fmt, va_list args);
NORET_TYPE void panic(const char * fmt, ...) NORET_TYPE void panic(const char * fmt, ...)
{ {
static char buf[1024]; static char buf[1024];
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
static char buf[1024]; static char buf[1024];
extern int vsprintf(char * buf, const char * fmt, va_list args);
extern void console_print(const char *); extern void console_print(const char *);
#define DEFAULT_MESSAGE_LOGLEVEL 7 /* KERN_DEBUG */ #define DEFAULT_MESSAGE_LOGLEVEL 7 /* KERN_DEBUG */
......
...@@ -468,7 +468,6 @@ void dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri) ...@@ -468,7 +468,6 @@ void dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri)
void netif_rx(struct sk_buff *skb) void netif_rx(struct sk_buff *skb)
{ {
static int dropping = 0; static int dropping = 0;
extern struct timeval xtime;
/* /*
* Any received buffers are un-owned and should be discarded * Any received buffers are un-owned and should be discarded
......
...@@ -423,7 +423,6 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, struct de ...@@ -423,7 +423,6 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, struct de
struct sk_buff *skb2; struct sk_buff *skb2;
int size, offset; int size, offset;
unsigned long *timeptr, midtime; unsigned long *timeptr, midtime;
extern struct timeval xtime; /* kernel/time.c */
struct device *ndev=NULL; struct device *ndev=NULL;
size = dev->hard_header_len + 64 + len; size = dev->hard_header_len + 64 + len;
......
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