diff -u --recursive --new-file v2.1.54/linux/MAINTAINERS linux/MAINTAINERS --- v2.1.54/linux/MAINTAINERS Wed Sep 3 20:52:41 1997 +++ linux/MAINTAINERS Sun Sep 7 14:00:19 1997 @@ -138,9 +138,9 @@ S: Maintained APPLETALK NETWORK LAYER -P: Alan Cox & University Of Michigan -M: net-patches@lxorguk.ukuu.org.uk -L: netatalk@umich.edu +P: Jay Schulist +M: Jay.Schulist@spacs.k12.wi.us +L: linux-atalk@netspace.org S: Maintained DECnet NETWORK LAYER diff -u --recursive --new-file v2.1.54/linux/Makefile linux/Makefile --- v2.1.54/linux/Makefile Sun Sep 7 13:10:42 1997 +++ linux/Makefile Mon Sep 8 21:57:58 1997 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 54 +SUBLEVEL = 55 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) diff -u --recursive --new-file v2.1.54/linux/arch/i386/defconfig linux/arch/i386/defconfig --- v2.1.54/linux/arch/i386/defconfig Sun Sep 7 13:10:42 1997 +++ linux/arch/i386/defconfig Sun Sep 7 14:15:41 1997 @@ -149,8 +149,6 @@ # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set -# CONFIG_SCSI_MESH is not set -# CONFIG_SCSI_MAC53C94 is not set # # Network device support @@ -240,7 +238,6 @@ # CONFIG_APM is not set # CONFIG_WATCHDOG is not set # CONFIG_RTC is not set -# CONFIG_H8 is not set # CONFIG_NVRAM is not set # CONFIG_JOYSTICK is not set diff -u --recursive --new-file v2.1.54/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S --- v2.1.54/linux/arch/i386/kernel/entry.S Thu Jun 26 12:33:36 1997 +++ linux/arch/i386/kernel/entry.S Mon Sep 8 10:23:56 1997 @@ -373,7 +373,7 @@ .long SYMBOL_NAME(sys_mknod) .long SYMBOL_NAME(sys_chmod) /* 15 */ .long SYMBOL_NAME(sys_chown) - .long SYMBOL_NAME(sys_break) + .long SYMBOL_NAME(sys_ni_syscall) /* old break syscall holder */ .long SYMBOL_NAME(sys_stat) .long SYMBOL_NAME(sys_lseek) .long SYMBOL_NAME(sys_getpid) /* 20 */ @@ -387,11 +387,11 @@ .long SYMBOL_NAME(sys_fstat) .long SYMBOL_NAME(sys_pause) .long SYMBOL_NAME(sys_utime) /* 30 */ - .long SYMBOL_NAME(sys_stty) - .long SYMBOL_NAME(sys_gtty) + .long SYMBOL_NAME(sys_ni_syscall) /* old stty syscall holder */ + .long SYMBOL_NAME(sys_ni_syscall) /* old gtty syscall holder */ .long SYMBOL_NAME(sys_access) .long SYMBOL_NAME(sys_nice) - .long SYMBOL_NAME(sys_ftime) /* 35 */ + .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ /* old ftime syscall holder */ .long SYMBOL_NAME(sys_sync) .long SYMBOL_NAME(sys_kill) .long SYMBOL_NAME(sys_rename) @@ -400,7 +400,7 @@ .long SYMBOL_NAME(sys_dup) .long SYMBOL_NAME(sys_pipe) .long SYMBOL_NAME(sys_times) - .long SYMBOL_NAME(sys_prof) + .long SYMBOL_NAME(sys_ni_syscall) /* old prof syscall holder */ .long SYMBOL_NAME(sys_brk) /* 45 */ .long SYMBOL_NAME(sys_setgid) .long SYMBOL_NAME(sys_getgid) @@ -408,13 +408,13 @@ .long SYMBOL_NAME(sys_geteuid) .long SYMBOL_NAME(sys_getegid) /* 50 */ .long SYMBOL_NAME(sys_acct) - .long SYMBOL_NAME(sys_phys) - .long SYMBOL_NAME(sys_lock) + .long SYMBOL_NAME(sys_ni_syscall) /* old phys syscall holder */ + .long SYMBOL_NAME(sys_ni_syscall) /* old lock syscall holder */ .long SYMBOL_NAME(sys_ioctl) .long SYMBOL_NAME(sys_fcntl) /* 55 */ - .long SYMBOL_NAME(sys_mpx) + .long SYMBOL_NAME(sys_ni_syscall) /* old mpx syscall holder */ .long SYMBOL_NAME(sys_setpgid) - .long SYMBOL_NAME(sys_ulimit) + .long SYMBOL_NAME(sys_ni_syscall) /* old ulimit syscall holder */ .long SYMBOL_NAME(sys_olduname) .long SYMBOL_NAME(sys_umask) /* 60 */ .long SYMBOL_NAME(sys_chroot) @@ -454,7 +454,7 @@ .long SYMBOL_NAME(sys_fchown) /* 95 */ .long SYMBOL_NAME(sys_getpriority) .long SYMBOL_NAME(sys_setpriority) - .long SYMBOL_NAME(sys_profil) + .long SYMBOL_NAME(sys_ni_syscall) /* old profil syscall holder */ .long SYMBOL_NAME(sys_statfs) .long SYMBOL_NAME(sys_fstatfs) /* 100 */ .long SYMBOL_NAME(sys_ioperm) diff -u --recursive --new-file v2.1.54/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c --- v2.1.54/linux/arch/i386/kernel/smp.c Mon Aug 4 16:25:35 1997 +++ linux/arch/i386/kernel/smp.c Sun Sep 7 14:00:19 1997 @@ -85,7 +85,7 @@ * 5AP. Remote read is never used * 9AP. XXX NEED TO CHECK WE HANDLE THIS XXX * 10AP. XXX NEED TO CHECK WE HANDLE THIS XXX - * 11AP. Linux read the APIC between writes to avoid this, as per + * 11AP. Linux reads the APIC between writes to avoid this, as per * the documentation. Make sure you preserve this as it affects * the C stepping chips too. * @@ -887,10 +887,14 @@ /* * Initialize the logical to physical cpu number mapping + * and the per-CPU profiling counter/multiplier */ - for (i = 0; i < NR_CPUS; i++) + for (i = 0; i < NR_CPUS; i++) { cpu_number_map[i] = -1; + prof_counter[i] = 1; + prof_multiplier[i] = 1; + } /* * Setup boot CPU information @@ -917,15 +921,8 @@ * of here now! */ - if (!smp_found_config) { - /* - * For SMP-simulation on one CPU to work, we must initialize these - * values for the single CPU here: - */ - prof_counter[0] = prof_multiplier[0] = 1; - + if (!smp_found_config) return; - } /* * Map the local APIC into kernel space @@ -1625,7 +1622,6 @@ __initfunc(void setup_APIC_clock (void)) { - int cpu = smp_processor_id(); unsigned long flags; static volatile int calibration_lock; @@ -1658,11 +1654,10 @@ } /* - * Now set up the timer for real. Profiling multiplier is 1. + * Now set up the timer for real. */ - setup_APIC_timer (calibration_result); - prof_counter[cpu] = prof_multiplier[cpu] = 1; + setup_APIC_timer (calibration_result); /* * We ACK the APIC, just in case there is something pending. diff -u --recursive --new-file v2.1.54/linux/arch/i386/kernel/sys_i386.c linux/arch/i386/kernel/sys_i386.c --- v2.1.54/linux/arch/i386/kernel/sys_i386.c Thu Feb 27 10:57:29 1997 +++ linux/arch/i386/kernel/sys_i386.c Sun Sep 7 14:10:00 1997 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -203,3 +204,45 @@ unlock_kernel(); return ret; } + +/* + * Old cruft + */ +asmlinkage int sys_uname(struct old_utsname * name) +{ + if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) + return 0; + return -EFAULT; +} + +asmlinkage int sys_olduname(struct oldold_utsname * name) +{ + int error; + + if (!name) + return -EFAULT; + if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) + return -EFAULT; + + error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + error -= __put_user(0,name->sysname+__OLD_UTS_LEN); + error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error -= __put_user(0,name->nodename+__OLD_UTS_LEN); + error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error -= __put_user(0,name->release+__OLD_UTS_LEN); + error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error -= __put_user(0,name->version+__OLD_UTS_LEN); + error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error = __put_user(0,name->machine+__OLD_UTS_LEN); + error = error ? -EFAULT : 0; + + return error; +} + +asmlinkage int sys_pause(void) +{ + current->state = TASK_INTERRUPTIBLE; + schedule(); + return -ERESTARTNOHAND; +} + diff -u --recursive --new-file v2.1.54/linux/drivers/char/Config.in linux/drivers/char/Config.in --- v2.1.54/linux/drivers/char/Config.in Sun Sep 7 13:10:42 1997 +++ linux/drivers/char/Config.in Mon Sep 8 22:26:09 1997 @@ -104,7 +104,9 @@ tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT fi bool 'Enhanced Real Time Clock Support' CONFIG_RTC -bool 'Tadpole ANA H8 Support' CONFIG_H8 +if [ "$CONFIG_PPC" = "y" ]; then + bool 'Tadpole ANA H8 Support' CONFIG_H8 +fi tristate '/dev/nvram support' CONFIG_NVRAM tristate 'PC joystick support' CONFIG_JOYSTICK endmenu diff -u --recursive --new-file v2.1.54/linux/drivers/char/apm_bios.c linux/drivers/char/apm_bios.c --- v2.1.54/linux/drivers/char/apm_bios.c Wed Apr 23 19:01:17 1997 +++ linux/drivers/char/apm_bios.c Sun Sep 7 14:00:19 1997 @@ -40,6 +40,10 @@ * is only incorrect by 30-60mS (vs. 1S previously) (Gabor J. Toth * ); improve interaction between * screen-blanking and gpm (Stephen Rothwell); Linux 1.99.4 + * 1.2a:Simple change to stop mysterious bug reports with SMP also added + * levels to the printk calls. APM is not defined for SMP machines. + * The new replacment for it is, but Linux doesn't yet support this. + * Alan Cox Linux 2.1.55 * * Reference: * @@ -492,9 +496,9 @@ for (i = 0; i < ERROR_COUNT; i++) if (error_table[i].key == err) break; if (i < ERROR_COUNT) - printk("apm_bios: %s: %s\n", str, error_table[i].msg); + printk(KERN_NOTICE "apm_bios: %s: %s\n", str, error_table[i].msg); else - printk("apm_bios: %s: unknown error code %#2.2x\n", str, err); + printk(KERN_NOTICE "apm_bios: %s: unknown error code %#2.2x\n", str, err); } /* Called from console driver -- must make sure apm_enabled. */ @@ -725,10 +729,10 @@ } #ifdef APM_DEBUG if (event <= NR_APM_EVENT_NAME) - printk("APM BIOS received %s notify\n", + printk(KERN_DEBUG "APM BIOS received %s notify\n", apm_event_name[event - 1]); else - printk("APM BIOS received unknown event 0x%02x\n", + printk(KERN_DEBUG "APM BIOS received unknown event 0x%02x\n", event); #endif } @@ -802,7 +806,7 @@ static int check_apm_bios_struct(struct apm_bios_struct *as, const char *func) { if ((as == NULL) || (as->magic != APM_BIOS_MAGIC)) { - printk("apm_bios: %s passed bad filp", func); + printk(KERN_ERR "apm_bios: %s passed bad filp", func); return 1; } return 0; @@ -940,7 +944,7 @@ as1 = as1->next) ; if (as1 == NULL) - printk("apm_bios: filp not in user list"); + printk(KERN_ERR "apm_bios: filp not in user list"); else as1->next = as->next; } @@ -954,7 +958,7 @@ as = (struct apm_bios_struct *)kmalloc(sizeof(*as), GFP_KERNEL); if (as == NULL) { - printk("apm_bios: cannot allocate struct of size %d bytes", + printk(KERN_ERR "apm_bios: cannot allocate struct of size %d bytes", sizeof(*as)); return -ENOMEM; } @@ -1070,17 +1074,21 @@ char * bat_stat; static struct proc_dir_entry *ent; +#ifdef __SMP__ + printk(KERN_NOTICE "APM disabled: APM is not SMP safe.\n"); + return; +#endif if (apm_bios_info.version == 0) { - printk("APM BIOS not found.\n"); + printk(KERN_INFO "APM BIOS not found.\n"); return; } - printk("APM BIOS version %c.%c Flags 0x%02x (Driver version %s)\n", + printk(KERN_INFO "APM BIOS version %c.%c Flags 0x%02x (Driver version %s)\n", ((apm_bios_info.version >> 8) & 0xff) + '0', (apm_bios_info.version & 0xff) + '0', apm_bios_info.flags, driver_version); if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) { - printk(" No 32 bit BIOS support\n"); + printk(KERN_INFO " No 32 bit BIOS support\n"); return; } @@ -1091,7 +1099,7 @@ if (apm_bios_info.version == 0x001) apm_bios_info.version = 0x100; - printk(" Entry %x:%lx cseg16 %x dseg %x", + printk(KERN_INFO " Entry %x:%lx cseg16 %x dseg %x", apm_bios_info.cseg, apm_bios_info.offset, apm_bios_info.cseg_16, apm_bios_info.dseg); if (apm_bios_info.version > 0x100) @@ -1139,7 +1147,7 @@ error = apm_get_power_status(&bx, &cx, &dx); if (error) - printk(" Power status not available\n"); + printk(KERN_INFO " Power status not available\n"); else { switch ((bx >> 8) & 0xff) { case 0: power_stat = "off line"; break; @@ -1154,7 +1162,7 @@ case 3: bat_stat = "charging"; break; default: bat_stat = "unknown"; break; } - printk(" AC %s, battery status %s, battery life ", + printk(KERN_INFO " AC %s, battery status %s, battery life ", power_stat, bat_stat); if ((cx & 0xff) == 0xff) printk("unknown\n"); diff -u --recursive --new-file v2.1.54/linux/drivers/scsi/Config.in linux/drivers/scsi/Config.in --- v2.1.54/linux/drivers/scsi/Config.in Wed Sep 3 20:52:43 1997 +++ linux/drivers/scsi/Config.in Mon Sep 8 22:20:16 1997 @@ -108,9 +108,11 @@ fi dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI #dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI -dep_tristate 'MESH (Power Mac internal SCSI) support' CONFIG_SCSI_MESH $CONFIG_SCSI -if [ "$CONFIG_SCSI_MESH" != "n" ]; then - int ' maximum synchronous transfer rate (MB/s) (0 = async)' CONFIG_SCSI_MESH_SYNC_RATE 5 +if [ "$CONFIG_PPC" = "y" ]; then + dep_tristate 'MESH (Power Mac internal SCSI) support' CONFIG_SCSI_MESH $CONFIG_SCSI + if [ "$CONFIG_SCSI_MESH" != "n" ]; then + int ' maximum synchronous transfer rate (MB/s) (0 = async)' CONFIG_SCSI_MESH_SYNC_RATE 5 + fi + dep_tristate '53C94 (Power Mac external SCSI) support' CONFIG_SCSI_MAC53C94 $CONFIG_SCSI fi -dep_tristate '53C94 (Power Mac external SCSI) support' CONFIG_SCSI_MAC53C94 $CONFIG_SCSI endmenu diff -u --recursive --new-file v2.1.54/linux/fs/affs/dir.c linux/fs/affs/dir.c --- v2.1.54/linux/fs/affs/dir.c Mon Jun 16 16:35:56 1997 +++ linux/fs/affs/dir.c Sun Sep 7 14:00:19 1997 @@ -23,7 +23,7 @@ #include #include -static int affs_readdir(struct inode *, struct file *, void *, filldir_t); +static int affs_readdir(struct file *, void *, filldir_t); static long affs_dir_read(struct inode * inode, struct file * filp, char * buf, unsigned long count); @@ -69,7 +69,7 @@ } static int -affs_readdir(struct inode *inode, struct file *filp, void *dirent, filldir_t filldir) +affs_readdir(struct file *filp, void *dirent, filldir_t filldir) { int j, namelen; s32 i; @@ -82,6 +82,7 @@ struct buffer_head *dir_bh; struct buffer_head *fh_bh; struct inode *dir; + struct inode *inode = file->f_dentry->d_inode; pr_debug("AFFS: readdir(ino=%ld,f_pos=%lu)\n",inode->i_ino,filp->f_pos); diff -u --recursive --new-file v2.1.54/linux/fs/affs/inode.c linux/fs/affs/inode.c --- v2.1.54/linux/fs/affs/inode.c Mon Aug 18 18:19:46 1997 +++ linux/fs/affs/inode.c Mon Sep 8 21:34:09 1997 @@ -908,7 +908,6 @@ inode->i_dev = sb->s_dev; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; - mark_inode_dirty(inode); inode->i_ino = block; inode->i_op = NULL; inode->i_blocks = 0; @@ -928,6 +927,7 @@ inode->u.affs_i.i_lastblock = -1; insert_inode_hash(inode); + mark_inode_dirty(inode); return inode; } diff -u --recursive --new-file v2.1.54/linux/fs/autofs/dir.c linux/fs/autofs/dir.c --- v2.1.54/linux/fs/autofs/dir.c Mon Aug 4 16:25:38 1997 +++ linux/fs/autofs/dir.c Sun Sep 7 14:00:19 1997 @@ -12,9 +12,10 @@ #include "autofs_i.h" -static int autofs_dir_readdir(struct inode *inode, struct file *filp, +static int autofs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) { + struct inode *inode=filp->f_dentry->d_inode; if (!inode || !S_ISDIR(inode->i_mode)) return -ENOTDIR; diff -u --recursive --new-file v2.1.54/linux/fs/autofs/root.c linux/fs/autofs/root.c --- v2.1.54/linux/fs/autofs/root.c Sun Sep 7 13:10:43 1997 +++ linux/fs/autofs/root.c Sun Sep 7 14:09:15 1997 @@ -15,7 +15,7 @@ #include #include "autofs_i.h" -static int autofs_root_readdir(struct inode *,struct file *,void *,filldir_t); +static int autofs_root_readdir(struct file *,void *,filldir_t); static int autofs_root_lookup(struct inode *,struct dentry *); static int autofs_root_symlink(struct inode *,struct dentry *,const char *); static int autofs_root_unlink(struct inode *,struct dentry *); @@ -63,11 +63,11 @@ NULL /* revalidate */ }; -static int autofs_root_readdir(struct inode *inode, struct file *filp, - void *dirent, filldir_t filldir) +static int autofs_root_readdir(struct file *filp, void *dirent, filldir_t filldir) { struct autofs_dir_ent *ent; struct autofs_dirhash *dirhash; + struct inode * inode = filp->f_dentry->d_inode; off_t onr, nr; if (!inode || !S_ISDIR(inode->i_mode)) diff -u --recursive --new-file v2.1.54/linux/fs/dquot.c linux/fs/dquot.c --- v2.1.54/linux/fs/dquot.c Mon Aug 4 16:25:39 1997 +++ linux/fs/dquot.c Sun Sep 7 11:11:30 1997 @@ -222,7 +222,7 @@ { short type = dquot->dq_type; struct file *filp = dquot->dq_mnt->mnt_quotas[type]; - unsigned short fs; + unsigned long fs; if (!(dquot->dq_flags & DQ_MOD) || (filp == (struct file *)NULL)) return; @@ -254,7 +254,7 @@ { short type = dquot->dq_type; struct file *filp = dquot->dq_mnt->mnt_quotas[type]; - unsigned short fs; + unsigned long fs; if (filp == (struct file *)NULL) return; diff -u --recursive --new-file v2.1.54/linux/fs/ext2/dir.c linux/fs/ext2/dir.c --- v2.1.54/linux/fs/ext2/dir.c Thu Jul 17 10:06:06 1997 +++ linux/fs/ext2/dir.c Sun Sep 7 14:00:24 1997 @@ -32,7 +32,7 @@ return -EISDIR; } -static int ext2_readdir (struct inode *, struct file *, void *, filldir_t); +static int ext2_readdir(struct file *, void *, filldir_t); static struct file_operations ext2_dir_operations = { NULL, /* lseek - default */ @@ -101,7 +101,7 @@ return error_msg == NULL ? 1 : 0; } -static int ext2_readdir (struct inode * inode, struct file * filp, +static int ext2_readdir(struct file * filp, void * dirent, filldir_t filldir) { int error = 0; @@ -111,6 +111,7 @@ struct ext2_dir_entry * de; struct super_block * sb; int err; + struct inode *inode = filp->f_dentry->d_inode; if (!inode || !S_ISDIR(inode->i_mode)) return -EBADF; diff -u --recursive --new-file v2.1.54/linux/fs/ext2/ialloc.c linux/fs/ext2/ialloc.c --- v2.1.54/linux/fs/ext2/ialloc.c Mon Aug 4 16:25:39 1997 +++ linux/fs/ext2/ialloc.c Mon Sep 8 21:24:51 1997 @@ -448,7 +448,7 @@ mode |= S_ISGID; } else inode->i_gid = current->fsgid; - mark_inode_dirty(inode); + inode->i_ino = j; inode->i_blksize = PAGE_SIZE; /* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks = 0; @@ -468,6 +468,7 @@ if (inode->u.ext2_i.i_flags & EXT2_SYNC_FL) inode->i_flags |= MS_SYNCHRONOUS; insert_inode_hash(inode); + mark_inode_dirty(inode); inc_inode_version (inode, gdp, mode); unlock_super (sb); diff -u --recursive --new-file v2.1.54/linux/fs/ext2/truncate.c linux/fs/ext2/truncate.c --- v2.1.54/linux/fs/ext2/truncate.c Thu Jul 17 10:06:06 1997 +++ linux/fs/ext2/truncate.c Sun Sep 7 13:01:03 1997 @@ -347,7 +347,7 @@ retry |= trunc_tindirect (inode); if (!retry) break; - if (IS_SYNC(inode) && test_bit(I_DIRTY, &inode->i_state)) + if (IS_SYNC(inode) && (inode->i_state & I_DIRTY)) ext2_sync_inode (inode); current->counter = 0; schedule (); diff -u --recursive --new-file v2.1.54/linux/fs/fat/dir.c linux/fs/fat/dir.c --- v2.1.54/linux/fs/fat/dir.c Mon Jun 16 16:35:57 1997 +++ linux/fs/fat/dir.c Sun Sep 7 14:00:24 1997 @@ -316,11 +316,11 @@ } int fat_readdir( - struct inode *inode, struct file *filp, void *dirent, filldir_t filldir) { + struct inode *inode = filp->f_dentry->d_inode; return fat_readdirx(inode, filp, dirent, fat_filldir, filldir, 0, 1, 0); } diff -u --recursive --new-file v2.1.54/linux/fs/hpfs/hpfs_fs.c linux/fs/hpfs/hpfs_fs.c --- v2.1.54/linux/fs/hpfs/hpfs_fs.c Mon Aug 4 16:25:39 1997 +++ linux/fs/hpfs/hpfs_fs.c Sun Sep 7 14:00:24 1997 @@ -189,7 +189,7 @@ static long hpfs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count); -static int hpfs_readdir(struct inode *inode, struct file *filp, +static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir); static int hpfs_lookup(struct inode *, struct dentry *); @@ -1362,7 +1362,7 @@ } } -static int hpfs_readdir(struct inode *inode, struct file *filp, void * dirent, +static int hpfs_readdir(struct file *filp, void * dirent, filldir_t filldir) { struct quad_buffer_head qbh; @@ -1371,6 +1371,7 @@ ino_t ino; char * tempname; long old_pos; + struct inode *inode = filp->f_dentry->d_inode; if (inode == 0 || inode->i_sb == 0 diff -u --recursive --new-file v2.1.54/linux/fs/inode.c linux/fs/inode.c --- v2.1.54/linux/fs/inode.c Sun Sep 7 13:10:43 1997 +++ linux/fs/inode.c Mon Sep 8 22:01:05 1997 @@ -43,7 +43,10 @@ static struct list_head inode_hashtable[HASH_SIZE]; /* - * A simple spinlock to protect the list manipulations + * A simple spinlock to protect the list manipulations. + * + * NOTE! You also have to own the lock if you change + * the i_state of an inode while it is in use.. */ spinlock_t inode_lock = SPIN_LOCK_UNLOCKED; @@ -59,7 +62,16 @@ int max_inodes = NR_INODE; /* - * Put the inode on the super block's dirty list + * Put the inode on the super block's dirty list. + * + * CAREFUL! We mark it dirty unconditionally, but + * move it onto the dirty list only if it is hashed. + * If it was not hashed, it will never be added to + * the dirty list even if it is later hashed, as it + * will have been marked dirty already. + * + * In short, make sure you hash any inodes _before_ + * you start marking them dirty.. */ void __mark_inode_dirty(struct inode *inode) { @@ -67,18 +79,18 @@ if (sb) { spin_lock(&inode_lock); - list_del(&inode->i_list); - list_add(&inode->i_list, &sb->s_dirty); + if (!(inode->i_state & I_DIRTY)) { + inode->i_state |= I_DIRTY; + /* Only add valid (ie hashed) inodes to the dirty list */ + if (!list_empty(&inode->i_hash)) { + list_del(&inode->i_list); + list_add(&inode->i_list, &sb->s_dirty); + } + } spin_unlock(&inode_lock); } } -static inline void unlock_inode(struct inode *inode) -{ - clear_bit(I_LOCK, &inode->i_state); - wake_up(&inode->i_wait); -} - static void __wait_on_inode(struct inode * inode) { struct wait_queue wait = { current, NULL }; @@ -86,7 +98,7 @@ add_wait_queue(&inode->i_wait, &wait); repeat: current->state = TASK_UNINTERRUPTIBLE; - if (test_bit(I_LOCK, &inode->i_state)) { + if (inode->i_state & I_LOCK) { schedule(); goto repeat; } @@ -96,7 +108,7 @@ static inline void wait_on_inode(struct inode *inode) { - if (test_bit(I_LOCK, &inode->i_state)) + if (inode->i_state & I_LOCK) __wait_on_inode(inode); } @@ -146,31 +158,34 @@ inode->i_sb->s_op->write_inode(inode); } -static inline void sync_one(struct list_head *head, struct list_head *clean, - struct list_head *placement, struct inode *inode) +static inline void sync_one(struct inode *inode) { - list_del(placement); - if (test_bit(I_LOCK, &inode->i_state)) { - list_add(placement, head); + if (inode->i_state & I_LOCK) { spin_unlock(&inode_lock); __wait_on_inode(inode); + spin_lock(&inode_lock); } else { - list_add(placement, clean); - clear_bit(I_DIRTY, &inode->i_state); - set_bit(I_LOCK, &inode->i_state); + list_del(&inode->i_list); + list_add(&inode->i_list, &inode_in_use); + + /* Set I_LOCK, reset I_DIRTY */ + inode->i_state ^= I_DIRTY | I_LOCK; spin_unlock(&inode_lock); + write_inode(inode); - unlock_inode(inode); + + spin_lock(&inode_lock); + inode->i_state &= ~I_LOCK; + wake_up(&inode->i_wait); } - spin_lock(&inode_lock); } -static inline void sync_list(struct list_head *head, struct list_head *clean) +static inline void sync_list(struct list_head *head) { struct list_head * tmp; while ((tmp = head->prev) != head) - sync_one(head, clean, tmp, list_entry(tmp, struct inode, i_list)); + sync_one(list_entry(tmp, struct inode, i_list)); } /* @@ -192,7 +207,7 @@ if (dev && sb->s_dev != dev) continue; - sync_list(&sb->s_dirty, &inode_in_use); + sync_list(&sb->s_dirty); if (dev) break; } @@ -208,9 +223,8 @@ if (sb) { spin_lock(&inode_lock); - if (test_bit(I_DIRTY, &inode->i_state)) - sync_one(&sb->s_dirty, &inode_in_use, &inode->i_list, - inode); + if (inode->i_state & I_DIRTY) + sync_one(inode); spin_unlock(&inode_lock); } else @@ -393,7 +407,6 @@ static inline void read_inode(struct inode *inode, struct super_block *sb) { sb->s_op->read_inode(inode); - unlock_inode(inode); } struct inode * get_empty_inode(void) @@ -451,10 +464,24 @@ inode->i_ino = ino; inode->i_flags = sb->s_flags; inode->i_count = 1; - inode->i_state = 1 << I_LOCK; + inode->i_state = I_LOCK; spin_unlock(&inode_lock); + clean_inode(inode); read_inode(inode, sb); + + /* + * This is special! We do not need the spinlock + * when clearing I_LOCK, because we're guaranteed + * that nobody else tries to do anything about the + * state of the inode when it is locked, as we + * just created it (so there can be no old holders + * that haven't tested I_LOCK). + * + * Verify this some day! + */ + inode->i_state &= ~I_LOCK; + return inode; } diff -u --recursive --new-file v2.1.54/linux/fs/isofs/dir.c linux/fs/isofs/dir.c --- v2.1.54/linux/fs/isofs/dir.c Thu Jul 17 10:06:07 1997 +++ linux/fs/isofs/dir.c Sun Sep 7 14:00:24 1997 @@ -23,7 +23,7 @@ #include -static int isofs_readdir(struct inode *, struct file *, void *, filldir_t); +static int isofs_readdir(struct file *, void *, filldir_t); static struct file_operations isofs_dir_operations = { @@ -241,12 +241,13 @@ * handling split directory entries.. The real work is done by * "do_isofs_readdir()". */ -static int isofs_readdir(struct inode *inode, struct file *filp, +static int isofs_readdir(struct file *filp, void *dirent, filldir_t filldir) { int result; char * tmpname; struct iso_directory_record * tmpde; + struct inode *inode = filp->f_dentry->d_inode; if (!inode || !S_ISDIR(inode->i_mode)) return -EBADF; diff -u --recursive --new-file v2.1.54/linux/fs/minix/bitmap.c linux/fs/minix/bitmap.c --- v2.1.54/linux/fs/minix/bitmap.c Sun Jul 27 12:11:01 1997 +++ linux/fs/minix/bitmap.c Mon Sep 8 21:32:13 1997 @@ -255,12 +255,12 @@ inode->i_dev = sb->s_dev; inode->i_uid = current->fsuid; inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid; - mark_inode_dirty(inode); inode->i_ino = j; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_op = NULL; inode->i_blocks = inode->i_blksize = 0; insert_inode_hash(inode); + mark_inode_dirty(inode); return inode; } diff -u --recursive --new-file v2.1.54/linux/fs/minix/dir.c linux/fs/minix/dir.c --- v2.1.54/linux/fs/minix/dir.c Sun Jul 27 12:11:01 1997 +++ linux/fs/minix/dir.c Sun Sep 7 14:00:24 1997 @@ -20,7 +20,7 @@ return -EISDIR; } -static int minix_readdir(struct inode *, struct file *, void *, filldir_t); +static int minix_readdir(struct file *, void *, filldir_t); static struct file_operations minix_dir_operations = { NULL, /* lseek - default */ @@ -58,13 +58,14 @@ NULL /* permission */ }; -static int minix_readdir(struct inode * inode, struct file * filp, +static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) { unsigned int offset; struct buffer_head * bh; struct minix_dir_entry * de; struct minix_sb_info * info; + struct inode *inode = filp->f_dentry->d_inode; if (!inode || !inode->i_sb || !S_ISDIR(inode->i_mode)) return -EBADF; diff -u --recursive --new-file v2.1.54/linux/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c --- v2.1.54/linux/fs/ncpfs/dir.c Mon Jun 16 16:35:58 1997 +++ linux/fs/ncpfs/dir.c Sun Sep 7 14:00:24 1997 @@ -31,7 +31,7 @@ ncp_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count); static int - ncp_readdir(struct inode *inode, struct file *filp, + ncp_readdir(struct file *filp, void *dirent, filldir_t filldir); static int @@ -210,12 +210,13 @@ wake_up(&c_wait); } -static int ncp_readdir(struct inode *inode, struct file *filp, +static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir) { int result = 0; int i = 0; int index = 0; + struct inode *inode = file->f_dentry->d_inode; struct ncp_dirent *entry = NULL; struct ncp_server *server = NCP_SERVER(inode); struct ncp_inode_info *dir = NCP_INOP(inode); diff -u --recursive --new-file v2.1.54/linux/fs/ncpfs/mmap.c linux/fs/ncpfs/mmap.c --- v2.1.54/linux/fs/ncpfs/mmap.c Mon Aug 18 18:19:46 1997 +++ linux/fs/ncpfs/mmap.c Sun Sep 7 11:10:45 1997 @@ -38,7 +38,7 @@ unsigned long tmp; int bufsize; int pos; - unsigned short fs; + unsigned long fs; page = __get_free_page(GFP_KERNEL); if (!page) diff -u --recursive --new-file v2.1.54/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c --- v2.1.54/linux/fs/ncpfs/sock.c Mon Aug 18 18:19:46 1997 +++ linux/fs/ncpfs/sock.c Sun Sep 7 11:11:01 1997 @@ -82,7 +82,7 @@ struct file *file; struct inode *inode; struct socket *sock; - unsigned short fs; + unsigned long fs; int result; char *start = server->packet; poll_table wait_table; diff -u --recursive --new-file v2.1.54/linux/fs/nfs/dir.c linux/fs/nfs/dir.c --- v2.1.54/linux/fs/nfs/dir.c Wed Sep 3 20:52:43 1997 +++ linux/fs/nfs/dir.c Sun Sep 7 14:00:24 1997 @@ -48,7 +48,7 @@ static int nfs_dir_open(struct inode * inode, struct file * file); static long nfs_dir_read(struct inode *, struct file *, char *, unsigned long); -static int nfs_readdir(struct inode *, struct file *, void *, filldir_t); +static int nfs_readdir(struct file *, void *, filldir_t); static int nfs_lookup(struct inode *, struct dentry *); static int nfs_create(struct inode *, struct dentry *, int); static int nfs_mkdir(struct inode *, struct dentry *, int); @@ -121,9 +121,7 @@ * page cache (may require some fiddling for rsize < PAGE_SIZE). */ -static int -nfs_readdir(struct inode *inode, struct file *filp, void *dirent, - filldir_t filldir) +static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) { static struct wait_queue *readdir_wait = NULL; struct wait_queue **waitp = NULL; @@ -133,6 +131,7 @@ u32 cookie; int ismydir, result; int i, j, index = 0; + struct inode *inode = filp->f_dentry->d_inode; dfprintk(VFS, "NFS: nfs_readdir(%x/%ld)\n", inode->i_dev, inode->i_ino); if (!inode || !S_ISDIR(inode->i_mode)) { diff -u --recursive --new-file v2.1.54/linux/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c --- v2.1.54/linux/fs/nfsd/vfs.c Wed Sep 3 20:52:43 1997 +++ linux/fs/nfsd/vfs.c Sun Sep 7 14:00:24 1997 @@ -476,7 +476,7 @@ #endif } - if (test_bit(I_DIRTY, &inode->i_state)) { + if (inode->i_state & I_DIRTY) { dprintk("nfsd: write sync %d\n", current->pid); nfsd_sync(inode, &file); write_inode_now(inode); @@ -928,8 +928,7 @@ file.f_inode->i_dev, file.f_inode->i_ino, (int) file.f_pos, (int) oldlen, (int) cd.buflen); */ - err = file.f_op->readdir(inode, &file, - &cd, (filldir_t) func); + err = file.f_op->readdir(&file, &cd, (filldir_t) func); if (err < 0) { nfsd_close(&file); diff -u --recursive --new-file v2.1.54/linux/fs/pipe.c linux/fs/pipe.c --- v2.1.54/linux/fs/pipe.c Mon Aug 18 18:19:46 1997 +++ linux/fs/pipe.c Sun Sep 7 12:36:50 1997 @@ -402,7 +402,7 @@ * list because "mark_inode_dirty()" will think * that it already _is_ on the dirty list. */ - inode->i_state = 1 << I_DIRTY; + inode->i_state = I_DIRTY; inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; diff -u --recursive --new-file v2.1.54/linux/fs/proc/fd.c linux/fs/proc/fd.c --- v2.1.54/linux/fs/proc/fd.c Thu Jul 17 10:06:07 1997 +++ linux/fs/proc/fd.c Sun Sep 7 14:00:24 1997 @@ -13,7 +13,7 @@ #include #include -static int proc_readfd(struct inode *, struct file *, void *, filldir_t); +static int proc_readfd(struct file *, void *, filldir_t); static int proc_lookupfd(struct inode *, struct dentry *); static struct file_operations proc_fd_operations = { @@ -124,13 +124,14 @@ #define NUMBUF 10 -static int proc_readfd(struct inode * inode, struct file * filp, +static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) { char buf[NUMBUF]; struct task_struct * p, **tarrayp; unsigned int fd, pid, ino; unsigned long i,j; + struct inode *inode = filp->f_dentry->d_inode; if (!inode || !S_ISDIR(inode->i_mode)) return -EBADF; diff -u --recursive --new-file v2.1.54/linux/fs/proc/root.c linux/fs/proc/root.c --- v2.1.54/linux/fs/proc/root.c Sun Sep 7 13:10:43 1997 +++ linux/fs/proc/root.c Sun Sep 7 14:00:24 1997 @@ -23,7 +23,7 @@ */ #define FIRST_PROCESS_ENTRY 256 -static int proc_root_readdir(struct inode *, struct file *, void *, filldir_t); +static int proc_root_readdir(struct file *, void *, filldir_t); static int proc_root_lookup(struct inode *,struct dentry *); static unsigned char proc_alloc_map[PROC_NDYNAMIC / 8] = {0}; @@ -734,12 +734,13 @@ * value of the readdir() call, as long as it's non-negative * for success.. */ -int proc_readdir(struct inode * inode, struct file * filp, +int proc_readdir(struct file * filp, void * dirent, filldir_t filldir) { struct proc_dir_entry * de; unsigned int ino; int i; + struct inode *inode = filp->f_dentry->d_inode; if (!inode || !S_ISDIR(inode->i_mode)) return -ENOTDIR; @@ -786,7 +787,7 @@ #define NUMBUF 10 -static int proc_root_readdir(struct inode * inode, struct file * filp, +static int proc_root_readdir(struct file * filp, void * dirent, filldir_t filldir) { struct task_struct *p; @@ -794,7 +795,7 @@ unsigned int nr = filp->f_pos; if (nr < FIRST_PROCESS_ENTRY) { - int error = proc_readdir(inode, filp, dirent, filldir); + int error = proc_readdir(filp, dirent, filldir); if (error <= 0) return error; filp->f_pos = FIRST_PROCESS_ENTRY; diff -u --recursive --new-file v2.1.54/linux/fs/readdir.c linux/fs/readdir.c --- v2.1.54/linux/fs/readdir.c Thu Jul 17 10:06:07 1997 +++ linux/fs/readdir.c Sun Sep 7 14:00:24 1997 @@ -87,7 +87,7 @@ if (!file->f_op || !file->f_op->readdir) goto out; - error = file->f_op->readdir(inode, file, &buf, fillonedir); + error = file->f_op->readdir(file, &buf, fillonedir); if (error < 0) goto out; error = buf.count; @@ -173,7 +173,7 @@ if (!file->f_op || !file->f_op->readdir) goto out; - error = file->f_op->readdir(inode, file, &buf, filldir); + error = file->f_op->readdir(file, &buf, filldir); if (error < 0) goto out; lastdirent = buf.previous; diff -u --recursive --new-file v2.1.54/linux/fs/romfs/inode.c linux/fs/romfs/inode.c --- v2.1.54/linux/fs/romfs/inode.c Wed Sep 3 20:52:43 1997 +++ linux/fs/romfs/inode.c Sun Sep 7 14:00:24 1997 @@ -261,8 +261,9 @@ } static int -romfs_readdir(struct inode *i, struct file *filp, void *dirent, filldir_t filldir) +romfs_readdir(struct file *filp, void *dirent, filldir_t filldir) { + struct inode *i = filp->f_dentry->d_inode; struct romfs_inode ri; unsigned long offset, maxoff; int j, ino, nextfh; diff -u --recursive --new-file v2.1.54/linux/fs/smbfs/dir.c linux/fs/smbfs/dir.c --- v2.1.54/linux/fs/smbfs/dir.c Wed Sep 3 20:52:43 1997 +++ linux/fs/smbfs/dir.c Sun Sep 7 14:00:24 1997 @@ -24,8 +24,7 @@ char *buf, unsigned long count); static int -smb_readdir(struct inode *inode, struct file *filp, - void *dirent, filldir_t filldir); +smb_readdir(struct file *filp, void *dirent, filldir_t filldir); static int smb_lookup(struct inode *, struct dentry *); static int smb_create(struct inode *, struct dentry *, int); @@ -105,9 +104,10 @@ } static int -smb_refill_dir_cache(struct inode *dir, unsigned long f_pos) +smb_refill_dir_cache(struct dentry *dentry, unsigned long f_pos) { int result; + struct inode *dir = dentry->d_inode; static struct semaphore sem = MUTEX; int i; ino_t ino; @@ -115,7 +115,7 @@ do { down(&sem); - result = smb_proc_readdir(dir, f_pos, + result = smb_proc_readdir(dentry, f_pos, SMB_READDIR_CACHE_SIZE, c_entry); if (result <= 0) @@ -142,10 +142,11 @@ return result; } -static int -smb_readdir(struct inode *dir, struct file *filp, +static int smb_readdir(struct file *filp, void *dirent, filldir_t filldir) { + struct dentry *dentry = filp->f_dentry; + struct inode *dir = dentry->d_inode; int result, i = 0; struct smb_dirent *entry = NULL; @@ -194,7 +195,7 @@ /* End of directory */ return 0; } - result = smb_refill_dir_cache(dir, filp->f_pos); + result = smb_refill_dir_cache(dentry, filp->f_pos); if (result <= 0) { return result; @@ -266,7 +267,7 @@ if (len > SMB_MAXNAMELEN) return -ENAMETOOLONG; - error = smb_proc_getattr(dir, &(d_entry->d_name), &finfo); + error = smb_proc_getattr(d_entry, &(d_entry->d_name), &finfo); inode = NULL; if (!error) { @@ -297,7 +298,7 @@ if (dentry->d_name.len > SMB_MAXNAMELEN) return -ENAMETOOLONG; - error = smb_proc_create(dir, &(dentry->d_name), 0, CURRENT_TIME); + error = smb_proc_create(dentry, &(dentry->d_name), 0, CURRENT_TIME); if (error < 0) return error; @@ -307,7 +308,7 @@ * state. Currently we close it directly again, although this * is not necessary anymore. */ - error = smb_proc_getattr(dir, &(dentry->d_name), &fattr); + error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr); if (error < 0) return error; @@ -337,13 +338,13 @@ if (dentry->d_name.len > SMB_MAXNAMELEN) return -ENAMETOOLONG; - error = smb_proc_mkdir(dir, &(dentry->d_name)); + error = smb_proc_mkdir(dentry, &(dentry->d_name)); if (error) return error; smb_invalid_dir_cache(dir->i_ino); - error = smb_proc_getattr(dir, &(dentry->d_name), &fattr); + error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr); if (error < 0) return error; @@ -371,7 +372,7 @@ if (dentry->d_name.len > NFS_MAXNAMLEN) return -ENAMETOOLONG; - error = smb_proc_rmdir(dir, &(dentry->d_name)); + error = smb_proc_rmdir(dentry, &(dentry->d_name)); if (error) return error; @@ -393,7 +394,7 @@ if (dentry->d_name.len > SMB_MAXNAMELEN) return -ENAMETOOLONG; - error = smb_proc_unlink(dir, &(dentry->d_name)); + error = smb_proc_unlink(dentry, &(dentry->d_name)); if (error) return error; @@ -424,18 +425,18 @@ new_dentry->d_name.len > SMB_MAXNAMELEN) return -ENAMETOOLONG; - error = smb_proc_mv(old_dir, &(old_dentry->d_name), - new_dir, &(new_dentry->d_name)); + error = smb_proc_mv(old_dentry, &(old_dentry->d_name), + new_dentry, &(new_dentry->d_name)); if (error == -EEXIST) { - error = smb_proc_unlink(old_dir, &(new_dentry->d_name)); + error = smb_proc_unlink(old_dentry, &(new_dentry->d_name)); if (error) return error; - error = smb_proc_mv(old_dir, &(old_dentry->d_name), - new_dir, &(new_dentry->d_name)); + error = smb_proc_mv(old_dentry, &(old_dentry->d_name), + new_dentry, &(new_dentry->d_name)); } if (error) diff -u --recursive --new-file v2.1.54/linux/fs/smbfs/proc.c linux/fs/smbfs/proc.c --- v2.1.54/linux/fs/smbfs/proc.c Wed Sep 3 20:52:44 1997 +++ linux/fs/smbfs/proc.c Sun Sep 7 14:00:24 1997 @@ -98,12 +98,12 @@ } static char *smb_encode_path(struct smb_sb_info *server, char *buf, - struct inode *dir, struct qstr *name) + struct dentry *dir, struct qstr *name) { char *start = buf; if (dir != NULL) - buf += smb_d_path(i_dentry(dir), buf); + buf += smb_d_path(dir, buf); if (name != NULL) { *buf++ = '\\'; @@ -510,8 +510,9 @@ */ static int -smb_proc_open(struct inode *ino) +smb_proc_open(struct dentry *dir) { + struct inode *ino = dir->d_inode; struct smb_sb_info *server = SMB_SERVER(ino); int error; char *p; @@ -521,7 +522,7 @@ WSET(server->packet, smb_vwv0, 0x42); /* read/write */ WSET(server->packet, smb_vwv1, aSYSTEM | aHIDDEN | aDIR); *p++ = 4; - p = smb_encode_path(server, p, ino, NULL); + p = smb_encode_path(server, p, dir, NULL); smb_setup_bcc(server, p); if ((error = smb_request_ok(server, SMBopen, 7, 0)) != 0) @@ -537,7 +538,7 @@ WSET(server->packet, smb_vwv0, 0x40); /* read only */ WSET(server->packet, smb_vwv1, aSYSTEM | aHIDDEN | aDIR); *p++ = 4; - p = smb_encode_path(server, p, ino, NULL); + p = smb_encode_path(server, p, dir, NULL); smb_setup_bcc(server, p); if ((error = smb_request_ok(server, SMBopen, 7, 0)) != 0) @@ -562,15 +563,16 @@ } int -smb_open(struct inode *i, int wish) +smb_open(struct dentry *dir, int wish) { + struct inode *i=dir->d_inode; struct smb_sb_info *server = SMB_SERVER(i); int result = -EACCES; smb_lock_server(server); if (!smb_is_open(i)) { - int error = smb_proc_open(i); + int error = smb_proc_open(dir); if (error) { smb_unlock_server(server); return error; @@ -600,8 +602,9 @@ } -int smb_close(struct inode *ino) +int smb_close(struct dentry *dir) { + struct inode *ino = dir->d_inode; struct smb_sb_info *server = SMB_SERVER(ino); int result; @@ -691,12 +694,13 @@ } int -smb_proc_create(struct inode *dir, struct qstr *name, +smb_proc_create(struct dentry *dir, struct qstr *name, __u16 attr, time_t ctime) { int error; char *p; - struct smb_sb_info *server = SMB_SERVER(dir); + struct inode *i=dir->d_inode; + struct smb_sb_info *server = SMB_SERVER(i); char *buf; smb_lock_server(server); @@ -725,11 +729,11 @@ } int -smb_proc_mv(struct inode *odir, struct qstr *oname, - struct inode *ndir, struct qstr *nname) +smb_proc_mv(struct dentry *odir, struct qstr *oname, + struct dentry *ndir, struct qstr *nname) { char *p; - struct smb_sb_info *server = SMB_SERVER(odir); + struct smb_sb_info *server = SMB_SERVER(odir->d_inode); int result; smb_lock_server(server); @@ -755,11 +759,11 @@ } int -smb_proc_mkdir(struct inode *dir, struct qstr *name) +smb_proc_mkdir(struct dentry *dir, struct qstr *name) { char *p; int result; - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); smb_lock_server(server); @@ -781,11 +785,11 @@ } int -smb_proc_rmdir(struct inode *dir, struct qstr *name) +smb_proc_rmdir(struct dentry *dir, struct qstr *name) { char *p; int result; - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); smb_lock_server(server); @@ -807,10 +811,10 @@ } int -smb_proc_unlink(struct inode *dir, struct qstr *name) +smb_proc_unlink(struct dentry *dir, struct qstr *name) { char *p; - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); int result; smb_lock_server(server); @@ -956,7 +960,7 @@ SMB_PROTOCOL_LANMAN2 */ static int -smb_proc_readdir_short(struct smb_sb_info *server, struct inode *dir, int fpos, +smb_proc_readdir_short(struct smb_sb_info *server, struct dentry *dir, int fpos, int cache_size, struct smb_dirent *entry) { char *p; @@ -1135,7 +1139,7 @@ } static int -smb_proc_readdir_long(struct smb_sb_info *server, struct inode *dir, int fpos, +smb_proc_readdir_long(struct smb_sb_info *server, struct dentry *dir, int fpos, int cache_size, struct smb_dirent *cache) { /* NT uses 260, OS/2 uses 2. Both accept 1. */ @@ -1335,10 +1339,10 @@ } int -smb_proc_readdir(struct inode *dir, int fpos, +smb_proc_readdir(struct dentry *dir, int fpos, int cache_size, struct smb_dirent *entry) { - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2) return smb_proc_readdir_long(server, dir, fpos, cache_size, @@ -1349,12 +1353,12 @@ } static int -smb_proc_getattr_core(struct inode *dir, struct qstr *name, +smb_proc_getattr_core(struct dentry *dir, struct qstr *name, struct smb_fattr *attr) { int result; char *p; - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); char *buf; smb_lock_server(server); @@ -1385,10 +1389,10 @@ } static int -smb_proc_getattr_trans2(struct inode *dir, struct qstr *name, +smb_proc_getattr_trans2(struct dentry *dir, struct qstr *name, struct smb_fattr *attr) { - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); char param[SMB_MAXPATHLEN + 20]; char *p; int result; @@ -1441,10 +1445,10 @@ return 0; } -int smb_proc_getattr(struct inode *dir, struct qstr *name, +int smb_proc_getattr(struct dentry *dir, struct qstr *name, struct smb_fattr *fattr) { - struct smb_sb_info *server = SMB_SERVER(dir); + struct smb_sb_info *server = SMB_SERVER(dir->d_inode); int result = 0; smb_init_dirent(server, fattr); @@ -1465,7 +1469,7 @@ entry->f_mtime, to make touch work. */ static int smb_proc_setattr_core(struct smb_sb_info *server, - struct inode *i, struct smb_fattr *fattr) + struct dentry *dir, struct smb_fattr *fattr) { char *p; char *buf; @@ -1479,7 +1483,7 @@ WSET(buf, smb_vwv0, fattr->attr); DSET(buf, smb_vwv1, utc2local(fattr->f_mtime)); *p++ = 4; - p = smb_encode_path(server, p, i, NULL); + p = smb_encode_path(server, p, dir, NULL); *p++ = 4; *p++ = 0; @@ -1494,7 +1498,7 @@ static int smb_proc_setattr_trans2(struct smb_sb_info *server, - struct inode *i, struct smb_fattr *fattr) + struct dentry *dir, struct smb_fattr *fattr) { char param[SMB_MAXPATHLEN + 20]; char data[26]; @@ -1508,7 +1512,7 @@ WSET(param, 0, 1); /* Info level SMB_INFO_STANDARD */ DSET(param, 2, 0); - p = smb_encode_path(server, param + 6, i, NULL); + p = smb_encode_path(server, param + 6, dir, NULL); date_unix2dos(fattr->f_ctime, &(data[0]), &(data[2])); date_unix2dos(fattr->f_atime, &(data[4]), &(data[6])); @@ -1539,16 +1543,16 @@ } int -smb_proc_setattr(struct smb_sb_info *server, struct inode *inode, +smb_proc_setattr(struct smb_sb_info *server, struct dentry *dir, struct smb_fattr *fattr) { int result; if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2) - result = smb_proc_setattr_trans2(server, inode, fattr); + result = smb_proc_setattr_trans2(server, dir, fattr); if ((server->opt.protocol < SMB_PROTOCOL_LANMAN2) || (result < 0)) - result = smb_proc_setattr_core(server, inode, fattr); + result = smb_proc_setattr_core(server, dir, fattr); return result; } diff -u --recursive --new-file v2.1.54/linux/fs/smbfs/sock.c linux/fs/smbfs/sock.c --- v2.1.54/linux/fs/smbfs/sock.c Wed Sep 3 20:52:44 1997 +++ linux/fs/smbfs/sock.c Sun Sep 7 11:07:20 1997 @@ -86,7 +86,7 @@ { unsigned char peek_buf[4]; int result; - unsigned short fs; + unsigned long fs; fs = get_fs(); set_fs(get_ds()); @@ -276,7 +276,7 @@ { int result; unsigned char peek_buf[4]; - unsigned short fs; + unsigned long fs; re_recv: fs = get_fs(); @@ -500,7 +500,7 @@ smb_request(struct smb_sb_info *server) { unsigned long old_mask; - unsigned short fs; + unsigned long fs; int len, result; unsigned char *buffer = (server == NULL) ? NULL : server->packet; @@ -649,7 +649,7 @@ int *lrparam, unsigned char **rparam) { unsigned long old_mask; - unsigned short fs; + unsigned long fs; int result; pr_debug("smb_trans2_request: com=%d, ld=%d, lp=%d\n", diff -u --recursive --new-file v2.1.54/linux/fs/sysv/dir.c linux/fs/sysv/dir.c --- v2.1.54/linux/fs/sysv/dir.c Thu Jul 17 10:06:08 1997 +++ linux/fs/sysv/dir.c Sun Sep 7 14:00:24 1997 @@ -27,7 +27,7 @@ return -EISDIR; } -static int sysv_readdir(struct inode *, struct file *, void *, filldir_t); +static int sysv_readdir(struct file *, void *, filldir_t); static struct file_operations sysv_dir_operations = { NULL, /* lseek - default */ @@ -65,9 +65,9 @@ NULL /* permission */ }; -static int sysv_readdir(struct inode * inode, struct file * filp, - void * dirent, filldir_t filldir) +static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) { + struct inode *inode = filp->f_dentry->d_inode; struct super_block * sb; unsigned int offset,i; struct buffer_head * bh; diff -u --recursive --new-file v2.1.54/linux/fs/sysv/ialloc.c linux/fs/sysv/ialloc.c --- v2.1.54/linux/fs/sysv/ialloc.c Thu Jul 17 10:06:08 1997 +++ linux/fs/sysv/ialloc.c Mon Sep 8 21:33:42 1997 @@ -154,12 +154,12 @@ inode->i_dev = sb->s_dev; inode->i_uid = current->fsuid; inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid; - mark_inode_dirty(inode); inode->i_ino = ino; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_op = NULL; inode->i_blocks = inode->i_blksize = 0; insert_inode_hash(inode); + mark_inode_dirty(inode); /* Change directory entry: */ inode->i_mode = 0; /* for sysv_write_inode() */ inode->i_size = 0; /* ditto */ diff -u --recursive --new-file v2.1.54/linux/fs/sysv/truncate.c linux/fs/sysv/truncate.c --- v2.1.54/linux/fs/sysv/truncate.c Thu Jul 17 10:06:08 1997 +++ linux/fs/sysv/truncate.c Sun Sep 7 13:06:08 1997 @@ -257,14 +257,13 @@ static int trunc_all(struct inode * inode) { struct super_block * sb; - char * res; + char dirty; sb = inode->i_sb; - res = (char *)test_bit(I_DIRTY,&inode->i_state); return trunc_direct(inode) - | trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,res) - | trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,res) - | trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,res); + | trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,&dirty) + | trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,&dirty) + | trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,&dirty); } diff -u --recursive --new-file v2.1.54/linux/fs/ufs/ufs_dir.c linux/fs/ufs/ufs_dir.c --- v2.1.54/linux/fs/ufs/ufs_dir.c Mon Jun 16 16:35:59 1997 +++ linux/fs/ufs/ufs_dir.c Sun Sep 7 14:00:24 1997 @@ -17,9 +17,9 @@ * This is blatantly stolen from ext2fs */ static int -ufs_readdir (struct inode * inode, struct file * filp, void * dirent, - filldir_t filldir) +ufs_readdir (struct file * filp, void * dirent, filldir_t filldir) { + struct inode *inode = filp->f_dentry->d_inode; int error = 0; unsigned long offset, lblk, blk; int i, stored; diff -u --recursive --new-file v2.1.54/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c --- v2.1.54/linux/fs/umsdos/emd.c Mon Jun 16 16:35:59 1997 +++ linux/fs/umsdos/emd.c Sun Sep 7 11:10:18 1997 @@ -29,7 +29,7 @@ unsigned long count) { int ret; - int old_fs = get_fs(); + unsigned long old_fs = get_fs(); set_fs (KERNEL_DS); ret = fat_file_read(inode,filp,buf,count); set_fs (old_fs); @@ -44,7 +44,7 @@ unsigned long count) { int ret; - int old_fs = get_fs(); + unsigned long old_fs = get_fs(); set_fs (KERNEL_DS); ret = fat_file_write(inode,filp,buf,count); set_fs (old_fs); diff -u --recursive --new-file v2.1.54/linux/include/asm-i386/bugs.h linux/include/asm-i386/bugs.h --- v2.1.54/linux/include/asm-i386/bugs.h Sun Sep 7 13:10:43 1997 +++ linux/include/asm-i386/bugs.h Tue Sep 9 11:16:25 1997 @@ -12,6 +12,7 @@ */ #include +#include #define CONFIG_BUGi386 @@ -41,10 +42,11 @@ outb_p(0,0xf0); } +static double __initdata x = 4195835.0; +static double __initdata y = 3145727.0; + __initfunc(static void check_fpu(void)) { - static double x = 4195835.0; - static double y = 3145727.0; unsigned short control_word; if (!hard_math) { @@ -91,12 +93,10 @@ "fninit" : "=m" (*&fdiv_bug) : "m" (*&x), "m" (*&y)); - if (!fdiv_bug) { + if (!fdiv_bug) printk("Ok, fpu using exception 16 error reporting.\n"); - return; - - } - printk("Hmm, FDIV bug i%c86 system\n", '0'+x86); + else + printk("Hmm, fpu using exception 16 error reporting with FDIV bug.\n"); } __initfunc(static void check_hlt(void)) @@ -125,10 +125,53 @@ #endif } +/* + * Most 386 processors have a bug where a POPAD can lock the + * machine even from user space. + */ + +__initfunc(static void check_popad(void)) +{ +#ifdef CONFIG_M386 + int res, inp = (int) &res; + + printk(KERN_INFO "Checking for popad bug... "); + __asm__ __volatile__( + "movl $12345678,%%eax; movl $0,%%edi; pusha; popa; movl (%%edx,%%edi),%%ecx " + : "=eax" (res) + : "edx" (inp) + : "eax", "ecx", "edx", "edi" ); + /* If this fails, it means that any user program may lock CPU hard. Too bad. */ + if (res != 12345678) printk( "Bad.\n" ); + else printk( "Ok.\n" ); +#endif +} + +/* + * B step AMD K6 before B 9729AIJW have hardware bugs that can cause + * misexecution of code under Linux. Owners of such processors should + * contact AMD for precise details and a CPU swap. + * + * See http://www.creaweb.fr/bpc/k6bug_faq.html + * http://www.amd.com/K6/k6docs/revgd.html + */ + +__initfunc(static void check_amd_k6(void)) +{ + /* B Step AMD K6 */ + if(x86_model==6 && x86_mask==1 && memcmp(x86_vendor_id, "AuthenticAMD", 12)==0) + { + printk(KERN_INFO "AMD K6 stepping B detected - system stability may be impaired. Please see.\n"); + printk(KERN_INFO "http://www.creaweb.fr/bpc/k6bug_faq.html"); + } +} + __initfunc(static void check_bugs(void)) { check_tlb(); check_fpu(); check_hlt(); + check_popad(); + check_amd_k6(); system_utsname.machine[1] = '0' + x86; } diff -u --recursive --new-file v2.1.54/linux/include/linux/fs.h linux/include/linux/fs.h --- v2.1.54/linux/include/linux/fs.h Wed Sep 3 20:52:44 1997 +++ linux/include/linux/fs.h Tue Sep 9 11:16:25 1997 @@ -356,14 +356,14 @@ }; /* Inode state bits.. */ -#define I_DIRTY 0 -#define I_LOCK 1 -#define I_FREEING 2 +#define I_DIRTY 1 +#define I_LOCK 2 +#define I_FREEING 4 extern void __mark_inode_dirty(struct inode *); static inline void mark_inode_dirty(struct inode *inode) { - if (!test_and_set_bit(I_DIRTY, &inode->i_state)) + if (!(inode->i_state & I_DIRTY)) __mark_inode_dirty(inode); } @@ -532,7 +532,7 @@ long long (*llseek) (struct inode *, struct file *, long long, int); long (*read) (struct inode *, struct file *, char *, unsigned long); long (*write) (struct inode *, struct file *, const char *, unsigned long); - int (*readdir) (struct inode *, struct file *, void *, filldir_t); + int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, poll_table *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); int (*mmap) (struct inode *, struct file *, struct vm_area_struct *); diff -u --recursive --new-file v2.1.54/linux/include/linux/ip_fw.h linux/include/linux/ip_fw.h --- v2.1.54/linux/include/linux/ip_fw.h Mon Jul 7 16:04:18 1997 +++ linux/include/linux/ip_fw.h Tue Sep 9 11:18:27 1997 @@ -65,15 +65,15 @@ struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */ struct in_addr fw_via; /* IP address of interface "via" */ struct device *fw_viadev; /* device of interface "via" */ - unsigned short fw_flg; /* Flags word */ - unsigned short fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */ + __u16 fw_flg; /* Flags word */ + __u16 fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */ /* in ports array (dst ports follow */ /* src ports; max of 10 ports in all; */ /* count of 0 means match all ports) */ #define IP_FW_MAX_PORTS 10 /* A reasonable maximum */ - unsigned short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */ + __u16 fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */ unsigned long fw_pcnt,fw_bcnt; /* Packet and byte counters */ - unsigned char fw_tosand, fw_tosxor; /* Revised packet priority */ + __u8 fw_tosand, fw_tosxor; /* Revised packet priority */ char fw_vianame[IFNAMSIZ]; /* name of interface "via" */ }; diff -u --recursive --new-file v2.1.54/linux/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h --- v2.1.54/linux/include/linux/msdos_fs.h Mon Aug 4 16:25:40 1997 +++ linux/include/linux/msdos_fs.h Tue Sep 9 11:18:08 1997 @@ -219,7 +219,7 @@ extern int fat_readdirx(struct inode *inode, struct file *filp, void *dirent, fat_filldir_t fat_filldir, filldir_t filldir, int shortnames, int longnames, int both); -extern int fat_readdir(struct inode *inode, struct file *filp, +extern int fat_readdir(struct file *filp, void *dirent, filldir_t); extern int fat_dir_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, unsigned long arg); diff -u --recursive --new-file v2.1.54/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h --- v2.1.54/linux/include/linux/proc_fs.h Mon Aug 18 18:19:47 1997 +++ linux/include/linux/proc_fs.h Tue Sep 9 11:16:25 1997 @@ -325,7 +325,7 @@ * The /proc root directory has extended versions to take care * of the /proc/ subdirectories. */ -extern int proc_readdir(struct inode *, struct file *, void *, filldir_t); +extern int proc_readdir(struct file *, void *, filldir_t); extern int proc_lookup(struct inode *, struct dentry *); struct openpromfs_dev { diff -u --recursive --new-file v2.1.54/linux/include/linux/smb_fs.h linux/include/linux/smb_fs.h --- v2.1.54/linux/include/linux/smb_fs.h Wed Sep 3 20:52:44 1997 +++ linux/include/linux/smb_fs.h Tue Sep 9 11:18:09 1997 @@ -104,8 +104,8 @@ __u16 wct, __u16 bcc); int smb_offerconn(struct smb_sb_info *server); int smb_newconn(struct smb_sb_info *server, struct smb_conn_opt *opt); -int smb_close(struct inode *); -int smb_open(struct inode *, int); +int smb_close(struct dentry *); +int smb_open(struct dentry *, int); static inline int smb_is_open(struct inode *i) { @@ -114,18 +114,16 @@ int smb_proc_read(struct inode *, off_t, long, char *); int smb_proc_write(struct inode *, off_t, int, const char *); -int smb_proc_create(struct inode *, struct qstr *, __u16, time_t); -int smb_proc_mv(struct inode *, struct qstr *, struct inode *, struct qstr *); -int smb_proc_mkdir(struct inode *, struct qstr *); -int smb_proc_rmdir(struct inode *, struct qstr *); -int smb_proc_unlink(struct inode *dir, struct qstr *); -int smb_proc_readdir(struct inode *dir, - int fpos, int cache_size, - struct smb_dirent *entry); -int smb_proc_getattr(struct inode *dir, struct qstr *name, +int smb_proc_create(struct dentry *, struct qstr *, __u16, time_t); +int smb_proc_mv(struct dentry *, struct qstr *, struct dentry *, struct qstr *); +int smb_proc_mkdir(struct dentry *, struct qstr *); +int smb_proc_rmdir(struct dentry *, struct qstr *); +int smb_proc_unlink(struct dentry *dir, struct qstr *); +int smb_proc_readdir(struct dentry *dir, int fpos, int cache_size, struct smb_dirent *entry); +int smb_proc_getattr(struct dentry *dir, struct qstr *name, struct smb_fattr *entry); int smb_proc_setattr(struct smb_sb_info *server, - struct inode *ino, + struct dentry *dir, struct smb_fattr *new_finfo); int smb_proc_dskattr(struct super_block *sb, struct statfs *attr); int smb_proc_reconnect(struct smb_sb_info *server); diff -u --recursive --new-file v2.1.54/linux/include/linux/udp.h linux/include/linux/udp.h --- v2.1.54/linux/include/linux/udp.h Thu Sep 4 17:07:31 1997 +++ linux/include/linux/udp.h Sun Sep 7 14:00:24 1997 @@ -19,10 +19,10 @@ struct udphdr { - u16 source; - u16 dest; - u16 len; - u16 check; + __u16 source; + __u16 dest; + __u16 len; + __u16 check; }; diff -u --recursive --new-file v2.1.54/linux/kernel/ksyms.c linux/kernel/ksyms.c --- v2.1.54/linux/kernel/ksyms.c Mon Aug 18 18:19:47 1997 +++ linux/kernel/ksyms.c Sat Sep 6 18:18:26 1997 @@ -155,6 +155,8 @@ EXPORT_SYMBOL(d_add); EXPORT_SYMBOL(d_move); EXPORT_SYMBOL(d_instantiate); +EXPORT_SYMBOL(d_alloc); +EXPORT_SYMBOL(d_lookup); EXPORT_SYMBOL(__mark_inode_dirty); EXPORT_SYMBOL(init_private_file); EXPORT_SYMBOL(insert_file_free); diff -u --recursive --new-file v2.1.54/linux/kernel/sched.c linux/kernel/sched.c --- v2.1.54/linux/kernel/sched.c Mon Aug 4 16:25:40 1997 +++ linux/kernel/sched.c Sun Sep 7 14:00:24 1997 @@ -492,20 +492,6 @@ *(int *)0 = 0; } -#ifndef __alpha__ - -/* - * For backwards compatibility? This can be done in libc so Alpha - * and all newer ports shouldn't need it. - */ -asmlinkage int sys_pause(void) -{ - current->state = TASK_INTERRUPTIBLE; - schedule(); - return -ERESTARTNOHAND; -} - -#endif rwlock_t waitqueue_lock = RW_LOCK_UNLOCKED; diff -u --recursive --new-file v2.1.54/linux/kernel/sys.c linux/kernel/sys.c --- v2.1.54/linux/kernel/sys.c Sun Sep 7 13:10:43 1997 +++ linux/kernel/sys.c Sun Sep 7 14:00:24 1997 @@ -158,45 +158,6 @@ return max_prio; } -#ifndef __alpha__ - -/* - * Why do these exist? Binary compatibility with some other standard? - * If so, maybe they should be moved into the appropriate arch - * directory. - */ - -asmlinkage int sys_profil(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_ftime(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_break(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_stty(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_gtty(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_prof(void) -{ - return -ENOSYS; -} - -#endif extern asmlinkage int sys_kill(int, int); @@ -480,40 +441,6 @@ return error; } -#ifndef __alpha__ - -/* - * Why do these exist? Binary compatibility with some other standard? - * If so, maybe they should be moved into the appropriate arch - * directory. - */ - -asmlinkage int sys_phys(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_lock(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_mpx(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_ulimit(void) -{ - return -ENOSYS; -} - -asmlinkage int sys_old_syscall(void) -{ - return -ENOSYS; -} - -#endif /* * Unprivileged users may change the real uid to the effective uid @@ -937,48 +864,6 @@ return -EFAULT; return 0; } - -#ifndef __alpha__ - -/* - * Move these to arch dependent dir since they are for - * backward compatibility only? - */ - -#ifndef __sparc__ -asmlinkage int sys_uname(struct old_utsname * name) -{ - if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) - return 0; - return -EFAULT; -} -#endif - -asmlinkage int sys_olduname(struct oldold_utsname * name) -{ - int error; - - if (!name) - return -EFAULT; - if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) - return -EFAULT; - - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); - error -= __put_user(0,name->sysname+__OLD_UTS_LEN); - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); - error -= __put_user(0,name->nodename+__OLD_UTS_LEN); - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); - error -= __put_user(0,name->release+__OLD_UTS_LEN); - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); - error -= __put_user(0,name->version+__OLD_UTS_LEN); - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); - error = __put_user(0,name->machine+__OLD_UTS_LEN); - error = error ? -EFAULT : 0; - - return error; -} - -#endif asmlinkage int sys_sethostname(char *name, int len) { diff -u --recursive --new-file v2.1.54/linux/net/README linux/net/README --- v2.1.54/linux/net/README Mon Jul 7 08:19:59 1997 +++ linux/net/README Sun Sep 7 14:00:24 1997 @@ -5,7 +5,7 @@ -------------------+------------------------------------------- 802 [other ] alan@lxorguk.ukuu.org.uk [token ring ] pnorton@cts.com -appletalk alan@lxorguk.ukuu.org.uk and netatalk@umich.edu +appletalk Jay.Schulist@spacs.k12.wi.us ax25 g4klx@g4klx.demon.co.uk core alan@lxorguk.ukuu.org.uk decnet SteveW@ACM.org diff -u --recursive --new-file v2.1.54/linux/net/bridge/br.c linux/net/bridge/br.c --- v2.1.54/linux/net/bridge/br.c Wed Sep 3 20:52:44 1997 +++ linux/net/bridge/br.c Sun Sep 7 14:00:24 1997 @@ -1545,8 +1545,6 @@ { if (strncmp(dev->name, "eth", 3) == 0) /* ethernet */ return(100); - if (strncmp(dev->name, "wic", 3) == 0) /* wic */ - return(1600); if (strncmp(dev->name, "plip",4) == 0) /* plip */ return (1600); return(100); /* default */ diff -u --recursive --new-file v2.1.54/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c --- v2.1.54/linux/net/ipv4/ip_fw.c Tue May 13 22:41:23 1997 +++ linux/net/ipv4/ip_fw.c Sun Sep 7 14:00:24 1997 @@ -1120,7 +1120,9 @@ ntohl(i->fw_dst.s_addr),ntohl(i->fw_dmsk.s_addr), (i->fw_vianame)[0] ? i->fw_vianame : "-", ntohl(i->fw_via.s_addr),i->fw_flg); - len+=sprintf(buffer+len,"%u %u %-9lu %-9lu", + /* 9 is enough for a 32 bit box but the counters are 64bit on + the Alpha and Ultrapenguin */ + len+=sprintf(buffer+len,"%u %u %-19lu %-19lu", i->fw_nsp,i->fw_ndp, i->fw_pcnt,i->fw_bcnt); for (p = 0; p < IP_FW_MAX_PORTS; p++) len+=sprintf(buffer+len, " %u", i->fw_pts[p]); diff -u --recursive --new-file v2.1.54/linux/net/unix/garbage.c linux/net/unix/garbage.c --- v2.1.54/linux/net/unix/garbage.c Thu Jul 17 10:06:09 1997 +++ linux/net/unix/garbage.c Sun Sep 7 14:10:32 1997 @@ -29,6 +29,8 @@ * 2 of the License, or (at your option) any later version. * * Fixes: + * Alan Cox 07 Sept 1997 Vmalloc internal stack as needed. + * Cope with changing max_files. * */ @@ -49,6 +51,8 @@ #include #include #include +#include + #include #include #include @@ -60,10 +64,9 @@ /* Internal data structures and random procedures: */ -#define MAX_STACK 1000 /* Maximum depth of tree (about 1 page) */ static unix_socket **stack; /* stack of objects to mark */ static int in_stack = 0; /* first free entry in stack */ - +static int max_stack; /* Top of stack */ extern inline unix_socket *unix_get_socket(struct file *filp) { @@ -112,7 +115,7 @@ extern inline void push_stack(unix_socket *x) { - if (in_stack == MAX_STACK) + if (in_stack == max_stack) panic("can't push onto full stack"); stack[in_stack++] = x; } @@ -155,7 +158,19 @@ return; in_unix_gc=1; - stack=(unix_socket **)get_free_page(GFP_KERNEL); + if(stack==NULL || max_files>max_stack) + { + if(stack) + vfree(stack); + stack=(unix_socket **)vmalloc(max_files*sizeof(struct unix_socket *)); + if(stack==NULL) + { + printk(KERN_NOTICE "unix_gc: deferred due to low memory.\n"); + in_unix_gc=0; + return; + } + max_stack=max_files; + } /* * Assume everything is now unmarked