diff -u --recursive --new-file v1.1.39/linux/Makefile linux/Makefile
--- v1.1.39/linux/Makefile	Sat Aug  6 21:32:05 1994
+++ linux/Makefile	Sat Aug  6 21:29:36 1994
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 1
-SUBLEVEL = 39
+SUBLEVEL = 40
 
 all:	Version zImage
 
diff -u --recursive --new-file v1.1.39/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v1.1.39/linux/drivers/char/tty_io.c	Mon Jul 25 17:56:39 1994
+++ linux/drivers/char/tty_io.c	Sat Aug  6 20:47:31 1994
@@ -439,8 +439,6 @@
 
 #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
  */
diff -u --recursive --new-file v1.1.39/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
--- v1.1.39/linux/drivers/char/tty_ioctl.c	Tue May 24 00:34:49 1994
+++ linux/drivers/char/tty_ioctl.c	Sat Aug  6 20:47:31 1994
@@ -31,9 +31,6 @@
 # define	PRINTK(x)	/**/
 #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)
 {
 	struct wait_queue wait = { current, NULL };
diff -u --recursive --new-file v1.1.39/linux/drivers/net/8390.c linux/drivers/net/8390.c
--- v1.1.39/linux/drivers/net/8390.c	Tue Jun 21 14:16:20 1994
+++ linux/drivers/net/8390.c	Sat Aug  6 23:11:37 1994
@@ -85,15 +85,11 @@
 static int high_water_mark = 0;
 
 /* 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_receive(struct device *dev);
 static void ei_rx_overrun(struct device *dev);
 
 /* 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,
 								int start_page);
 #ifdef HAVE_MULTICAST
@@ -288,7 +284,6 @@
 		if (interrupts & ENISR_TX) {
 			ei_tx_intr(dev);
 		} 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_crc_errors   += inb_p(e8390_base + EN0_COUNTER1);
 			ei_local->stat.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2);
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/NCR5380.c linux/drivers/scsi/NCR5380.c
--- v1.1.39/linux/drivers/scsi/NCR5380.c	Wed Aug  3 09:32:28 1994
+++ linux/drivers/scsi/NCR5380.c	Sat Aug  6 20:09:27 1994
@@ -2737,7 +2737,7 @@
  * 
  * Purpose : reset the SCSI bus.
  *
- * Returns : 0
+ * Returns : SCSI_RESET_WAKEUP
  *
  */ 
 
@@ -2756,6 +2756,6 @@
     NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
     sti();
 
-    return 0;
+    return SCSI_RESET_WAKEUP;
 }
 
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
--- v1.1.39/linux/drivers/scsi/aha1542.c	Tue Aug  2 11:27:41 1994
+++ linux/drivers/scsi/aha1542.c	Sat Aug  6 20:20:26 1994
@@ -1083,6 +1083,7 @@
 	      SCtmp->scsi_done(SCpnt);
 	      
 	      HOSTDATA(SCpnt->host)->SCint[i] = NULL;
+	      HOSTDATA(SCpnt->host)->mb[i].status = 0;
 	    }
 	  return SCSI_RESET_SUCCESS;
 #else
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/constants.h linux/drivers/scsi/constants.h
--- v1.1.39/linux/drivers/scsi/constants.h	Wed Dec  1 14:44:16 1993
+++ linux/drivers/scsi/constants.h	Sat Aug  6 20:25:52 1994
@@ -3,5 +3,5 @@
 extern void print_command(unsigned char *);
 extern int print_msg(unsigned char *);
 extern void print_sense(char *,  Scsi_Cmnd *);
-extern void print_status(int);;
+extern void print_status(int);
 #endif /* def _CONSTANTS_H */
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/g_NCR5380.c linux/drivers/scsi/g_NCR5380.c
--- v1.1.39/linux/drivers/scsi/g_NCR5380.c	Tue Aug  2 11:27:41 1994
+++ linux/drivers/scsi/g_NCR5380.c	Sat Aug  6 20:05:31 1994
@@ -131,7 +131,7 @@
 	instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
 	instance->io_port = overrides[current_override].port;
 
