]> git.neil.brown.name Git - history.git/commitdiff
Import 2.2.5pre2 2.2.5pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:18:29 +0000 (15:18 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:18:29 +0000 (15:18 -0500)
67 files changed:
Documentation/Configure.help
Documentation/parport.txt
arch/sparc/kernel/process.c
arch/sparc/mm/srmmu.c
arch/sparc/mm/viking.S
arch/sparc64/kernel/ioctl32.c
drivers/block/floppy.c
drivers/block/rd.c
drivers/char/bttv.c
drivers/char/bw-qcam.c
drivers/char/misc.c
drivers/fc4/soc.c
drivers/net/hamradio/baycom_epp.c
drivers/net/myri_sbus.c
drivers/sbus/char/sab82532.c
drivers/scsi/ppa.c
drivers/sound/es1370.c
drivers/sound/es1371.c
drivers/sound/sonicvibes.c
fs/adfs/inode.c
fs/adfs/super.c
fs/lockd/svcsubs.c
fs/ncpfs/sock.c
fs/qnx4/file.c
include/asm-sparc/mmu_context.h
include/asm-sparc/processor.h
include/asm-sparc/termios.h
include/asm-sparc/unistd.h
include/asm-sparc64/termios.h
include/asm-sparc64/unistd.h
include/linux/adfs_fs_sb.h
include/linux/hippidevice.h
include/linux/if_arp.h
include/linux/nfsd/nfsfh.h
include/net/pkt_cls.h
include/net/sock.h
kernel/fork.c
kernel/signal.c
net/appletalk/ddp.c
net/core/dev.c
net/core/filter.c
net/core/neighbour.c
net/core/sock.c
net/ipv4/af_inet.c
net/ipv4/devinet.c
net/ipv4/fib_hash.c
net/ipv4/fib_rules.c
net/ipv4/igmp.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/route.c
net/ipv6/addrconf.c
net/ipv6/ipv6_sockglue.c
net/ipv6/mcast.c
net/ipv6/sit.c
net/netlink/af_netlink.c
net/sched/cls_api.c
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_u32.c
net/sched/estimator.c
net/sched/sch_prio.c
net/unix/af_unix.c

index fb989d35bf48020f6f43e0dd23b1f128903440c7..142fc2c23972785633270438bab8e7f92b4fcf6a 100644 (file)
@@ -8042,15 +8042,14 @@ CONFIG_PRINTER
   removed from the running kernel whenever you want), say M here and
   read Documentation/modules.txt. The module will be called lp.o. 
 
