home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 October / PCO_1098.ISO / filesbbs / linux / patch-2_1_119.tgz / patch-2.1.119
Encoding:
Text File  |  1998-08-27  |  53.2 KB  |  1,873 lines

  1. diff -u --recursive --new-file v2.1.118/linux/CREDITS linux/CREDITS
  2. --- v2.1.118/linux/CREDITS    Wed Aug 26 11:37:32 1998
  3. +++ linux/CREDITS    Thu Aug 27 12:00:25 1998
  4. @@ -68,6 +68,7 @@
  5.  D: Implemented a workaround for some interrupt buggy printers
  6.  D: Author of pscan that helps to fix lp/parport bug
  7.  D: Author of lil (Linux Interrupt Latency benchmark)
  8. +D: Fixed the shm swap deallocation at swapoff time (try_to_unuse message)
  9.  D: Various other kernel hacks
  10.  S: Via Ciaclini 26
  11.  S: Imola 40026
  12. @@ -288,8 +289,8 @@
  13.  E: chaffee@cs.berkeley.edu
  14.  W: http://bmrc.berkeley.edu/people/chaffee/
  15.  D: vfat, fat32, joliet, native language support
  16. -S: 3674 Oakwood Terrace #201
  17. -S: Fremont, California 94536
  18. +S: 3700 Warwick Road
  19. +S: Fremont, California 94555
  20.  S: USA
  21.  
  22.  N: Chih-Jen Chang
  23. @@ -708,8 +709,8 @@
  24.  E: rth@cygnus.com
  25.  E: richard@gnu.org
  26.  D: Alpha/ELF, gcc, binutils, and glibc
  27. -S: 50 E. Middlefield #10
  28. -S: Mountain View, California 94043-3822
  29. +S: 5450 Mayme #25
  30. +S: San Jose, California 95129
  31.  S: USA
  32.  
  33.  N: Sebastian Hetze
  34. diff -u --recursive --new-file v2.1.118/linux/Documentation/Changes linux/Documentation/Changes
  35. --- v2.1.118/linux/Documentation/Changes    Wed Jun 24 22:54:01 1998
  36. +++ linux/Documentation/Changes    Thu Aug 27 12:01:47 1998
  37. @@ -190,12 +190,6 @@
  38.  of /proc/net/dev changed; as a result, an older ifconfig will
  39.  incorrectly report errors.
  40.  
  41. -   As of 2.1.102, the firewalling code has been replaced with
  42. -firewalling chains.  See
  43. -http://www.adelaide.net.au/~rustcorp/ipfwchains/ipfwchains.html for
  44. -more information.  Among other things, you'll now need to use ipchains
  45. -instead of ipfwadm to configure your filters.
  46. -
  47.     The IP firewalling code has been replaced: ipfwadm will no longer
  48.  work.  You need to obtain `ipchains', available from
  49.  http://www.adelaide.net.au/~rustcorp/ipfwchains/ipfwchains.html
  50. diff -u --recursive --new-file v2.1.118/linux/Makefile linux/Makefile
  51. --- v2.1.118/linux/Makefile    Wed Aug 26 11:37:33 1998
  52. +++ linux/Makefile    Thu Aug 27 11:45:04 1998
  53. @@ -1,6 +1,6 @@
  54.  VERSION = 2
  55.  PATCHLEVEL = 1
  56. -SUBLEVEL = 118
  57. +SUBLEVEL = 119
  58.  
  59.  ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
  60.  
  61. @@ -73,6 +73,12 @@
  62.  #INSTALL_PATH=/boot
  63.  
  64.  #
  65. +# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory 
  66. +# relocations required by build roots.  This is not defined in the
  67. +# makefile but the arguement can be passed to make if needed.
  68. +#
  69. +
  70. +#
  71.  # If you want to preset the SVGA mode, uncomment the next line and
  72.  # set SVGA_MODE to whatever number you want.
  73.  # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
  74. @@ -289,7 +295,7 @@
  75.  
  76.  modules_install:
  77.      @( \
  78. -    MODLIB=/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \
  79. +    MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \
  80.      cd modules; \
  81.      MODULES=""; \
  82.      inst_mod() { These="`cat $$1`"; MODULES="$$MODULES $$These"; \
  83. diff -u --recursive --new-file v2.1.118/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
  84. --- v2.1.118/linux/arch/i386/kernel/irq.c    Thu Aug  6 14:06:28 1998
  85. +++ linux/arch/i386/kernel/irq.c    Wed Aug 26 15:40:08 1998
  86. @@ -450,12 +450,12 @@
  87.   * no other CPU is executing any bottom half handler.
  88.   *
  89.   * Don't wait if we're already running in an interrupt
  90. - * context or are inside a bh handler.
  91. + * context or are inside a bh handler. 
  92.   */
  93.  void synchronize_bh(void)
  94.  {
  95.      if (atomic_read(&global_bh_count) && !in_interrupt())
  96. -            wait_on_bh();
  97. +        wait_on_bh();
  98.  }
  99.  
  100.  /*
  101. diff -u --recursive --new-file v2.1.118/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
  102. --- v2.1.118/linux/arch/i386/kernel/smp.c    Tue Aug 18 22:02:02 1998
  103. +++ linux/arch/i386/kernel/smp.c    Wed Aug 26 10:00:31 1998
  104. @@ -245,7 +245,7 @@
  105.  {
  106.      char str[16];
  107.      int count=sizeof(*mpc);
  108. -    int apics=0;
  109. +    int ioapics = 0;
  110.      unsigned char *mpt=((unsigned char *)mpc)+count;
  111.  
  112.      if(memcmp(mpc->mpc_signature,MPC_SIGNATURE,4))
  113. @@ -364,11 +364,15 @@
  114.                      (struct mpc_config_ioapic *)mpt;
  115.                  if(m->mpc_flags&MPC_APIC_USABLE)
  116.                  {
  117. -                    apics++;
  118. +                    ioapics++;
  119.                      printk("I/O APIC #%d Version %d at 0x%lX.\n",
  120.                          m->mpc_apicid,m->mpc_apicver,
  121.                          m->mpc_apicaddr);
  122. -                    mp_ioapic_addr = m->mpc_apicaddr;
  123. +                    /*
  124. +                     * we use the first one only currently
  125. +                     */
  126. +                    if (!ioapics)
  127. +                        mp_ioapic_addr = m->mpc_apicaddr;
  128.                  }
  129.                  mpt+=sizeof(*m);
  130.                  count+=sizeof(*m);
  131. @@ -400,8 +404,8 @@
  132.              }
  133.          }
  134.      }
  135. -    if(apics>1)
  136. -        printk("Warning: Multiple APICs not supported.\n");
  137. +    if (ioapics > 1)
  138. +        printk("Warning: Multiple IO-APICs not yet supported.\n");
  139.      return num_processors;
  140.  }
  141.  
  142. diff -u --recursive --new-file v2.1.118/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
  143. --- v2.1.118/linux/arch/ppc/kernel/pmac_setup.c    Thu Aug  6 14:06:29 1998
  144. +++ linux/arch/ppc/kernel/pmac_setup.c    Thu Aug 27 11:03:56 1998
  145. @@ -44,7 +44,6 @@
  146.  #include <asm/system.h>
  147.  #include <asm/pgtable.h>
  148.  #include <asm/io.h>
  149. -#include <asm/ide.h>
  150.  #include <asm/pci-bridge.h>
  151.  #include <asm/adb.h>
  152.  #include <asm/cuda.h>
  153. @@ -272,95 +271,4 @@
  154.          printk(" (root)");
  155.      }
  156.  }
  157. -
  158. -#ifdef CONFIG_BLK_DEV_IDE
  159. -int pmac_ide_ports_known;
  160. -ide_ioreg_t pmac_ide_regbase[MAX_HWIFS];
  161. -int pmac_ide_irq[MAX_HWIFS];
  162. -
  163. -__initfunc(void pmac_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq))
  164. -{
  165. -    int i;
  166. -
  167. -    *p = 0;
  168. -    if (base == 0)
  169. -        return;
  170. -    if (base == mb_cd_base && !check_media_bay(MB_CD)) {
  171. -        mb_cd_index = -1;
  172. -        return;
  173. -    }
  174. -    for (i = 0; i < 8; ++i)
  175. -        *p++ = base + i * 0x10;
  176. -    *p = base + 0x160;
  177. -    if (irq != NULL) {
  178. -        *irq = 0;
  179. -        for (i = 0; i < MAX_HWIFS; ++i) {
  180. -            if (base == pmac_ide_regbase[i]) {
  181. -                *irq = pmac_ide_irq[i];
  182. -                break;
  183. -            }
  184. -        }
  185. -    }
  186. -}
  187. -
  188. -__initfunc(void pmac_ide_probe(void))
  189. -{
  190. -    struct device_node *np;
  191. -    int i;
  192. -    struct device_node *atas;
  193. -    struct device_node *p, **pp, *removables, **rp;
  194. -
  195. -    pp = &atas;
  196. -    rp = &removables;
  197. -    p = find_devices("ATA");
  198. -    if (p == NULL)
  199. -        p = find_devices("IDE");
  200. -    if (p == NULL)
  201. -        p = find_type_devices("ide");
  202. -    if (p == NULL)
  203. -        p = find_type_devices("ata");
  204. -    /* Move removable devices such as the media-bay CDROM
  205. -       on the PB3400 to the end of the list. */
  206. -    for (; p != NULL; p = p->next) {
  207. -        if (p->parent && p->parent->name
  208. -            && strcasecmp(p->parent->name, "media-bay") == 0) {
  209. -            *rp = p;
  210. -            rp = &p->next;
  211. -        } else {
  212. -            *pp = p;
  213. -            pp = &p->next;
  214. -        }
  215. -    }
  216. -    *rp = NULL;
  217. -    *pp = removables;
  218. -
  219. -    for (i = 0, np = atas; i < MAX_HWIFS && np != NULL; np = np->next) {
  220. -        if (np->n_addrs == 0) {
  221. -            printk(KERN_WARNING "ide: no address for device %s\n",
  222. -                   np->full_name);
  223. -            continue;
  224. -        }
  225. -        pmac_ide_regbase[i] = (unsigned long)
  226. -            ioremap(np->addrs[0].address, 0x200);
  227. -        if (np->n_intrs == 0) {
  228. -            printk("ide: no intrs for device %s, using 13\n",
  229. -                   np->full_name);
  230. -            pmac_ide_irq[i] = 13;
  231. -        } else {
  232. -            pmac_ide_irq[i] = np->intrs[0].line;
  233. -        }
  234. -
  235. -        if (np->parent && np->parent->name
  236. -            && strcasecmp(np->parent->name, "media-bay") == 0) {
  237. -            mb_cd_index = i;
  238. -            mb_cd_base = pmac_ide_regbase[i];
  239. -            mb_cd_irq = pmac_ide_irq[i];
  240. -        }
  241. -
  242. -        ++i;
  243. -    }
  244. -
  245. -    pmac_ide_ports_known = 1;
  246. -}
  247. -#endif /* CONFIG_BLK_DEV_IDE */
  248.  
  249. diff -u --recursive --new-file v2.1.118/linux/drivers/block/Config.in linux/drivers/block/Config.in
  250. --- v2.1.118/linux/drivers/block/Config.in    Tue Aug 18 22:02:03 1998
  251. +++ linux/drivers/block/Config.in    Thu Aug 27 11:03:56 1998
  252. @@ -48,6 +48,14 @@
  253.            bool '   WInbond SL82c105 support' CONFIG_BLK_DEV_SL82C105
  254.        fi
  255.      fi
  256. +    if [ "$CONFIG_PMAC" = "y" ]; then
  257. +      define_bool CONFIG_BLK_DEV_IDE_PMAC y
  258. +      bool '   PowerMac IDE DMA support' CONFIG_BLK_DEV_IDEDMA_PMAC
  259. +      if [ "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" ]; then
  260. +        define_bool CONFIG_BLK_DEV_IDEDMA y
  261. +    bool '     Use DMA by default' CONFIG_PMAC_IDEDMA_AUTO
  262. +      fi
  263. +    fi
  264.      bool '   Other IDE chipset support' CONFIG_IDE_CHIPSETS
  265.      if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then
  266.        comment 'Note: most of these also require special kernel boot parameters'
  267. diff -u --recursive --new-file v2.1.118/linux/drivers/block/Makefile linux/drivers/block/Makefile
  268. --- v2.1.118/linux/drivers/block/Makefile    Wed Aug 26 11:37:34 1998
  269. +++ linux/drivers/block/Makefile    Thu Aug 27 11:03:56 1998
  270. @@ -106,6 +106,10 @@
  271.  IDE_OBJS += cmd640.o
  272.  endif
  273.  
  274. +ifeq ($(CONFIG_BLK_DEV_IDE_PMAC),y)
  275. +IDE_OBJS += ide-pmac.o
  276. +endif
  277. +
  278.  ifeq ($(CONFIG_BLK_DEV_IDEPCI),y)
  279.  IDE_OBJS += ide-pci.o
  280.  endif
  281. diff -u --recursive --new-file v2.1.118/linux/drivers/block/ide-pmac.c linux/drivers/block/ide-pmac.c
  282. --- v2.1.118/linux/drivers/block/ide-pmac.c    Wed Dec 31 16:00:00 1969
  283. +++ linux/drivers/block/ide-pmac.c    Thu Aug 27 11:03:56 1998
  284. @@ -0,0 +1,298 @@
  285. +/*
  286. + * Support for IDE interfaces on PowerMacs.
  287. + * These IDE interfaces are memory-mapped and have a DBDMA channel
  288. + * for doing DMA.
  289. + *
  290. + *  Copyright (C) 1998 Paul Mackerras.
  291. + *
  292. + *  This program is free software; you can redistribute it and/or
  293. + *  modify it under the terms of the GNU General Public License
  294. + *  as published by the Free Software Foundation; either version
  295. + *  2 of the License, or (at your option) any later version.
  296. + *
  297. + * Some code taken from drivers/block/ide-dma.c:
  298. + *
  299. + *  Copyright (c) 1995-1998  Mark Lord
  300. + *
  301. + */
  302. +#include <linux/config.h>
  303. +#include <linux/types.h>
  304. +#include <linux/kernel.h>
  305. +#include <linux/sched.h>
  306. +#include <linux/init.h>
  307. +#include <asm/prom.h>
  308. +#include <asm/io.h>
  309. +#include <asm/dbdma.h>
  310. +#include <asm/ide.h>
  311. +#include <asm/mediabay.h>
  312. +#include "ide.h"
  313. +
  314. +ide_ioreg_t pmac_ide_regbase[MAX_HWIFS];
  315. +int pmac_ide_irq[MAX_HWIFS];
  316. +
  317. +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
  318. +#define MAX_DCMDS    256    /* allow up to 256 DBDMA commands per xfer */
  319. +
  320. +static void pmac_ide_setup_dma(struct device_node *np, ide_hwif_t *hwif);
  321. +static int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive);
  322. +static int pmac_ide_build_dmatable(ide_drive_t *drive, int wr);
  323. +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
  324. +
  325. +__initfunc(void
  326. +pmac_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq))
  327. +{
  328. +    int i;
  329. +
  330. +    *p = 0;
  331. +    if (base == 0)
  332. +        return;
  333. +    if (base == mb_cd_base && !check_media_bay(MB_CD)) {
  334. +        mb_cd_index = -1;
  335. +        return;
  336. +    }
  337. +    for (i = 0; i < 8; ++i)
  338. +        *p++ = base + i * 0x10;
  339. +    *p = base + 0x160;
  340. +    if (irq != NULL) {
  341. +        *irq = 0;
  342. +        for (i = 0; i < MAX_HWIFS; ++i) {
  343. +            if (base == pmac_ide_regbase[i]) {
  344. +                *irq = pmac_ide_irq[i];
  345. +                break;
  346. +            }
  347. +        }
  348. +    }
  349. +}
  350. +
  351. +__initfunc(void
  352. +pmac_ide_probe(void))
  353. +{
  354. +    struct device_node *np;
  355. +    int i;
  356. +    struct device_node *atas;
  357. +    struct device_node *p, **pp, *removables, **rp;
  358. +    unsigned long base;
  359. +    int irq;
  360. +    ide_hwif_t *hwif;
  361. +
  362. +    if (_machine != _MACH_Pmac)
  363. +        return;
  364. +    pp = &atas;
  365. +    rp = &removables;
  366. +    p = find_devices("ATA");
  367. +    if (p == NULL)
  368. +        p = find_devices("IDE");
  369. +    if (p == NULL)
  370. +        p = find_type_devices("ide");
  371. +    if (p == NULL)
  372. +        p = find_type_devices("ata");
  373. +    /* Move removable devices such as the media-bay CDROM
  374. +       on the PB3400 to the end of the list. */
  375. +    for (; p != NULL; p = p->next) {
  376. +        if (p->parent && p->parent->name
  377. +            && strcasecmp(p->parent->name, "media-bay") == 0) {
  378. +            *rp = p;
  379. +            rp = &p->next;
  380. +        } else {
  381. +            *pp = p;
  382. +            pp = &p->next;
  383. +        }
  384. +    }
  385. +    *rp = NULL;
  386. +    *pp = removables;
  387. +
  388. +    for (i = 0, np = atas; i < MAX_HWIFS && np != NULL; np = np->next) {
  389. +        if (np->n_addrs == 0) {
  390. +            printk(KERN_WARNING "ide: no address for device %s\n",
  391. +                   np->full_name);
  392. +            continue;
  393. +        }
  394. +        base = (unsigned long) ioremap(np->addrs[0].address, 0x200);
  395. +        if (np->n_intrs == 0) {
  396. +            printk("ide: no intrs for device %s, using 13\n",
  397. +                   np->full_name);
  398. +            irq = 13;
  399. +        } else {
  400. +            irq = np->intrs[0].line;
  401. +        }
  402. +        pmac_ide_regbase[i] = base;
  403. +        pmac_ide_irq[i] = irq;
  404. +
  405. +        if (np->parent && np->parent->name
  406. +            && strcasecmp(np->parent->name, "media-bay") == 0) {
  407. +            mb_cd_index = i;
  408. +            mb_cd_base = base;
  409. +            mb_cd_irq = irq;
  410. +        }
  411. +
  412. +        hwif = &ide_hwifs[i];
  413. +        pmac_ide_init_hwif_ports(hwif->io_ports, base, &hwif->irq);
  414. +        hwif->chipset = ide_generic;
  415. +        hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
  416. +
  417. +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
  418. +        if (np->n_addrs >= 2 && np->n_intrs >= 2) {
  419. +            /* has a DBDMA controller channel */
  420. +            pmac_ide_setup_dma(np, hwif);
  421. +        }
  422. +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
  423. +
  424. +        ++i;
  425. +    }
  426. +}
  427. +
  428. +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
  429. +
  430. +__initfunc(static void
  431. +pmac_ide_setup_dma(struct device_node *np, ide_hwif_t *hwif))
  432. +{
  433. +    hwif->dma_base = (unsigned long) ioremap(np->addrs[1].address, 0x200);
  434. +
  435. +    /*
  436. +     * Allocate space for the DBDMA commands.
  437. +     * The +2 is +1 for the stop command and +1 to allow for
  438. +     * aligning the start address to a multiple of 16 bytes.
  439. +     */
  440. +    hwif->dmatable = (unsigned long *)
  441. +           kmalloc((MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), GFP_KERNEL);
  442. +    if (hwif->dmatable == 0) {
  443. +        printk(KERN_ERR "%s: unable to allocate DMA command list\n",
  444. +               hwif->name);
  445. +        return;
  446. +    }
  447. +
  448. +    hwif->dmaproc = &pmac_ide_dmaproc;
  449. +#ifdef CONFIG_PMAC_IDEDMA_AUTO
  450. +    hwif->autodma = 1;
  451. +#endif
  452. +}
  453. +
  454. +/*
  455. + * pmac_ide_build_dmatable builds the DBDMA command list
  456. + * for a transfer and sets the DBDMA channel to point to it.
  457. + */
  458. +static int
  459. +pmac_ide_build_dmatable(ide_drive_t *drive, int wr)
  460. +{
  461. +    ide_hwif_t *hwif = HWIF(drive);
  462. +    struct dbdma_cmd *table, *tstart;
  463. +    int count = 0;
  464. +    struct request *rq = HWGROUP(drive)->rq;
  465. +    struct buffer_head *bh = rq->bh;
  466. +    unsigned int size, addr;
  467. +    volatile struct dbdma_regs *dma
  468. +        = (volatile struct dbdma_regs *) hwif->dma_base;
  469. +
  470. +    table = tstart = (struct dbdma_cmd *) DBDMA_ALIGN(hwif->dmatable);
  471. +    out_le32(&dma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16);
  472. +
  473. +    do {
  474. +        /*
  475. +         * Determine addr and size of next buffer area.  We assume that
  476. +         * individual virtual buffers are always composed linearly in
  477. +         * physical memory.  For example, we assume that any 8kB buffer
  478. +         * is always composed of two adjacent physical 4kB pages rather
  479. +         * than two possibly non-adjacent physical 4kB pages.
  480. +         */
  481. +        if (bh == NULL) {  /* paging requests have (rq->bh == NULL) */
  482. +            addr = virt_to_bus(rq->buffer);
  483. +            size = rq->nr_sectors << 9;
  484. +        } else {
  485. +            /* group sequential buffers into one large buffer */
  486. +            addr = virt_to_bus(bh->b_data);
  487. +            size = bh->b_size;
  488. +            while ((bh = bh->b_reqnext) != NULL) {
  489. +                if ((addr + size) != virt_to_bus(bh->b_data))
  490. +                    break;
  491. +                size += bh->b_size;
  492. +            }
  493. +        }
  494. +
  495. +        /*
  496. +         * Fill in the next DBDMA command block.
  497. +         * Note that one DBDMA command can transfer
  498. +         * at most 65535 bytes.
  499. +         */
  500. +        while (size) {
  501. +            unsigned int tc = (size < 0xfe00)? size: 0xfe00;
  502. +
  503. +            if (++count >= MAX_DCMDS) {
  504. +                printk("%s: DMA table too small\n",
  505. +                       drive->name);
  506. +                return 0; /* revert to PIO for this request */
  507. +            }
  508. +            st_le16(&table->command, wr? OUTPUT_MORE: INPUT_MORE);
  509. +            st_le16(&table->req_count, tc);
  510. +            st_le32(&table->phy_addr, addr);
  511. +            table->cmd_dep = 0;
  512. +            table->xfer_status = 0;
  513. +            table->res_count = 0;
  514. +            addr += tc;
  515. +            size -= tc;
  516. +            ++table;
  517. +        }
  518. +    } while (bh != NULL);
  519. +
  520. +    /* convert the last command to an input/output last command */
  521. +    if (count)
  522. +        st_le16(&table[-1].command, wr? OUTPUT_LAST: INPUT_LAST);
  523. +    else
  524. +        printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name);
  525. +
  526. +    /* add the stop command to the end of the list */
  527. +    memset(table, 0, sizeof(struct dbdma_cmd));
  528. +    out_le16(&table->command, DBDMA_STOP);
  529. +
  530. +    out_le32(&dma->cmdptr, virt_to_bus(tstart));
  531. +    return 1;
  532. +}
  533. +
  534. +int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive)
  535. +{
  536. +    ide_hwif_t *hwif = HWIF(drive);
  537. +    volatile struct dbdma_regs *dma
  538. +        = (volatile struct dbdma_regs *) hwif->dma_base;
  539. +    int dstat;
  540. +
  541. +    switch (func) {
  542. +    case ide_dma_on:
  543. +        /* ide-floppy DMA doesn't work yet... */
  544. +        drive->using_dma = drive->media != ide_floppy;
  545. +        break;
  546. +    case ide_dma_off:
  547. +        printk(KERN_INFO "%s: DMA disabled\n", drive->name);
  548. +    case ide_dma_off_quietly:
  549. +        drive->using_dma = 0;
  550. +        break;
  551. +    case ide_dma_check:
  552. +        /* ide-floppy DMA doesn't work yet... */
  553. +        drive->using_dma = hwif->autodma && drive->media != ide_floppy;
  554. +        break;
  555. +    case ide_dma_read:
  556. +    case ide_dma_write:
  557. +        if (!pmac_ide_build_dmatable(drive, func==ide_dma_write))
  558. +            return 1;
  559. +        drive->waiting_for_dma = 1;
  560. +        if (drive->media != ide_disk)
  561. +            return 0;
  562. +        ide_set_handler(drive, &ide_dma_intr, WAIT_CMD);
  563. +        OUT_BYTE(func==ide_dma_write? WIN_WRITEDMA: WIN_READDMA,
  564. +             IDE_COMMAND_REG);
  565. +    case ide_dma_begin:
  566. +        out_le32(&dma->control, (RUN << 16) | RUN);
  567. +        break;
  568. +    case ide_dma_end:
  569. +        drive->waiting_for_dma = 0;
  570. +        dstat = in_le32(&dma->status);
  571. +        out_le32(&dma->control, ((RUN|WAKE|DEAD) << 16));
  572. +        /* verify good dma status */
  573. +        return (dstat & (RUN|DEAD|ACTIVE)) != RUN;
  574. +    case ide_dma_test_irq:
  575. +        return (in_le32(&dma->status) & (RUN|ACTIVE)) == RUN;
  576. +    default:
  577. +        printk(KERN_ERR "pmac_ide_dmaproc: bad func %d\n", func);
  578. +    }
  579. +    return 0;
  580. +}
  581. +
  582. +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
  583. diff -u --recursive --new-file v2.1.118/linux/drivers/block/ide.c linux/drivers/block/ide.c
  584. --- v2.1.118/linux/drivers/block/ide.c    Wed Aug 26 11:37:35 1998
  585. +++ linux/drivers/block/ide.c    Thu Aug 27 11:03:56 1998
  586. @@ -1104,8 +1104,7 @@
  587.              if (sleep) {
  588.                  if (0 < (signed long)(jiffies + WAIT_MIN_SLEEP - sleep)) 
  589.                      sleep = jiffies + WAIT_MIN_SLEEP;
  590. -                hwgroup->timer.expires = sleep;
  591. -                add_timer(&hwgroup->timer);
  592. +                mod_timer(&hwgroup->timer, sleep);
  593.              } else {
  594.                  /* Ugly, but how can we sleep for the lock otherwise? perhaps from tq_scheduler? */
  595.                  ide_release_lock(&ide_lock);    /* for atari only */
  596. @@ -2638,6 +2637,12 @@
  597.          (void) init_pdc4030();
  598.      }
  599.  #endif /* CONFIG_BLK_DEV_PDC4030 */
  600. +#ifdef CONFIG_BLK_DEV_IDE_PMAC
  601. +    {
  602. +        extern void pmac_ide_probe(void);
  603. +        pmac_ide_probe();
  604. +    }
  605. +#endif /* CONFIG_BLK_DEV_IDE_PMAC */
  606.  }
  607.  
  608.  __initfunc(void ide_init_builtin_drivers (void))
  609. diff -u --recursive --new-file v2.1.118/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
  610. --- v2.1.118/linux/drivers/block/nbd.c    Wed Aug 26 11:37:35 1998
  611. +++ linux/drivers/block/nbd.c    Thu Aug 27 11:52:04 1998
  612. @@ -81,9 +81,18 @@
  613.      int result;
  614.      struct msghdr msg;
  615.      struct iovec iov;
  616. +    unsigned long flags;
  617.  
  618.      oldfs = get_fs();
  619.      set_fs(get_ds());
  620. +
  621. +    spin_lock_irqsave(¤t->sigmask_lock, flags);
  622. +    oldset = current->blocked;
  623. +    sigfillset(¤t->blocked);
  624. +    recalc_sigpending(current);
  625. +    spin_unlock_irqrestore(¤t->sigmask_lock, flags);
  626. +
  627. +
  628.      do {
  629.          sigset_t oldset;
  630.  
  631. @@ -98,22 +107,11 @@
  632.          msg.msg_namelen = 0;
  633.          msg.msg_flags = 0;
  634.  
  635. -        spin_lock_irq(¤t->sigmask_lock);
  636. -        oldset = current->blocked;
  637. -        sigfillset(¤t->blocked);
  638. -        recalc_sigpending(current);
  639. -        spin_unlock_irq(¤t->sigmask_lock);
  640. -
  641.          if (send)
  642.              result = sock_sendmsg(sock, &msg, size);
  643.          else
  644.              result = sock_recvmsg(sock, &msg, size, 0);
  645.  
  646. -        spin_lock_irq(¤t->sigmask_lock);
  647. -        current->blocked = oldset;
  648. -        recalc_sigpending(current);
  649. -        spin_unlock_irq(¤t->sigmask_lock);
  650. -
  651.          if (result <= 0) {
  652.  #ifdef PARANOIA
  653.              printk(KERN_ERR "NBD: %s - sock=%ld at buf=%ld, size=%d returned %d.\n",
  654. @@ -124,6 +122,12 @@
  655.          size -= result;
  656.          buf += result;
  657.      } while (size > 0);
  658. +
  659. +    spin_lock_irqsave(¤t->sigmask_lock, flags);
  660. +    current->blocked = oldset;
  661. +    recalc_sigpending(current);
  662. +    spin_unlock_irqrestore(¤t->sigmask_lock, flags);
  663. +
  664.      set_fs(oldfs);
  665.      return result;
  666.  }
  667. @@ -295,8 +299,6 @@
  668.          requests_in++;
  669.  #endif
  670.          req->errors = 0;
  671. -
  672. -        nbd_send_req(lo->sock, req);    /* Why does this block?         */
  673.          CURRENT = CURRENT->next;
  674.          req->next = NULL;
  675.          if (lo->head == NULL) {
  676. @@ -306,6 +308,10 @@
  677.              lo->head->next = req;
  678.              lo->head = req;
  679.          }
  680. +
  681. +        spin_unlock_irq(&io_request_lock);
  682. +        nbd_send_req(lo->sock, req);    /* Why does this block?         */
  683. +        spin_lock_irq(&io_request_lock);
  684.          continue;
  685.  
  686.            error_out:
  687. diff -u --recursive --new-file v2.1.118/linux/drivers/char/joystick.c linux/drivers/char/joystick.c
  688. --- v2.1.118/linux/drivers/char/joystick.c    Thu May 14 19:47:39 1998
  689. +++ linux/drivers/char/joystick.c    Wed Aug 26 10:27:55 1998
  690. @@ -771,6 +771,7 @@
  691.      js_ioctl,        /* js_ioctl */
  692.      NULL,            /* js_mmap */
  693.      js_open,        /* js_open */
  694. +    NULL,            /* js_flush */
  695.      js_release,        /* js_release */
  696.      NULL            /* js_sync */
  697.  };
  698. diff -u --recursive --new-file v2.1.118/linux/drivers/isdn/isdn_common.c linux/drivers/isdn/isdn_common.c
  699. --- v2.1.118/linux/drivers/isdn/isdn_common.c    Wed Apr  1 20:11:51 1998
  700. +++ linux/drivers/isdn/isdn_common.c    Thu Aug 27 12:00:06 1998
  701. @@ -1787,6 +1787,7 @@
  702.      isdn_ioctl,             /* isdn_ioctl */
  703.      NULL,                   /* isdn_mmap */
  704.      isdn_open,
  705. +    NULL,            /* flush */
  706.      isdn_close,
  707.      NULL                    /* fsync */
  708.  };
  709. diff -u --recursive --new-file v2.1.118/linux/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c
  710. --- v2.1.118/linux/drivers/scsi/hosts.c    Thu Aug  6 14:06:33 1998
  711. +++ linux/drivers/scsi/hosts.c    Thu Aug 27 12:01:00 1998
  712. @@ -518,10 +518,18 @@
  713.      
  714.      /* If we are removing the last host registered, it is safe to reuse
  715.       * its host number (this avoids "holes" at boot time) (DB) 
  716. +     * It is also safe to reuse those of numbers directly below which have
  717. +     * been released earlier (to avoid some holes in numbering).
  718.       */
  719. -    if (max_scsi_hosts == next_scsi_host)
  720. -    max_scsi_hosts--;
  721. -    
  722. +    if(sh->host_no == max_scsi_hosts - 1) {
  723. +    while(--max_scsi_hosts >= next_scsi_host) {
  724. +        shpnt = scsi_hostlist;
  725. +        while(shpnt && shpnt->host_no != max_scsi_hosts - 1)
  726. +        shpnt = shpnt->next;
  727. +        if(shpnt)
  728. +        break;
  729. +    }
  730. +    }
  731.      next_scsi_host--;
  732.      scsi_init_free((char *) sh, sizeof(struct Scsi_Host) + sh->extra_bytes);
  733.  }
  734. diff -u --recursive --new-file v2.1.118/linux/fs/hfs/super.c linux/fs/hfs/super.c
  735. --- v2.1.118/linux/fs/hfs/super.c    Sun Jun  7 11:16:36 1998
  736. +++ linux/fs/hfs/super.c    Wed Aug 26 13:25:21 1998
  737. @@ -396,9 +396,7 @@
  738.      struct hfs_mdb *mdb;
  739.      struct hfs_cat_key key;
  740.      kdev_t dev = s->s_dev;
  741. -#ifndef CONFIG_MAC_PARTITION
  742.      hfs_s32 part_size, part_start;
  743. -#endif
  744.      struct inode *root_inode;
  745.      int part;
  746.  
  747. @@ -415,16 +413,25 @@
  748.      /* set the device driver to 512-byte blocks */
  749.      set_blocksize(dev, HFS_SECTOR_SIZE);
  750.  
  751. -    /* look for a partition table and find the correct partition */
  752. -#ifndef CONFIG_MAC_PARTITION
  753. +#ifdef CONFIG_MAC_PARTITION
  754. +    /* check to see if we're in a partition */
  755. +    mdb = hfs_mdb_get(s, s->s_flags & MS_RDONLY, 0);
  756. +
  757. +    /* erk. try parsing the partition table ourselves */
  758. +    if (!mdb) {
  759. +        if (hfs_part_find(s, part, silent, &part_size, &part_start)) {
  760. +                goto bail2;
  761. +          }
  762. +          mdb = hfs_mdb_get(s, s->s_flags & MS_RDONLY, part_start);
  763. +    }
  764. +#else
  765.      if (hfs_part_find(s, part, silent, &part_size, &part_start)) {
  766.          goto bail2;
  767.      }
  768.  
  769.      mdb = hfs_mdb_get(s, s->s_flags & MS_RDONLY, part_start);
  770. -#else
  771. -    mdb = hfs_mdb_get(s, s->s_flags & MS_RDONLY, 0);
  772.  #endif
  773. +
  774.      if (!mdb) {
  775.          if (!silent) {
  776.              printk("VFS: Can't find a HFS filesystem on dev %s.\n",
  777. diff -u --recursive --new-file v2.1.118/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
  778. --- v2.1.118/linux/fs/isofs/inode.c    Wed Jun 24 22:54:09 1998
  779. +++ linux/fs/isofs/inode.c    Wed Aug 26 15:06:55 1998
  780. @@ -25,6 +25,7 @@
  781.  #include <linux/cdrom.h>
  782.  #include <linux/init.h>
  783.  #include <linux/nls.h>
  784. +#include <linux/ctype.h>
  785.  
  786.  #include <asm/system.h>
  787.  #include <asm/uaccess.h>
  788. @@ -41,6 +42,18 @@
  789.  static int check_bread = 0;
  790.  #endif
  791.  
  792. +static int isofs_hashi(struct dentry *parent, struct qstr *qstr);
  793. +static int isofs_hash(struct dentry *parent, struct qstr *qstr);
  794. +static int isofs_cmpi(struct dentry *dentry, struct qstr *a, struct qstr *b);
  795. +static int isofs_cmp(struct dentry *dentry, struct qstr *a, struct qstr *b);
  796. +
  797. +#ifdef CONFIG_JOLIET
  798. +static int isofs_hashi_ms(struct dentry *parent, struct qstr *qstr);
  799. +static int isofs_hash_ms(struct dentry *parent, struct qstr *qstr);
  800. +static int isofs_cmpi_ms(struct dentry *dentry, struct qstr *a, struct qstr *b);
  801. +static int isofs_cmp_ms(struct dentry *dentry, struct qstr *a, struct qstr *b);
  802. +#endif
  803. +
  804.  void isofs_put_super(struct super_block *sb)
  805.  {
  806.  #ifdef CONFIG_JOLIET
  807. @@ -71,21 +84,213 @@
  808.      NULL
  809.  };
  810.  
  811. +static struct dentry_operations isofs_dentry_ops[] = {
  812. +    {
  813. +        NULL,            /* d_revalidate */
  814. +        isofs_hash,
  815. +        isofs_cmp,
  816. +        NULL            /* d_delete */
  817. +    },
  818. +    {
  819. +        NULL,            /* d_revalidate */
  820. +        isofs_hashi,
  821. +        isofs_cmpi,
  822. +        NULL            /* d_delete */
  823. +    },
  824. +#ifdef CONFIG_JOLIET
  825. +    {
  826. +        NULL,            /* d_revalidate */
  827. +        isofs_hash_ms,
  828. +        isofs_cmp_ms,
  829. +        NULL            /* d_delete */
  830. +    },
  831. +    {
  832. +        NULL,            /* d_revalidate */
  833. +        isofs_hashi_ms,
  834. +        isofs_cmpi_ms,
  835. +        NULL            /* d_delete */
  836. +    }
  837. +#endif
  838. +};
  839. +
  840.  struct iso9660_options{
  841. -  char map;
  842. -  char rock;
  843. -  char joliet;
  844. -  char cruft;
  845. -  char unhide;
  846. -  unsigned char check;
  847. -  unsigned int blocksize;
  848. -  mode_t mode;
  849. -  gid_t gid;
  850. -  uid_t uid;
  851. -  char *iocharset;
  852. -  unsigned char utf8;
  853. +    char map;
  854. +    char rock;
  855. +    char joliet;
  856. +    char cruft;
  857. +    char unhide;
  858. +    unsigned char check;
  859. +    unsigned int blocksize;
  860. +    mode_t mode;
  861. +    gid_t gid;
  862. +    uid_t uid;
  863. +    char *iocharset;
  864. +    unsigned char utf8;
  865.  };
  866.  
  867. +static int strnicmp(const char *s1, const char *s2, int len)
  868. +{
  869. +    int n = 0;
  870. +    while (*s1 && *s2 && (tolower(*s1) == tolower(*s2))) {
  871. +        s1++; s2++; n++;
  872. +        if (n == len) return 0;
  873. +    }
  874. +    if (*s1 == 0 && *s2 == 0) return 0;
  875. +    if (*s1 && *s2) {
  876. +        if (*s1 > *s2) return 1;
  877. +        return -1;
  878. +    }
  879. +    if (*s1) return 1;
  880. +    return -1;
  881. +}
  882. +
  883. +/*
  884. + * Compute the hash for the isofs name corresponding to the dentry.
  885. + */
  886. +static int
  887. +isofs_hash_common(struct dentry *dentry, struct qstr *qstr, int ms)
  888. +{
  889. +    const char *name;
  890. +    int len;
  891. +
  892. +    len = qstr->len;
  893. +    name = qstr->name;
  894. +    if (ms) {
  895. +        while (len && name[len-1] == '.')
  896. +            len--;
  897. +    }
  898. +
  899. +    qstr->hash = full_name_hash(name, len);
  900. +
  901. +    return 0;
  902. +}
  903. +
  904. +/*
  905. + * Compute the hash for the isofs name corresponding to the dentry.
  906. + */
  907. +static int
  908. +isofs_hashi_common(struct dentry *dentry, struct qstr *qstr, int ms)
  909. +{
  910. +    const char *name;
  911. +    int len;
  912. +    char c;
  913. +    unsigned long hash;
  914. +
  915. +    len = qstr->len;
  916. +    name = qstr->name;
  917. +    if (ms) {
  918. +        while (len && name[len-1] == '.')
  919. +            len--;
  920. +    }
  921. +
  922. +    hash = init_name_hash();
  923. +    while (len--) {
  924. +        c = tolower(*name++);
  925. +        hash = partial_name_hash(tolower(c), hash);
  926. +    }
  927. +    qstr->hash = end_name_hash(hash);
  928. +
  929. +    return 0;
  930. +}
  931. +
  932. +/*
  933. + * Case insensitive compare of two isofs names.
  934. + */
  935. +static int
  936. +isofs_cmpi_common(struct dentry *dentry,struct qstr *a,struct qstr *b,int ms)
  937. +{
  938. +    int alen, blen;
  939. +
  940. +    /* A filename cannot end in '.' or we treat it like it has none */
  941. +    alen = a->len;
  942. +    blen = b->len;
  943. +    if (ms) {
  944. +        while (alen && a->name[alen-1] == '.')
  945. +            alen--;
  946. +        while (blen && b->name[blen-1] == '.')
  947. +            blen--;
  948. +    }
  949. +    if (alen == blen) {
  950. +        if (strnicmp(a->name, b->name, alen) == 0)
  951. +            return 0;
  952. +    }
  953. +    return 1;
  954. +}
  955. +
  956. +/*
  957. + * Case sensitive compare of two isofs names.
  958. + */
  959. +static int
  960. +isofs_cmp_common(struct dentry *dentry,struct qstr *a,struct qstr *b,int ms)
  961. +{
  962. +    int alen, blen;
  963. +
  964. +    /* A filename cannot end in '.' or we treat it like it has none */
  965. +    alen = a->len;
  966. +    blen = b->len;
  967. +    if (ms) {
  968. +        while (alen && a->name[alen-1] == '.')
  969. +            alen--;
  970. +        while (blen && b->name[blen-1] == '.')
  971. +            blen--;
  972. +    }
  973. +    if (alen == blen) {
  974. +        if (strncmp(a->name, b->name, alen) == 0)
  975. +            return 0;
  976. +    }
  977. +    return 1;
  978. +}
  979. +
  980. +static int
  981. +isofs_hash(struct dentry *dentry, struct qstr *qstr)
  982. +{
  983. +    return isofs_hash_common(dentry, qstr, 0);
  984. +}
  985. +
  986. +static int
  987. +isofs_hashi(struct dentry *dentry, struct qstr *qstr)
  988. +{
  989. +    return isofs_hashi_common(dentry, qstr, 0);
  990. +}
  991. +
  992. +static int
  993. +isofs_cmp(struct dentry *dentry,struct qstr *a,struct qstr *b)
  994. +{
  995. +    return isofs_cmp_common(dentry, a, b, 0);
  996. +}
  997. +
  998. +static int
  999. +isofs_cmpi(struct dentry *dentry,struct qstr *a,struct qstr *b)
  1000. +{
  1001. +    return isofs_cmpi_common(dentry, a, b, 0);
  1002. +}
  1003. +
  1004. +#ifdef CONFIG_JOLIET
  1005. +static int
  1006. +isofs_hash_ms(struct dentry *dentry, struct qstr *qstr)
  1007. +{
  1008. +    return isofs_hash_common(dentry, qstr, 1);
  1009. +}
  1010. +
  1011. +static int
  1012. +isofs_hashi_ms(struct dentry *dentry, struct qstr *qstr)
  1013. +{
  1014. +    return isofs_hashi_common(dentry, qstr, 1);
  1015. +}
  1016. +
  1017. +static int
  1018. +isofs_cmp_ms(struct dentry *dentry,struct qstr *a,struct qstr *b)
  1019. +{
  1020. +    return isofs_cmp_common(dentry, a, b, 1);
  1021. +}
  1022. +
  1023. +static int
  1024. +isofs_cmpi_ms(struct dentry *dentry,struct qstr *a,struct qstr *b)
  1025. +{
  1026. +    return isofs_cmpi_common(dentry, a, b, 1);
  1027. +}
  1028. +#endif
  1029. +
  1030.  static int parse_options(char *options, struct iso9660_options * popt)
  1031.  {
  1032.      char *this_char,*value;
  1033. @@ -95,7 +300,7 @@
  1034.      popt->joliet = 'y';
  1035.      popt->cruft = 'n';
  1036.      popt->unhide = 'n';
  1037. -    popt->check = 's';        /* default: strict */
  1038. +    popt->check = 'u';        /* unset */
  1039.      popt->blocksize = 1024;
  1040.      popt->mode = S_IRUGO | S_IXUGO; /* r-x for all.  The disc could
  1041.                         be shared with DOS machines so
  1042. @@ -274,6 +479,7 @@
  1043.      unsigned int            vol_desc_start;
  1044.      struct inode              * inode;
  1045.      struct iso9660_options        opt;
  1046. +    int                table;
  1047.  
  1048.      MOD_INC_USE_COUNT;
  1049.      /* lock before any blocking operations */
  1050. @@ -374,7 +580,7 @@
  1051.                  } else if (sec->escape[2] == 0x45) {
  1052.                  joliet_level = 3;
  1053.                  }
  1054. -                printk("ISO 9660 Extensions: Microsoft Joliet Level %d\n",
  1055. +                printk(KERN_DEBUG"ISO 9660 Extensions: Microsoft Joliet Level %d\n",
  1056.                     joliet_level);
  1057.              }
  1058.              goto root_found;
  1059. @@ -532,7 +738,6 @@
  1060.      s->s_op = &isofs_sops;
  1061.      s->u.isofs_sb.s_mapping = opt.map;
  1062.      s->u.isofs_sb.s_rock = (opt.rock == 'y' ? 2 : 0);
  1063. -    s->u.isofs_sb.s_name_check = opt.check;
  1064.      s->u.isofs_sb.s_cruft = opt.cruft;
  1065.      s->u.isofs_sb.s_unhide = opt.unhide;
  1066.      s->u.isofs_sb.s_uid = opt.uid;
  1067. @@ -555,7 +760,10 @@
  1068.       * CD with Unicode names.  Until someone sees such a beast, it
  1069.       * will not be supported.
  1070.       */
  1071. -    if (joliet_level && opt.rock == 'y' && s->u.isofs_sb.s_rock != 1) {
  1072. +    if (opt.rock == 'y' && s->u.isofs_sb.s_rock == 1) {
  1073. +        joliet_level = 0;
  1074. +    }
  1075. +    if (joliet_level) {
  1076.          iput(inode);
  1077.          pri = (struct iso_primary_descriptor *) sec;
  1078.          rootp = (struct iso_directory_record *)
  1079. @@ -566,11 +774,22 @@
  1080.               << s -> u.isofs_sb.s_log_zone_size);
  1081.          inode = iget(s, s->u.isofs_sb.s_firstdatazone);
  1082.          s->u.isofs_sb.s_rock = 0;
  1083. +        opt.rock = 'n';
  1084. +    }
  1085. +
  1086. +    if (opt.check == 'u') {
  1087. +        /* Only Joliet is case insensitive by default */
  1088. +        if (joliet_level) opt.check = 'r';
  1089. +        else opt.check = 's';
  1090.      }
  1091.  
  1092.      s->s_root = d_alloc_root(inode, NULL);
  1093.      if (!(s->s_root))
  1094.          goto out_no_root;
  1095. +    table = 0;
  1096. +    if (joliet_level) table += 2;
  1097. +    if (opt.check == 'r') table++;
  1098. +    s->s_root->d_op = &isofs_dentry_ops[table];
  1099.  
  1100.      if(!check_disk_change(dev)) {
  1101.          brelse(bh);
  1102. @@ -694,34 +913,36 @@
  1103.      size = inode->u.isofs_i.i_section_size;
  1104.      nextino = inode->u.isofs_i.i_next_section_ino;
  1105.  #ifdef DEBUG
  1106. -    printk("first inode: inode=%lu nextino=%lu firstext=%u size=%lu\n",
  1107. +    printk("first inode: inode=%x nextino=%x firstext=%u size=%lu\n",
  1108.          inode->i_ino, nextino, firstext, size);
  1109.  #endif
  1110.      i = 0;
  1111. -    while(b_off >= offset + size) {
  1112. -        offset += size;
  1113. -
  1114. -        if(nextino == 0) return 0;
  1115. -        ino = iget(inode->i_sb, nextino);
  1116. -        if(!ino) return 0;
  1117. -        firstext = ino->u.isofs_i.i_first_extent;
  1118. -        size = ino->u.isofs_i.i_section_size;
  1119. +    if (nextino) {
  1120. +        while(b_off >= offset + size) {
  1121. +            offset += size;
  1122. +
  1123. +            if(nextino == 0) return 0;
  1124. +            ino = iget(inode->i_sb, nextino);
  1125. +            if(!ino) return 0;
  1126. +            firstext = ino->u.isofs_i.i_first_extent;
  1127. +            size = ino->u.isofs_i.i_section_size;
  1128.  #ifdef DEBUG
  1129. -        printk("read inode: inode=%lu ino=%lu nextino=%lu firstext=%u size=%lu\n",
  1130. -            inode->i_ino, nextino, ino->u.isofs_i.i_next_section_ino, firstext, size);
  1131. +            printk("read inode: inode=%lu ino=%lu nextino=%lu firstext=%u size=%lu\n",
  1132. +                   inode->i_ino, nextino, ino->u.isofs_i.i_next_section_ino, firstext, size);
  1133.  #endif
  1134. -        nextino = ino->u.isofs_i.i_next_section_ino;
  1135. -        iput(ino);
  1136. +            nextino = ino->u.isofs_i.i_next_section_ino;
  1137. +            iput(ino);
  1138.          
  1139. -        if(++i > 100) {
  1140. -            printk("isofs_bmap: More than 100 file sections ?!?, aborting...\n");
  1141. -            printk("isofs_bmap: ino=%lu block=%d firstext=%u size=%u nextino=%lu\n",
  1142. -                inode->i_ino, block, firstext, (unsigned)size, nextino);
  1143. -            return 0;
  1144. +            if(++i > 100) {
  1145. +                printk("isofs_bmap: More than 100 file sections ?!?, aborting...\n");
  1146. +                printk("isofs_bmap: ino=%lu block=%d firstext=%u size=%u nextino=%lu\n",
  1147. +                       inode->i_ino, block, firstext, (unsigned)size, nextino);
  1148. +                return 0;
  1149. +            }
  1150.          }
  1151.      }
  1152.  #ifdef DEBUG
  1153. -    printk("isofs_bmap: mapped inode:block %lu:%d to block %lu\n",
  1154. +    printk("isofs_bmap: mapped inode:block %x:%d to block %lu\n",
  1155.          inode->i_ino, block, (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode));
  1156.  #endif
  1157.      return (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode);
  1158. @@ -905,7 +1126,7 @@
  1159.  #endif
  1160.  
  1161.  #ifdef DEBUG
  1162. -    printk("Get inode %d: %d %d: %d\n",inode->i_ino, block,
  1163. +    printk("Get inode %x: %d %d: %d\n",inode->i_ino, block,
  1164.             ((int)pnt) & 0x3ff, inode->i_size);
  1165.  #endif
  1166.  
  1167. diff -u --recursive --new-file v2.1.118/linux/fs/isofs/joliet.c linux/fs/isofs/joliet.c
  1168. --- v2.1.118/linux/fs/isofs/joliet.c    Wed Jun 24 22:54:09 1998
  1169. +++ linux/fs/isofs/joliet.c    Wed Aug 26 09:54:41 1998
  1170. @@ -79,8 +79,6 @@
  1171.      unsigned char utf8;
  1172.      struct nls_table *nls;
  1173.      unsigned char len = 0;
  1174. -    int i;
  1175. -    char c;
  1176.  
  1177.      utf8 = inode->i_sb->u.isofs_sb.s_utf8;
  1178.      nls = inode->i_sb->u.isofs_sb.s_nls_iocharset;
  1179. @@ -96,14 +94,12 @@
  1180.          len -= 2;
  1181.      }
  1182.  
  1183. -        if (inode->i_sb->u.isofs_sb.s_name_check == 'r') {
  1184. -               for (i = 0; i < len; i++) {
  1185. -                       c = outname[i];
  1186. -                       /* lower case */
  1187. -                       if (c >= 'A' && c <= 'Z') c |= 0x20;
  1188. -                       if (c == ';') c = '.';
  1189. -                       outname[i] = c;
  1190. -               }
  1191. +    /*
  1192. +     * Windows doesn't like periods at the end of a name,
  1193. +     * so neither do we
  1194. +     */
  1195. +    while (len >= 2 && (outname[len-1] == '.')) {
  1196. +        len--;
  1197.      }
  1198.  
  1199.      return len;
  1200. diff -u --recursive --new-file v2.1.118/linux/fs/isofs/namei.c linux/fs/isofs/namei.c
  1201. --- v2.1.118/linux/fs/isofs/namei.c    Wed Jun 24 22:54:09 1998
  1202. +++ linux/fs/isofs/namei.c    Wed Aug 26 09:54:41 1998
  1203. @@ -22,33 +22,31 @@
  1204.   * ok, we cannot use strncmp, as the name is not in our data space.
  1205.   * Thus we'll have to use isofs_match. No big problem. Match also makes
  1206.   * some sanity tests.
  1207. - *
  1208. - * NOTE! unlike strncmp, isofs_match returns 1 for success, 0 for failure.
  1209.   */
  1210. -static int isofs_match(int len,const char * name, const char * compare, int dlen)
  1211. +static int
  1212. +isofs_cmp(struct dentry * dentry, const char * compare, int dlen)
  1213.  {
  1214. +    struct qstr qstr;
  1215. +
  1216.      if (!compare)
  1217. -        return 0;
  1218. +        return 1;
  1219.  
  1220.      /* check special "." and ".." files */
  1221.      if (dlen == 1) {
  1222.          /* "." */
  1223.          if (compare[0] == 0) {
  1224. -            if (!len)
  1225. -                return 1;
  1226. +            if (!dentry->d_name.len)
  1227. +                return 0;
  1228.              compare = ".";
  1229.          } else if (compare[0] == 1) {
  1230.              compare = "..";
  1231.              dlen = 2;
  1232.          }
  1233.      }
  1234. -#if 0
  1235. -    if (len <= 2) printk("Match: %d %d %s %d %d \n",len,dlen,compare,de->name[0], dlen);
  1236. -#endif
  1237. -    
  1238. -    if (dlen != len)
  1239. -        return 0;
  1240. -    return !memcmp(name, compare, len);
  1241. +
  1242. +    qstr.name = compare;
  1243. +    qstr.len = dlen;
  1244. +    return dentry->d_op->d_compare(dentry, &dentry->d_name, &qstr);
  1245.  }
  1246.  
  1247.  /*
  1248. @@ -59,8 +57,8 @@
  1249.   * itself (as an inode number). It does NOT read the inode of the
  1250.   * entry - you'll have to do that yourself if you want to.
  1251.   */
  1252. -static struct buffer_head * isofs_find_entry(struct inode * dir,
  1253. -    const char * name, int namelen, unsigned long * ino)
  1254. +static struct buffer_head *
  1255. +isofs_find_entry(struct inode *dir, struct dentry *dentry, unsigned long *ino)
  1256.  {
  1257.      unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
  1258.      unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
  1259. @@ -195,7 +193,7 @@
  1260.              }
  1261.              /* This allows us to match with and without
  1262.               * a trailing period. */
  1263. -            if(dpnt[dlen-1] == '.' && namelen == dlen-1)
  1264. +            if(dpnt[dlen-1] == '.' && dentry->d_name.len == dlen-1)
  1265.                  dlen--;
  1266.          }
  1267.          /*
  1268. @@ -205,7 +203,7 @@
  1269.          if(   !(de->flags[-dir->i_sb->u.isofs_sb.s_high_sierra] & 5)
  1270.             || dir->i_sb->u.isofs_sb.s_unhide == 'y' )
  1271.          {
  1272. -            match = isofs_match(namelen,name,dpnt,dlen);
  1273. +            match = (isofs_cmp(dentry,dpnt,dlen) == 0);
  1274.          }
  1275.          if (match) {
  1276.              if(inode_number == -1) {
  1277. @@ -231,11 +229,10 @@
  1278.  {
  1279.      unsigned long ino;
  1280.      struct buffer_head * bh;
  1281. -    char *lcname;
  1282.      struct inode *inode;
  1283.  
  1284.  #ifdef DEBUG
  1285. -    printk("lookup: %x %d\n",dir->i_ino, dentry->d_name.len);
  1286. +    printk("lookup: %x %s\n",dir->i_ino, dentry->d_name.name);
  1287.  #endif
  1288.      if (!dir)
  1289.          return -ENOENT;
  1290. @@ -243,23 +240,9 @@
  1291.      if (!S_ISDIR(dir->i_mode))
  1292.          return -ENOENT;
  1293.  
  1294. -    /* If mounted with check=relaxed (and most likely norock),
  1295. -     * then first convert this name to lower case.
  1296. -     */
  1297. -    if (dir->i_sb->u.isofs_sb.s_name_check == 'r' &&
  1298. -        (lcname = kmalloc(dentry->d_name.len, GFP_KERNEL)) != NULL) {
  1299. -        int i;
  1300. -        char c;
  1301. -
  1302. -        for (i=0; i<dentry->d_name.len; i++) {
  1303. -            c = dentry->d_name.name[i];
  1304. -            if (c >= 'A' && c <= 'Z') c |= 0x20;
  1305. -            lcname[i] = c;
  1306. -        }
  1307. -        bh = isofs_find_entry(dir, lcname, dentry->d_name.len, &ino);
  1308. -        kfree(lcname);
  1309. -    } else
  1310. -        bh = isofs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &ino);
  1311. +    dentry->d_op = dir->i_sb->s_root->d_op;
  1312. +
  1313. +    bh = isofs_find_entry(dir, dentry, &ino);
  1314.  
  1315.      inode = NULL;
  1316.      if (bh) {
  1317. diff -u --recursive --new-file v2.1.118/linux/fs/nfs/mount_clnt.c linux/fs/nfs/mount_clnt.c
  1318. --- v2.1.118/linux/fs/nfs/mount_clnt.c    Wed Aug 26 11:37:43 1998
  1319. +++ linux/fs/nfs/mount_clnt.c    Wed Aug 26 10:10:33 1998
  1320. @@ -78,6 +78,7 @@
  1321.          clnt->cl_softrtry = 1;
  1322.          clnt->cl_chatty   = 1;
  1323.          clnt->cl_oneshot  = 1;
  1324. +        clnt->cl_intr = 1;
  1325.      }
  1326.      return clnt;
  1327.  }
  1328. diff -u --recursive --new-file v2.1.118/linux/fs/nfs/write.c linux/fs/nfs/write.c
  1329. --- v2.1.118/linux/fs/nfs/write.c    Wed Aug 26 11:37:43 1998
  1330. +++ linux/fs/nfs/write.c    Thu Aug 27 13:17:48 1998
  1331. @@ -56,18 +56,6 @@
  1332.  #include <linux/nfs_fs.h>
  1333.  #include <asm/uaccess.h>
  1334.  
  1335. -/*
  1336. - * NOTE! We must NOT default to soft-mounting: that breaks too many
  1337. - * programs that depend on POSIX behaviour of uninterruptible reads
  1338. - * and writes.
  1339. - *
  1340. - * Until we have a per-mount soft/hard mount policy that we can honour
  1341. - * we must default to hard mounting!
  1342. - *
  1343. - * And yes, this should be "interruptible", not soft.
  1344. - */
  1345. -#define IS_SOFT 0
  1346. -
  1347.  #define NFS_PARANOIA 1
  1348.  #define NFSDBG_FACILITY        NFSDBG_PAGECACHE
  1349.  
  1350. @@ -730,29 +718,21 @@
  1351.  nfs_flush_dirty_pages(struct inode *inode, pid_t pid, off_t offset, off_t len)
  1352.  {
  1353.      struct nfs_wreq *last = NULL;
  1354. -    int result = 0, cancel = 0;
  1355. +    int result = 0;
  1356.  
  1357.      dprintk("NFS:      flush_dirty_pages(%x/%ld for pid %d %ld/%ld)\n",
  1358.          inode->i_dev, inode->i_ino, current->pid, offset, len);
  1359.  
  1360. -    if (IS_SOFT && signalled()) {
  1361. -        nfs_cancel_dirty(inode, pid);
  1362. -        cancel = 1;
  1363. -    }
  1364. -
  1365.      for (;;) {
  1366. -        if (IS_SOFT && signalled()) {
  1367. -            if (!cancel)
  1368. -                nfs_cancel_dirty(inode, pid);
  1369. -            result = -ERESTARTSYS;
  1370. -            break;
  1371. -        }
  1372. -
  1373.          /* Flush all pending writes for the pid and file region */
  1374.          last = nfs_flush_pages(inode, pid, offset, len, 0);
  1375.          if (last == NULL)
  1376.              break;
  1377. -        wait_on_write_request(last);
  1378. +        result = wait_on_write_request(last);
  1379. +        if (result) {
  1380. +            nfs_cancel_dirty(inode,pid);
  1381. +            break;
  1382. +        }
  1383.      }
  1384.  
  1385.      return result;
  1386. diff -u --recursive --new-file v2.1.118/linux/fs/romfs/inode.c linux/fs/romfs/inode.c
  1387. --- v2.1.118/linux/fs/romfs/inode.c    Wed Jun 24 22:54:10 1998
  1388. +++ linux/fs/romfs/inode.c    Wed Aug 26 10:16:25 1998
  1389. @@ -30,17 +30,18 @@
  1390.   *                      correct namelen for statfs
  1391.   *                    spotted by Bill Hawes:
  1392.   *                      readlink shouldn't iput()
  1393. + *    Jun 1998    2.1.106        from Avery Pennarun: glibc scandir()
  1394. + *                      exposed a problem in readdir
  1395. + *            2.1.107        code-freeze spellchecker run
  1396. + *    Aug 1998            2.1.118+ VFS changes
  1397.   */
  1398.  
  1399.  /* todo:
  1400.   *    - see Documentation/filesystems/romfs.txt
  1401. - *    - use malloced memory for file names?
  1402. - *    - quicklist routines from fs/namei.c, get_page is possibly not
  1403. - *      intended to be used now
  1404. + *    - use allocated, not stack memory for file names?
  1405.   *    - considering write access...
  1406.   *    - network (tftp) files?
  1407. - *    - in the ancient times something leaked to made umounts
  1408. - *      impossible, but I've not seen it in the last months
  1409. + *    - merge back some _op tables
  1410.   */
  1411.  
  1412.  /*
  1413. @@ -492,6 +493,7 @@
  1414.      NULL,            /* ioctl */
  1415.      generic_file_mmap,    /* mmap */
  1416.      NULL,            /* open */
  1417. +    NULL,            /* flush */
  1418.      NULL,            /* release */
  1419.      NULL,            /* fsync */
  1420.      NULL,            /* fasync */
  1421. @@ -529,6 +531,7 @@
  1422.      NULL,            /* ioctl */
  1423.      NULL,            /* mmap */
  1424.      NULL,            /* open */
  1425. +    NULL,            /* flush */
  1426.      NULL,            /* release */
  1427.      NULL,            /* fsync */
  1428.      NULL,            /* fasync */
  1429. diff -u --recursive --new-file v2.1.118/linux/fs/smbfs/proc.c linux/fs/smbfs/proc.c
  1430. --- v2.1.118/linux/fs/smbfs/proc.c    Tue Aug 18 22:02:06 1998
  1431. +++ linux/fs/smbfs/proc.c    Thu Aug 27 10:58:23 1998
  1432. @@ -1961,11 +1961,13 @@
  1433.      smb_init_dirent(server, fattr);
  1434.  
  1435.      /*
  1436. -     * Win 95 is painfully slow at returning trans2 getattr info,
  1437. -     * so we provide the SMB_FIX_OLDATTR option switch.
  1438. +     * Select whether to use core or trans2 getattr.
  1439.        */
  1440.      if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2) {
  1441. -        if (server->mnt->version & SMB_FIX_OLDATTR)
  1442. +        /*
  1443. +         * Win 95 appears to break with the trans2 getattr.
  1444. +           */
  1445. +        if (server->mnt->version & (SMB_FIX_OLDATTR|SMB_FIX_WIN95))
  1446.              goto core_attr;
  1447.          if (server->mnt->version & SMB_FIX_DIRATTR)
  1448.              result = smb_proc_getattr_ff(server, dir, fattr);
  1449. diff -u --recursive --new-file v2.1.118/linux/include/asm-i386/hardirq.h linux/include/asm-i386/hardirq.h
  1450. --- v2.1.118/linux/include/asm-i386/hardirq.h    Mon Aug  3 12:45:47 1998
  1451. +++ linux/include/asm-i386/hardirq.h    Wed Aug 26 14:59:12 1998
  1452. @@ -20,7 +20,7 @@
  1453.  #define hardirq_enter(cpu)    (local_irq_count[cpu]++)
  1454.  #define hardirq_exit(cpu)    (local_irq_count[cpu]--)
  1455.  
  1456. -#define synchronize_irq()    do { } while (0)
  1457. +#define synchronize_irq()    barrier()
  1458.  
  1459.  #else
  1460.  
  1461. diff -u --recursive --new-file v2.1.118/linux/include/asm-i386/softirq.h linux/include/asm-i386/softirq.h
  1462. --- v2.1.118/linux/include/asm-i386/softirq.h    Wed Jun 24 22:54:10 1998
  1463. +++ linux/include/asm-i386/softirq.h    Wed Aug 26 15:00:38 1998
  1464. @@ -86,7 +86,7 @@
  1465.  /* These are for the irq's testing the lock */
  1466.  #define softirq_trylock(cpu)    (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
  1467.  #define softirq_endlock(cpu)    (local_bh_count[cpu] = 0)
  1468. -#define synchronize_bh()    do { } while (0)
  1469. +#define synchronize_bh()    barrier()
  1470.  
  1471.  #endif    /* SMP */
  1472.  
  1473. diff -u --recursive --new-file v2.1.118/linux/include/asm-ppc/ide.h linux/include/asm-ppc/ide.h
  1474. --- v2.1.118/linux/include/asm-ppc/ide.h    Thu Aug  6 14:06:33 1998
  1475. +++ linux/include/asm-ppc/ide.h    Thu Aug 27 11:03:56 1998
  1476. @@ -95,8 +95,6 @@
  1477.  static __inline__ ide_ioreg_t ide_default_io_base(int index)
  1478.  {
  1479.          if (_machine == _MACH_Pmac) {
  1480. -        if (!pmac_ide_ports_known)
  1481. -            pmac_ide_probe();
  1482.          return pmac_ide_regbase[index];
  1483.      }
  1484.      if (_machine == _MACH_mbx) return index;
  1485. diff -u --recursive --new-file v2.1.118/linux/include/linux/iso_fs_sb.h linux/include/linux/iso_fs_sb.h
  1486. --- v2.1.118/linux/include/linux/iso_fs_sb.h    Tue Jun 23 10:01:29 1998
  1487. +++ linux/include/linux/iso_fs_sb.h    Wed Aug 26 09:54:41 1998
  1488. @@ -16,7 +16,6 @@
  1489.      unsigned char s_rock;
  1490.      unsigned char s_joliet_level;
  1491.      unsigned char s_utf8;
  1492. -    unsigned char s_name_check; /* r = relaxed, s = strict */
  1493.      unsigned char s_cruft; /* Broken disks with high
  1494.                    byte of length containing
  1495.                    junk */
  1496. diff -u --recursive --new-file v2.1.118/linux/include/linux/smb_fs.h linux/include/linux/smb_fs.h
  1497. --- v2.1.118/linux/include/linux/smb_fs.h    Fri Jul 31 17:10:57 1998
  1498. +++ linux/include/linux/smb_fs.h    Thu Aug 27 13:22:30 1998
  1499. @@ -9,7 +9,6 @@
  1500.  #ifndef _LINUX_SMB_FS_H
  1501.  #define _LINUX_SMB_FS_H
  1502.  
  1503. -#include <linux/dirent.h>
  1504.  #include <linux/smb.h>
  1505.  
  1506.  /*
  1507. diff -u --recursive --new-file v2.1.118/linux/include/linux/smb_mount.h linux/include/linux/smb_mount.h
  1508. --- v2.1.118/linux/include/linux/smb_mount.h    Wed Oct 29 14:49:18 1997
  1509. +++ linux/include/linux/smb_mount.h    Thu Aug 27 10:58:23 1998
  1510. @@ -15,12 +15,11 @@
  1511.  
  1512.  struct smb_mount_data {
  1513.      int version;
  1514. -        uid_t mounted_uid;      /* Who may umount() this filesystem? */
  1515. -
  1516. -        uid_t uid;
  1517. -        gid_t gid;
  1518. -        mode_t file_mode;
  1519. -        mode_t dir_mode;
  1520. +    __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
  1521. +    __kernel_uid_t uid;
  1522. +    __kernel_gid_t gid;
  1523. +    __kernel_mode_t file_mode;
  1524. +    __kernel_mode_t dir_mode;
  1525.  };
  1526.  
  1527.  #endif
  1528. diff -u --recursive --new-file v2.1.118/linux/include/net/sock.h linux/include/net/sock.h
  1529. --- v2.1.118/linux/include/net/sock.h    Fri Jul 31 17:07:32 1998
  1530. +++ linux/include/net/sock.h    Thu Aug 27 13:19:38 1998
  1531. @@ -350,7 +350,7 @@
  1532.      unsigned char        reuse,        /* SO_REUSEADDR setting            */
  1533.                  nonagle;    /* Disable Nagle algorithm?        */
  1534.  
  1535. -    int            sock_readers;    /* User count                */
  1536. +    atomic_t        sock_readers;    /* User count                */
  1537.      int            rcvbuf;        /* Size of receive buffer in bytes    */
  1538.  
  1539.      struct wait_queue    **sleep;    /* Sock wait queue            */
  1540. @@ -643,42 +643,20 @@
  1541.  #if 0
  1542.  /* debugging code: the test isn't even 100% correct, but it can catch bugs */
  1543.  /* Note that a double lock is ok in theory - it's just _usually_ a bug */
  1544. -    if (sk->sock_readers) {
  1545. +    if (atomic_read(&sk->sock_readers)) {
  1546.          __label__ here;
  1547.          printk("double lock on socket at %p\n", &&here);
  1548.  here:
  1549.      }
  1550.  #endif
  1551. -#ifdef __SMP__
  1552. -    /*
  1553. -     * This is a very broken bottom half synchronization mechanism.
  1554. -     * You don't want to know..
  1555. -     */
  1556. -    { unsigned long flags;
  1557. -    save_flags(flags);
  1558. -    cli();
  1559. -    sk->sock_readers++;
  1560. -    restore_flags(flags);
  1561. -    }
  1562. -#else
  1563. -    sk->sock_readers++;
  1564. -    barrier();
  1565. -#endif
  1566. +    atomic_inc(&sk->sock_readers);
  1567. +    synchronize_bh();
  1568.  }
  1569.  
  1570.  static inline void release_sock(struct sock *sk)
  1571.  {
  1572.      barrier();
  1573. -#if 0
  1574. -/* debugging code: remove me when ok */
  1575. -    if (sk->sock_readers == 0) {
  1576. -        __label__ here;
  1577. -        sk->sock_readers = 1;
  1578. -        printk("trying to unlock unlocked socket at %p\n", &&here);
  1579. -here:
  1580. -    }
  1581. -#endif
  1582. -    if ((sk->sock_readers = sk->sock_readers-1) == 0)
  1583. +    if (atomic_dec_and_test(&sk->sock_readers))
  1584.          __release_sock(sk);
  1585.  }
  1586.  
  1587. diff -u --recursive --new-file v2.1.118/linux/kernel/sched.c linux/kernel/sched.c
  1588. --- v2.1.118/linux/kernel/sched.c    Wed Aug 26 11:37:45 1998
  1589. +++ linux/kernel/sched.c    Wed Aug 26 15:06:00 1998
  1590. @@ -430,9 +430,6 @@
  1591.      ret = detach_timer(timer);
  1592.      timer->next = timer->prev = 0;
  1593.      spin_unlock_irqrestore(&timerlist_lock, flags);
  1594. -
  1595. -    /* Make sure the timer isn't running in parallell.. */
  1596. -    synchronize_bh();
  1597.      return ret;
  1598.  }
  1599.  
  1600. diff -u --recursive --new-file v2.1.118/linux/mm/swapfile.c linux/mm/swapfile.c
  1601. --- v2.1.118/linux/mm/swapfile.c    Wed Aug 26 11:37:45 1998
  1602. +++ linux/mm/swapfile.c    Wed Aug 26 16:01:57 1998
  1603. @@ -489,7 +489,7 @@
  1604.      int swap_header_version;
  1605.      int lock_map_size = PAGE_SIZE;
  1606.      int nr_good_pages = 0;
  1607. -    char tmp_lock_map = 0;
  1608. +    unsigned long tmp_lock_map = 0;
  1609.      
  1610.      lock_kernel();
  1611.      if (!capable(CAP_SYS_ADMIN))
  1612. @@ -558,9 +558,9 @@
  1613.          goto bad_swap;
  1614.      }
  1615.  
  1616. -    p->swap_lockmap = &tmp_lock_map;
  1617. +    p->swap_lockmap = (char *) &tmp_lock_map;
  1618.      rw_swap_page_nocache(READ, SWP_ENTRY(type,0), (char *) swap_header);
  1619. -    p->swap_lockmap = 0;
  1620. +    p->swap_lockmap = NULL;
  1621.  
  1622.      if (!memcmp("SWAP-SPACE",swap_header->magic.magic,10))
  1623.          swap_header_version = 1;
  1624. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/raw.c linux/net/ipv4/raw.c
  1625. --- v2.1.118/linux/net/ipv4/raw.c    Thu May 14 19:47:44 1998
  1626. +++ linux/net/ipv4/raw.c    Wed Aug 26 15:53:08 1998
  1627. @@ -152,7 +152,7 @@
  1628.      int type = skb->h.icmph->type;
  1629.      int code = skb->h.icmph->code;
  1630.  
  1631. -    if (sk->ip_recverr && !sk->sock_readers) {
  1632. +    if (sk->ip_recverr && !atomic_read(&sk->sock_readers)) {
  1633.          struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
  1634.          if (skb2 && sock_queue_err_skb(sk, skb2))
  1635.              kfree_skb(skb);
  1636. @@ -194,7 +194,7 @@
  1637.      
  1638.      skb->h.raw = skb->nh.raw;
  1639.  
  1640. -    if (sk->sock_readers) {
  1641. +    if (atomic_read(&sk->sock_readers)) {
  1642.          __skb_queue_tail(&sk->back_log, skb);
  1643.          return 0;
  1644.      }
  1645. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
  1646. --- v2.1.118/linux/net/ipv4/tcp.c    Tue Jul 28 14:21:10 1998
  1647. +++ linux/net/ipv4/tcp.c    Wed Aug 26 15:53:35 1998
  1648. @@ -707,7 +707,7 @@
  1649.      int copied  = 0;
  1650.  
  1651.      /* Verify that the socket is locked */
  1652. -    if (!sk->sock_readers)
  1653. +    if (!atomic_read(&sk->sock_readers))
  1654.          printk("tcp_do_sendmsg: socket not locked!\n");
  1655.  
  1656.      /* Wait for a connection to finish. */
  1657. @@ -1389,7 +1389,7 @@
  1658.       * Check whether the socket is locked ... supposedly
  1659.       * it's impossible to tcp_close() a locked socket.
  1660.       */
  1661. -    if (sk->sock_readers)
  1662. +    if (atomic_read(&sk->sock_readers))
  1663.          printk("tcp_close: socket already locked!\n");
  1664.  
  1665.      /* We need to grab some memory, and put together a FIN,
  1666. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
  1667. --- v2.1.118/linux/net/ipv4/tcp_ipv4.c    Mon Aug  3 12:45:48 1998
  1668. +++ linux/net/ipv4/tcp_ipv4.c    Wed Aug 26 15:52:37 1998
  1669. @@ -720,7 +720,7 @@
  1670.               * dropped. This is the new "fast" path mtu
  1671.               * discovery.
  1672.               */
  1673. -            if (!sk->sock_readers) {
  1674. +            if (!atomic_read(&sk->sock_readers)) {
  1675.                  lock_sock(sk); 
  1676.                  tcp_simple_retransmit(sk);
  1677.                  release_sock(sk);
  1678. @@ -813,7 +813,7 @@
  1679.          /* Prevent race conditions with accept() - 
  1680.           * ICMP is unreliable. 
  1681.           */
  1682. -        if (sk->sock_readers) {
  1683. +        if (atomic_read(&sk->sock_readers)) {
  1684.              /* XXX: add a counter here to profile this. 
  1685.               * If too many ICMPs get dropped on busy
  1686.               * servers this needs to be solved differently.
  1687. @@ -1175,7 +1175,7 @@
  1688.          /* Clone the TCP header template */
  1689.          newsk->dport = req->rmt_port;
  1690.  
  1691. -        newsk->sock_readers = 0;
  1692. +        atomic_set(&newsk->sock_readers, 0);
  1693.          atomic_set(&newsk->rmem_alloc, 0);
  1694.          skb_queue_head_init(&newsk->receive_queue);
  1695.          atomic_set(&newsk->wmem_alloc, 0);
  1696. @@ -1543,7 +1543,7 @@
  1697.  
  1698.      if (sk->state == TCP_TIME_WAIT)
  1699.          goto do_time_wait;
  1700. -    if (!sk->sock_readers)
  1701. +    if (!atomic_read(&sk->sock_readers))
  1702.          return tcp_v4_do_rcv(sk, skb);
  1703.  
  1704.      __skb_queue_tail(&sk->back_log, skb);
  1705. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
  1706. --- v2.1.118/linux/net/ipv4/tcp_timer.c    Thu May  7 22:51:56 1998
  1707. +++ linux/net/ipv4/tcp_timer.c    Wed Aug 26 15:54:19 1998
  1708. @@ -182,7 +182,7 @@
  1709.      if(sk->zapped) 
  1710.          return;
  1711.      
  1712. -    if (sk->sock_readers) {
  1713. +    if (atomic_read(&sk->sock_readers)) {
  1714.          /* Try again in second. */
  1715.          tcp_reset_xmit_timer(sk, TIME_PROBE0, HZ);
  1716.          return;
  1717. @@ -432,7 +432,7 @@
  1718.          return;
  1719.      }
  1720.  
  1721. -    if (sk->sock_readers) {
  1722. +    if (atomic_read(&sk->sock_readers)) {
  1723.          /* Try again in a second. */
  1724.          tcp_reset_xmit_timer(sk, TIME_RETRANS, HZ);
  1725.          return;
  1726. @@ -518,7 +518,7 @@
  1727.              struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
  1728.              
  1729.              /* TCP_LISTEN is implied. */
  1730. -            if (!sk->sock_readers && tp->syn_wait_queue) {
  1731. +            if (!atomic_read(&sk->sock_readers) && tp->syn_wait_queue) {
  1732.                  struct open_request *prev = (struct open_request *)(&tp->syn_wait_queue);
  1733.                  struct open_request *req = tp->syn_wait_queue;
  1734.                  do {
  1735. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/timer.c linux/net/ipv4/timer.c
  1736. --- v2.1.118/linux/net/ipv4/timer.c    Thu Mar 26 15:57:13 1998
  1737. +++ linux/net/ipv4/timer.c    Wed Aug 26 15:54:33 1998
  1738. @@ -73,7 +73,7 @@
  1739.      int why = sk->timeout;
  1740.  
  1741.      /* Only process if socket is not in use. */
  1742. -    if (sk->sock_readers) {
  1743. +    if (atomic_read(&sk->sock_readers)) {
  1744.          sk->timer.expires = jiffies+HZ;
  1745.          add_timer(&sk->timer);
  1746.          return;
  1747. diff -u --recursive --new-file v2.1.118/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
  1748. --- v2.1.118/linux/net/ipv4/udp.c    Tue Jun 23 10:01:31 1998
  1749. +++ linux/net/ipv4/udp.c    Wed Aug 26 15:54:54 1998
  1750. @@ -493,7 +493,7 @@
  1751.                return;    /* No socket for error */
  1752.      }
  1753.  
  1754. -    if (sk->ip_recverr && !sk->sock_readers) {
  1755. +    if (sk->ip_recverr && !atomic_read(&sk->sock_readers)) {
  1756.          struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
  1757.          if (skb2 && sock_queue_err_skb(sk, skb2))
  1758.              kfree_skb(skb2);
  1759. @@ -1026,7 +1026,7 @@
  1760.  
  1761.  static inline void udp_deliver(struct sock *sk, struct sk_buff *skb)
  1762.  {
  1763. -    if (sk->sock_readers) {
  1764. +    if (atomic_read(&sk->sock_readers)) {
  1765.          __skb_queue_tail(&sk->back_log, skb);
  1766.          return;
  1767.      }
  1768. diff -u --recursive --new-file v2.1.118/linux/net/ipv6/raw.c linux/net/ipv6/raw.c
  1769. --- v2.1.118/linux/net/ipv6/raw.c    Tue Jul 28 14:21:10 1998
  1770. +++ linux/net/ipv6/raw.c    Wed Aug 26 15:55:32 1998
  1771. @@ -220,7 +220,7 @@
  1772.      if (sk->ip_hdrincl)
  1773.          skb->h.raw = skb->nh.raw;
  1774.  
  1775. -    if (sk->sock_readers) {
  1776. +    if (atomic_read(&sk->sock_readers)) {
  1777.          __skb_queue_tail(&sk->back_log, skb);
  1778.          return 0;
  1779.      }
  1780. diff -u --recursive --new-file v2.1.118/linux/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c
  1781. --- v2.1.118/linux/net/ipv6/tcp_ipv6.c    Tue Jun 23 10:01:31 1998
  1782. +++ linux/net/ipv6/tcp_ipv6.c    Wed Aug 26 15:56:01 1998
  1783. @@ -617,7 +617,7 @@
  1784.               */
  1785.              sk->mtu = sk->dst_cache->pmtu;
  1786.          }
  1787. -        if (sk->sock_readers) { /* remove later */
  1788. +        if (atomic_read(&sk->sock_readers)) { /* remove later */
  1789.              printk(KERN_DEBUG "tcp_v6_err: pmtu disc: socket locked.\n");
  1790.              return;
  1791.          }
  1792. @@ -631,7 +631,7 @@
  1793.          struct open_request *req, *prev;
  1794.          struct ipv6hdr hd;
  1795.      case TCP_LISTEN:
  1796. -        if (sk->sock_readers)
  1797. +        if (atomic_read(&sk->sock_readers))
  1798.              return;
  1799.  
  1800.          /* Grrrr - fix this later. */
  1801. @@ -1178,7 +1178,7 @@
  1802.      if(sk->state == TCP_TIME_WAIT)
  1803.          goto do_time_wait;
  1804.  
  1805. -    if (!sk->sock_readers)
  1806. +    if (!atomic_read(&sk->sock_readers))
  1807.          return tcp_v6_do_rcv(sk, skb);
  1808.  
  1809.      __skb_queue_tail(&sk->back_log, skb);
  1810. diff -u --recursive --new-file v2.1.118/linux/net/ipv6/udp.c linux/net/ipv6/udp.c
  1811. --- v2.1.118/linux/net/ipv6/udp.c    Tue Jul 28 14:21:10 1998
  1812. +++ linux/net/ipv6/udp.c    Wed Aug 26 15:56:19 1998
  1813. @@ -569,7 +569,7 @@
  1814.  
  1815.      /* deliver */
  1816.  
  1817. -    if (sk->sock_readers)
  1818. +    if (atomic_read(&sk->sock_readers))
  1819.          __skb_queue_tail(&sk->back_log, skb);
  1820.      else
  1821.          udpv6_queue_rcv_skb(sk, skb);
  1822. diff -u --recursive --new-file v2.1.118/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
  1823. --- v2.1.118/linux/net/unix/af_unix.c    Tue Jun 23 10:01:31 1998
  1824. +++ linux/net/unix/af_unix.c    Wed Aug 26 16:03:02 1998
  1825. @@ -125,17 +125,17 @@
  1826.  
  1827.  extern __inline__ void unix_lock(unix_socket *sk)
  1828.  {
  1829. -    sk->sock_readers++;
  1830. +    atomic_inc(&sk->sock_readers);
  1831.  }
  1832.  
  1833.  extern __inline__ int unix_unlock(unix_socket *sk)
  1834.  {
  1835. -    return --sk->sock_readers;
  1836. +    return atomic_dec_and_test(&sk->sock_readers);
  1837.  }
  1838.  
  1839.  extern __inline__ int unix_locked(unix_socket *sk)
  1840.  {
  1841. -    return sk->sock_readers;
  1842. +    return atomic_read(&sk->sock_readers);
  1843.  }
  1844.  
  1845.  extern __inline__ void unix_release_addr(struct unix_address *addr)
  1846. @@ -338,7 +338,7 @@
  1847.          sk->protinfo.af_unix.dentry=NULL;
  1848.      }
  1849.      
  1850. -    if(!unix_unlock(sk) && atomic_read(&sk->wmem_alloc) == 0)
  1851. +    if(unix_unlock(sk) && atomic_read(&sk->wmem_alloc) == 0)
  1852.      {
  1853.          sk_free(sk);
  1854.          unix_remove_socket(sk);
  1855. @@ -418,7 +418,7 @@
  1856.      sk->destruct = unix_destruct_addr;
  1857.      sk->protinfo.af_unix.family=PF_UNIX;
  1858.      sk->protinfo.af_unix.dentry=NULL;
  1859. -    sk->sock_readers=1;            /* Us */
  1860. +    atomic_set(&sk->sock_readers, 1);    /* Us */
  1861.      sk->protinfo.af_unix.readsem=MUTEX;    /* single task reading lock */
  1862.      sk->mtu=4096;
  1863.      sk->protinfo.af_unix.list=&unix_sockets_unbound;
  1864. @@ -1411,7 +1411,7 @@
  1865.      {
  1866.          len+=sprintf(buffer+len,"%p: %08X %08X %08lX %04X %02X %5ld",
  1867.              s,
  1868. -            s->sock_readers,
  1869. +            atomic_read(&s->sock_readers),
  1870.              0,
  1871.              s->socket ? s->socket->flags : 0,
  1872.              s->type,
  1873.