-	NCR5380_init(instance);
+	NCR5380_init(instance, 0);
 
 	if (overrides[current_override].irq != IRQ_AUTO)
 	    instance->irq = overrides[current_override].irq;
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/pas16.c linux/drivers/scsi/pas16.c
--- v1.1.39/linux/drivers/scsi/pas16.c	Wed Aug  3 09:32:29 1994
+++ linux/drivers/scsi/pas16.c	Sat Aug  6 20:05:50 1994
@@ -360,7 +360,7 @@
 	instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
 	instance->io_port = io_port;
 
-	NCR5380_init(instance);
+	NCR5380_init(instance, 0);
 
 	if (overrides[current_override].irq != IRQ_AUTO)
 	    instance->irq = overrides[current_override].irq;
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- v1.1.39/linux/drivers/scsi/scsi.c	Wed Aug  3 09:32:29 1994
+++ linux/drivers/scsi/scsi.c	Sat Aug  6 20:47:31 1994
@@ -384,7 +384,6 @@
 	      
 	      if (type != -1)
 		{
-		  struct Scsi_Device_Template * sdtpnt;
 		  print_inquiry(scsi_result);
 
 		  for(sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next)
@@ -767,7 +766,6 @@
 
         if (host->hostt->can_queue)
 		{
-		  extern unsigned long intr_count;
 #ifdef DEBUG
 	printk("queuecommand : routine at %08x\n", 
 		host->hostt->queuecommand);
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
--- v1.1.39/linux/drivers/scsi/sd.c	Wed Aug  3 09:32:30 1994
+++ linux/drivers/scsi/sd.c	Sat Aug  6 20:32:14 1994
@@ -1014,6 +1014,7 @@
 
 	rscsi_disks = (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) * 
 					    sizeof(int));
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/seagate.c linux/drivers/scsi/seagate.c
--- v1.1.39/linux/drivers/scsi/seagate.c	Wed Aug  3 09:32:30 1994
+++ linux/drivers/scsi/seagate.c	Sat Aug  6 20:31:24 1994
@@ -672,7 +672,7 @@
  */
 		
 		for (clock = jiffies + 10, temp = 0; (jiffies < clock) &&
-		    !((temp = STATUS) & STAT_IO) || (STAT & STAT_BSY););
+		    !((temp = STATUS) & (STAT_IO | STAT_BSY)););
 
 		if (jiffies >= clock)
 			{
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
--- v1.1.39/linux/drivers/scsi/sg.c	Tue Aug  2 11:27:42 1994
+++ linux/drivers/scsi/sg.c	Sat Aug  6 20:32:14 1994
@@ -340,6 +340,7 @@
 
    scsi_generics = (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;
  }
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- v1.1.39/linux/drivers/scsi/sr.c	Wed Aug  3 09:32:30 1994
+++ linux/drivers/scsi/sr.c	Sat Aug  6 20:32:14 1994
@@ -768,6 +768,7 @@
 
 	sr_template.dev_max = sr_template.dev_noticed;
 	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));
 	memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));