-  If you have several parallel ports, you should specify the base
-  address for the port to be used by the printer with the "lp" kernel
-  command line option. (Try "man bootparam" or see the documentation
-  of your boot loader (lilo or loadlin) about how to pass options to
-  the kernel at boot time. The lilo procedure is also explained in the
-  SCSI-HOWTO, available via FTP (user: anonymous) in
-  ftp://metalab.unc.edu/pub/Linux/docs/HOWTO.) The standard base
-  addresses as well as the syntax of the "lp" command line option can
-  be found in drivers/char/lp.c.
+  If you have several parallel ports, you can specify which ports to
+  use with the "lp" kernel command line option. (Try "man bootparam"
+  or see the documentation of your boot loader (lilo or loadlin)
+  about how to pass options to the kernel at boot time. The lilo
+  procedure is also explained in the SCSI-HOWTO, available via FTP
+  (user: anonymous) in ftp://metalab.unc.edu/pub/Linux/docs/HOWTO.)
+  The syntax of the "lp" command line option can be found in
+  drivers/char/lp.c.
 
   If you have more than 3 printers, you need to increase the LP_NO
   variable in lp.c.
index 94a6318b91a7cb9cb2b0eab4c3628b456b97f85c..6cf09e631071d945395c18a6009ddacbcd566f28 100644 (file)
@@ -87,7 +87,7 @@ Files in /proc
 If you have configured the /proc filesystem into your kernel, you will
 see a new directory entry: /proc/parport.  In there will be a
 directory entry for each parallel port for which parport is
-configured.  In each of those directories are three files describing
+configured.  In each of those directories are four files describing
 that parallel port.  For example:
 
 File:                          Contents:
index 306e96b0ea2725d710dc7fe11e1baa6f6636a55b..4013041ea9ae3b637ce9db9f5ab800ff4d5bb23b 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: process.c,v 1.132 1999/03/22 02:12:13 davem Exp $
+/*  $Id: process.c,v 1.133 1999/03/24 11:42:30 davem Exp $
  *  linux/arch/sparc/kernel/process.c
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -517,9 +517,16 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        p->tss.kregs = childregs;
 
        if(regs->psr & PSR_PS) {
-               childregs->u_regs[UREG_FP] = p->tss.ksp;
+               new_stack = (struct reg_window *)
+                       ((((unsigned long)p) +
+                         (TASK_UNION_SIZE)) -
+                        (REGWIN_SZ));
+               childregs->u_regs[UREG_FP] = (unsigned long) new_stack;
                p->tss.flags |= SPARC_FLAG_KTHREAD;
                p->tss.current_ds = KERNEL_DS;
+               memcpy((void *)new_stack,
+                      (void *)regs->u_regs[UREG_FP],
+                      sizeof(struct reg_window));
                childregs->u_regs[UREG_G6] = (unsigned long) p;
        } else {
                childregs->u_regs[UREG_FP] = sp;
index bd87b02296dea7ce6e95f6d92e93634a2d8ea92e..406bb81cbf10668c6e6c45f62986da2b517350c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: srmmu.c,v 1.184 1999/03/20 22:02:03 davem Exp $
+/* $Id: srmmu.c,v 1.185 1999/03/24 11:42:35 davem Exp $
  * srmmu.c:  SRMMU specific routines for memory management.
  *
  * Copyright (C) 1995 David S. Miller  (davem@caip.rutgers.edu)
@@ -817,19 +817,11 @@ static inline void free_context(int context)
 
 static void srmmu_switch_to_context(struct task_struct *tsk)
 {
-       int set = 0;
-
        if(tsk->mm->context == NO_CONTEXT) {
                alloc_context(tsk->mm);
-               flush_cache_mm(tsk->mm);
                ctxd_set(&srmmu_context_table[tsk->mm->context], tsk->mm->pgd);
-               flush_tlb_mm(tsk->mm);
-               set = 1;
-       } else if(tsk->mm != current->mm)
-               set = 1;
-
-       if(set != 0)
-               srmmu_set_context(tsk->mm->context);
+       }
+       srmmu_set_context(tsk->mm->context);
 }
 
 static void srmmu_init_new_context(struct mm_struct *mm)
@@ -1353,7 +1345,7 @@ static void hypersparc_update_rootmmu_dir(struct task_struct *tsk, pgd_t *pgdp)
 static void viking_update_rootmmu_dir(struct task_struct *tsk, pgd_t *pgdp) 
 {
        if(pgdp != swapper_pg_dir)
-               viking_flush_page((unsigned long)pgdp);
+               flush_chunk((unsigned long)pgdp);
        if(tsk->mm->context != NO_CONTEXT &&
           tsk->mm->pgd != pgdp) {
                flush_cache_mm(tsk->mm);
@@ -1402,8 +1394,6 @@ skip_flush:
 
 static void hypersparc_switch_to_context(struct task_struct *tsk)
 {
-       int set = 0;
-
        if(tsk->mm->context == NO_CONTEXT) {
                ctxd_t *ctxp;
 
@@ -1411,14 +1401,9 @@ static void hypersparc_switch_to_context(struct task_struct *tsk)
                ctxp = &srmmu_context_table[tsk->mm->context];
                srmmu_set_entry((pte_t *)ctxp, __pte((SRMMU_ET_PTD | (srmmu_v2p((unsigned long) tsk->mm->pgd) >> 4))));
                hypersparc_flush_page_to_ram((unsigned long)ctxp);
-               set = 1;
-       } else if(tsk->mm != current->mm)
-               set = 1;
-
-       if(set != 0) {
-               hyper_flush_whole_icache();
-               srmmu_set_context(tsk->mm->context);
        }
+       hyper_flush_whole_icache();
+       srmmu_set_context(tsk->mm->context);
 }
 
 static void hypersparc_init_new_context(struct mm_struct *mm)
@@ -2739,11 +2724,10 @@ __initfunc(static void init_viking(void))
                BTFIXUPSET_CALL(flush_page_for_dma, viking_flush_page_for_dma, BTFIXUPCALL_NOP);
        }
 
-       /* flush_cache_* are nops */
-       BTFIXUPSET_CALL(flush_cache_all, viking_flush_cache_all, BTFIXUPCALL_NOP);
-       BTFIXUPSET_CALL(flush_cache_mm, viking_flush_cache_mm, BTFIXUPCALL_NOP);
-       BTFIXUPSET_CALL(flush_cache_page, viking_flush_cache_page, BTFIXUPCALL_NOP);
-       BTFIXUPSET_CALL(flush_cache_range, viking_flush_cache_range, BTFIXUPCALL_NOP);
+       BTFIXUPSET_CALL(flush_cache_all, viking_flush_cache_all, BTFIXUPCALL_NORM);
+       BTFIXUPSET_CALL(flush_cache_mm, viking_flush_cache_mm, BTFIXUPCALL_NORM);
+       BTFIXUPSET_CALL(flush_cache_page, viking_flush_cache_page, BTFIXUPCALL_NORM);
+       BTFIXUPSET_CALL(flush_cache_range, viking_flush_cache_range, BTFIXUPCALL_NORM);
 
 #ifdef __SMP__
        if (sparc_cpu_model == sun4d) {
index cf543ccfbb52ac7c97a670ac015c0e4c378598c5..2ab87121f4b8e436ed34733f39184362a0a1b19f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: viking.S,v 1.12 1999/02/23 13:23:50 jj Exp $
+/* $Id: viking.S,v 1.13 1999/03/24 11:42:32 davem Exp $
  * viking.S: High speed Viking cache/mmu operations
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -67,7 +67,7 @@ viking_flush_chunk:
        clr     %o1                     ! set counter, 0 - 127
        sethi   %hi(KERNBASE + PAGE_SIZE - 0x80000000), %o3
        sethi   %hi(0x80000000), %o4
-       sethi   %hi(VIKING_PTAG_VALID | VIKING_PTAG_DIRTY), %o5
+       sethi   %hi(VIKING_PTAG_VALID), %o5
        sethi   %hi(2*PAGE_SIZE), %o0
        sethi   %hi(PAGE_SIZE), %g7
        clr     %o2                     ! block counter, 0 - 3
@@ -80,15 +80,12 @@ viking_flush_chunk:
        or      %g5, %g4, %g5
        ldda    [%g5] ASI_M_DATAC_TAG, %g2
        cmp     %g3, %g1                ! ptag == ppage?
-       bne,a   7f
+       bne     7f
         inc    %o2
 
-       and     %g2, %o5, %g3           ! ptag VALID and DIRTY?
-       cmp     %g3, %o5
-       bne,a   7f
-        inc    %o2
-
-       add     %g4, %o3, %g2           ! (KERNBASE + PAGE_SIZE) | (set << 5)
+       andcc   %g2, %o5, %g0           ! ptag VALID?
+       be      7f
+        add    %g4, %o3, %g2           ! (KERNBASE + PAGE_SIZE) | (set << 5)
        ld      [%g2], %g3
        ld      [%g2 + %g7], %g3
        add     %g2, %o0, %g2
@@ -99,18 +96,15 @@ viking_flush_chunk:
        ld      [%g2 + %g7], %g3
        add     %g2, %o0, %g2
        ld      [%g2], %g3
-       ld      [%g2 + %g7], %g3
-
        b       8f
-        inc    %o1
+        ld     [%g2 + %g7], %g3
 
 7:
        cmp     %o2, 3
        ble     6b
         sll    %o2, 26, %g5                    ! block << 26
 
-       inc     %o1
-8:
+8:     inc     %o1
        cmp     %o1, 0x7f
        ble     5b
         clr    %o2
@@ -148,10 +142,33 @@ viking_mxcc_flush_chunk:
        retl
         nop
 
-viking_flush_cache_all:
+#define WINDOW_FLUSH(tmp1, tmp2)                                       \
+       mov     0, tmp1;                                                \
+98:    ld      [%g6 + AOFF_task_tss + AOFF_thread_uwinmask], tmp2;     \
+       orcc    %g0, tmp2, %g0;                                         \
+       add     tmp1, 1, tmp1;                                          \
+       bne     98b;                                                    \
+        save   %sp, -64, %sp;                                          \
+99:    subcc   tmp1, 1, tmp1;                                          \
+       bne     99b;                                                    \
+        restore %g0, %g0, %g0;
+
+viking_flush_cache_page:
+#ifndef __SMP__
+       ld      [%o0 + 0x0], %o0                /* XXX vma->vm_mm, GROSS XXX */
+#endif
 viking_flush_cache_mm:
 viking_flush_cache_range:
-viking_flush_cache_page:
+#ifndef __SMP__
+       ld      [%o0 + AOFF_mm_context], %g1
+       cmp     %g1, -1
+       bne     viking_flush_cache_all
+        nop
+       b,a     viking_flush_cache_out
+#endif
+viking_flush_cache_all:
+       WINDOW_FLUSH(%g4, %g5)
+viking_flush_cache_out:
        retl
         nop
 
index 9a4acfea50ee46544237a8600e85e9b51aa3f1a4..3917a12a7f60cdedb60ffe49a78ddd069252873f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.59 1999/03/12 13:30:21 jj Exp $
+/* $Id: ioctl32.c,v 1.60 1999/03/22 10:40:54 jj Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997  Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
@@ -577,8 +577,7 @@ static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                        cmap.transp = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL);
                        if (!cmap.transp)
                                goto out;
-               } else
-                       cmap.transp = NULL;
+               }
                        
                if (cmd == FBIOGETCMAP)
                        break;
index 85387fd8a2b4dd6f64d4c94c4ffccf27d6ee681e..b4c986f4cd156ef6654d88afd217b4c2b247c2b4 100644 (file)
@@ -3592,7 +3592,7 @@ static void config_types(void)
        /* read drive info out of physical CMOS */
        drive=0;
        if (!UDP->cmos)
-               UDP->cmos= FLOPPY0_TYPE;
+               UDP->cmos = FLOPPY0_TYPE;
        drive=1;
        if (!UDP->cmos && FLOPPY1_TYPE)
                UDP->cmos = FLOPPY1_TYPE;
@@ -3601,26 +3601,31 @@ static void config_types(void)
        /* additional physical CMOS drive detection should go here */
 
        for (drive=0; drive < N_DRIVE; drive++){
-               if (UDP->cmos >= 16)
-                       UDP->cmos = 0;
-               if (UDP->cmos >= 0 && UDP->cmos <= NUMBER(default_drive_params))
-                       memcpy((char *) UDP,
-                              (char *) (&default_drive_params[(int)UDP->cmos].params),
-                              sizeof(struct floppy_drive_params));
-               if (UDP->cmos){
-                       if (first)
-                               printk(KERN_INFO "Floppy drive(s): ");
-                       else
-                               printk(", ");
-                       first=0;
-                       if (UDP->cmos > 0){
+               unsigned int type = UDP->cmos;
+               struct floppy_drive_params *params;
+               const char *name = NULL;
+               static char temparea[32];
+
+               if (type < NUMBER(default_drive_params)) {
+                       params = &default_drive_params[type].params;
+                       if (type) {
+                               name = default_drive_params[type].name;
                                allowed_drive_mask |= 1 << drive;
-                               printk("fd%d is %s", drive,
-                                      default_drive_params[(int)UDP->cmos].name);
-                       } else
-                               printk("fd%d is unknown type %d",drive,
-                                      UDP->cmos);
+                       }
+               } else {
+                       params = &default_drive_params[0].params;
+                       sprintf(temparea, "unknown type %d (usb?)", type);
+                       name = temparea;
                }
+               if (name) {
+                       const char * prepend = ",";
+                       if (first) {
+                               prepend = KERN_INFO "Floppy drive(s):";
+                               first = 0;
+                       }
+                       printk("%s fd%d is %s", prepend, drive, name);
+               }
+               *UDP = *params;
        }
        if (!first)
                printk("\n");
@@ -4020,11 +4025,6 @@ __initfunc(static void set_cmos(int *ints, int dummy, int dummy2))
        }
        if (current_drive >= 4 && !FDC2)
                FDC2 = 0x370;
-       if (ints[2] <= 0 || 
-           (ints[2] >= NUMBER(default_drive_params) && ints[2] != 16)){
-               DPRINT("bad CMOS code %d\n", ints[2]);
-               return;
-       }
        DP->cmos = ints[2];
        DPRINT("setting CMOS code to %d\n", ints[2]);
 }
index 1a3561d04fcbb4d685ab69029cf20da1bc118984..e8f4a0554be7e888040ad7aeb313fbaa88a666bf 100644 (file)
@@ -158,8 +158,6 @@ repeat:
 
 static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-       int err;
-       
        if (!inode || !inode->i_rdev)   
                return -EINVAL;
 
index bdd126d84b1870c2c52e3478498fe0dc795e52bb..1f452ac58374d24806f8531bdc33d8b6fa072e80 100644 (file)
@@ -3751,6 +3751,8 @@ static void release_bttv(void)
 
 #ifdef MODULE
 
+EXPORT_NO_SYMBOLS;
+
 int init_module(void)
 {
 #else
index 313bc29b6866afd67a3006487cf8176be7939939..87821edf896f87db53c1a6b13fc08f8f994eabe3 100644 (file)
@@ -986,11 +986,41 @@ void close_bwqcam(struct qcam_device *qcam)
        kfree(qcam);
 }
 
+/* The parport parameter controls which parports will be scanned.
+ * Scanning all parports causes some printers to print a garbage page.
+ *       -- March 14, 1999  Billy Donahue <billy@escape.com> */
+#ifdef MODULE
+static char *parport[MAX_CAMS] = { NULL, };
+MODULE_PARM(parport, "1-" __MODULE_STRING(MAX_CAMS) "s");
+#endif
+
 #ifdef MODULE
 int init_module(void)
 {
        struct parport *port;
-
+       int n;
+       if(parport[0] && strncmp(parport[0], "auto", 4)){
+               /* user gave parport parameters */
+               for(n=0; parport[n] && n<MAX_CAMS; n++){
+                       char *ep;
+                       unsigned long r;
+                       r = simple_strtoul(parport[n], &ep, 0);
+                       if(ep == parport[n]){
+                               printk(KERN_ERR
+                                       "bw-qcam: bad port specifier \"%s\"\n",
+                                       parport[n]);
+                               continue;
+                       }
+                       for (port=parport_enumerate(); port; port=port->next){
+                               if(r!=port->number)
+                                       continue;
+                               init_bwqcam(port);
+                               break;
+                       }
+               }
+               return (num_cams)?0:-ENODEV;
+       } 
+       /* no parameter or "auto" */
        for (port = parport_enumerate(); port; port=port->next)
                init_bwqcam(port);
 
index 04409a84ee103cfb90af58167d9bb7cf9a760bc8..0102ce5ccb24efcfa6dc79b4cc560d4bf1213020 100644 (file)
@@ -73,6 +73,7 @@ extern int adb_mouse_init(void);
 extern void watchdog_init(void);
 extern void wdt_init(void);
 extern void acq_init(void);
+extern void dtlk_init(void);
 extern void pcwatchdog_init(void);
 extern int rtc_init(void);
 extern int rtc_DP8570A_init(void);
index e9087556cd4390f351f733dbf3920afc41e5efbd..f0ddd38d1e5cd4fd3baf8783e586e3ddfadcd66c 100644 (file)
@@ -41,7 +41,6 @@ static char *version =
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
-#include <asm/system.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 
index bd35d5362a22b2af1b3895656834360cae88bebb..d72719e5c0558a1d47fd72f9a45a421ec716f079 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/string.h>
 #include <linux/parport.h>
 #include <linux/bitops.h>
-#include <linux/sched.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/processor.h>
index d888e603a4c3cbc62c593b846252078c7bdf507a..659824e92e3e04d8158218b7749b88d3eb3c584a 100644 (file)
@@ -34,7 +34,6 @@ static char *version =
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/auxio.h>
-#include <asm/system.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 
index 6d56d40b201913fa8cc0b9132632161e462734c0..bbbd7c67040f1eea23291c61bfd53e09d98fe518 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sab82532.c,v 1.28 1999/01/02 16:47:35 davem Exp $
+/* $Id: sab82532.c,v 1.30 1999/03/24 11:34:52 davem Exp $
  * sab82532.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -2136,7 +2136,7 @@ sab82532_kgdb_hook(int line))
 
 __initfunc(static inline void show_serial_version(void))
 {
-       char *revision = "$Revision: 1.28 $";
+       char *revision = "$Revision: 1.30 $";
        char *version, *p;
 
        version = strchr(revision, ' ');
@@ -2359,8 +2359,10 @@ void cleanup_module(void)
        restore_flags(flags);
 
        for (i = 0; i < NR_PORTS; i++) {
-               if (sab82532_table[i].type != PORT_UNKNOWN)
-                       release_region(sab82532_table[i].port, 8);
+               struct sab82532 *info = (struct sab82532 *)sab82532_table[i]->driver_data;
+               if (info->type != PORT_UNKNOWN)
+                       release_region((unsigned long)info->regs,
+                                      sizeof(union sab82532_async_regs));
        }
        if (tmp_buf) {
                free_page((unsigned long) tmp_buf);
index de54daef66f31a5b537931f0d6d05ada7562b639..59c1ac0178849d91f5f902dcdbad4a5200a5713d 100644 (file)
@@ -48,7 +48,6 @@ typedef struct {
 }
 
 #include  "ppa.h"
-#include <linux/parport.h>
 
 #define NO_HOSTS 4
 static ppa_struct ppa_hosts[NO_HOSTS] =
index 1705d7b589afa507ff2c6ab41ea33bf10ccbbf1c..9226318ef9eb6ea5abd2d7f82fdb9d62a5f2912e 100644 (file)
  *    16.12.98   0.16  Don't wake up app until there are fragsize bytes to read/write
  *    06.01.99   0.17  remove the silly SA_INTERRUPT flag.
  *                     hopefully killed the egcs section type conflict
+ *    12.03.99   0.18  cinfo.blocks should be reset after GETxPTR ioctl.
+ *                     reported by Johan Maes <joma@telindus.be>
+ *    22.03.99   0.19  return EAGAIN instead of EBUSY when O_NONBLOCK
+ *                     read/write cannot be executed
  *
  * some important things missing in Ensoniq documentation:
  *
@@ -1097,7 +1101,7 @@ static ssize_t es1370_read(struct file *file, char *buffer, size_t count, loff_t
                if (cnt <= 0) {
                        start_adc(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_adc.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1152,7 +1156,7 @@ static ssize_t es1370_write(struct file *file, const char *buffer, size_t count,
                if (cnt <= 0) {
                        start_dac2(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_dac2.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1455,7 +1459,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                spin_lock_irqsave(&s->lock, flags);
                es1370_update_ptr(s);
                 cinfo.bytes = s->dma_adc.total_bytes;
-                cinfo.blocks = s->dma_adc.total_bytes >> s->dma_adc.fragshift;
+                cinfo.blocks = s->dma_adc.count >> s->dma_adc.fragshift;
                 cinfo.ptr = s->dma_adc.hwptr;
                if (s->dma_adc.mapped)
                        s->dma_adc.count &= s->dma_adc.fragsize-1;
@@ -1468,7 +1472,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                spin_lock_irqsave(&s->lock, flags);
                es1370_update_ptr(s);
                 cinfo.bytes = s->dma_dac2.total_bytes;
-                cinfo.blocks = s->dma_dac2.total_bytes >> s->dma_dac2.fragshift;
+                cinfo.blocks = s->dma_dac2.count >> s->dma_dac2.fragshift;
                 cinfo.ptr = s->dma_dac2.hwptr;
                if (s->dma_dac2.mapped)
                        s->dma_dac2.count &= s->dma_dac2.fragsize-1;
@@ -1664,7 +1668,7 @@ static ssize_t es1370_write_dac(struct file *file, const char *buffer, size_t co
                if (cnt <= 0) {
                        start_dac1(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_dac1.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1866,7 +1870,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
                spin_lock_irqsave(&s->lock, flags);
                es1370_update_ptr(s);
                 cinfo.bytes = s->dma_dac1.total_bytes;
-                cinfo.blocks = s->dma_dac1.total_bytes >> s->dma_dac1.fragshift;
+                cinfo.blocks = s->dma_dac1.count >> s->dma_dac1.fragshift;
                 cinfo.ptr = s->dma_dac1.hwptr;
                if (s->dma_dac1.mapped)
                        s->dma_dac1.count &= s->dma_dac1.fragsize-1;
@@ -2021,7 +2025,7 @@ static ssize_t es1370_midi_read(struct file *file, char *buffer, size_t count, l
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.iwait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2068,7 +2072,7 @@ static ssize_t es1370_midi_write(struct file *file, const char *buffer, size_t c
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.owait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2271,7 +2275,7 @@ __initfunc(int init_es1370(void))
 
        if (!pci_present())   /* No PCI bus in this machine! */
                return -ENODEV;
-       printk(KERN_INFO "es1370: version v0.17 time " __TIME__ " " __DATE__ "\n");
+       printk(KERN_INFO "es1370: version v0.19 time " __TIME__ " " __DATE__ "\n");
        while (index < NR_DEVICE && 
               (pcidev = pci_find_device(PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, pcidev))) {
                if (pcidev->base_address[0] == 0 || 
index 69aa867aaa8de41156f5fd646d5074035bb6d16d..6c9bd5ecc44d9dbe5dae46ad52d2ae41628382fe 100644 (file)
  *                     Don't wake up app until there are fragsize bytes to read/write
  *    06.01.99   0.8   remove the silly SA_INTERRUPT flag.
  *                     hopefully killed the egcs section type conflict
+ *    12.03.99   0.9   cinfo.blocks should be reset after GETxPTR ioctl.
+ *                     reported by Johan Maes <joma@telindus.be>
+ *    22.03.99   0.10  return EAGAIN instead of EBUSY when O_NONBLOCK
+ *                     read/write cannot be executed
  *
  */
 
@@ -1542,7 +1546,7 @@ static ssize_t es1371_read(struct file *file, char *buffer, size_t count, loff_t
                if (cnt <= 0) {
                        start_adc(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_adc.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1597,7 +1601,7 @@ static ssize_t es1371_write(struct file *file, const char *buffer, size_t count,
                if (cnt <= 0) {
                        start_dac2(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_dac2.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1897,7 +1901,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                spin_lock_irqsave(&s->lock, flags);
                es1371_update_ptr(s);
                 cinfo.bytes = s->dma_adc.total_bytes;
-                cinfo.blocks = s->dma_adc.total_bytes >> s->dma_adc.fragshift;
+                cinfo.blocks = s->dma_adc.count >> s->dma_adc.fragshift;
                 cinfo.ptr = s->dma_adc.hwptr;
                if (s->dma_adc.mapped)
                        s->dma_adc.count &= s->dma_adc.fragsize-1;
@@ -1910,7 +1914,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                spin_lock_irqsave(&s->lock, flags);
                es1371_update_ptr(s);
                 cinfo.bytes = s->dma_dac2.total_bytes;
-                cinfo.blocks = s->dma_dac2.total_bytes >> s->dma_dac2.fragshift;
+                cinfo.blocks = s->dma_dac2.count >> s->dma_dac2.fragshift;
                 cinfo.ptr = s->dma_dac2.hwptr;
                if (s->dma_dac2.mapped)
                        s->dma_dac2.count &= s->dma_dac2.fragsize-1;
@@ -2108,7 +2112,7 @@ static ssize_t es1371_write_dac(struct file *file, const char *buffer, size_t co
                if (cnt <= 0) {
                        start_dac1(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_dac1.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2301,7 +2305,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
                spin_lock_irqsave(&s->lock, flags);
                es1371_update_ptr(s);
                 cinfo.bytes = s->dma_dac1.total_bytes;
-                cinfo.blocks = s->dma_dac1.total_bytes >> s->dma_dac1.fragshift;
+                cinfo.blocks = s->dma_dac1.count >> s->dma_dac1.fragshift;
                 cinfo.ptr = s->dma_dac1.hwptr;
                if (s->dma_dac1.mapped)
                        s->dma_dac1.count &= s->dma_dac1.fragsize-1;
@@ -2455,7 +2459,7 @@ static ssize_t es1371_midi_read(struct file *file, char *buffer, size_t count, l
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.iwait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2502,7 +2506,7 @@ static ssize_t es1371_midi_write(struct file *file, const char *buffer, size_t c
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.owait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2708,7 +2712,7 @@ __initfunc(int init_es1371(void))
 
        if (!pci_present())   /* No PCI bus in this machine! */
                return -ENODEV;
-       printk(KERN_INFO "es1371: version v0.8 time " __TIME__ " " __DATE__ "\n");
+       printk(KERN_INFO "es1371: version v0.10 time " __TIME__ " " __DATE__ "\n");
        while (index < NR_DEVICE && 
               (pcidev = pci_find_device(PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1371, pcidev))) {
                if (pcidev->base_address[0] == 0 || 
index 0ecb00c62ad015c6b85863e0a8e095cfdc762ede..c2d9774f8a19ce02941355a9ea9e3ba423f4632d 100644 (file)
  *    16.12.98   0.9   Fix a few f_file & FMODE_ bugs
  *    06.01.99   0.10  remove the silly SA_INTERRUPT flag.
  *                     hopefully killed the egcs section type conflict
+ *    12.03.99   0.11  cinfo.blocks should be reset after GETxPTR ioctl.
+ *                     reported by Johan Maes <joma@telindus.be>
+ *    22.03.99   0.12  return EAGAIN instead of EBUSY when O_NONBLOCK
+ *                     read/write cannot be executed
  *
  */
 
@@ -1293,7 +1297,7 @@ static ssize_t sv_read(struct file *file, char *buffer, size_t count, loff_t *pp
                if (cnt <= 0) {
                        start_adc(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_adc.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1353,7 +1357,7 @@ static ssize_t sv_write(struct file *file, const char *buffer, size_t count, lof
                if (cnt <= 0) {
                        start_dac(s);
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->dma_dac.wait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1646,7 +1650,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                spin_lock_irqsave(&s->lock, flags);
                sv_update_ptr(s);
                 cinfo.bytes = s->dma_adc.total_bytes;
-                cinfo.blocks = s->dma_adc.total_bytes >> s->dma_adc.fragshift;
+                cinfo.blocks = s->dma_adc.count >> s->dma_adc.fragshift;
                 cinfo.ptr = s->dma_adc.hwptr;
                if (s->dma_adc.mapped)
                        s->dma_adc.count &= s->dma_adc.fragsize-1;
@@ -1659,7 +1663,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                spin_lock_irqsave(&s->lock, flags);
                sv_update_ptr(s);
                 cinfo.bytes = s->dma_dac.total_bytes;
-                cinfo.blocks = s->dma_dac.total_bytes >> s->dma_dac.fragshift;
+                cinfo.blocks = s->dma_dac.count >> s->dma_dac.fragshift;
                 cinfo.ptr = s->dma_dac.hwptr;
                if (s->dma_dac.mapped)
                        s->dma_dac.count &= s->dma_dac.fragsize-1;
@@ -1839,7 +1843,7 @@ static ssize_t sv_midi_read(struct file *file, char *buffer, size_t count, loff_
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.iwait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -1886,7 +1890,7 @@ static ssize_t sv_midi_write(struct file *file, const char *buffer, size_t count
                        cnt = count;
                if (cnt <= 0) {
                        if (file->f_flags & O_NONBLOCK)
-                               return ret ? ret : -EBUSY;
+                               return ret ? ret : -EAGAIN;
                        interruptible_sleep_on(&s->midi.owait);
                        if (signal_pending(current))
                                return ret ? ret : -ERESTARTSYS;
@@ -2271,7 +2275,7 @@ __initfunc(int init_sonicvibes(void))
 
        if (!pci_present())   /* No PCI bus in this machine! */
                return -ENODEV;
-       printk(KERN_INFO "sv: version v0.10 time " __TIME__ " " __DATE__ "\n");
+       printk(KERN_INFO "sv: version v0.12 time " __TIME__ " " __DATE__ "\n");
 #if 0
        if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT)))
                printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n");
index 37daaa3c367336d9e730c2e8d76026e55f475596..6c8814567ab2d74a8d135ad1d7e32c386715a42b 100644 (file)
@@ -27,7 +27,7 @@
 #define inode_dirindex(idx)    (((idx) & 0xff) * 26 - 21)
 
 #define frag_id(x)             (((x) >> 8) & 0x7fff)
-#define off(x)                 (((x) & 0xff) ? ((x) & 0xff) - 1 : 0)
+#define off(x)                 (((x) & 0xff) ? (((x) & 0xff) - 1) << sb->u.adfs_sb.s_dr->log2sharesize : 0)
 
 static inline int adfs_inode_validate_no (struct super_block *sb, unsigned int inode_no)
 {
@@ -83,11 +83,20 @@ int adfs_bmap (struct inode *inode, int block)
                return 0;
        }
 
+       if (block < 0) {
+               adfs_error(sb, "adfs_bmap", "block(%d) < 0", block);
+               return 0;
+       }
+
+       if (block > inode->i_blocks)
+               return 0;
+
+       block += off(inode->u.adfs_i.file_id);
+
        if (frag_id(inode->u.adfs_i.file_id) == ADFS_ROOT_FRAG)
-               blk = sb->u.adfs_sb.s_map_block + off(inode_frag (inode->i_ino)) + block;
+               blk = sb->u.adfs_sb.s_map_block + block;
        else
-               blk = adfs_map_lookup (sb, frag_id(inode->u.adfs_i.file_id),
-                                      off (inode->u.adfs_i.file_id) + block);
+               blk = adfs_map_lookup (sb, frag_id(inode->u.adfs_i.file_id), block);
        return blk;
 }
 
@@ -105,13 +114,13 @@ unsigned int adfs_parent_bmap (struct inode *inode, int block)
 
        fragment = inode_frag (inode->i_ino);
        if (frag_id (fragment) == ADFS_ROOT_FRAG)
-               blk = sb->u.adfs_sb.s_map_block + off (fragment) + block;
+               blk = sb->u.adfs_sb.s_map_block + off(fragment) + block;
        else
-               blk = adfs_map_lookup (sb, frag_id (fragment), off (fragment) + block);
+               blk = adfs_map_lookup (sb, frag_id (fragment), off(fragment) + block);
        return blk;     
 }
 
-static int adfs_atts2mode (unsigned char mode, unsigned int filetype)
+static int adfs_atts2mode(struct super_block *sb, unsigned char mode, unsigned int filetype)
 {
        int omode = 0;
 
@@ -120,24 +129,29 @@ static int adfs_atts2mode (unsigned char mode, unsigned int filetype)
                                S_IRGRP|S_IWGRP|S_IXGRP|
                                S_IROTH|S_IWOTH|S_IXOTH;
        } else {
-               if (mode & ADFS_NDA_DIRECTORY)
-                       omode |= S_IFDIR|S_IRUSR|S_IXUSR|S_IXGRP|S_IXOTH;
-               else
+               if (mode & ADFS_NDA_DIRECTORY) {
+                       omode |= S_IRUGO & sb->u.adfs_sb.s_owner_mask;
+                       omode |= S_IFDIR|S_IXUSR|S_IXGRP|S_IXOTH;
+               } else
                        omode |= S_IFREG;
+
                if (mode & ADFS_NDA_OWNER_READ) {
-                       omode |= S_IRUSR;
+                       omode |= S_IRUGO & sb->u.adfs_sb.s_owner_mask;
                        if (filetype == 0xfe6 /* UnixExec */)
-                               omode |= S_IXUSR;
+                               omode |= S_IXUGO & sb->u.adfs_sb.s_owner_mask;
                }
+
                if (mode & ADFS_NDA_OWNER_WRITE)
-                       omode |= S_IWUSR;
+                       omode |= S_IWUGO & sb->u.adfs_sb.s_owner_mask;
+
                if (mode & ADFS_NDA_PUBLIC_READ) {
-                       omode |= S_IRGRP | S_IROTH;
-                       if (filetype == 0xfe6)
-                               omode |= S_IXGRP | S_IXOTH;
+                       omode |= S_IRUGO & sb->u.adfs_sb.s_other_mask;
+                       if (filetype == 0xfe6 /* UnixExec */)
+                               omode |= S_IXUGO & sb->u.adfs_sb.s_other_mask;
                }
+
                if (mode & ADFS_NDA_PUBLIC_WRITE)
-                       omode |= S_IWGRP | S_IWOTH;
+                       omode |= S_IWUGO & sb->u.adfs_sb.s_other_mask;
        }
        return omode;
 }
@@ -150,8 +164,8 @@ void adfs_read_inode (struct inode *inode)
        int buffers;
 
        sb = inode->i_sb;
-       inode->i_uid = 0;
-       inode->i_gid = 0;
+       inode->i_uid = sb->u.adfs_sb.s_uid;
+       inode->i_gid = sb->u.adfs_sb.s_gid;
        inode->i_version = ++event;
 
        if (adfs_inode_validate_no (sb, inode->i_ino & 0xffffff00)) {
@@ -186,7 +200,7 @@ void adfs_read_inode (struct inode *inode)
                        goto bad;
                }
                adfs_dir_free (bh, buffers);
-               inode->i_mode    = adfs_atts2mode (ide.mode, ide.filetype);
+               inode->i_mode    = adfs_atts2mode(sb, ide.mode, ide.filetype);
                inode->i_nlink   = 2;
                inode->i_size    = ide.size;
                inode->i_blksize = PAGE_SIZE;
@@ -204,13 +218,5 @@ void adfs_read_inode (struct inode *inode)
        return;
 
 bad:
-       inode->i_mode    = 0;
-       inode->i_nlink   = 1;
-       inode->i_size    = 0;
-       inode->i_blksize = 0;
-       inode->i_blocks  = 0;
-       inode->i_mtime   =
-       inode->i_atime   =
-       inode->i_ctime   = 0;
-       inode->i_op      = NULL;
+       make_bad_inode(inode);
 }
index 234d8cf21c10c6277c3fa506ea557591eaaadf6e..8c2fbe8fa62347032c27c18ad6160ffb61f250f0 100644 (file)
 
 #include <stdarg.h>
 
-static void adfs_put_super (struct super_block *sb);
-static int adfs_statfs (struct super_block *sb, struct statfs *buf, int bufsiz);
-void adfs_read_inode (struct inode *inode);
+static void adfs_put_super(struct super_block *sb);
+static int adfs_remount(struct super_block *sb, int *flags, char *data);
+static int adfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+void adfs_read_inode(struct inode *inode);
 
-void adfs_error (struct super_block *sb, const char *function, const char *fmt, ...)
+void adfs_error(struct super_block *sb, const char *function, const char *fmt, ...)
 {
        char error_buf[128];
        va_list args;
 
-       va_start (args, fmt);
-       vsprintf (error_buf, fmt, args);
-       va_end (args);
+       va_start(args, fmt);
+       vsprintf(error_buf, fmt, args);
+       va_end(args);
 
-       printk (KERN_CRIT "ADFS-fs error (device %s)%s%s: %s\n",
-               kdevname (sb->s_dev), function ? ": " : "",
+       printk(KERN_CRIT "ADFS-fs error (device %s)%s%s: %s\n",
+               kdevname(sb->s_dev), function ? ": " : "",
                function ? function : "", error_buf);
 }
 
-unsigned char adfs_calccrosscheck (struct super_block *sb, char *map)
+static unsigned char adfs_calczonecheck(struct super_block *sb, char *map)
 {
        unsigned int v0, v1, v2, v3;
        int i;
@@ -63,7 +64,7 @@ unsigned char adfs_calccrosscheck (struct super_block *sb, char *map)
        return v0 ^ v1 ^ v2 ^ v3;
 }
 
-static int adfs_checkmap (struct super_block *sb)
+static int adfs_checkmap(struct super_block *sb)
 {
        unsigned char crosscheck = 0, zonecheck = 1;
        int i;
@@ -72,14 +73,14 @@ static int adfs_checkmap (struct super_block *sb)
                char *map;
 
                map = sb->u.adfs_sb.s_map[i]->b_data;
-               if (adfs_calccrosscheck (sb, map) != map[0]) {
-                       adfs_error (sb, "adfs_checkmap", "zone %d fails zonecheck", i);
+               if (adfs_calczonecheck(sb, map) != map[0]) {
+                       adfs_error(sb, "adfs_checkmap", "zone %d fails zonecheck", i);
                        zonecheck = 0;
                }
                crosscheck ^= map[3];
        }
        if (crosscheck != 0xff)
-               adfs_error (sb, "adfs_checkmap", "crosscheck != 0xff");
+               adfs_error(sb, "adfs_checkmap", "crosscheck != 0xff");
        return crosscheck == 0xff && zonecheck;
 }
 
@@ -92,21 +93,73 @@ static struct super_operations adfs_sops = {
        adfs_put_super,
        NULL,
        adfs_statfs,
-       NULL
+       adfs_remount
 };
 
-static void adfs_put_super (struct super_block *sb)
+static void adfs_put_super(struct super_block *sb)
 {
        int i;
 
        for (i = 0; i < sb->u.adfs_sb.s_map_size; i++)
-               brelse (sb->u.adfs_sb.s_map[i]);
-       kfree (sb->u.adfs_sb.s_map);
-       brelse (sb->u.adfs_sb.s_sbh);
+               brelse(sb->u.adfs_sb.s_map[i]);
+       kfree(sb->u.adfs_sb.s_map);
+       brelse(sb->u.adfs_sb.s_sbh);
        MOD_DEC_USE_COUNT;
 }
 
-struct super_block *adfs_read_super (struct super_block *sb, void *data, int silent)
+static int parse_options(struct super_block *sb, char *options)
+{
+       char *value, *opt;
+
+       if (!options)
+               return 0;
+
+       for (opt = strtok(options, ","); opt != NULL; opt = strtok(NULL, ",")) {
+               value = strchr(opt, '=');
+               if (value)
+                       *value++ = '\0';
+
+               if (!strcmp(opt, "uid")) {      /* owner of all files */
+                       if (!value || !*value)
+                               return -EINVAL;
+                       sb->u.adfs_sb.s_uid = simple_strtoul(value, &value, 0);
+                       if (*value)
+                               return -EINVAL;
+               } else
+               if (!strcmp(opt, "gid")) {      /* group owner of all files */
+                       if (!value || !*value)
+                               return -EINVAL;
+                       sb->u.adfs_sb.s_gid = simple_strtoul(value, &value, 0);
+                       if (*value)
+                               return -EINVAL;
+               } else
+               if (!strcmp(opt, "ownmask")) {  /* owner permission mask */
+                       if (!value || !*value)
+                               return -EINVAL;
+                       sb->u.adfs_sb.s_owner_mask = simple_strtoul(value, &value, 8);
+                       if (*value)
+                               return -EINVAL;
+               } else
+               if (!strcmp(opt, "othmask")) {  /* others permission mask */
+                       if (!value || !*value)
+                               return -EINVAL;
+                       sb->u.adfs_sb.s_other_mask = simple_strtoul(value, &value, 8);
+                       if (*value)
+                               return -EINVAL;
+               } else {                        /* eh? say again. */
+                       printk("ADFS-fs: unrecognised mount option %s\n", opt);
+                       return -EINVAL;
+               }
+       }
+       return 0;
+}
+
+static int adfs_remount(struct super_block *sb, int *flags, char *data)
+{
+       return parse_options(sb, data);
+}
+
+struct super_block *adfs_read_super(struct super_block *sb, void *data, int silent)
 {
        struct adfs_discrecord *dr;
        struct buffer_head *bh;
@@ -114,28 +167,30 @@ struct super_block *adfs_read_super (struct super_block *sb, void *data, int sil
        kdev_t dev = sb->s_dev;
        int i, j;
 
+       /* set default options */
+       sb->u.adfs_sb.s_uid = 0;
+       sb->u.adfs_sb.s_gid = 0;
+       sb->u.adfs_sb.s_owner_mask = S_IRWXU;
+       sb->u.adfs_sb.s_other_mask = S_IRWXG | S_IRWXO;
+
+       if (parse_options(sb, data))
+               goto error;
+
        MOD_INC_USE_COUNT;
-       lock_super (sb);
-       set_blocksize (dev, BLOCK_SIZE);
-       if (!(bh = bread (dev, ADFS_DISCRECORD / BLOCK_SIZE, BLOCK_SIZE))) {
-               unlock_super (sb);
-               adfs_error (sb, NULL, "unable to read superblock");
-               MOD_DEC_USE_COUNT;
-               return NULL;
+       lock_super(sb);
+       set_blocksize(dev, BLOCK_SIZE);
+       if (!(bh = bread(dev, ADFS_DISCRECORD / BLOCK_SIZE, BLOCK_SIZE))) {
+               adfs_error(sb, NULL, "unable to read superblock");
+               goto error_unlock;
        }
 
        b_data = bh->b_data + (ADFS_DISCRECORD % BLOCK_SIZE);
 
-       if (adfs_checkbblk (b_data)) {
+       if (adfs_checkbblk(b_data)) {
                if (!silent)
-                       printk ("VFS: Can't find an adfs filesystem on dev "
+                       printk("VFS: Can't find an adfs filesystem on dev "
                                "%s.\n", kdevname(dev));
-failed_mount:
-               unlock_super (sb);
-               if (bh)
-                       brelse (bh);
-               MOD_DEC_USE_COUNT;
-               return NULL;
+               goto error_free_bh;
        }
        dr = (struct adfs_discrecord *)(b_data + ADFS_DR_OFFSET);
 
@@ -145,26 +200,26 @@ failed_mount:
            (sb->s_blocksize == 512 || sb->s_blocksize == 1024 ||
             sb->s_blocksize == 2048 || sb->s_blocksize == 4096)) {
 
-               brelse (bh);
-               set_blocksize (dev, sb->s_blocksize);
-               bh = bread (dev, ADFS_DISCRECORD / sb->s_blocksize, sb->s_blocksize);
+               brelse(bh);
+               set_blocksize(dev, sb->s_blocksize);
+               bh = bread(dev, ADFS_DISCRECORD / sb->s_blocksize, sb->s_blocksize);
                if (!bh) {
-                       adfs_error (sb, NULL, "couldn't read superblock on "
+                       adfs_error(sb, NULL, "couldn't read superblock on "
                                "2nd try.");
-                       goto failed_mount;
+                       goto error_unlock;
                }
                b_data = bh->b_data + (ADFS_DISCRECORD % sb->s_blocksize);
-               if (adfs_checkbblk (b_data)) {
-                       adfs_error (sb, NULL, "disc record mismatch, very weird!");
-                       goto failed_mount;
+               if (adfs_checkbblk(b_data)) {
+                       adfs_error(sb, NULL, "disc record mismatch, very weird!");
+                       goto error_free_bh;
                }
                dr = (struct adfs_discrecord *)(b_data + ADFS_DR_OFFSET);
        }
        if (sb->s_blocksize != bh->b_size) {
                if (!silent)
-                       printk (KERN_ERR "VFS: Unsupported blocksize on dev "
-                               "%s.\n", kdevname (dev));
-               goto failed_mount;
+                       printk(KERN_ERR "VFS: Unsupported blocksize on dev "
+                               "%s.\n", kdevname(dev));
+               goto error_free_bh;
        }
        /* blocksize on this device should now be set to the adfs log2secsize */
 
@@ -202,71 +257,81 @@ failed_mount:
        else
                sb->u.adfs_sb.s_map_block >>= -sb->u.adfs_sb.s_map2blk;
 
-       printk (KERN_DEBUG "ADFS: zone size %d, IDs per zone %d, map address %X size %d sectors\n",
+       printk(KERN_DEBUG "ADFS: zone size %d, IDs per zone %d, map address %X size %d sectors\n",
                sb->u.adfs_sb.s_zone_size, sb->u.adfs_sb.s_ids_per_zone,
                sb->u.adfs_sb.s_map_block, sb->u.adfs_sb.s_map_size);
-       printk (KERN_DEBUG "ADFS: sector size %d, map bit size %d\n",
-               1 << dr->log2secsize, 1 << dr->log2bpmb);
+       printk(KERN_DEBUG "ADFS: sector size %d, map bit size %d, share size %d\n",
+               1 << dr->log2secsize, 1 << dr->log2bpmb,
+               1 << (dr->log2secsize + dr->log2sharesize));
 
        sb->s_magic = ADFS_SUPER_MAGIC;
-       sb->s_flags |= MS_RDONLY;       /* we don't support writing yet */
 
-       sb->u.adfs_sb.s_map = kmalloc (sb->u.adfs_sb.s_map_size *
-                               sizeof (struct buffer_head *), GFP_KERNEL);
+       sb->u.adfs_sb.s_map = kmalloc(sb->u.adfs_sb.s_map_size *
+                               sizeof(struct buffer_head *), GFP_KERNEL);
        if (sb->u.adfs_sb.s_map == NULL) {
-               adfs_error (sb, NULL, "not enough memory");
-               goto failed_mount;
+               adfs_error(sb, NULL, "not enough memory");
+               goto error_free_bh;
        }
 
        for (i = 0; i < sb->u.adfs_sb.s_map_size; i++) {
-               sb->u.adfs_sb.s_map[i] = bread (dev,
+               sb->u.adfs_sb.s_map[i] = bread(dev,
                                                sb->u.adfs_sb.s_map_block + i,
                                                sb->s_blocksize);
                if (!sb->u.adfs_sb.s_map[i]) {
                        for (j = 0; j < i; j++)
-                               brelse (sb->u.adfs_sb.s_map[j]);
-                       kfree (sb->u.adfs_sb.s_map);
-                       adfs_error (sb, NULL, "unable to read map");
-                       goto failed_mount;
+                               brelse(sb->u.adfs_sb.s_map[j]);
+                       kfree(sb->u.adfs_sb.s_map);
+                       adfs_error(sb, NULL, "unable to read map");
+                       goto error_free_bh;
                }
        }
-       if (!adfs_checkmap (sb)) {
+       if (!adfs_checkmap(sb)) {
                for (i = 0; i < sb->u.adfs_sb.s_map_size; i++)
-                       brelse (sb->u.adfs_sb.s_map[i]);
-               adfs_error (sb, NULL, "map corrupted");
-               goto failed_mount;
+                       brelse(sb->u.adfs_sb.s_map[i]);
+               adfs_error(sb, NULL, "map corrupted");
+               goto error_free_bh;
        }
 
        dr = (struct adfs_discrecord *)(sb->u.adfs_sb.s_map[0]->b_data + 4);
-       unlock_super (sb);
+       unlock_super(sb);
 
        /*
         * set up enough so that it can read an inode
         */
        sb->s_op = &adfs_sops;
-       sb->u.adfs_sb.s_root = adfs_inode_generate (dr->root, 0);
+       sb->u.adfs_sb.s_root = adfs_inode_generate(dr->root, 0);
        sb->s_root = d_alloc_root(iget(sb, sb->u.adfs_sb.s_root), NULL);
 
        if (!sb->s_root) {
-               sb->s_dev = 0;
                for (i = 0; i < sb->u.adfs_sb.s_map_size; i++)
-                       brelse (sb->u.adfs_sb.s_map[i]);
-               brelse (bh);
-               adfs_error (sb, NULL, "get root inode failed\n");
-               MOD_DEC_USE_COUNT;
-               return NULL;
+                       brelse(sb->u.adfs_sb.s_map[i]);
+               brelse(bh);
+               adfs_error(sb, NULL, "get root inode failed\n");
+               goto error_dec_use;
        }
        return sb;
+
+error_free_bh:
+       if (bh)
+               brelse(bh);
+error_unlock:
+       unlock_super(sb);
+error_dec_use:
+       MOD_DEC_USE_COUNT;
+error:
+       sb->s_dev = 0;
+       return NULL;
 }
 
-static int adfs_statfs (struct super_block *sb, struct statfs *buf, int bufsiz)
+static int adfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
 {
        struct statfs tmp;
        const unsigned int nidlen = sb->u.adfs_sb.s_idlen + 1;
 
        tmp.f_type = ADFS_SUPER_MAGIC;
        tmp.f_bsize = sb->s_blocksize;
-       tmp.f_blocks = (sb->u.adfs_sb.s_dr->disc_size) >> (sb->s_blocksize_bits);
+       tmp.f_blocks = sb->u.adfs_sb.s_dr->disc_size_high << (32 - sb->s_blocksize_bits) |
+                      sb->u.adfs_sb.s_dr->disc_size >> sb->s_blocksize_bits;
        tmp.f_files = tmp.f_blocks >> nidlen;
        {
                unsigned int i, j = 0;
@@ -305,35 +370,35 @@ static int adfs_statfs (struct super_block *sb, struct statfs *buf, int bufsiz)
                                if (freelink <= nidlen) break;
                        } while (mapindex < 8 * sb->s_blocksize);
                        if (mapindex > 8 * sb->s_blocksize)
-                               adfs_error (sb, NULL, "oversized free fragment\n");
+                               adfs_error(sb, NULL, "oversized free fragment\n");
                        else if (freelink)
-                               adfs_error (sb, NULL, "undersized free fragment\n");
+                               adfs_error(sb, NULL, "undersized free fragment\n");
                }
                tmp.f_bfree = tmp.f_bavail = j <<
                        (sb->u.adfs_sb.s_dr->log2bpmb - sb->s_blocksize_bits);
        }
        tmp.f_ffree = tmp.f_bfree >> nidlen;
        tmp.f_namelen = ADFS_NAME_LEN;
-       return copy_to_user (buf, &tmp, bufsiz) ? -EFAULT : 0;
+       return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
 }
 
 static struct file_system_type adfs_fs_type = {
        "adfs", FS_REQUIRES_DEV, adfs_read_super, NULL
 };
 
-__initfunc(int init_adfs_fs (void))
+__initfunc(int init_adfs_fs(void))
 {
-       return register_filesystem (&adfs_fs_type);
+       return register_filesystem(&adfs_fs_type);
 }
 
 #ifdef MODULE
-int init_module (void)
+int init_module(void)
 {
        return init_adfs_fs();
 }
 
-void cleanup_module (void)
+void cleanup_module(void)
 {
-       unregister_filesystem (&adfs_fs_type);
+       unregister_filesystem(&adfs_fs_type);
 }
 #endif
index dcd54ee3fcfb0b9b37c5bf1bf4f5fc8ecfaa10c4..4cac77aec7c7ac7a14235dab45439de796f0aedb 100644 (file)
@@ -127,7 +127,7 @@ nlm_delete_file(struct nlm_file *file)
                        kfree(file);
                        return;
                }
-               fp = &file->f_next;
+               fp = &f->f_next;
        }
 
        printk(KERN_WARNING "lockd: attempt to release unknown file!\n");
index cdcfc42209b20767831ea8a890694b04ed294416..865fc68a323ab1c5fc0deb1d1216c3a97a8e0d07 100644 (file)
@@ -94,7 +94,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size)
        poll_table wait_table;
        struct poll_table_entry entry;
        int init_timeout, max_timeout;
-       int timeout; long tmp_timeout;
+       int timeout;
        int retrans;
        int major_timeout_seen;
        int acknowledge_seen;
index 49998012677bc0a7b8ac0ba68c58b9baadcfd552..ab923b7f07468881a9c3e102251d6e638075f1de 100644 (file)
@@ -33,8 +33,6 @@
 #define MIN(a,b) (((a)<(b))?(a):(b))
 #define MAX(a,b) (((a)>(b))?(a):(b))
 
-#include <linux/fs.h>
-#include <linux/qnx4_fs.h>
 
 static int qnx4_readpage(struct file *file, struct page *page);
 
index c833a2a809d0ad190850d86f46926ce0f75f5f90..d31a9ea6bcc24e47a11b5f9423958b95fc7a1f5c 100644 (file)
@@ -22,9 +22,9 @@ BTFIXUPDEF_CALL(void, destroy_context, struct mm_struct *)
 
 #define destroy_context(mm) BTFIXUP_CALL(destroy_context)(mm)
 
-/* After we have set current->mm to a new value, this activates
- * the context for the new mm so we see the new mappings.
+/* This need not do anything on Sparc32.  The switch happens
+ * properly later as a side effect of calling flush_thread.
  */
-#define activate_context(tsk)  switch_to_context(tsk)
+#define activate_context(tsk)  do { } while(0)
 
 #endif /* !(__SPARC_MMU_CONTEXT_H) */
index b43a3413f6434e3261e5c1cca71b9beeabd4fd5c..a79d587914a3cda1d63343fc8803608bf044e14b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.69 1999/01/19 07:57:44 davem Exp $
+/* $Id: processor.h,v 1.70 1999/03/24 11:42:44 davem Exp $
  * include/asm-sparc/processor.h
  *
  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
@@ -148,7 +148,10 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
 extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
 
-#define copy_segments(nr, tsk, mm)     do { } while (0)
+#define copy_segments(__nr, __tsk, __mm)       \
+       if((__tsk) == current &&                \
+          (__mm) != NULL)                      \
+               flush_user_windows()
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
index 0d88464aee04668dbed165400c2447da437b25cf..b24f9a3244ba9ba83c508d059b7219fd075969cc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.28 1999/01/02 16:50:22 davem Exp $ */
+/* $Id: termios.h,v 1.29 1999/03/25 09:11:18 davem Exp $ */
 #ifndef _SPARC_TERMIOS_H
 #define _SPARC_TERMIOS_H
 
index 627811799055d4e4de2a48dde2beef6cb5f8815b..4cf6eb3fc4080934fe40d070dd40cf20be8721af 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.53 1999/02/21 02:34:54 anton Exp $ */
+/* $Id: unistd.h,v 1.54 1999/03/25 00:40:12 davem Exp $ */
 #ifndef _SPARC_UNISTD_H
 #define _SPARC_UNISTD_H
 
@@ -428,6 +428,8 @@ static __inline__ _syscall0(int,pause)
 static __inline__ _syscall0(int,sync)
 static __inline__ _syscall0(pid_t,setsid)
 static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
+static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
+static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
 static __inline__ _syscall1(int,dup,int,fd)
 static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
 static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
index 775673eff3374e9b1f0edb8d28f5d5e849529ec0..3f77c8dbf6cacf7d8373895b3bb6c29570007d68 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.7 1999/01/02 16:50:29 davem Exp $ */
+/* $Id: termios.h,v 1.8 1999/03/25 09:11:26 davem Exp $ */
 #ifndef _SPARC64_TERMIOS_H
 #define _SPARC64_TERMIOS_H
 
index b52c008463f34847e7302e777acfda5dcd580513..132a09861a377856b2037c24e7b05da8f7431877 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.26 1999/02/10 22:24:35 jj Exp $ */
+/* $Id: unistd.h,v 1.27 1999/03/25 00:40:14 davem Exp $ */
 #ifndef _SPARC64_UNISTD_H
 #define _SPARC64_UNISTD_H
 
@@ -417,6 +417,7 @@ static __inline__ _syscall0(int,sync)
 static __inline__ _syscall0(pid_t,setsid)
 static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
 static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
+static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
 static __inline__ _syscall1(int,dup,int,fd)
 static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
 static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
index 527c29fb6722c37ac02ee8beec3e3568d65e2b93..649b61e450de54882a40723b25296b75ca817edc 100644 (file)
 struct adfs_sb_info {
        struct buffer_head *s_sbh;      /* buffer head containing disc record    */
        struct adfs_discrecord *s_dr;   /* pointer to disc record in s_sbh       */
+       uid_t   s_uid;                  /* owner uid                             */
+       gid_t   s_gid;                  /* owner gid                             */
+       int     s_owner_mask;           /* ADFS Owner perm -> unix perm          */
+       int     s_other_mask;           /* ADFS Other perm -> unix perm          */
        __u16   s_zone_size;            /* size of a map zone in bits            */
        __u16   s_ids_per_zone;         /* max. no ids in one zone               */
        __u32   s_idlen;                /* length of ID in map                   */
index f3b3310e3a5bb9f0d690186d4a6568f23ae78a60..e345a9d227bbab9d84afd45065d34df1d20485f9 100644 (file)
@@ -52,6 +52,7 @@ extern void hippi_net_init(void);
 void hippi_setup(struct device *dev);
 
 extern struct device *init_hippi_dev(struct device *, int);
+extern void unregister_hipdev(struct device *dev);
 #endif
 
 #endif /* _LINUX_HIPPIDEVICE_H */
index 30d8b8f0a3147e96a7eaa932ca0b2b7c98d4f791..24e001e9781ae530d593e7af1f4d0b0b14baa78e 100644 (file)
 #define ARPHRD_ASH     781             /* Nexus 64Mbps Ash             */
 #define ARPHRD_ECONET  782             /* Acorn Econet                 */
 #define ARPHRD_IRDA    783             /* Linux/IR                     */
+/* ARP works differently on different FC media .. so  */
+#define ARPHRD_FCPP    784             /* Point to point fibrechanel   */
+#define ARPHRD_FCAL    785             /* Fibrechannel arbitrated loop */
+#define ARPHRD_FCPL    786             /* Fibrechannel public loop     */
+#define ARPHRD_FCFABRIC        786             /* Fibrechannel fabric          */
+       /* 787->799 reserved for fibrechannel media types */
+
 
 /* ARP protocol opcodes. */
 #define        ARPOP_REQUEST   1               /* ARP request                  */
index e33eaa41865582da422312bf668ce6794b5c06a5..dc16282e1724efd5338a9706fc4338897ba0fb2f 100644 (file)
@@ -107,6 +107,9 @@ void        nfsd_fh_flush(kdev_t);
 void   nfsd_fh_init(void);
 void   nfsd_fh_free(void);
 
+void   expire_all(void);
+void   expire_by_dentry(struct dentry *);
+
 static __inline__ struct svc_fh *
 fh_copy(struct svc_fh *dst, struct svc_fh *src)
 {
index a906fc92bb9959f68340c9d88bdf3aed13ddb916..4c37d11ed2adac83c8ff23729aeaf96cafdf39f8 100644 (file)
@@ -79,9 +79,8 @@ extern __inline__ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, str
 
 extern __inline__ unsigned long cls_set_class(unsigned long *clp, unsigned long cl)
 {
-       net_serialize_enter();
        cl = xchg(clp, cl);
-       net_serialize_leave();
+       synchronize_bh();
        return cl;
 }
 
index 834ca8acbdeef1b0c2c23ab8421ad03dbc2fc35e..31261fd69b18ec88ad7325f50c644a7635f8e96e 100644 (file)
@@ -923,14 +923,6 @@ extern __inline__ int gfp_any(void)
        return in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
 }
 
-#ifdef __SMP__
-#define net_serialize_enter()  start_bh_atomic()
-#define net_serialize_leave()  end_bh_atomic()
-#else
-#define net_serialize_enter()  barrier();
-#define net_serialize_leave()  barrier();
-#endif
-
 /* 
  *     Enable debug/info messages 
  */
index 340361c4cd36441dfbf025585b3f698830b5e309..8b17238884fe6eee0f1cb503f56a443e3f74e9c1 100644 (file)
@@ -57,33 +57,39 @@ kmem_cache_t *uid_cachep;
 
 #define uidhashfn(uid) (((uid >> 8) ^ uid) & (UIDHASH_SZ - 1))
 
+/*
+ * These routines must be called with the uidhash spinlock held!
+ */
 static inline void uid_hash_insert(struct user_struct *up, unsigned int hashent)
 {
-       spin_lock(&uidhash_lock);
        if((up->next = uidhash[hashent]) != NULL)
                uidhash[hashent]->pprev = &up->next;
        up->pprev = &uidhash[hashent];
        uidhash[hashent] = up;
-       spin_unlock(&uidhash_lock);
 }
 
 static inline void uid_hash_remove(struct user_struct *up)
 {
-       spin_lock(&uidhash_lock);
        if(up->next)
                up->next->pprev = up->pprev;
        *up->pprev = up->next;
-       spin_unlock(&uidhash_lock);
 }
 
-static inline struct user_struct *uid_find(unsigned short uid, unsigned int hashent)
+static inline struct user_struct *uid_hash_find(unsigned short uid, unsigned int hashent)
 {
-       struct user_struct *up;
-
-       spin_lock(&uidhash_lock);
-       for(up = uidhash[hashent]; (up && up->uid != uid); up = up->next)
-               ;
-       spin_unlock(&uidhash_lock);
+       struct user_struct *up, *next;
+
+       next = uidhash[hashent];
+       for (;;) {
+               up = next;
+               if (next) {
+                       next = up->next;
+                       if (up->uid != uid)
+                               continue;
+                       atomic_inc(&up->count);
+               }
+               break;
+       }
        return up;
 }
 
@@ -94,7 +100,9 @@ void free_uid(struct task_struct *p)
        if (up) {
                p->user = NULL;
                if (atomic_dec_and_test(&up->count)) {
+                       spin_lock(&uidhash_lock);
                        uid_hash_remove(up);
+                       spin_unlock(&uidhash_lock);
                        kmem_cache_free(uid_cachep, up);
                }
        }
@@ -103,20 +111,37 @@ void free_uid(struct task_struct *p)
 int alloc_uid(struct task_struct *p)
 {
        unsigned int hashent = uidhashfn(p->uid);
-       struct user_struct *up = uid_find(p->uid, hashent);
+       struct user_struct *up;
+
+       spin_lock(&uidhash_lock);
+       up = uid_hash_find(p->uid, hashent);
+       spin_unlock(&uidhash_lock);
 
-       p->user = up;
        if (!up) {
-               up = kmem_cache_alloc(uid_cachep, SLAB_KERNEL);
-               if (!up)
+               struct user_struct *new;
+
+               new = kmem_cache_alloc(uid_cachep, SLAB_KERNEL);
+               if (!new)
                        return -EAGAIN;
-               p->user = up;
-               up->uid = p->uid;
-               atomic_set(&up->count, 0);
-               uid_hash_insert(up, hashent);
-       }
+               new->uid = p->uid;
+               atomic_set(&new->count, 1);
 
-       atomic_inc(&up->count);
+               /*
+                * Before adding this, check whether we raced
+                * on adding the same user already..
+                */
+               spin_lock(&uidhash_lock);
+               up = uid_hash_find(p->uid, hashent);
+               if (up) {
+                       kmem_cache_free(uid_cachep, new);
+               } else {
+                       uid_hash_insert(new, hashent);
+                       up = new;
+               }
+               spin_unlock(&uidhash_lock);
+
+       }
+       p->user = up;
        return 0;
 }
 
index 65f12e633f827718fe1411a49f4b1e2d7e1bc5f5..ac7b86f22e896a5813720124fd6b95f8f7c857c5 100644 (file)
@@ -363,8 +363,27 @@ printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
        }
 
        sigaddset(&t->signal, sig);
-       if (!sigismember(&t->blocked, sig))
+       if (!sigismember(&t->blocked, sig)) {
                t->sigpending = 1;
+#ifdef __SMP__
+               /*
+                * If the task is running on a different CPU 
+                * force a reschedule on the other CPU - note that
+                * the code below is a tad loose and might occasionally
+                * kick the wrong CPU if we catch the process in the
+                * process of changing - but no harm is done by that
+                * other than doing an extra (lightweight) IPI interrupt.
+                *
+                * note that we rely on the previous spin_lock to
+                * lock interrupts for us! No need to set need_resched
+                * since signal event passing goes through ->blocked.
+                */
+               spin_lock(&runqueue_lock);
+               if (t->has_cpu && t->processor != smp_processor_id())
+                       smp_send_reschedule(t->processor);
+               spin_unlock(&runqueue_lock);
+#endif /* __SMP__ */
+       }
 
 out:
        spin_unlock_irqrestore(&t->sigmask_lock, flags);
index 73582584232da40a9ad9638b9c510a768aad53f1..4c8c6e390cbface848b7a318fb2e6f172ff4fe6f 100644 (file)
@@ -356,7 +356,7 @@ static int atif_probe_device(struct atalk_iface *atif)
        /*
         * Scan the networks.
         */
-
+       atif->status |= ATIF_PROBE;
        for(netct = 0; netct <= netrange; netct++)
        {
                /*
@@ -374,8 +374,10 @@ static int atif_probe_device(struct atalk_iface *atif)
                                 */
                                aarp_probe_network(atif);
 
-                               if(!(atif->status & ATIF_PROBE_FAIL))
+                               if(!(atif->status & ATIF_PROBE_FAIL)) {
+                                       atif->status &= ~ATIF_PROBE;
                                        return (0);
+                               }
                        }
                        atif->status &= ~ATIF_PROBE_FAIL;
                }
@@ -383,7 +385,7 @@ static int atif_probe_device(struct atalk_iface *atif)
                if(probe_net > ntohs(atif->nets.nr_lastnet))
                        probe_net = ntohs(atif->nets.nr_firstnet);
        }
-
+       atif->status &= ~ATIF_PROBE;
        return (-EADDRINUSE);   /* Network is full... */
 }
 
index 53e5352a10c1e7f41d662081184cfeac644d6c8d..921f05470faaddd70eeab118ee3a388280367f54 100644 (file)
@@ -232,9 +232,8 @@ void dev_remove_pack(struct packet_type *pt)
        {
                if(pt==(*pt1))
                {
-                       net_serialize_enter();
                        *pt1=pt->next;
-                       net_serialize_leave();
+                       synchronize_bh();
 #ifdef CONFIG_NET_FASTROUTE
                        if (pt->data)
                                netdev_fastroute_obstacles--;
@@ -1823,9 +1822,8 @@ int unregister_netdevice(struct device *dev)
        /* And unlink it from device chain. */
        for (dp = &dev_base; (d=*dp) != NULL; dp=&d->next) {
                if (d == dev) {
-                       net_serialize_enter();
                        *dp = d->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        d->next = NULL;
 
                        if (dev->destructor)
@@ -1986,9 +1984,8 @@ __initfunc(int net_dev_init(void))
                        /*
                         *      It failed to come up. Unhook it.
                         */
-                       net_serialize_enter();
                        *dp = dev->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                } 
                else
                {
index 112bbca9e3f4915eba75e9ffe29cbc0e8880dfdd..cc1ed83cd8325531eb080f7b9a442c614a29cd5e 100644 (file)
@@ -441,9 +441,8 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
 
        if ((err = sk_chk_filter(fp->insns, fp->len))==0) {
                struct sk_filter *old_fp = sk->filter;
-               net_serialize_enter();
                sk->filter = fp;
-               net_serialize_leave();
+               synchronize_bh();
                fp = old_fp;
        }
 
index 7b00cd9daf66644fa2ed5cc9338954e8d3f4dc03..22c6df5cfd991119faf8fa95ce67b3a127c8ef4e 100644 (file)
@@ -337,9 +337,8 @@ int pneigh_delete(struct neigh_table *tbl, const void *pkey, struct device *dev)
 
        for (np = &tbl->phash_buckets[hash_val]; (n=*np) != NULL; np = &n->next) {
                if (memcmp(n->key, pkey, key_len) == 0 && n->dev == dev) {
-                       net_serialize_enter();
                        *np = n->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        if (tbl->pdestructor)
                                tbl->pdestructor(n);
                        kfree(n);
@@ -358,9 +357,8 @@ static int pneigh_ifdown(struct neigh_table *tbl, struct device *dev)
                np = &tbl->phash_buckets[h]; 
                for (np = &tbl->phash_buckets[h]; (n=*np) != NULL; np = &n->next) {
                        if (n->dev == dev || dev == NULL) {
-                               net_serialize_enter();
                                *np = n->next;
-                               net_serialize_leave();
+                               synchronize_bh();
                                if (tbl->pdestructor)
                                        tbl->pdestructor(n);
                                kfree(n);
@@ -963,9 +961,8 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
                return;
        for (p = &tbl->parms.next; *p; p = &(*p)->next) {
                if (*p == parms) {
-                       net_serialize_enter();
                        *p = parms->next;
-                       net_serialize_leave();
+                       synchronize_bh();
 #ifdef CONFIG_SYSCTL
                        neigh_sysctl_unregister(parms);
 #endif
@@ -1014,9 +1011,8 @@ int neigh_table_clear(struct neigh_table *tbl)
                printk(KERN_CRIT "neighbour leakage\n");
        for (tp = &neigh_tables; *tp; tp = &(*tp)->next) {
                if (*tp == tbl) {
-                       net_serialize_enter();
                        *tp = tbl->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        break;
                }
        }
index 2cfcbad8ab9498b04cabcdcd3d49142380d31e35..2266a9641db406165f8b808deb48ec1055f5136f 100644 (file)
@@ -7,7 +7,7 @@
  *             handler for protocols to use and generic option handler.
  *
  *
- * Version:    $Id: sock.c,v 1.77 1999/03/21 05:22:26 davem Exp $
+ * Version:    $Id: sock.c,v 1.78 1999/03/25 10:03:55 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -346,9 +346,8 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 
                                filter = sk->filter;
 
-                               net_serialize_enter();
                                sk->filter = NULL;
-                               net_serialize_leave();
+                               synchronize_bh();
                                
                                if (filter)
                                        sk_filter_release(sk, filter);
index 434dd612d3bf65160cb44ce8001952699e6bdfcf..0623191f25f25850d9702fd53e27f46168e634ce 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             PF_INET protocol family socket handler.
  *
- * Version:    $Id: af_inet.c,v 1.85 1999/03/21 05:22:28 davem Exp $
+ * Version:    $Id: af_inet.c,v 1.86 1999/03/25 00:38:15 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -661,6 +661,7 @@ sock_error:
                lock_sock(sk);  
                tcp_set_state(sk, TCP_CLOSE);
                release_sock(sk); 
+               sk->zapped = 0;
        }
        sock->state = SS_UNCONNECTED;
        return sock_error(sk);
index c02171f4fb6ee1d88adc5a9f1d05313cec574a95..3d0e31e1d49bb975803f5bb05c2196b5843ad5cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     NET3    IP device support routines.
  *
- *     Version: $Id: devinet.c,v 1.26 1999/03/21 05:22:31 davem Exp $
+ *     Version: $Id: devinet.c,v 1.27 1999/03/25 10:04:06 davem Exp $
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
@@ -138,9 +138,8 @@ static void inetdev_destroy(struct in_device *in_dev)
 #ifdef CONFIG_SYSCTL
        devinet_sysctl_unregister(&in_dev->cnf);
 #endif
-       net_serialize_enter();
        in_dev->dev->ip_ptr = NULL;
-       net_serialize_leave();
+       synchronize_bh();
        neigh_parms_release(&arp_tbl, in_dev->arp_parms);
        kfree(in_dev);
 }
@@ -174,9 +173,8 @@ inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, int destroy)
                                ifap1 = &ifa->ifa_next;
                                continue;
                        }
-                       net_serialize_enter();
                        *ifap1 = ifa->ifa_next;
-                       net_serialize_leave();
+                       synchronize_bh();
 
                        rtmsg_ifa(RTM_DELADDR, ifa);
                        notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa);
@@ -186,9 +184,8 @@ inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, int destroy)
 
        /* 2. Unlink it */
 
-       net_serialize_enter();
        *ifap = ifa1->ifa_next;
-       net_serialize_leave();
+       synchronize_bh();
 
        /* 3. Announce address deletion */
 
@@ -244,9 +241,8 @@ inet_insert_ifa(struct in_device *in_dev, struct in_ifaddr *ifa)
        }
 
        ifa->ifa_next = *ifap;
-       net_serialize_enter();
+       wmb();
        *ifap = ifa;
-       net_serialize_leave();
 
        /* Send message first, then call notifier.
           Notifier will trigger FIB update, so that
index ba8dc6d4806613d96e2e46331b0aeb191b2b7128..d9e029cef55cee88b0939386018c7cee892ac956 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             IPv4 FIB: lookup engine and maintenance routines.
  *
- * Version:    $Id: fib_hash.c,v 1.7 1999/03/21 05:22:32 davem Exp $
+ * Version:    $Id: fib_hash.c,v 1.8 1999/03/25 10:04:17 davem Exp $
  *
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
@@ -566,9 +566,8 @@ replace:
        if (del_fp) {
                f = *del_fp;
                /* Unlink replaced node */
-               net_serialize_enter();
                *del_fp = f->fn_next;
-               net_serialize_leave();
+               synchronize_bh();
 
                if (!(f->fn_state&FN_S_ZOMBIE))
                        rtmsg_fib(RTM_DELROUTE, f, z, tb->tb_id, n, req);
@@ -656,9 +655,8 @@ FTprint("tb(%d)_delete: %d %08x/%d %d\n", tb->tb_id, r->rtm_type, rta->rta_dst ?
                rtmsg_fib(RTM_DELROUTE, f, z, tb->tb_id, n, req);
 
                if (matched != 1) {
-                       net_serialize_enter();
                        *del_fp = f->fn_next;
-                       net_serialize_leave();
+                       synchronize_bh();
 
                        if (f->fn_state&FN_S_ACCESSED)
                                rt_cache_flush(-1);
@@ -689,9 +687,8 @@ fn_flush_list(struct fib_node ** fp, int z, struct fn_hash *table)
                struct fib_info *fi = FIB_INFO(f);
 
                if (fi && ((f->fn_state&FN_S_ZOMBIE) || (fi->fib_flags&RTNH_F_DEAD))) {
-                       net_serialize_enter();
                        *fp = f->fn_next;
-                       net_serialize_leave();
+                       synchronize_bh();
 
                        fn_free_node(f);
                        found++;
index 815c6d3dd44c5dcbaeeb77796f10264a8563d801..868c44c31cec49957874baee8a4ebadfa13d1bc9 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             IPv4 Forwarding Information Base: policy rules.
  *
- * Version:    $Id: fib_rules.c,v 1.8 1999/03/21 05:22:33 davem Exp $
+ * Version:    $Id: fib_rules.c,v 1.9 1999/03/25 10:04:23 davem Exp $
  *
  * Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
@@ -101,9 +101,10 @@ int inet_rtm_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
                    (!rtm->rtm_table || (r && rtm->rtm_table == r->r_table))) {
                        if (r == &local_rule)
                                return -EPERM;
-                       net_serialize_enter();
+
                        *rp = r->r_next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        if (r != &default_rule && r != &main_rule)
                                kfree(r);
                        return 0;
index 3ae0936ff3b48af01e64431df414a01b009443a7..68e52633eb25f4fa82d0054afd7d0c7c4f6d196b 100644 (file)
@@ -8,7 +8,7 @@
  *     the older version didn't come out right using gcc 2.5.8, the newer one
  *     seems to fall out with gcc 2.6.2.
  *
- *     Version: $Id: igmp.c,v 1.29 1999/03/21 05:22:36 davem Exp $
+ *     Version: $Id: igmp.c,v 1.30 1999/03/25 10:04:10 davem Exp $
  *
  *     Authors:
  *             Alan Cox <Alan.Cox@linux.org>
@@ -463,9 +463,9 @@ int ip_mc_dec_group(struct in_device *in_dev, u32 addr)
        for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) {
                if (i->multiaddr==addr) {
                        if (--i->users == 0) {
-                               net_serialize_enter();
                                *ip = i->next;
-                               net_serialize_leave();
+                               synchronize_bh();
+
                                igmp_group_dropped(i);
                                if (in_dev->dev->flags & IFF_UP)
                                        ip_rt_multicast_event(in_dev);
@@ -613,9 +613,10 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
                        struct in_device *in_dev;
                        if (--iml->count)
                                return 0;
-                       net_serialize_enter();
+
                        *imlp = iml->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        in_dev = inetdev_by_index(iml->multi.imr_ifindex);
                        if (in_dev)
                                ip_mc_dec_group(in_dev, imr->imr_multiaddr.s_addr);
index 7c7dc2a994239f45c409ca521b48ef2d1afd4843..6a7546fd50d81d483fe0571a0a16d2f710610ded 100644 (file)
@@ -211,10 +211,9 @@ static void ipgre_tunnel_link(struct ip_tunnel *t)
 {
        struct ip_tunnel **tp = ipgre_bucket(t);
 
-       net_serialize_enter();
        t->next = *tp;
+       wmb();
        *tp = t;
-       net_serialize_leave();
 }
 
 static void ipgre_tunnel_unlink(struct ip_tunnel *t)
@@ -223,9 +222,8 @@ static void ipgre_tunnel_unlink(struct ip_tunnel *t)
 
        for (tp = ipgre_bucket(t); *tp; tp = &(*tp)->next) {
                if (t == *tp) {
-                       net_serialize_enter();
                        *tp = t->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        break;
                }
        }
index a519c454ce556a9be6535efb8e8e2ff3a5a3ef5f..44d635573378abd7f85cf2b81c0b3734f2b43d0e 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             The Internet Protocol (IP) output module.
  *
- * Version:    $Id: ip_output.c,v 1.66 1999/03/21 05:22:41 davem Exp $
+ * Version:    $Id: ip_output.c,v 1.67 1999/03/25 00:43:00 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -350,7 +350,7 @@ fragment:
                   into account). Actually, tcp should make it. --ANK (980801)
                 */
                iph->frag_off |= __constant_htons(IP_DF);
-               printk(KERN_DEBUG "sending pkt_too_big to self\n");
+               NETDEBUG(printk(KERN_DEBUG "sending pkt_too_big to self\n"));
 
                /* icmp_send is not reenterable, so that bh_atomic... --ANK */
                start_bh_atomic();
index 017e6e62074310ed2f091d218333e279d88ec9eb..e84992a38b5d74a07a18d436f37e6238755094be 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             The IP to API glue.
  *             
- * Version:    $Id: ip_sockglue.c,v 1.40 1999/03/21 05:22:42 davem Exp $
+ * Version:    $Id: ip_sockglue.c,v 1.41 1999/03/25 10:04:29 davem Exp $
  *
  * Authors:    see ip.c
  *
@@ -209,9 +209,9 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s
                                        kfree(new_ra);
                                return -EADDRINUSE;
                        }
-                       net_serialize_enter();
                        *rap = ra->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        if (ra->destructor)
                                ra->destructor(sk);
                        kfree(ra);
@@ -222,10 +222,11 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s
                return -ENOBUFS;
        new_ra->sk = sk;
        new_ra->destructor = destructor;
+
        new_ra->next = ra;
-       net_serialize_enter();
+       wmb();
        *rap = new_ra;
-       net_serialize_leave();
+
        return 0;
 }
 
index 0bb5f256e00320965c62557d4bab12a350979dd6..0aeef4a31bb5ef49bf7974f7a49c1a7bc5d4f4b7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Linux NET3:     IP/IP protocol decoder. 
  *
- *     Version: $Id: ipip.c,v 1.25 1999/03/21 05:22:43 davem Exp $
+ *     Version: $Id: ipip.c,v 1.26 1999/03/25 10:04:32 davem Exp $
  *
  *     Authors:
  *             Sam Lantinga (slouken@cs.ucdavis.edu)  02/01/95
@@ -182,9 +182,8 @@ static void ipip_tunnel_unlink(struct ip_tunnel *t)
 
        for (tp = ipip_bucket(t); *tp; tp = &(*tp)->next) {
                if (t == *tp) {
-                       net_serialize_enter();
                        *tp = t->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        break;
                }
        }
@@ -194,10 +193,9 @@ static void ipip_tunnel_link(struct ip_tunnel *t)
 {
        struct ip_tunnel **tp = ipip_bucket(t);
 
-       net_serialize_enter();
        t->next = *tp;
+       wmb();
        *tp = t;
-       net_serialize_leave();
 }
 
 struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int create)
@@ -265,9 +263,8 @@ failed:
 static void ipip_tunnel_destroy(struct device *dev)
 {
        if (dev == &ipip_fb_tunnel_dev) {
-               net_serialize_enter();
                tunnels_wc[0] = NULL;
-               net_serialize_leave();
+               synchronize_bh();
        } else {
                ipip_tunnel_unlink((struct ip_tunnel*)dev->priv);
                kfree(dev);
index a164025b23115910624e5a42d58bf033d89e29cd..d7db0c007343b6979c08ce91385cd16d0ef61aa8 100644 (file)
@@ -9,7 +9,7 @@
  *     as published by the Free Software Foundation; either version
  *     2 of the License, or (at your option) any later version.
  *
- *     Version: $Id: ipmr.c,v 1.39 1999/03/21 05:22:44 davem Exp $
+ *     Version: $Id: ipmr.c,v 1.40 1999/03/25 10:04:25 davem Exp $
  *
  *     Fixes:
  *     Michael Chastain        :       Incorrect size of copying.
@@ -661,9 +661,10 @@ static void mrtsock_destruct(struct sock *sk)
 {
        if (sk == mroute_socket) {
                ipv4_devconf.mc_forwarding = 0;
-               net_serialize_enter();
+
                mroute_socket=NULL;
-               net_serialize_leave();
+               synchronize_bh();
+
                mroute_close(sk);
        }
 }
index 8c591325211ad684581d27873db215ae6b849d47..5108e0629c28a1016532ab2d2534130696c27c56 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             ROUTE - implementation of the IP router.
  *
- * Version:    $Id: route.c,v 1.64 1999/03/23 21:21:13 davem Exp $
+ * Version:    $Id: route.c,v 1.65 1999/03/25 10:04:35 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -338,11 +338,11 @@ static void rt_run_flush(unsigned long dummy)
 
        rt_deadline = 0;
 
-       net_serialize_enter();
+       start_bh_atomic();
        for (i=0; i<RT_HASH_DIVISOR; i++) {
                if ((rth = xchg(&rt_hash_table[i], NULL)) == NULL)
                        continue;
-               net_serialize_leave();
+               end_bh_atomic();
 
                for (; rth; rth=next) {
                        next = rth->u.rt_next;
@@ -350,9 +350,9 @@ static void rt_run_flush(unsigned long dummy)
                        rt_free(rth);
                }
 
-               net_serialize_enter();
+               start_bh_atomic();
        }
-       net_serialize_leave();
+       end_bh_atomic();
 }
   
 void rt_cache_flush(int delay)
index e3257e06c257eaada3f12fcb3b047520ec42a08c..f349750766d2f427090720c6890406c16fed95c0 100644 (file)
@@ -5,7 +5,7 @@
  *     Authors:
  *     Pedro Roque             <roque@di.fc.ul.pt>     
  *
- *     $Id: addrconf.c,v 1.47 1999/03/21 05:22:50 davem Exp $
+ *     $Id: addrconf.c,v 1.48 1999/03/25 10:04:43 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -340,9 +340,9 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 
        for (; iter; iter = iter->lst_next) {
                if (iter == ifp) {
-                       net_serialize_enter();
                        *back = ifp->lst_next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        ifp->lst_next = NULL;
                        break;
                }
@@ -354,9 +354,9 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 
        for (; iter; iter = iter->if_next) {
                if (iter == ifp) {
-                       net_serialize_enter();
                        *back = ifp->if_next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        ifp->if_next = NULL;
                        break;
                }
index b92a138b7f93eff2f8af70485737ba8420ce1a0b..f4baf3513c0165cf7f85fc28803c798046730665 100644 (file)
@@ -7,7 +7,7 @@
  *
  *     Based on linux/net/ipv4/ip_sockglue.c
  *
- *     $Id: ipv6_sockglue.c,v 1.25 1999/03/21 05:22:54 davem Exp $
+ *     $Id: ipv6_sockglue.c,v 1.26 1999/03/25 10:04:53 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -86,9 +86,10 @@ int ip6_ra_control(struct sock *sk, int sel, void (*destructor)(struct sock *))
                                        kfree(new_ra);
                                return -EADDRINUSE;
                        }
-                       net_serialize_enter();
+
                        *rap = ra->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        if (ra->destructor)
                                ra->destructor(sk);
                        kfree(ra);
index 9b9ddbb90e52f2a84b57feef3ab3692aca3d4edb..939d268da3e5c0508da938811ecf0d344893a949 100644 (file)
@@ -5,7 +5,7 @@
  *     Authors:
  *     Pedro Roque             <roque@di.fc.ul.pt>     
  *
- *     $Id: mcast.c,v 1.18 1999/03/21 05:22:55 davem Exp $
+ *     $Id: mcast.c,v 1.19 1999/03/25 10:04:50 davem Exp $
  *
  *     Based on linux/ipv4/igmp.c and linux/ipv4/ip_sockglue.c 
  *
@@ -132,9 +132,10 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
                if (mc_lst->ifindex == ifindex &&
                    ipv6_addr_cmp(&mc_lst->addr, addr) == 0) {
                        struct device *dev;
-                       net_serialize_enter();
+
                        *lnk = mc_lst->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        if ((dev = dev_get_by_index(ifindex)) != NULL)
                                ipv6_dev_mc_dec(dev, &mc_lst->addr);
                        sock_kfree_s(sk, mc_lst, sizeof(*mc_lst));
@@ -254,9 +255,8 @@ static void ipv6_mca_remove(struct device *dev, struct ifmcaddr6 *ma)
                
                for (lnk = &idev->mc_list; (iter = *lnk) != NULL; lnk = &iter->if_next) {
                        if (iter == ma) {
-                               net_serialize_enter();
                                *lnk = iter->if_next;
-                               net_serialize_leave();
+                               synchronize_bh();
                                return;
                        }
                }
@@ -277,9 +277,10 @@ int ipv6_dev_mc_dec(struct device *dev, struct in6_addr *addr)
                if (ipv6_addr_cmp(&ma->mca_addr, addr) == 0 && ma->dev == dev) {
                        if (atomic_dec_and_test(&ma->mca_users)) {
                                igmp6_group_dropped(ma);
-                               net_serialize_enter();
+
                                *lnk = ma->next;
-                               net_serialize_leave();
+                               synchronize_bh();
+
                                ipv6_mca_remove(dev, ma);
                                kfree(ma);
                        }
@@ -595,9 +596,8 @@ void ipv6_mc_destroy_dev(struct inet6_dev *idev)
 
                for (lnk = &inet6_mcast_lst[hash]; *lnk; lnk = &(*lnk)->next) {
                        if (*lnk == i) {
-                               net_serialize_enter();
                                *lnk = i->next;
-                               net_serialize_leave();
+                               synchronize_bh();
                                break;
                        }
                }
index 058fd0487fd34d54682dea8a88fcaddc90536fa7..a1d888c98e2a32830903a69ec23e60e0d2a96e9b 100644 (file)
@@ -6,7 +6,7 @@
  *     Pedro Roque             <roque@di.fc.ul.pt>     
  *     Alexey Kuznetsov        <kuznet@ms2.inr.ac.ru>
  *
- *     $Id: sit.c,v 1.30 1999/03/21 05:22:58 davem Exp $
+ *     $Id: sit.c,v 1.31 1999/03/25 10:04:55 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -118,9 +118,8 @@ static void ipip6_tunnel_unlink(struct ip_tunnel *t)
 
        for (tp = ipip6_bucket(t); *tp; tp = &(*tp)->next) {
                if (t == *tp) {
-                       net_serialize_enter();
                        *tp = t->next;
-                       net_serialize_leave();
+                       synchronize_bh();
                        break;
                }
        }
@@ -130,10 +129,9 @@ static void ipip6_tunnel_link(struct ip_tunnel *t)
 {
        struct ip_tunnel **tp = ipip6_bucket(t);
 
-       net_serialize_enter();
        t->next = *tp;
+       wmb();
        *tp = t;
-       net_serialize_leave();
 }
 
 struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create)
@@ -200,9 +198,8 @@ failed:
 static void ipip6_tunnel_destroy(struct device *dev)
 {
        if (dev == &ipip6_fb_tunnel_dev) {
-               net_serialize_enter();
                tunnels_wc[0] = NULL;
-               net_serialize_leave();
+               synchronize_bh();
                return;
        } else {
                ipip6_tunnel_unlink((struct ip_tunnel*)dev->priv);
index 45ec9d6b50317af247c69d5cd2bc68c7cef6375e..abb0499adb73c4396d22844aff4aea1433f737e2 100644 (file)
@@ -747,9 +747,9 @@ void netlink_detach(int unit)
 {
        struct socket *sock = netlink_kernel[unit];
 
-       net_serialize_enter();
        netlink_kernel[unit] = NULL;
-       net_serialize_leave();
+       synchronize_bh();
+
        sock_release(sock);
 }
 
index 0d29ccf50c08ebbeb26df56600a5f49c3f5b9e22..6830631370113686272eb94ff08e480981e15787 100644 (file)
@@ -226,9 +226,9 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 
        if (fh == 0) {
                if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) {
-                       net_serialize_enter();
                        *back = tp->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        tp->ops->destroy(tp);
                        kfree(tp);
                        err = 0;
index bc4d4db2b7866e017eef8edb7d98f04997904225..268ea9e8ccaa7fafcfee09f46385fdb7de3dd958 100644 (file)
@@ -157,9 +157,8 @@ static int fw_delete(struct tcf_proto *tp, unsigned long arg)
                if (*fp == f) {
                        unsigned long cl;
 
-                       net_serialize_enter();
                        *fp = f->next;
-                       net_serialize_leave();
+                       synchronize_bh();
 
                        if ((cl = cls_set_class(&f->res.class, 0)) != 0)
                                tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
@@ -207,9 +206,10 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 #ifdef CONFIG_NET_CLS_POLICE
                if (tb[TCA_FW_POLICE-1]) {
                        struct tcf_police *police = tcf_police_locate(tb[TCA_FW_POLICE-1], tca[TCA_RATE-1]);
-                       net_serialize_enter();
+
                        police = xchg(&f->police, police);
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        tcf_police_release(police);
                }
 #endif
@@ -224,9 +224,9 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
                if (head == NULL)
                        return -ENOBUFS;
                memset(head, 0, sizeof(*head));
-               net_serialize_enter();
+
                tp->root = head;
-               net_serialize_leave();
+               synchronize_bh();
        }
 
        f = kmalloc(sizeof(struct fw_filter), GFP_KERNEL);
@@ -250,9 +250,9 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 #endif
 
        f->next = head->ht[fw_hash(handle)];
-       net_serialize_enter();
+       wmb();
        head->ht[fw_hash(handle)] = f;
-       net_serialize_leave();
+
        *arg = (unsigned long)f;
        return 0;
 
@@ -303,7 +303,11 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
 
        t->tcm_handle = f->id;
 
-       if (!f->res.classid && !f->police)
+       if (!f->res.classid
+#ifdef CONFIG_NET_CLS_POLICE
+           && !f->police
+#endif
+           )
                return skb->len;
 
        rta = (struct rtattr*)b;
index ac17deff02969d13f7106db3021d2efc9c13e450..f83e79134fd6d366ca073f3412fd41f52c2789ce 100644 (file)
@@ -329,9 +329,9 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
                if (*fp == f) {
                        unsigned long cl;
 
-                       net_serialize_enter();
                        *fp = f->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        route4_reset_fastmap(head, f->id);
 
                        if ((cl = cls_set_class(&f->res.class, 0)) != 0)
@@ -349,9 +349,9 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
                                        return 0;
 
                        /* OK, session has no flows */
-                       net_serialize_enter();
                        head->table[to_hash(h)] = NULL;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        kfree(b);
                        return 0;
                }
@@ -394,9 +394,10 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
 #ifdef CONFIG_NET_CLS_POLICE
                if (tb[TCA_ROUTE4_POLICE-1]) {
                        struct tcf_police *police = tcf_police_locate(tb[TCA_ROUTE4_POLICE-1], tca[TCA_RATE-1]);
-                       net_serialize_enter();
+
                        police = xchg(&f->police, police);
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        tcf_police_release(police);
                }
 #endif
@@ -410,9 +411,9 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
                if (head == NULL)
                        return -ENOBUFS;
                memset(head, 0, sizeof(struct route4_head));
-               net_serialize_enter();
+
                tp->root = head;
-               net_serialize_leave();
+               synchronize_bh();
        }
 
        f = kmalloc(sizeof(struct route4_filter), GFP_KERNEL);
@@ -473,9 +474,9 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
                if (b == NULL)
                        goto errout;
                memset(b, 0, sizeof(*b));
-               net_serialize_enter();
+
                head->table[h1] = b;
-               net_serialize_leave();
+               synchronize_bh();
        }
        f->bkt = b;
 
@@ -495,9 +496,9 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
 #endif
 
        f->next = f1;
-       net_serialize_enter();
+       wmb();
        *ins_f = f;
-       net_serialize_leave();
+
        route4_reset_fastmap(head, f->id);
        *arg = (unsigned long)f;
        return 0;
index e587fad291d4cd5887e3784fd520704c1608fd5d..b53fbf0d6f8c22e53d61c28c831ab8ec2464b7ab 100644 (file)
@@ -149,7 +149,7 @@ static int rsvp_classify(struct sk_buff *skb, struct tcf_proto *tp,
        struct iphdr *nhptr = skb->nh.iph;
 #endif
 
-#if !defined( __i386__) && !defined(__m68k__)
+#if !defined( __i386__) && !defined(__mc68000__)
        if ((unsigned long)nhptr & 3)
                return -1;
 #endif
@@ -309,9 +309,9 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
                if (*fp == f) {
                        unsigned long cl;
 
-                       net_serialize_enter();
+
                        *fp = f->next;
-                       net_serialize_leave();
+                       synchronize_bh();
 
                        if ((cl = cls_set_class(&f->res.class, 0)) != 0)
                                tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
@@ -332,9 +332,9 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
                        for (sp = &((struct rsvp_head*)tp->root)->ht[h&0xFF];
                             *sp; sp = &(*sp)->next) {
                                if (*sp == s) {
-                                       net_serialize_enter();
                                        *sp = s->next;
-                                       net_serialize_leave();
+                                       synchronize_bh();
+
                                        kfree(s);
                                        return 0;
                                }
@@ -453,9 +453,10 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base,
 #ifdef CONFIG_NET_CLS_POLICE
                if (tb[TCA_RSVP_POLICE-1]) {
                        struct tcf_police *police = tcf_police_locate(tb[TCA_RSVP_POLICE-1], tca[TCA_RATE-1]);
-                       net_serialize_enter();
+
                        police = xchg(&f->police, police);
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        tcf_police_release(police);
                }
 #endif
@@ -545,9 +546,9 @@ insert:
                                if (((*fp)->spi.mask&f->spi.mask) != f->spi.mask)
                                        break;
                        f->next = *fp;
-                       net_serialize_enter();
+                       wmb();
                        *fp = f;
-                       net_serialize_leave();
+
                        *arg = (unsigned long)f;
                        return 0;
                }
@@ -569,9 +570,8 @@ insert:
                        break;
        }
        s->next = *sp;
-       net_serialize_enter();
+       wmb();
        *sp = s;
-       net_serialize_leave();
        
        goto insert;
 
index 5ca4708b3edcc5447805d2e65bbe97e521c92f6c..98d4e1f7b42f3f2c537e4c53e4dbe22de6740f50 100644 (file)
@@ -114,7 +114,7 @@ static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_re
        int sel = 0;
        int i;
 
-#if !defined(__i386__) && !defined(__m68k__)
+#if !defined(__i386__) && !defined(__mc68000__)
        if ((unsigned long)ptr & 3)
                return -1;
 #endif
@@ -326,9 +326,8 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode* key)
        if (ht) {
                for (kp = &ht->ht[TC_U32_HASH(key->handle)]; *kp; kp = &(*kp)->next) {
                        if (*kp == key) {
-                               net_serialize_enter();
                                *kp = key->next;
-                               net_serialize_leave();
+                               synchronize_bh();
 
                                u32_destroy_key(tp, key);
                                return 0;
@@ -346,9 +345,9 @@ static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht)
 
        for (h=0; h<=ht->divisor; h++) {
                while ((n = ht->ht[h]) != NULL) {
-                       net_serialize_enter();
                        ht->ht[h] = n->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        u32_destroy_key(tp, n);
                }
        }
@@ -466,9 +465,8 @@ static int u32_set_parms(struct Qdisc *q, unsigned long base,
                        ht_down->refcnt++;
                }
 
-               net_serialize_enter();
                ht_down = xchg(&n->ht_down, ht_down);
-               net_serialize_leave();
+               synchronize_bh();
 
                if (ht_down)
                        ht_down->refcnt--;
@@ -484,9 +482,10 @@ static int u32_set_parms(struct Qdisc *q, unsigned long base,
 #ifdef CONFIG_NET_CLS_POLICE
        if (tb[TCA_U32_POLICE-1]) {
                struct tcf_police *police = tcf_police_locate(tb[TCA_U32_POLICE-1], est);
-               net_serialize_enter();
+
                police = xchg(&n->police, police);
-               net_serialize_leave();
+               synchronize_bh();
+
                tcf_police_release(police);
        }
 #endif
@@ -588,10 +587,11 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
                for (ins = &ht->ht[TC_U32_HASH(handle)]; *ins; ins = &(*ins)->next)
                        if (TC_U32_NODE(handle) < TC_U32_NODE((*ins)->handle))
                                break;
-               net_serialize_enter();
+
                n->next = *ins;
+               wmb();
                *ins = n;
-               net_serialize_leave();
+
                *arg = (unsigned long)n;
                return 0;
        }
index a35a9168e3d9aecada71e337a0b8e5f81131cd13..d51017c844446249eca6968bd2b30dce60679ce9 100644 (file)
@@ -171,9 +171,10 @@ void qdisc_kill_estimator(struct tc_stats *stats)
                                pest = &est->next;
                                continue;
                        }
-                       net_serialize_enter();
+
                        *pest = est->next;
-                       net_serialize_leave();
+                       synchronize_bh();
+
                        kfree(est);
                        killed++;
                }
index ca2d02d16000bb6f50ab62cc468305d05a4783c7..5222d149dcbf940a2c487737d911bca1384ddebb 100644 (file)
@@ -195,9 +195,9 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
                        struct Qdisc *child;
                        child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
                        if (child) {
-                               net_serialize_enter();
                                child = xchg(&q->queues[band], child);
-                               net_serialize_leave();
+                               synchronize_bh();
+
                                if (child != &noop_qdisc)
                                        qdisc_destroy(child);
                        }
index 91e438b2b046148c61e920c772b4091299081880..c7f594fbba67ab35e333a2a5cc701828b25cf62e 100644 (file)
@@ -8,7 +8,7 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Version:    $Id: af_unix.c,v 1.74 1999/03/21 05:23:16 davem Exp $
+ * Version:    $Id: af_unix.c,v 1.75 1999/03/22 05:02:45 davem Exp $
  *
  * Fixes:
  *             Linus Torvalds  :       Assorted bug cures.