diff -u --recursive --new-file v1.1.39/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
--- v1.1.39/linux/drivers/scsi/st.c	Sat Aug  6 21:32:06 1994
+++ linux/drivers/scsi/st.c	Sat Aug  6 20:32:14 1994
@@ -1750,6 +1750,7 @@
 
   for (i=0, SDp = scsi_devices; i < st_template.dev_noticed; ++i) {
     STp = &(scsi_tapes[i]);
+    STp->device = NULL;
     STp->capacity = 0xfffff;
     STp->dirty = 0;
     STp->rw = ST_IDLE;
diff -u --recursive --new-file v1.1.39/linux/drivers/sound/pas2_mixer.c linux/drivers/sound/pas2_mixer.c
--- v1.1.39/linux/drivers/sound/pas2_mixer.c	Tue Jul 19 10:19:05 1994
+++ linux/drivers/sound/pas2_mixer.c	Sat Aug  6 20:26:51 1994
@@ -289,19 +289,6 @@
 
 /*****/
 
-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
 pas_mixer_reset (void)
 {
diff -u --recursive --new-file v1.1.39/linux/fs/Makefile linux/fs/Makefile
--- v1.1.39/linux/fs/Makefile	Tue Aug  2 11:27:43 1994
+++ linux/fs/Makefile	Sat Aug  6 20:04:43 1994
@@ -7,7 +7,7 @@
 #
 # 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
 FS_SUBDIRS := $(FS_SUBDIRS) minix
diff -u --recursive --new-file v1.1.39/linux/fs/exec.c linux/fs/exec.c
--- v1.1.39/linux/fs/exec.c	Wed Aug  3 09:32:31 1994
+++ linux/fs/exec.c	Sat Aug  6 20:47:31 1994
@@ -48,8 +48,6 @@
 #include <asm/system.h>
 
 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);
 
 extern void shm_exit (void);
diff -u --recursive --new-file v1.1.39/linux/fs/ext2/super.c linux/fs/ext2/super.c
--- v1.1.39/linux/fs/ext2/super.c	Tue Aug  2 11:27:44 1994
+++ linux/fs/ext2/super.c	Sat Aug  6 20:47:31 1994
@@ -25,8 +25,6 @@
 #include <linux/string.h>
 #include <linux/locks.h>
 
-extern int vsprintf (char *, const char *, va_list);
-
 void ext2_error (struct super_block * sb, const char * function,
 		 const char * fmt, ...)
 {
diff -u --recursive --new-file v1.1.39/linux/fs/isofs/dir.c linux/fs/isofs/dir.c
--- v1.1.39/linux/fs/isofs/dir.c	Tue Apr 19 10:52:57 1994
+++ linux/fs/isofs/dir.c	Sat Aug  6 21:01:33 1994
@@ -57,12 +57,6 @@
 	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,
 	struct dirent * dirent, int count)
 {
@@ -75,9 +69,10 @@
 	void * cpnt = NULL;
 	unsigned int old_offset;
 	int dlen, rrflag;
-	char * dpnt;
+	char * dpnt, *dpnt1;
 	struct iso_directory_record * de;
 	
+	dpnt1 = NULL;
 	if (!inode || !S_ISDIR(inode->i_mode))
 		return -EBADF;
 	
@@ -124,20 +119,21 @@
 		filp->f_pos += *((unsigned char *) de);
 
 		if (offset >=  bufsize) {
-			cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL);
-			memcpy(cpnt, bh->b_data, bufsize);
-			de = (struct iso_directory_record *)
-				((char *)cpnt + old_offset);
+		        unsigned int frag1;
+			frag1 = bufsize - old_offset;
+			cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
+			memcpy(cpnt, bh->b_data + old_offset, frag1);
+			de = (struct iso_directory_record *) ((char *)cpnt);
 			brelse(bh);
 			offset = filp->f_pos & (bufsize - 1);
 			block = isofs_bmap(inode,(filp->f_pos)>> bufbits);
 			if (!block
 			    || !(bh = breada(inode->i_dev, block, bufsize,
 					     filp->f_pos, inode->i_size))) {
-			        kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			        kfree(cpnt);
 				return 0;
 			};
-			memcpy((char *)cpnt+bufsize, bh->b_data, bufsize);
+			memcpy((char *)cpnt+frag1, bh->b_data, offset);
 		}
 		
 		/* Handle the case of the '.' directory */
@@ -186,7 +182,7 @@
 			if (rrflag) {
 			  if (rrflag == -1) {  /* This is a rock ridge reloc dir */
 			    if (cpnt) {
-				kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+				kfree(cpnt);
 				cpnt = NULL;
 			    };
 			    continue;
@@ -194,9 +190,11 @@
 			  i = dlen;
 			}
 			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++) {
-			      if (!(c = dpnt[i])) break;
+			      if (!(c = dpnt1[i])) break;
 			      if (c >= 'A' && c <= 'Z') c |= 0x20;  /* lower case */
 			      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) */
@@ -204,26 +202,24 @@
 				break;  /* Drop trailing ';1' */
 			      if (c == ';') c = '.';  /* Convert remaining ';' to '.' */
 			      dpnt[i] = c;
-			  };
-			
+			    }
+			  }
 			for(j=0; j<i; j++)
 			  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
 		printk("Nchar: %d\n",i);
 #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 (cpnt) {
-			kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			kfree(cpnt);
 			cpnt = NULL;
 		};
 		
@@ -239,7 +235,7 @@
 	   to here at the end of the directory. */
  out:
 	if (cpnt)
-		kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+		kfree(cpnt);
 	brelse(bh);
 	return 0;
 }
diff -u --recursive --new-file v1.1.39/linux/fs/isofs/file.c linux/fs/isofs/file.c
--- v1.1.39/linux/fs/isofs/file.c	Tue Apr 19 10:52:57 1994
+++ linux/fs/isofs/file.c	Sat Aug  6 20:24:51 1994
@@ -72,14 +72,19 @@
  * 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--){
-		if(*buffer == 0x1a) *buffer = 0x0a;
-		if(*buffer == 0x0d){
-			if(mode == ISOFS_FILE_TEXT_M) *buffer = 0x0a;
-			if(mode == ISOFS_FILE_TEXT) *buffer = ' ';
+	  	outchar = *buffer;
+		if(outchar == 0x1a) outchar = 0x0a;
+		if(outchar == 0x0d){
+			if(mode == ISOFS_FILE_TEXT_M) outchar = 0x0a;
+			if(mode == ISOFS_FILE_TEXT) outchar = ' ';
 		}
+		put_fs_byte(outchar, outbuf++);
 		buffer++;
 	}
 }
@@ -210,9 +215,10 @@
 		  if (*bhe) {
 		    if (inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT ||
 			inode->u.isofs_i.i_file_format == ISOFS_FILE_TEXT_M)
-		      unixify_text_buffer(offset+(*bhe)->b_data,
-					  chars, inode->u.isofs_i.i_file_format);
-		    memcpy_tofs(buf,offset+(*bhe)->b_data,chars);
+		      unixify_to_fs(buf, offset+(*bhe)->b_data, chars, 
+				    inode->u.isofs_i.i_file_format);
+		    else
+		      memcpy_tofs(buf,offset+(*bhe)->b_data,chars);
 		    brelse(*bhe);
 		    buf += chars;
 		  } else {
diff -u --recursive --new-file v1.1.39/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
--- v1.1.39/linux/fs/isofs/inode.c	Thu Jul 14 00:48:26 1994
+++ linux/fs/isofs/inode.c	Sat Aug  6 20:19:08 1994
@@ -346,22 +346,26 @@
 	high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
 
 	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) {
 			printk(KERN_INFO "NoMem ISO inode %lu\n",inode->i_ino);
 			brelse(bh);
 			goto fail;
 		}
-		memcpy(cpnt, bh->b_data, bufsize);
+		memcpy(cpnt, bh->b_data + offset, frag1);
 		brelse(bh);
 		if (!(bh = bread(inode->i_dev,++block, bufsize))) {
-			kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			kfree(cpnt);
 			printk("unable to read i-node block");
 			goto fail;
 		}
-		memcpy((char *)cpnt + bufsize, bh->b_data, bufsize);
-		pnt = ((unsigned char *) cpnt
-		       + (inode->i_ino & (bufsize - 1)));
+		offset += *pnt - bufsize;
+		memcpy((char *)cpnt+frag1, bh->b_data, offset);
+		pnt = ((unsigned char *) cpnt);
 		raw_inode = ((struct iso_directory_record *) pnt);
 	}
 
@@ -370,8 +374,11 @@
 	
 	if (raw_inode->flags[-high_sierra] & 2) {
 		inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;
-		inode->i_nlink = 2; /* There are always at least 2.  It is
-				       hard to figure out what is correct*/
+		inode->i_nlink = 1; /* Set to 1.  We know there are 2, but
+				       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 {
 		inode->i_mode = S_IRUGO; /* Everybody gets to read the file. */
 		inode->i_nlink = 1;
@@ -491,7 +498,7 @@
 	    init_fifo(inode);
 	}
 	if (cpnt) {
-		kfree_s (cpnt, 1 << ISOFS_BLOCK_BITS);
+		kfree (cpnt);
 		cpnt = NULL;
 	}
 	return;
@@ -536,6 +543,7 @@
 	int old_offset;
 	void * cpnt = NULL;
 	int result;
+	int directory_size;
 	struct buffer_head * bh;
 	struct iso_directory_record * de;
 	
@@ -564,6 +572,7 @@
 		if (de->name_len[0] == 1 && de->name[0] == 1) 
 		{
 			parent_dir = find_rock_ridge_relocation(de, parent);
+			directory_size = isonum_733 (de->size);
 			brelse(bh);
 			break;
 		}
@@ -571,9 +580,7 @@
 #ifdef DEBUG
 	printk("Parent dir:%x\n",parent_dir);
 #endif
-	/* Now we know the extent where the parent dir starts on.  We have no
-	   idea how long it is, so we just start reading until we either find
-	   it or we find some kind of unreasonable circumstance. */
+	/* Now we know the extent where the parent dir starts on. */
 	
 	result = -1;
 
@@ -596,6 +603,8 @@
 			brelse(bh);
 			offset = 0;
 			block++;
+			directory_size -= bufsize;
+			if(directory_size < 0) return -1;
 			if((block & 1) && (ISOFS_BLOCK_BITS - bufbits))
 			  return -1;
 			if (!block
@@ -613,19 +622,21 @@
 
 		if (offset >= bufsize)
 		{
-			if((block & 1) != 0) return -1;
-			cpnt = kmalloc(1<<ISOFS_BLOCK_BITS,GFP_KERNEL);
-			memcpy(cpnt, bh->b_data, bufsize);
-			de = (struct iso_directory_record *)
-				((char *)cpnt + old_offset);
+ 		        unsigned int frag1;
+ 			frag1 = bufsize - old_offset;
+ 			cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
+ 			memcpy(cpnt, bh->b_data + old_offset, frag1);
+ 			de = (struct iso_directory_record *) ((char *)cpnt);
 			brelse(bh);
 			offset -= bufsize;
+ 			directory_size -= bufsize;
+			if(directory_size < 0) return -1;
 			block++;
-			if (!(bh = bread(parent->i_dev,block,bufsize))) {
-			        kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			if(!(bh = bread(parent->i_dev,block,bufsize))) {
+ 			        kfree(cpnt);
 				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){
@@ -634,7 +645,7 @@
 		}
 		
 		if (cpnt) {
-			kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			kfree(cpnt);
 			cpnt = NULL;
 		}
 	}
@@ -644,7 +655,7 @@
 
  out:
 	if (cpnt) {
-	        kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+	        kfree(cpnt);
 		cpnt = NULL;
 	}
 	brelse(bh);
diff -u --recursive --new-file v1.1.39/linux/fs/isofs/namei.c linux/fs/isofs/namei.c
--- v1.1.39/linux/fs/isofs/namei.c	Tue Jul 19 10:19:13 1994
+++ linux/fs/isofs/namei.c	Sat Aug  6 20:41:00 1994
@@ -116,18 +116,20 @@
 		/* Handle case where the directory entry spans two blocks.
 		   Usually 1024 byte boundaries */
 		if (offset >= bufsize) {
-			cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL);
-			memcpy(cpnt, bh->b_data, bufsize);
-			de = (struct iso_directory_record *)
-			  ((char *)cpnt + old_offset);
+		        unsigned int frag1;
+			frag1 = bufsize - old_offset;
+			cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
+			memcpy(cpnt, bh->b_data + old_offset, frag1);
+
+			de = (struct iso_directory_record *) cpnt;
 			brelse(bh);
 			offset = f_pos & (bufsize - 1);
 			block = isofs_bmap(dir,f_pos>>bufbits);
 			if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
-			        kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			        kfree(cpnt);
 				return 0;
 			};
-			memcpy((char *)cpnt+bufsize,bh->b_data,bufsize);
+			memcpy((char *)cpnt+frag1, bh->b_data, offset);
 		}
 		
 		/* Handle the '.' case */
@@ -179,7 +181,7 @@
 		}
 		match = isofs_match(namelen,name,dpnt,dlen);
 		if (cpnt) {
-			kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+			kfree(cpnt);
 			cpnt = NULL;
 		}
 
@@ -203,7 +205,7 @@
 	}
  out:
 	if (cpnt)
-		kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+		kfree(cpnt);
 	brelse(bh);
 	return NULL;
 }
@@ -227,25 +229,16 @@
 	}
 
 	ino = 0;
-	if (dir->i_dev == cache.dev && 
-	    dir->i_ino == cache.dir &&
-	    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 (dcache_lookup(dir, name, len, &ino)) ino_back = dir->i_ino;
 
 	if (!ino) {
 	  if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back))) {
 	    iput(dir);
 	    return -ENOENT;
 	  }
+	  if (ino_back == dir->i_ino)
+		dcache_add(dir, name, len, ino);
 	  brelse(bh);
 	};
 
diff -u --recursive --new-file v1.1.39/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
--- v1.1.39/linux/fs/isofs/rock.c	Tue Aug  2 11:27:44 1994
+++ linux/fs/isofs/rock.c	Sat Aug  6 20:17:43 1994
@@ -419,16 +419,22 @@
   raw_inode = ((struct iso_directory_record *) pnt);
   
   if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){
-    cpnt = kmalloc(1 << ISOFS_BLOCK_BITS, GFP_KERNEL);
-    memcpy(cpnt, bh->b_data, bufsize);
+    int frag1, offset;
+    
+    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);
     if (!(bh = bread(inode->i_dev,++block, bufsize))) {
-      kfree_s(cpnt, 1 << ISOFS_BLOCK_BITS);
+      kfree(cpnt);
       printk("unable to read i-node block");
       return NULL;
     };
-    memcpy((char *)cpnt+bufsize, bh->b_data, bufsize);
-    pnt = ((unsigned char *) cpnt) + (inode->i_ino & (bufsize - 1));
+    offset += *pnt - bufsize;
+    memcpy((char *)cpnt+frag1, bh->b_data, offset);
+    pnt = ((unsigned char *) cpnt);
     raw_inode = ((struct iso_directory_record *) pnt);
   };
   
diff -u --recursive --new-file v1.1.39/linux/fs/msdos/dir.c linux/fs/msdos/dir.c
--- v1.1.39/linux/fs/msdos/dir.c	Mon Jul 25 17:56:40 1994
+++ linux/fs/msdos/dir.c	Sat Aug  6 20:47:31 1994
@@ -20,10 +20,6 @@
 	return -EISDIR;
 }
 
-int msdos_readdir(struct inode *inode,struct file *filp,
-    struct dirent *dirent,int count);
-
-
 static struct file_operations msdos_dir_operations = {
 	NULL,			/* lseek - default */
 	msdos_dir_read,		/* read */
diff -u --recursive --new-file v1.1.39/linux/fs/proc/base.c linux/fs/proc/base.c
--- v1.1.39/linux/fs/proc/base.c	Mon Jul 18 14:48:30 1994
+++ linux/fs/proc/base.c	Sat Aug  6 20:28:13 1994
@@ -58,7 +58,6 @@
 	{ 5,4,"root" },
 	{ 6,3,"exe" },
 	{ 7,2,"fd" },
-	{ 8,4,"mmap" },
 	{ 9,7,"environ" },
 	{ 10,7,"cmdline" },
 	{ 11,4,"stat" },
diff -u --recursive --new-file v1.1.39/linux/fs/proc/fd.c linux/fs/proc/fd.c
--- v1.1.39/linux/fs/proc/fd.c	Sat May  7 14:54:10 1994
+++ linux/fs/proc/fd.c	Sat Aug  6 20:28:13 1994
@@ -66,7 +66,7 @@
 	if (!dir)
 		return -ENOENT;
 	sb = dir->i_sb;
-	if (!pid || ino > 1 || !S_ISDIR(dir->i_mode)) {
+	if (!pid || ino || !S_ISDIR(dir->i_mode)) {
 		iput(dir);
 		return -ENOENT;
 	}
@@ -104,20 +104,12 @@
 			break;
 	if (!pid || i >= NR_TASKS)
 		return -ENOENT;
-	if (!ino) {
-		if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
-			return -ENOENT;
-		ino = (pid << 16) + 0x100 + fd;
-	} 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)
-			return -ENOENT;
-		ino = (pid << 16) + 0x200 + fd;
-	}
+
+	if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
+	  return -ENOENT;
+
+	ino = (pid << 16) + 0x100 + fd;
+
 	if (!(*result = iget(sb,ino)))
 		return -ENOENT;
 	return 0;
@@ -136,7 +128,7 @@
 	pid = ino >> 16;
 	ino &= 0x0000ffff;
 	ino -= 7;
-	if (ino > 1)
+	if (ino)
 		return 0;
 	while (1) {
 		fd = filp->f_pos;
@@ -160,20 +152,12 @@
 				break;
 		if (i >= NR_TASKS)
 			return 0;
-		if (!ino) {
-			if (fd >= NR_OPEN)
-				break;
-			if (!p->files->fd[fd] || !p->files->fd[fd]->f_inode)
-				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;
-		}
+		if (fd >= NR_OPEN)
+		  break;
+
+		if (!p->files->fd[fd] || !p->files->fd[fd]->f_inode)
+		  continue;
+
 		j = 10;
 		i = 1;
 		while (fd >= j) {
@@ -181,10 +165,8 @@
 			i++;
 		}
 		j = i;
-		if (!ino)
-			ino = (pid << 16) + 0x100 + fd;
-		else
-			ino = (pid << 16) + 0x200 + fd;
+		ino = (pid << 16) + 0x100 + fd;
+
 		put_fs_long(ino, &dirent->d_ino);
 		put_fs_word(i, &dirent->d_reclen);
 		put_fs_byte(0, i+dirent->d_name);
diff -u --recursive --new-file v1.1.39/linux/fs/proc/inode.c linux/fs/proc/inode.c
--- v1.1.39/linux/fs/proc/inode.c	Sat May  7 14:54:10 1994
+++ linux/fs/proc/inode.c	Sat Aug  6 20:28:13 1994
@@ -152,7 +152,6 @@
 			inode->i_mode = S_IFLNK | S_IRWXU;
 			return;
 		case 7:
-		case 8:
 			inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR;
 			inode->i_op = &proc_fd_inode_operations;
 			inode->i_nlink = 2;
diff -u --recursive --new-file v1.1.39/linux/fs/super.c linux/fs/super.c
--- v1.1.39/linux/fs/super.c	Sat Aug  6 21:32:06 1994
+++ linux/fs/super.c	Sat Aug  6 20:27:38 1994
@@ -27,6 +27,7 @@
 
 extern void wait_for_keypress(void);
 extern void fcntl_init_locks(void);
+extern int floppy_grab_irq_and_dma(void);
 
 extern int root_mountflags;
 
diff -u --recursive --new-file v1.1.39/linux/include/linux/iso_fs.h linux/include/linux/iso_fs.h
--- v1.1.39/linux/include/linux/iso_fs.h	Mon Jul 25 17:56:42 1994
+++ linux/include/linux/iso_fs.h	Sat Aug  6 20:17:43 1994
@@ -190,16 +190,6 @@
 extern struct inode_operations isofs_blkdev_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. */
 #ifdef LEAK_CHECK
 #define free_s leak_check_free_s
diff -u --recursive --new-file v1.1.39/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- v1.1.39/linux/include/linux/proc_fs.h	Wed Dec  1 14:44:15 1993
+++ linux/include/linux/proc_fs.h	Sat Aug  6 20:47:32 1994
@@ -31,6 +31,5 @@
 extern struct inode_operations proc_kmsg_inode_operations;
 extern struct inode_operations proc_link_inode_operations;
 extern struct inode_operations proc_fd_inode_operations;
-extern struct inode_operations proc_net_inode_operations;
 
 #endif
diff -u --recursive --new-file v1.1.39/linux/init/main.c linux/init/main.c
--- v1.1.39/linux/init/main.c	Sat Aug  6 21:32:07 1994
+++ linux/init/main.c	Sat Aug  6 20:47:32 1994
@@ -68,7 +68,6 @@
 extern int console_loglevel;
 
 extern char empty_zero_page[PAGE_SIZE];
-extern int vsprintf(char *,const char *,va_list);
 extern void init(void);
 extern void init_IRQ(void);
 extern void init_modules(void);
diff -u --recursive --new-file v1.1.39/linux/kernel/bios32.c linux/kernel/bios32.c
--- v1.1.39/linux/kernel/bios32.c	Wed Aug  3 09:32:33 1994
+++ linux/kernel/bios32.c	Sat Aug  6 20:47:32 1994
@@ -397,7 +397,7 @@
 }
 
 char *pcibios_strerror (int error) {
-    char buf[80];
+    static char buf[80];
     switch (error) {
     case PCIBIOS_SUCCESFUL:
         return "SUCCESFUL";
diff -u --recursive --new-file v1.1.39/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- v1.1.39/linux/kernel/ksyms.c	Wed Aug  3 09:32:33 1994
+++ linux/kernel/ksyms.c	Sat Aug  6 20:47:32 1994
@@ -45,26 +45,14 @@
 
 extern int do_execve(char * filename, char ** argv, char ** envp,
 		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 void (* iABI_hook)(struct pt_regs * regs);
 
 #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 netif_rx(struct sk_buff *);
-extern int dev_rint(unsigned char *, long, int, struct device *);
 extern void dev_tint(struct device *);
 extern struct device *irq2dev_map[];
-extern void dev_kfree_skb(struct sk_buff *, int);
 #endif
 
 
@@ -83,6 +71,8 @@
 	X(do_munmap),
 	X(zeromap_page_range),
 	X(unmap_page_range),
+	X(insert_vm_struct),
+	X(merge_segments),
 
 	/* internal kernel memory management */
 	X(__get_free_pages),
diff -u --recursive --new-file v1.1.39/linux/kernel/panic.c linux/kernel/panic.c
--- v1.1.39/linux/kernel/panic.c	Wed Dec  1 14:44:15 1993
+++ linux/kernel/panic.c	Sat Aug  6 20:47:32 1994
@@ -15,8 +15,6 @@
 
 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, ...)
 {
 	static char buf[1024];
diff -u --recursive --new-file v1.1.39/linux/kernel/printk.c linux/kernel/printk.c
--- v1.1.39/linux/kernel/printk.c	Tue Dec 28 13:22:42 1993
+++ linux/kernel/printk.c	Sat Aug  6 20:47:32 1994
@@ -24,7 +24,6 @@
 
 static char buf[1024];
 
-extern int vsprintf(char * buf, const char * fmt, va_list args);
 extern void console_print(const char *);
 
 #define DEFAULT_MESSAGE_LOGLEVEL 7 /* KERN_DEBUG */
diff -u --recursive --new-file v1.1.39/linux/net/inet/dev.c linux/net/inet/dev.c
--- v1.1.39/linux/net/inet/dev.c	Wed Aug  3 09:32:34 1994
+++ linux/net/inet/dev.c	Sat Aug  6 20:47:32 1994
@@ -468,7 +468,6 @@
 void netif_rx(struct sk_buff *skb)
 {
 	static int dropping = 0;
-	extern struct timeval xtime;
 
 	/*
 	 *	Any received buffers are un-owned and should be discarded
diff -u --recursive --new-file v1.1.39/linux/net/inet/icmp.c linux/net/inet/icmp.c
--- v1.1.39/linux/net/inet/icmp.c	Wed Jul 13 01:09:44 1994
+++ linux/net/inet/icmp.c	Sat Aug  6 20:47:32 1994
@@ -423,7 +423,6 @@
 	struct sk_buff *skb2;
 	int size, offset;
 	unsigned long *timeptr, midtime;
-	extern struct timeval xtime;			/* kernel/time.c */
 	struct device *ndev=NULL;
  
 	size = dev->hard_header_len + 64 + len;
