]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.25pre2 2.3.25pre2
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:28:10 +0000 (15:28 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:28:10 +0000 (15:28 -0500)
79 files changed:
CREDITS
Documentation/Configure.help
Makefile
arch/arm/mm/mm-ebsa110.c
arch/arm/mm/mm-footbridge.c
arch/arm/mm/mm-nexuspci.c
arch/arm/mm/mm-tbox.c
arch/i386/kernel/entry.S
drivers/block/ll_rw_blk.c
drivers/char/Config.in
drivers/char/Makefile
drivers/char/nvram.c
drivers/char/ppdev.c
drivers/char/radio-typhoon.c
drivers/net/3c507.c
drivers/net/ac3200.c
drivers/net/es3210.c
drivers/net/ewrk3.c
drivers/net/hp-plus.c
drivers/net/lne390.c
drivers/net/ne3210.c
drivers/net/sk_mca.c
drivers/net/smc-ultra.c
drivers/net/smc-ultra32.c
drivers/net/wd.c
drivers/parport/parport_pc.c
drivers/pci/devlist.h
drivers/pci/helper.c
drivers/sbus/char/flash.c
drivers/scsi/53c8xx_d.h
drivers/scsi/sim710_d.h
fs/bfs/bfs_defs.h
fs/bfs/dir.c
fs/bfs/inode.c
fs/binfmt_elf.c
fs/binfmt_em86.c
fs/buffer.c
fs/coda/file.c
fs/fat/file.c
fs/inode.c
fs/ncpfs/dir.c
fs/ncpfs/file.c
fs/ncpfs/inode.c
fs/ncpfs/ioctl.c
fs/ncpfs/mmap.c
fs/ncpfs/ncplib_kernel.c
fs/ncpfs/ncplib_kernel.h
fs/ncpfs/sock.c
fs/ncpfs/symlink.c
fs/nfs/read.c
fs/nfs/write.c
fs/proc/proc_misc.c
fs/smbfs/file.c
include/asm-i386/io.h
include/asm-i386/mmx.h
include/asm-i386/unistd.h
include/linux/bfs_fs_sb.h
include/linux/mm.h
include/linux/ncp_fs.h
include/linux/nvram.h
include/linux/pagemap.h
include/linux/pci.h
include/linux/pci_ids.h
include/linux/shm.h
ipc/shm.c
ipc/util.c
kernel/exec_domain.c
kernel/sys.c
kernel/sysctl.c
mm/filemap.c
mm/highmem.c
mm/mprotect.c
mm/mremap.c
mm/page_io.c
mm/swap_state.c
mm/swapfile.c
mm/vmscan.c
net/ipv4/route.c
net/packet/af_packet.c

diff --git a/CREDITS b/CREDITS
index ca6a4c41eb0ee55c61a456ece64d4808643e3783..749f212bdd31bf5202c253929a02ea36709bd9e8 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -2213,9 +2213,10 @@ S: The Netherlands
 N: Tim Waugh
 E: tim@cyberelk.demon.co.uk
 D: Co-architect of the parallel-port sharing system
-S: 4 Fox Close
-S: Bishopstoke
-S: SO50 8NB
+S: 34 Bladon Close
+S: GUILDFORD
+S: Surrey
+S: GU1 1TY
 S: United Kingdom
 
 N: Juergen Weigert
index 375c4c5d477bc9cad92cfc71c1daa9181f99c2b1..0f4f84c9d5b8865c70b6da7366708a23231149cb 100644 (file)
@@ -13049,7 +13049,7 @@ CONFIG_KHTTPD
 # LocalWords:  EBSA chattr RiscOS Winmodem AGP Atomwide DUALSP pcsp robinson CT
 # LocalWords:  SGALAXY Waverider DSPxxx TRXPRO AudioTrix OSWF MOT CFB DSY kbps
 # LocalWords:  tuwien kkudielk LVD mega lun MAXTAGS Gbps arcnet Olicom SKTR SNA
-# LocalWords:  SysKonnect sktr sna etherboot ufs NetBEUI MultiSound MSNDCLAS GX
+# LocalWords:  SysKonnect tms380tr sna etherboot ufs NetBEUI MultiSound MSNDCLAS GX
 # LocalWords:  MSNDINIT MSNDPERM MSNDPIN PNDSPINI PNDSPERM Ensoniq's RetinaZ SS
 # LocalWords:  AudioPCI lspci SonicVibes sonicvibes SPARCs roadrunner CLgen UPA
 # LocalWords:  swansea shtml Zoltrix zoltrix BINUTILS EGCS binutils VIDC DACs
index 5dfefbe30ec5ad5725f69c01fa01758bc5f599eb..ea646a627d90b3e169101d36139ff50e75f10f7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -250,9 +250,6 @@ vmlinux: $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
 symlinks:
        rm -f include/asm
        ( cd include ; ln -sf asm-$(ARCH) asm)
-       @if [ ! -d modules ]; then \
-               mkdir modules; \
-       fi
        @if [ ! -d include/linux/modules ]; then \
                mkdir include/linux/modules; \
        fi
@@ -331,7 +328,11 @@ endif
 
 modules: $(patsubst %, _mod_%, $(SUBDIRS))
 
-$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
+modules/MARKER:
+       mkdir modules
+       touch modules/MARKER
+
+$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER modules/MARKER
        $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
 
 modules_install:
index 5e31deb59a748722ca1dc7ac035bda095c73bc2e..a1172b1f10a58bafa97dd0de1704429e2a5b7412 100644 (file)
 
 #include "map.h"
  
+#define SIZE(x) (sizeof(x) / sizeof(x[0]))
+
 const struct map_desc io_desc[] __initdata = {
        { IO_BASE - PGDIR_SIZE, 0xc0000000, PGDIR_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
        { IO_BASE             , IO_START  , IO_SIZE   , DOMAIN_IO, 0, 1, 0, 0 }
 };
 
-#define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
-
-unsigned int __initdata io_desc_size = SIZEOFMAP;
+unsigned int __initdata io_desc_size = SIZE(io_desc);
index 304ee68c2791c3f0a46c2613934156b100a8434a..b67cdec330167d657454b7c3875bda0d6267757a 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "map.h"
 
+#define SIZE(x) (sizeof(x) / sizeof(x[0]))
+
 /*
  * The first entry allows us to fiddle with the EEPROM from user-space.
  *  This entry will go away in time, once the fmu32 can mmap() the
@@ -93,7 +95,5 @@ struct map_desc io_desc[] __initdata = {
        MAPPING
 };
 
-#define SIZE(x) (sizeof(x) / sizeof(x[0]))
-
 unsigned int __initdata io_desc_size = SIZE(io_desc);
 
index 3bec2581d2d690029f9e7e98ec633d7398757bca..5b66faa51855d3e113773ce84ea12f881523ad3f 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "map.h"
  
+#define SIZE(x) (sizeof(x) / sizeof(x[0]))
+
 const struct map_desc io_desc[] __initdata = {
        { 0xfff00000, 0x10000000, 0x00001000, DOMAIN_IO, 0, 1, 0, 0 },
        { 0xffe00000, 0x20000000, 0x00001000, DOMAIN_IO, 0, 1, 0, 0 },
@@ -26,6 +28,4 @@ const struct map_desc io_desc[] __initdata = {
        { 0xfd000000, 0x88000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }
 };
 
-#define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
-
-unsigned int __initdata io_desc_size = SIZEOFMAP;
+unsigned int __initdata io_desc_size = SIZE(io_desc);
index 095509b3ddd922660a0a8624b5c765a5e92064c8..78250336efc8d30a25b4e043978cdd7b5b982d28 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "map.h"
  
+#define SIZE(x) (sizeof(x) / sizeof(x[0]))
+
 /*    Logical    Physical
  * 0xffff1000  0x00100000      DMA registers
  * 0xffff2000  0x00200000      MPEG
@@ -54,6 +56,4 @@ const struct map_desc io_desc[] __initdata = {
        { 0xffffe000, 0x00e00000, 0x00001000, DOMAIN_IO, 0, 1, 0, 0 }
 };
 
-#define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
-
-unsigned int __initdata io_desc_size = SIZEOFMAP;
+unsigned int __initdata io_desc_size = SIZE(io_desc);
index c0cb65324b7554462a30acd7392e7126fa636001..59e4207498fb6e2a98bcbce4c76d8a6cf97ade62 100644 (file)
@@ -476,7 +476,7 @@ ENTRY(sys_call_table)
        .long SYMBOL_NAME(sys_sigpending)
        .long SYMBOL_NAME(sys_sethostname)
        .long SYMBOL_NAME(sys_setrlimit)        /* 75 */
-       .long SYMBOL_NAME(sys_getrlimit)
+       .long SYMBOL_NAME(sys_old_getrlimit)
        .long SYMBOL_NAME(sys_getrusage)
        .long SYMBOL_NAME(sys_gettimeofday)
        .long SYMBOL_NAME(sys_settimeofday)
@@ -591,6 +591,7 @@ ENTRY(sys_call_table)
        .long SYMBOL_NAME(sys_ni_syscall)               /* streams1 */
        .long SYMBOL_NAME(sys_ni_syscall)               /* streams2 */
        .long SYMBOL_NAME(sys_vfork)            /* 190 */
+       .long SYMBOL_NAME(sys_getrlimit)
 
        /*
         * NOTE!! This doesn't have to be exact - we just have
@@ -598,6 +599,6 @@ ENTRY(sys_call_table)
         * entries. Don't panic if you notice that this hasn't
         * been shrunk every time we add a new system call.
         */
-       .rept NR_syscalls-190
+       .rept NR_syscalls-191
                .long SYMBOL_NAME(sys_ni_syscall)
        .endr
index 7a14aa650692c067a83205ecc4f5f09276a18ff5..47704a6746da03c5cda673fa30c43cca5666d03c 100644 (file)
@@ -388,9 +388,12 @@ out:
 /*
  * Has to be called with the request spinlock aquired
  */
-static inline void attempt_merge (struct request *req, int max_sectors)
+static inline void attempt_merge (struct request *req,
+                               int max_sectors,
+                               int max_segments)
 {
        struct request *next = req->next;
+       int total_segments;
 
        if (!next)
                return;
@@ -398,9 +401,15 @@ static inline void attempt_merge (struct request *req, int max_sectors)
                return;
        if (next->sem || req->cmd != next->cmd || req->rq_dev != next->rq_dev || req->nr_sectors + next->nr_sectors > max_sectors)
                return;
+       total_segments = req->nr_segments + next->nr_segments;
+       if (req->bhtail->b_data + req->bhtail->b_size == next->bh->b_data)
+               total_segments--;
+       if (total_segments > max_segments)
+               return;
        req->bhtail->b_reqnext = next->bh;
        req->bhtail = next->bhtail;
        req->nr_sectors += next->nr_sectors;
+       req->nr_segments = total_segments;
        next->rq_status = RQ_INACTIVE;
        req->next = next->next;
        wake_up (&wait_for_request);
@@ -410,7 +419,7 @@ void make_request(int major,int rw, struct buffer_head * bh)
 {
        unsigned int sector, count;
        struct request * req;
-       int rw_ahead, max_req, max_sectors;
+       int rw_ahead, max_req, max_sectors, max_segments;
        unsigned long flags;
 
        count = bh->b_size >> 9;
@@ -493,6 +502,7 @@ void make_request(int major,int rw, struct buffer_head * bh)
         * Try to coalesce the new request with old requests
         */
        max_sectors = get_max_sectors(bh->b_rdev);
+       max_segments = get_max_segments(bh->b_rdev);
 
        /*
         * Now we acquire the request spinlock, we have to be mega careful
@@ -572,14 +582,26 @@ void make_request(int major,int rw, struct buffer_head * bh)
                                continue;
                        /* Can we add it to the end of this request? */
                        if (req->sector + req->nr_sectors == sector) {
+                               if (req->bhtail->b_data + req->bhtail->b_size
+                                   != bh->b_data) {
+                                       if (req->nr_segments < max_segments)
+                                               req->nr_segments++;
+                                       else continue;
+                               }
                                req->bhtail->b_reqnext = bh;
                                req->bhtail = bh;
                                req->nr_sectors += count;
                                drive_stat_acct(req, count, 0);
                                /* Can we now merge this req with the next? */
-                               attempt_merge(req, max_sectors);
+                               attempt_merge(req, max_sectors, max_segments);
                        /* or to the beginning? */
                        } else if (req->sector - count == sector) {
+                               if (bh->b_data + bh->b_size
+                                   != req->bh->b_data) {
+                                       if (req->nr_segments < max_segments)
+                                               req->nr_segments++;
+                                       else continue;
+                               }
                                bh->b_reqnext = req->bh;
                                req->bh = bh;
                                req->buffer = bh->b_data;
@@ -613,6 +635,7 @@ void make_request(int major,int rw, struct buffer_head * bh)
        req->errors = 0;
        req->sector = sector;
        req->nr_sectors = count;
+       req->nr_segments = 1;
        req->current_nr_sectors = count;
        req->buffer = bh->b_data;
        req->sem = NULL;
index a81cc8b586a500d614ac55cc91cbc4097009780a..33ac64891f163475e8c502d55a683bfc4a237669 100644 (file)
@@ -148,6 +148,10 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
   if [ "$CONFIG_RADIO_TERRATEC" = "y" ]; then
     hex '  Terratec i/o port (normally 0x590)' CONFIG_RADIO_TERRATEC_PORT 590
   fi
+  dep_tristate 'Trust FM radio card' CONFIG_RADIO_TRUST $CONFIG_VIDEO_DEV
+  if [ "$CONFIG_RADIO_TRUST" = "y" ]; then
+    hex '  Trust i/o port (usually 0x350 or 0x358)' CONFIG_RADIO_TRUST_PORT 350
+  fi
   if [ "$CONFIG_PCI" != "n" ]; then
     dep_tristate 'BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
   fi
index c3a8239f6749932c78b99d792d943fbb0cfcff04..c6145ceb52929d20a963ee902b593e2ffdd3c28b 100644 (file)
@@ -261,7 +261,7 @@ O_OBJS += softdog.o
 else
   ifeq ($(CONFIG_SOFT_WATCHDOG),m)
   M_OBJS += softdog.o
-  endif   
+  endif
 endif
 
 ifeq ($(CONFIG_PCWATCHDOG),y)
@@ -452,7 +452,15 @@ else
   ifeq ($(CONFIG_RADIO_AZTECH),m)
   M_OBJS += radio-aztech.o
   endif
-endif                                             
+endif
+
+ifeq ($(CONFIG_RADIO_RTRACK2),y)
+O_OBJS += radio-rtrack2.o
+else
+  ifeq ($(CONFIG_RADIO_RTRACK2),m)
+  M_OBJS += radio-rtrack2.o
+  endif
+endif
 
 ifeq ($(CONFIG_RADIO_SF16FMI),y)
 O_OBJS += radio-sf16fmi.o
@@ -460,23 +468,15 @@ else
   ifeq ($(CONFIG_RADIO_SF16FMI),m)
   M_OBJS += radio-sf16fmi.o
   endif
-endif                                             
-
-ifeq ($(CONFIG_RADIO_RTRACK),y)
-O_OBJS += radio-aimslab.o
-else
-  ifeq ($(CONFIG_RADIO_RTRACK),m)
-  M_OBJS += radio-aimslab.o
-  endif
-endif                                             
+endif
 
-ifeq ($(CONFIG_RADIO_RTRACK2),y)
-O_OBJS += radio-rtrack2.o
+ifeq ($(CONFIG_RADIO_CADET),y)
+O_OBJS += radio-cadet.o
 else
-  ifeq ($(CONFIG_RADIO_RTRACK2),m)
-  M_OBJS += radio-rtrack2.o
+  ifeq ($(CONFIG_RADIO_CADET),m)
+  M_OBJS += radio-cadet.o
   endif
-endif                                             
+endif
 
 ifeq ($(CONFIG_RADIO_TYPHOON),y)
 O_OBJS += radio-typhoon.o
@@ -484,7 +484,23 @@ else
   ifeq ($(CONFIG_RADIO_TYPHOON),m)
   M_OBJS += radio-typhoon.o
   endif
-endif                                             
+endif
+
+ifeq ($(CONFIG_RADIO_TERRATEC),y)
+O_OBJS += radio-terratec.o
+else
+  ifeq ($(CONFIG_RADIO_TERRATEC),m)
+  M_OBJS += radio-terratec.o
+  endif
+endif
+
+ifeq ($(CONFIG_RADIO_RTRACK),y)
+O_OBJS += radio-aimslab.o
+else
+  ifeq ($(CONFIG_RADIO_RTRACK),m)
+  M_OBJS += radio-aimslab.o
+  endif
+endif
 
 ifeq ($(CONFIG_RADIO_ZOLTRIX),y)
 O_OBJS += radio-zoltrix.o
@@ -492,15 +508,7 @@ else
   ifeq ($(CONFIG_RADIO_ZOLTRIX),m)
   M_OBJS += radio-zoltrix.o
   endif
-endif                                             
-
-ifeq ($(CONFIG_RADIO_CADET),y)
-O_OBJS += radio-cadet.o
-else
-  ifeq ($(CONFIG_RADIO_CADET),m)
-  M_OBJS += radio-cadet.o
-  endif
-endif                                             
+endif
 
 ifeq ($(CONFIG_RADIO_MIROPCM20),y)
 O_OBJS += radio-miropcm20.o
@@ -516,13 +524,13 @@ else
   ifeq ($(CONFIG_RADIO_GEMTEK),m)
   M_OBJS += radio-gemtek.o
   endif
-endif                                             
+endif
 
-ifeq ($(CONFIG_RADIO_TERRATEC),y)
-O_OBJS += radio-terratec.o
+ifeq ($(CONFIG_RADIO_TRUST),y)
+O_OBJS += radio-trust.o
 else
-  ifeq ($(CONFIG_RADIO_TERRATEC),m)
-  M_OBJS += radio-terratec.o
+  ifeq ($(CONFIG_RADIO_TRUST),m)
+  M_OBJS += radio-trust.o
   endif
 endif
 
index 9ac9908723f4b9c28c16ca31b1529928741f1b9d..60ee17688363bf7e4235d19c57423d61d8b13d1e 100644 (file)
@@ -349,10 +349,9 @@ static int nvram_release( struct inode *inode, struct file *file )
 }
 
 
-#ifdef CONFIG_PROC_FS
+#ifndef CONFIG_PROC_FS
 static int nvram_read_proc( char *buffer, char **start, off_t offset,
-                                                       int size, int *eof,
-                                                       void *data) {}
+                           int size, int *eof, void *data) { return 0; }
 #else
 
 static int nvram_read_proc( char *buffer, char **start, off_t offset,
index d73f128d87c318ed001e667e8cff3c3b1b88dbbe..5935ea1227137a842700986204eb9c892cd2fbc5 100644 (file)
@@ -509,6 +509,7 @@ static int pp_open (struct inode * inode, struct file * file)
        if (!pp)
                return -ENOMEM;
 
+       memset (pp, 0, sizeof (struct pp_struct));
        pp->state.mode = IEEE1284_MODE_COMPAT;
        pp->state.phase = init_phase (pp->state.mode);
        pp->flags = 0;
index 4e5993add4e22e8159ee258245702ef85f7e97e2..7f546a12d545109f4805784a122d929b9c88fc0b 100644 (file)
@@ -72,8 +72,8 @@ static int typhoon_ioctl(struct video_device *dev, unsigned int cmd, void *arg);
 static int typhoon_open(struct video_device *dev, int flags);
 static void typhoon_close(struct video_device *dev);
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
-static int typhoon_read_proc(char *buf, char **start, off_t offset, int len,
-                            int unused);
+static int typhoon_get_info(char *buf, char **start, off_t offset, int len,
+                           int unused);
 #endif
 
 static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
@@ -299,8 +299,8 @@ static struct video_device typhoon_radio =
 
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
 
-static int typhoon_read_proc(char *buf, char **start, off_t offset, int len,
-                     int unused)
+static int typhoon_get_info(char *buf, char **start, off_t offset, int len,
+                           int unused)
 {
        #ifdef MODULE
            #define MODULEPROCSTRING "Driver loaded as a module"
@@ -386,8 +386,8 @@ static int __init typhoon_init(void)
        typhoon_mute(&typhoon_unit);
 
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
-       if (!create_proc_read_entry("driver/radio-typhoon", 0, NULL,
-                                       typhoon_read_proc, NULL)) 
+       if (!create_proc_info_entry("driver/radio-typhoon", 0, NULL,
+                                   typhoon_get_info)) 
                printk(KERN_ERR "radio-typhoon: registering /proc/driver/radio-typhoon failed\n");
 #endif
 
@@ -398,7 +398,7 @@ static void __exit typhoon_cleanup_module(void)
 {
 
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
-       remove_proc_entry("driver/radio-typhoon");
+       remove_proc_entry("driver/radio-typhoon", NULL);
 #endif
 
        video_unregister_device(&typhoon_radio);
index 3ad87d4ec03048b8c9add82c3657d1f042d76876..a9125785d57ad817a4a0a14387c7e8d1f6484a56 100644 (file)
@@ -462,7 +462,7 @@ static int el16_send_packet(struct sk_buff *skb, struct net_device *dev)
                        return 1;
                if (net_debug > 1)
                        printk("%s: transmit timed out, %s?  ", dev->name,
-                                  readw(shmem+iSCB_STATUS) & 0x8000 ? "IRQ conflict" :
+                                  isa_readw(shmem+iSCB_STATUS) & 0x8000 ? "IRQ conflict" :
                                   "network cable problem");
                /* Try to restart the adaptor. */
                if (lp->last_restart == lp->stats.tx_packets) {
@@ -472,7 +472,7 @@ static int el16_send_packet(struct sk_buff *skb, struct net_device *dev)
                } else {
                        /* Issue the channel attention signal and hope it "gets better". */
                        if (net_debug > 1) printk("Kicking board.\n");
-                       writew(0xf000|CUC_START|RX_START,shmem+iSCB_CMD);
+                       isa_writew(0xf000|CUC_START|RX_START,shmem+iSCB_CMD);
                        outb(0, ioaddr + SIGNAL_CA);                    /* Issue channel-attn. */
                        lp->last_restart = lp->stats.tx_packets;
                }
@@ -533,7 +533,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        spin_lock(&lp->lock);
 
-       status = readw(shmem+iSCB_STATUS);
+       status = isa_readw(shmem+iSCB_STATUS);
 
        if (net_debug > 4) {
                printk("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status);
@@ -544,7 +544,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        /* Reap the Tx packet buffers. */
        while (lp->tx_reap != lp->tx_head) {
-         unsigned short tx_status = readw(shmem+lp->tx_reap);
+         unsigned short tx_status = isa_readw(shmem+lp->tx_reap);
 
          if (tx_status == 0) {
                if (net_debug > 5)  printk("Couldn't reap %#x.\n", lp->tx_reap);
@@ -599,11 +599,11 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                        printk("%s: Rx unit stopped, status %04x, restarting.\n",
                                   dev->name, status);
                init_rx_bufs(dev);
-               writew(RX_BUF_START,shmem+iSCB_RFA);
+               isa_writew(RX_BUF_START,shmem+iSCB_RFA);
                ack_cmd |= RX_START;
        }
 
-       writew(ack_cmd,shmem+iSCB_CMD);
+       isa_writew(ack_cmd,shmem+iSCB_CMD);
        outb(0, ioaddr + SIGNAL_CA);                    /* Issue channel-attn. */
 
        /* Clear the latched interrupt. */
@@ -625,7 +625,7 @@ static int el16_close(struct net_device *dev)
        dev->start = 0;
 
        /* Flush the Tx and disable Rx. */
-       writew(RX_SUSPEND | CUC_SUSPEND,shmem+iSCB_CMD);
+       isa_writew(RX_SUSPEND | CUC_SUSPEND,shmem+iSCB_CMD);
        outb(0, ioaddr + SIGNAL_CA);
 
        /* Disable the 82586's input to the interrupt line. */
@@ -665,24 +665,24 @@ static void init_rx_bufs(struct net_device *dev)
 
          write_ptr = dev->mem_start + cur_rxbuf;
 
-               writew(0x0000,write_ptr);                       /* Status */
-               writew(0x0000,write_ptr+=2);                    /* Command */
-               writew(cur_rxbuf + RX_BUF_SIZE,write_ptr+=2);   /* Link */
-               writew(cur_rxbuf + 22,write_ptr+=2);            /* Buffer offset */
-               writew(0x0000,write_ptr+=2);                    /* Pad for dest addr. */
-               writew(0x0000,write_ptr+=2);
-               writew(0x0000,write_ptr+=2);
-               writew(0x0000,write_ptr+=2);                    /* Pad for source addr. */
-               writew(0x0000,write_ptr+=2);
-               writew(0x0000,write_ptr+=2);
-               writew(0x0000,write_ptr+=2);                    /* Pad for protocol. */
-
-               writew(0x0000,write_ptr+=2);                    /* Buffer: Actual count */
-               writew(-1,write_ptr+=2);                        /* Buffer: Next (none). */
-               writew(cur_rxbuf + 0x20 + SCB_base,write_ptr+=2);/* Buffer: Address low */
-               writew(0x0000,write_ptr+=2);
+               isa_writew(0x0000,write_ptr);                   /* Status */
+               isa_writew(0x0000,write_ptr+=2);                        /* Command */
+               isa_writew(cur_rxbuf + RX_BUF_SIZE,write_ptr+=2);       /* Link */
+               isa_writew(cur_rxbuf + 22,write_ptr+=2);                /* Buffer offset */
+               isa_writew(0x0000,write_ptr+=2);                        /* Pad for dest addr. */
+               isa_writew(0x0000,write_ptr+=2);
+               isa_writew(0x0000,write_ptr+=2);
+               isa_writew(0x0000,write_ptr+=2);                        /* Pad for source addr. */
+               isa_writew(0x0000,write_ptr+=2);
+               isa_writew(0x0000,write_ptr+=2);
+               isa_writew(0x0000,write_ptr+=2);                        /* Pad for protocol. */
+
+               isa_writew(0x0000,write_ptr+=2);                        /* Buffer: Actual count */
+               isa_writew(-1,write_ptr+=2);                    /* Buffer: Next (none). */
+               isa_writew(cur_rxbuf + 0x20 + SCB_base,write_ptr+=2);/* Buffer: Address low */
+               isa_writew(0x0000,write_ptr+=2);
                /* Finally, the number of bytes in the buffer. */
-               writew(0x8000 + RX_BUF_SIZE-0x20,write_ptr+=2);
+               isa_writew(0x8000 + RX_BUF_SIZE-0x20,write_ptr+=2);
 
                lp->rx_tail = cur_rxbuf;
                cur_rxbuf += RX_BUF_SIZE;
@@ -691,8 +691,8 @@ static void init_rx_bufs(struct net_device *dev)
        /* Terminate the list by setting the EOL bit, and wrap the pointer to make
           the list a ring. */
        write_ptr = dev->mem_start + lp->rx_tail + 2;
-       writew(0xC000,write_ptr);                               /* Command, mark as last. */
-       writew(lp->rx_head,write_ptr+2);                        /* Link */
+       isa_writew(0xC000,write_ptr);                           /* Command, mark as last. */
+       isa_writew(lp->rx_head,write_ptr+2);                    /* Link */
 }
 
 static void init_82586_mem(struct net_device *dev)
@@ -710,13 +710,13 @@ static void init_82586_mem(struct net_device *dev)
        init_words[7] = SCB_BASE;
 
        /* Write the words at 0xfff6 (address-aliased to 0xfffff6). */
-       memcpy_toio(dev->mem_end-10, init_words, 10);
+       isa_memcpy_toio(dev->mem_end-10, init_words, 10);
 
        /* Write the words at 0x0000. */
-       memcpy_toio(dev->mem_start, init_words + 5, sizeof(init_words) - 10);
+       isa_memcpy_toio(dev->mem_start, init_words + 5, sizeof(init_words) - 10);
 
        /* Fill in the station address. */
-       memcpy_toio(dev->mem_start+SA_OFFSET, dev->dev_addr,
+       isa_memcpy_toio(dev->mem_start+SA_OFFSET, dev->dev_addr,
                   sizeof(dev->dev_addr));
 
        /* The Tx-block list is written as needed.  We just set up the values. */
@@ -734,11 +734,11 @@ static void init_82586_mem(struct net_device *dev)
 
        {
                int boguscnt = 50;
-               while (readw(shmem+iSCB_STATUS) == 0)
+               while (isa_readw(shmem+iSCB_STATUS) == 0)
                        if (--boguscnt == 0) {
                                printk("%s: i82586 initialization timed out with status %04x,"
                                           "cmd %04x.\n", dev->name,
-                                          readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD));
+                                          isa_readw(shmem+iSCB_STATUS), isa_readw(shmem+iSCB_CMD));
                                break;
                        }
                /* Issue channel-attn -- the 82586 won't start. */
@@ -749,7 +749,7 @@ static void init_82586_mem(struct net_device *dev)
        outb(0x84, ioaddr + MISC_CTRL);
        if (net_debug > 4)
                printk("%s: Initialized 82586, status %04x.\n", dev->name,
-                          readw(shmem+iSCB_STATUS));
+                          isa_readw(shmem+iSCB_STATUS));
        return;
 }
 
@@ -761,27 +761,27 @@ static void hardware_send_packet(struct net_device *dev, void *buf, short length
        unsigned long write_ptr = dev->mem_start + tx_block;
 
        /* Set the write pointer to the Tx block, and put out the header. */
-       writew(0x0000,write_ptr);                       /* Tx status */
-       writew(CMD_INTR|CmdTx,write_ptr+=2);            /* Tx command */
-       writew(tx_block+16,write_ptr+=2);               /* Next command is a NoOp. */
-       writew(tx_block+8,write_ptr+=2);                        /* Data Buffer offset. */
+       isa_writew(0x0000,write_ptr);                   /* Tx status */
+       isa_writew(CMD_INTR|CmdTx,write_ptr+=2);                /* Tx command */
+       isa_writew(tx_block+16,write_ptr+=2);           /* Next command is a NoOp. */
+       isa_writew(tx_block+8,write_ptr+=2);                    /* Data Buffer offset. */
 
        /* Output the data buffer descriptor. */
-       writew(length | 0x8000,write_ptr+=2);           /* Byte count parameter. */
-       writew(-1,write_ptr+=2);                        /* No next data buffer. */
-       writew(tx_block+22+SCB_BASE,write_ptr+=2);      /* Buffer follows the NoOp command. */
-       writew(0x0000,write_ptr+=2);                    /* Buffer address high bits (always zero). */
+       isa_writew(length | 0x8000,write_ptr+=2);               /* Byte count parameter. */
+       isa_writew(-1,write_ptr+=2);                    /* No next data buffer. */
+       isa_writew(tx_block+22+SCB_BASE,write_ptr+=2);  /* Buffer follows the NoOp command. */
+       isa_writew(0x0000,write_ptr+=2);                        /* Buffer address high bits (always zero). */
 
        /* Output the Loop-back NoOp command. */
-       writew(0x0000,write_ptr+=2);                    /* Tx status */
-       writew(CmdNOp,write_ptr+=2);                    /* Tx command */
-       writew(tx_block+16,write_ptr+=2);               /* Next is myself. */
+       isa_writew(0x0000,write_ptr+=2);                        /* Tx status */
+       isa_writew(CmdNOp,write_ptr+=2);                        /* Tx command */
+       isa_writew(tx_block+16,write_ptr+=2);           /* Next is myself. */
 
        /* Output the packet at the write pointer. */
-       memcpy_toio(write_ptr+2, buf, length);
+       isa_memcpy_toio(write_ptr+2, buf, length);
 
        /* Set the old command link pointing to this send packet. */
-       writew(tx_block,dev->mem_start + lp->tx_cmd_link);
+       isa_isa_writew(tx_block,dev->mem_start + lp->tx_cmd_link);
        lp->tx_cmd_link = tx_block + 20;
 
        /* Set the next free tx region. */
@@ -807,13 +807,13 @@ static void el16_rx(struct net_device *dev)
        ushort boguscount = 10;
        short frame_status;
 
-       while ((frame_status = readw(shmem+rx_head)) < 0) {   /* Command complete */
+       while ((frame_status = isa_readw(shmem+rx_head)) < 0) {   /* Command complete */
                unsigned long read_frame = dev->mem_start + rx_head;
-               ushort rfd_cmd = readw(read_frame+2);
-               ushort next_rx_frame = readw(read_frame+4);
-               ushort data_buffer_addr = readw(read_frame+6);
+               ushort rfd_cmd = isa_readw(read_frame+2);
+               ushort next_rx_frame = isa_readw(read_frame+4);
+               ushort data_buffer_addr = isa_readw(read_frame+6);
                unsigned long data_frame = dev->mem_start + data_buffer_addr;
-               ushort pkt_len = readw(data_frame);
+               ushort pkt_len = isa_readw(data_frame);
 
                if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22
                        || (pkt_len & 0xC000) != 0xC000) {
@@ -845,7 +845,7 @@ static void el16_rx(struct net_device *dev)
                        skb->dev = dev;
 
                        /* 'skb->data' points to the start of sk_buff data area. */
-                       memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len);
+                       isa_memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len);
 
                        skb->protocol=eth_type_trans(skb,dev);
                        netif_rx(skb);
@@ -853,10 +853,10 @@ static void el16_rx(struct net_device *dev)
                }
 
                /* Clear the status word and set End-of-List on the rx frame. */
-               writew(0,read_frame);
-               writew(0xC000,read_frame+2);
+               isa_writew(0,read_frame);
+               isa_writew(0xC000,read_frame+2);
                /* Clear the end-of-list on the prev. RFD. */
-               writew(0x0000,dev->mem_start + rx_tail + 2);
+               isa_writew(0x0000,dev->mem_start + rx_tail + 2);
 
                rx_tail = rx_head;
                rx_head = next_rx_frame;
index 012dc2b8d4758c009832de8b34d7c86d9428b941..975676afec3a98b682cccd8105e8eaba7da97602 100644 (file)
@@ -293,7 +293,7 @@ static void
 ac_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
 {
        unsigned long hdr_start = dev->mem_start + ((ring_page - AC_START_PG)<<8);
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
 }
 
 /*  Block input and output are easy on shared memory ethercards, the only
@@ -307,12 +307,12 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *sk
        if (xfer_start + count > dev->rmem_end) {
                /* We must wrap the input move. */
                int semi_count = dev->rmem_end - xfer_start;
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
-               memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+               isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk -- we can copy + cksum. */
-               eth_io_copy_and_sum(skb, xfer_start, count, 0);
+               isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
        }
 }
 
@@ -321,7 +321,7 @@ static void ac_block_output(struct net_device *dev, int count,
 {
        unsigned long shmem = dev->mem_start + ((start_page - AC_START_PG)<<8);
 
-       memcpy_toio(shmem, buf, count);
+       isa_memcpy_toio(shmem, buf, count);
 }
 
 static int ac_close_card(struct net_device *dev)
index 8292fbe4310708766139df4cc38ed102d6c949ff..6f7eda2ed7945c0608103eebe2cf06c8a1a25a3e 100644 (file)
@@ -321,7 +321,7 @@ static void
 es_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
 {
        unsigned long hdr_start = dev->mem_start + ((ring_page - ES_START_PG)<<8);
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
        hdr->count = (hdr->count + 3) & ~3;     /* Round up allocation. */
 }
 
@@ -339,12 +339,12 @@ static void es_block_input(struct net_device *dev, int count, struct sk_buff *sk
        if (xfer_start + count > dev->rmem_end) {
                /* Packet wraps over end of ring buffer. */
                int semi_count = dev->rmem_end - xfer_start;
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
-               memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+               isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk. */
-               memcpy_fromio(skb->data, xfer_start, count);
+               isa_eth_io_copy_and_csum(skb, xfer_start, count, 0);
        }
 }
 
@@ -354,7 +354,7 @@ static void es_block_output(struct net_device *dev, int count,
        unsigned long shmem = dev->mem_start + ((start_page - ES_START_PG)<<8);
 
        count = (count + 3) & ~3;     /* Round up to doubleword */
-       memcpy_toio(shmem, buf, count);
+       isa_memcpy_toio(shmem, buf, count);
 }
 
 static int es_open(struct net_device *dev)
index 40e2ec507ddbcec43f6ff3784355cf3b9b11cc94..eecbb9a56c27ed358b1a7c5e7ff8d7a3a04d6ad5 100644 (file)
@@ -829,16 +829,16 @@ static int ewrk3_queue_pkt(struct sk_buff *skb, struct net_device *dev)
                                                        writeb(0x04, (char *) buf);     /* index byte */
                                                        buf += 1;
                                                        writeb(0x00, (char *) (buf + skb->len));        /* Write the XCT flag */
-                                                       memcpy_toio(buf, skb->data, PRELOAD);   /* Write PRELOAD bytes */
+                                                       isa_memcpy_toio(buf, skb->data, PRELOAD);       /* Write PRELOAD bytes */
                                                        outb(page, EWRK3_TQ);   /* Start sending pkt */
-                                                       memcpy_toio(buf + PRELOAD, skb->data + PRELOAD, skb->len - PRELOAD);
+                                                       isa_memcpy_toio(buf + PRELOAD, skb->data + PRELOAD, skb->len - PRELOAD);
                                                        writeb(0xff, (char *) (buf + skb->len));        /* Write the XCT flag */
                                                } else {
                                                        writeb((char) ((skb->len >> 8) & 0xff), (char *) buf);
                                                        buf += 1;
                                                        writeb(0x04, (char *) buf);     /* index byte */
                                                        buf += 1;
-                                                       memcpy_toio((char *) buf, skb->data, skb->len);         /* Write data bytes */
+                                                       isa_memcpy_toio(buf, skb->data, skb->len);              /* Write data bytes */
                                                        outb(page, EWRK3_TQ);   /* Start sending pkt */
                                                }
                                        }
@@ -1012,7 +1012,7 @@ static int ewrk3_rx(struct net_device *dev)
                                                                *p++ = inb(EWRK3_DATA);
                                                        }
                                                } else {
-                                                       memcpy_fromio(p, buf, pkt_len);
+                                                       isa_memcpy_fromio(p, buf, pkt_len);
                                                }
 
                                                /*
@@ -1737,7 +1737,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                                }
                        } else {
                                outb(0, EWRK3_MPR);
-                               memcpy_fromio(tmp.addr, (char *) (lp->shmem_base + PAGE0_HTE), (HASH_TABLE_LEN >> 3));
+                               isa_memcpy_fromio(tmp.addr, lp->shmem_base + PAGE0_HTE, (HASH_TABLE_LEN >> 3));
                        }
                        ioc->len = (HASH_TABLE_LEN >> 3);
                        if (copy_to_user(ioc->data, tmp.addr, ioc->len)) {
index 889c586fad751974d0ca61c80271e4903d930e27..2bf83d866115d34337914cd66230555df5e78938 100644 (file)
@@ -361,7 +361,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring
 
        outw((ring_page<<8), ioaddr + HPP_IN_ADDR);
        outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
-       memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr));
        outw(option_reg, ioaddr + HPP_OPTION);
        hdr->count = (hdr->count + 3) & ~3;     /* Round up allocation. */
 }
@@ -380,7 +380,7 @@ hpp_mem_block_input(struct net_device *dev, int count, struct sk_buff *skb, int
           Also note that we *can't* use eth_io_copy_and_sum() because
           it will not always copy "count" bytes (e.g. padded IP).  */
 
-       memcpy_fromio(skb->data, dev->mem_start, count);
+       isa_memcpy_fromio(skb->data, dev->mem_start, count);
        outw(option_reg, ioaddr + HPP_OPTION);
 }
 
@@ -405,7 +405,7 @@ hpp_mem_block_output(struct net_device *dev, int count,
 
        outw(start_page << 8, ioaddr + HPP_OUT_ADDR);
        outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
-       memcpy_toio(dev->mem_start, buf, (count + 3) & ~3);
+       isa_memcpy_toio(dev->mem_start, buf, (count + 3) & ~3);
        outw(option_reg, ioaddr + HPP_OPTION);
 
        return;
index 5f99b56d9cd07ebf8be0d27926cbd1281a87fa99..2700129c29f73cfbdb7216214e7431868c2def39 100644 (file)
@@ -316,7 +316,7 @@ static void
 lne390_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
 {
        unsigned long hdr_start = dev->mem_start + ((ring_page - LNE390_START_PG)<<8);
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
        hdr->count = (hdr->count + 3) & ~3;     /* Round up allocation. */
 }
 
@@ -334,12 +334,12 @@ static void lne390_block_input(struct net_device *dev, int count, struct sk_buff
        if (xfer_start + count > dev->rmem_end) {
                /* Packet wraps over end of ring buffer. */
                int semi_count = dev->rmem_end - xfer_start;
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
-               memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+               isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk. */
-               memcpy_fromio(skb->data, xfer_start, count);
+               isa_memcpy_fromio(skb->data, xfer_start, count);
        }
 }
 
@@ -349,7 +349,7 @@ static void lne390_block_output(struct net_device *dev, int count,
        unsigned long shmem = dev->mem_start + ((start_page - LNE390_START_PG)<<8);
 
        count = (count + 3) & ~3;     /* Round up to doubleword */
-       memcpy_toio(shmem, buf, count);
+       isa_memcpy_toio(shmem, buf, count);
 }
 
 static int lne390_open(struct net_device *dev)
index 0f59bcb08229b1b10259831727346fb52c7fcf2f..9a70ecee1386ffed7aa09d29f0cccfc9dbc63cb7 100644 (file)
@@ -307,7 +307,7 @@ static void
 ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
 {
        unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8);
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
        hdr->count = (hdr->count + 3) & ~3;     /* Round up allocation. */
 }
 
@@ -325,12 +325,12 @@ static void ne3210_block_input(struct net_device *dev, int count, struct sk_buff
        if (xfer_start + count > dev->rmem_end) {
                /* Packet wraps over end of ring buffer. */
                int semi_count = dev->rmem_end - xfer_start;
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
-               memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+               isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk. */
-               memcpy_fromio(skb->data, xfer_start, count);
+               isa_memcpy_fromio(skb->data, xfer_start, count);
        }
 }
 
@@ -340,7 +340,7 @@ static void ne3210_block_output(struct net_device *dev, int count,
        unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8);
 
        count = (count + 3) & ~3;     /* Round up to doubleword */
-       memcpy_toio(shmem, buf, count);
+       isa_memcpy_toio(shmem, buf, count);
 }
 
 static int ne3210_open(struct net_device *dev)
index cdee2d6e68863216b17eb1c89718ce8021402887..17a33841ecf7f6f436420296f0c37b12c58d4770 100644 (file)
@@ -306,7 +306,7 @@ static void InitDscrs(struct net_device *dev)
       descr.Flags = 0;
       descr.Len = 0xf000;
       descr.Status = 0;
-      memcpy_toio(dev->mem_start + RAM_TXBASE + (z * sizeof(LANCE_TxDescr)),
+      isa_memcpy_toio(dev->mem_start + RAM_TXBASE + (z * sizeof(LANCE_TxDescr)),
                   &descr, sizeof(LANCE_TxDescr));
       memset_io(dev->mem_start + bufaddr, 0, RAM_BUFSIZE);
       bufaddr += RAM_BUFSIZE;
@@ -325,9 +325,9 @@ static void InitDscrs(struct net_device *dev)
       descr.Flags = RXDSCR_FLAGS_OWN;
       descr.MaxLen = -RAM_BUFSIZE;
       descr.Len = 0;
-      memcpy_toio(dev->mem_start + RAM_RXBASE + (z * sizeof(LANCE_RxDescr)),
+      isa_memcpy_toio(dev->mem_start + RAM_RXBASE + (z * sizeof(LANCE_RxDescr)),
                   &descr, sizeof(LANCE_RxDescr));
-      memset_io(dev->mem_start + bufaddr, 0, RAM_BUFSIZE);
+      isa_memset_io(dev->mem_start + bufaddr, 0, RAM_BUFSIZE);
       bufaddr += RAM_BUFSIZE;
     }
   }
@@ -450,7 +450,7 @@ static void InitBoard(struct net_device *dev)
   block.RdrP = (RAM_RXBASE & 0xffffff) | (LRXCOUNT << 29);
   block.TdrP = (RAM_TXBASE & 0xffffff) | (LTXCOUNT << 29);
 
-  memcpy_toio(dev->mem_start + RAM_INITBASE, &block, sizeof(block));
+  isa_memcpy_toio(dev->mem_start + RAM_INITBASE, &block, sizeof(block));
 
   /* initialize LANCE. Implicitly sets up other structures in RAM. */
 
@@ -507,7 +507,7 @@ static u16 irqrx_handler(struct net_device *dev, u16 oldcsr0)
   while (1)
   {
     /* read descriptor */
-    memcpy_fromio(&descr, dev->mem_start + descraddr, sizeof(LANCE_RxDescr));
+    isa_memcpy_fromio(&descr, dev->mem_start + descraddr, sizeof(LANCE_RxDescr));
  
     /* if we reach a descriptor we do not own, we're done */
     if ((descr.Flags & RXDSCR_FLAGS_OWN) != 0)
@@ -539,7 +539,7 @@ static u16 irqrx_handler(struct net_device *dev, u16 oldcsr0)
         priv->stat.rx_dropped++;
       else
       {
-        memcpy_fromio(skb_put(skb, descr.Len),
+        isa_memcpy_fromio(skb_put(skb, descr.Len),
                       dev->mem_start + descr.LowAddr, descr.Len);
         skb->dev = dev;
         skb->protocol = eth_type_trans(skb, dev);
@@ -557,7 +557,7 @@ static u16 irqrx_handler(struct net_device *dev, u16 oldcsr0)
     descr.Flags |= RXDSCR_FLAGS_OWN;
 
     /* update descriptor in shared RAM */
-    memcpy_toio(dev->mem_start + descraddr, &descr, sizeof(LANCE_RxDescr));
+    isa_memcpy_toio(dev->mem_start + descraddr, &descr, sizeof(LANCE_RxDescr));
 
     /* go to next descriptor */
     priv->nextrx++; descraddr += sizeof(LANCE_RxDescr);
@@ -588,7 +588,7 @@ static u16 irqtx_handler(struct net_device *dev, u16 oldcsr0)
   while (priv->txbusy > 0)
   {
     /* read descriptor */
-    memcpy_fromio(&descr, dev->mem_start + descraddr, sizeof(LANCE_TxDescr));
+    isa_memcpy_fromio(&descr, dev->mem_start + descraddr, sizeof(LANCE_TxDescr));
 
     /* if the LANCE still owns this one, we've worked out all sent packets */
     if ((descr.Flags & TXDSCR_FLAGS_OWN) != 0)
@@ -798,7 +798,7 @@ static int skmca_tx(struct sk_buff *skb, struct net_device *dev)
 
   /* get TX descriptor */
   address = RAM_TXBASE + (priv->nexttxput * sizeof(LANCE_TxDescr));
-  memcpy_fromio(&descr, dev->mem_start + address, sizeof(LANCE_TxDescr));
+  isa_memcpy_fromio(&descr, dev->mem_start + address, sizeof(LANCE_TxDescr));
 
   /* enter packet length as 2s complement - assure minimum length */
   tmplen = skb->len;
@@ -816,13 +816,13 @@ static int skmca_tx(struct sk_buff *skb, struct net_device *dev)
 
     while (destoffs < tmplen)
     {
-      memcpy_toio(dev->mem_start + descr.LowAddr + destoffs, fill, l);
+      isa_memcpy_toio(dev->mem_start + descr.LowAddr + destoffs, fill, l);
       destoffs += l;
     }
   }
 
   /* do the real data copying */
-  memcpy_toio(dev->mem_start + descr.LowAddr, skb->data, skb->len);
+  isa_memcpy_toio(dev->mem_start + descr.LowAddr, skb->data, skb->len);
 
   /* hand descriptor over to LANCE - this is the first and last chunk */
   descr.Flags = TXDSCR_FLAGS_OWN | TXDSCR_FLAGS_STP | TXDSCR_FLAGS_ENP;
@@ -841,7 +841,7 @@ static int skmca_tx(struct sk_buff *skb, struct net_device *dev)
   dev->tbusy = (priv->txbusy >= TXCOUNT);
 
   /* write descriptor back to RAM */
-  memcpy_toio(dev->mem_start + address, &descr, sizeof(LANCE_TxDescr));
+  isa_memcpy_toio(dev->mem_start + address, &descr, sizeof(LANCE_TxDescr));
 
   /* if no descriptors were active, give the LANCE a hint to read it
      immediately */
@@ -891,7 +891,7 @@ static void skmca_set_multicast_list(struct net_device *dev)
   StopLANCE(dev);
 
   /* ...then modify the initialization block... */
-  memcpy_fromio(&block, dev->mem_start + RAM_INITBASE, sizeof(block));
+  isa_memcpy_fromio(&block, dev->mem_start + RAM_INITBASE, sizeof(block));
   if (dev->flags & IFF_PROMISC)
     block.Mode |= LANCE_INIT_PROM;
   else
@@ -914,7 +914,7 @@ static void skmca_set_multicast_list(struct net_device *dev)
     }
   }
 
-  memcpy_toio(dev->mem_start + RAM_INITBASE, &block, sizeof(block));
+  isa_memcpy_toio(dev->mem_start + RAM_INITBASE, &block, sizeof(block));
 
   /* ...then reinit LANCE with the correct flags */
   InitLANCE(dev);
index 938eaf3897d1ab15d62ae6c1f56824f7cb914508..16af6660c668c8a475f546a67b3e889134cbaa89 100644 (file)
@@ -312,9 +312,9 @@ ultra_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p
        outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);  /* shmem on */
 #ifdef notdef
        /* Officially this is what we are doing, but the readl() is faster */
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
 #else
-       ((unsigned int*)hdr)[0] = readl(hdr_start);
+       ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
 #endif
        outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* shmem off */
 }
@@ -333,12 +333,12 @@ ultra_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ri
        if (xfer_start + count > dev->rmem_end) {
                /* We must wrap the input move. */
                int semi_count = dev->rmem_end - xfer_start;
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
-               memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+               isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk -- we can copy + cksum. */
-               eth_io_copy_and_sum(skb, xfer_start, count, 0);
+               isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
        }
 
        outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET);  /* Disable memory. */
@@ -353,7 +353,7 @@ ultra_block_output(struct net_device *dev, int count, const unsigned char *buf,
        /* Enable shared memory. */
        outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
 
-       memcpy_toio(shmem, buf, count);
+       isa_memcpy_toio(shmem, buf, count);
 
        outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
 }
index d941ef7beb926941c5b25adbe4bd0138418e4c39..4657500f0d8bd874ded754b4f82df21d7ef8ed65 100644 (file)
@@ -314,9 +314,9 @@ static void ultra32_get_8390_hdr(struct net_device *dev,
 
 #ifdef notdef
        /* Officially this is what we are doing, but the readl() is faster */
-       memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
+       isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
 #else
-       ((unsigned int*)hdr)[0] = readl(hdr_start);
+       ((unsigned int*)hdr)[0] = isa_readl(hdr_start);
 #endif
 }
 
@@ -335,21 +335,21 @@ static void ultra32_block_input(struct net_device *dev,
 
        if ((ring_offset & ~0x1fff) != ((ring_offset + count - 1) & ~0x1fff)) {
                int semi_count = 8192 - (ring_offset & 0x1FFF);
-               memcpy_fromio(skb->data, xfer_start, semi_count);
+               isa_memcpy_fromio(skb->data, xfer_start, semi_count);
                count -= semi_count;
                if (ring_offset < 96*256) {
                        /* Select next 8KB Window. */
                        ring_offset += semi_count;
                        outb(ei_status.reg0 | ((ring_offset & 0x6000) >> 13), RamReg);
-                       memcpy_fromio(skb->data + semi_count, dev->mem_start, count);
+                       isa_memcpy_fromio(skb->data + semi_count, dev->mem_start, count);
                } else {
                        /* Select first 8KB Window. */
                        outb(ei_status.reg0, RamReg);
-                       memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
+                       isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
                }
        } else {
                /* Packet is in one chunk -- we can copy + cksum. */
-               eth_io_copy_and_sum(skb, xfer_start, count, 0);
+               isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
        }
 }
 
@@ -364,7 +364,7 @@ static void ultra32_block_output(struct net_device *dev,
        /* Select first 8KB Window. */
        outb(ei_status.reg0, RamReg);
 
-       memcpy_toio(xfer_start, buf, count);
+       isa_memcpy_toio(xfer_start, buf, count);
 }
 \f
 #ifdef MODULE
index 9b442d5f32b4890a345ffc28aa1d72ee2283498f..9507ba615815ce73191b23ce7558edab94620338 100644 (file)
@@ -392,7 +392,7 @@ wd_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_
                isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
        } else {
                /* Packet is in one chunk -- we can copy + cksum. */
-               isa_eth_io_copy_and_csum(skb, xfer_start, count, 0);
+               isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
        }
 
        /* Turn off 16 bit access so that reboot works.  ISA brain-damage */
index f6516d5b1345ae2c5531d5395078fd696bfc51d1..587a6a2b0bc74aa5e8867af5e040a9db4e0eddc1 100644 (file)
@@ -1782,6 +1782,9 @@ static int __init parport_pc_init_pci (int irq, int dma)
                { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_B,
                  PCI_ANY_ID, PCI_ANY_ID,
                  1, { { 0, -1 }, } },
+               { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_BOCA_IOPPAR,
+                 PCI_ANY_ID, PCI_ANY_ID,
+                 1, { { 0, -1 }, } },
                { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
                  PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014,
                  2, { { 4, -1 }, { 5, -1 }, } },
index d4314cfa1a93a55d173a51e3b3dbfe30d1db9665..f0482b7d3c3171a676912a4017f880ce76f633d1 100644 (file)
@@ -844,6 +844,13 @@ VENDOR( MOTOROLA_OOPS, "Motorola" )
        DEVICE( MOTOROLA_OOPS,  MOTOROLA_FALCON,"Falcon")
 ENDVENDOR()
 
+VENDOR( LAVA, "Lava Computer MFG" )
+       DEVICE( LAVA,           LAVA_PARALLEL,  "Lava Parallel")
+       DEVICE( LAVA,           LAVA_DUAL_PAR_A,"Lava Dual Parallel (A)")
+       DEVICE( LAVA,           LAVA_DUAL_PAR_B,"Lava Dual Parallel (B)")
+       DEVICE( LAVA,           LAVA_BOCA_IOPPAR,"BOCA Research IOPPAR")
+ENDVENDOR()
+
 VENDOR( SYMPHONY, "Symphony" )
        DEVICE( SYMPHONY,       SYMPHONY_101,   "82C101")
 ENDVENDOR()
index 883bfb89d087d5784df6b0a369f5325bbac8b15c..c6815e3b1a92ec3c3685fa91a9c1ba30b5b64e39 100644 (file)
 #include <linux/pci.h>
 
 
-int pci_simple_probe (struct pci_simple_probe_entry *list, size_t match_limit,
-                     pci_simple_probe_callback cb, void *drvr_data)
+int pci_simple_probe (const struct pci_simple_probe_entry *list,
+                     size_t match_limit, pci_simple_probe_callback cb,
+                     void *drvr_data)
 {
        struct pci_dev *dev;
-       struct pci_simple_probe_entry *ent;
+       const struct pci_simple_probe_entry *ent;
        size_t matches = 0;
        unsigned short vendor, device;
        int rc;
index 6764486c8175d18a2edb67456180a175dda9a761..fdf7c2568da40389dcf4bba61151834c9e3fb216 100644 (file)
@@ -37,9 +37,6 @@ flash_mmap(struct file *file, struct vm_area_struct *vma)
        unsigned long addr;
        unsigned long size;
 
-       if (vma->vm_offset & ~(PAGE_MASK))
-               return -ENXIO;
-
        if (flash.read_base == flash.write_base) {
                addr = flash.read_base;
                size = flash.read_size;
index b586340693ab2aeac13829b4f27f92f5aca75d73..a3c81ffc22555b6fd45182895b7e8cea3dd2f35c 100644 (file)
@@ -1,4 +1,4 @@
-u32 SCRIPT[] = {
+static u32 SCRIPT[] = {
 /*
 
 
@@ -2179,40 +2179,40 @@ at 0x00000270 : */      0x90080000,0x00000000,
 };
 
 #define A_NCR53c7xx_msg_abort  0x00000000
-u32 A_NCR53c7xx_msg_abort_used[] = {
+static u32 A_NCR53c7xx_msg_abort_used[] __attribute((unused)) = {
        0x00000249,
 };
 
 #define A_NCR53c7xx_msg_reject 0x00000000
-u32 A_NCR53c7xx_msg_reject_used[] = {
+static u32 A_NCR53c7xx_msg_reject_used[] __attribute((unused)) = {
        0x00000172,
 };
 
 #define A_NCR53c7xx_sink       0x00000000
-u32 A_NCR53c7xx_sink_used[] = {
+static u32 A_NCR53c7xx_sink_used[] __attribute((unused)) = {
        0x00000233,
        0x00000239,
        0x0000023f,
 };
 
 #define A_NCR53c7xx_zero       0x00000000
-u32 A_NCR53c7xx_zero_used[] = {
+static u32 A_NCR53c7xx_zero_used[] __attribute((unused)) = {
        0x0000022f,
        0x00000245,
 };
 
 #define A_NOP_insn     0x00000000
-u32 A_NOP_insn_used[] = {
+static u32 A_NOP_insn_used[] __attribute((unused)) = {
        0x00000010,
 };
 
 #define A_addr_reconnect_dsa_head      0x00000000
-u32 A_addr_reconnect_dsa_head_used[] = {
+static u32 A_addr_reconnect_dsa_head_used[] __attribute((unused)) = {
        0x000001a7,
 };
 
 #define A_addr_scratch 0x00000000
-u32 A_addr_scratch_used[] = {
+static u32 A_addr_scratch_used[] __attribute((unused)) = {
        0x00000004,
        0x0000001b,
        0x00000046,
@@ -2227,13 +2227,13 @@ u32 A_addr_scratch_used[] = {
 };
 
 #define A_addr_temp    0x00000000
-u32 A_addr_temp_used[] = {
+static u32 A_addr_temp_used[] __attribute((unused)) = {
        0x00000025,
        0x00000034,
 };
 
 #define A_dmode_memory_to_memory       0x00000000
-u32 A_dmode_memory_to_memory_used[] = {
+static u32 A_dmode_memory_to_memory_used[] __attribute((unused)) = {
        0x00000005,
        0x0000001c,
        0x00000027,
@@ -2251,7 +2251,7 @@ u32 A_dmode_memory_to_memory_used[] = {
 };
 
 #define A_dmode_memory_to_ncr  0x00000000
-u32 A_dmode_memory_to_ncr_used[] = {
+static u32 A_dmode_memory_to_ncr_used[] __attribute((unused)) = {
        0x00000000,
        0x00000017,
        0x00000030,
@@ -2260,7 +2260,7 @@ u32 A_dmode_memory_to_ncr_used[] = {
 };
 
 #define A_dmode_ncr_to_memory  0x00000000
-u32 A_dmode_ncr_to_memory_used[] = {
+static u32 A_dmode_ncr_to_memory_used[] __attribute((unused)) = {
        0x00000022,
        0x00000064,
        0x00000070,
@@ -2272,161 +2272,161 @@ u32 A_dmode_ncr_to_memory_used[] = {
 };
 
 #define A_dsa_check_reselect   0x00000000
-u32 A_dsa_check_reselect_used[] = {
+static u32 A_dsa_check_reselect_used[] __attribute((unused)) = {
        0x000001bd,
 };
 
 #define A_dsa_cmdout   0x00000048
-u32 A_dsa_cmdout_used[] = {
+static u32 A_dsa_cmdout_used[] __attribute((unused)) = {
        0x00000094,
 };
 
 #define A_dsa_cmnd     0x00000038
-u32 A_dsa_cmnd_used[] = {
+static u32 A_dsa_cmnd_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_datain   0x00000054
-u32 A_dsa_datain_used[] = {
+static u32 A_dsa_datain_used[] __attribute((unused)) = {
        0x000000bb,
 };
 
 #define A_dsa_dataout  0x00000050
-u32 A_dsa_dataout_used[] = {
+static u32 A_dsa_dataout_used[] __attribute((unused)) = {
        0x000000a5,
 };
 
 #define A_dsa_end      0x00000070
-u32 A_dsa_end_used[] = {
+static u32 A_dsa_end_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_fields_start     0x00000000
-u32 A_dsa_fields_start_used[] = {
+static u32 A_dsa_fields_start_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_msgin    0x00000058
-u32 A_dsa_msgin_used[] = {
+static u32 A_dsa_msgin_used[] __attribute((unused)) = {
        0x00000188,
 };
 
 #define A_dsa_msgout   0x00000040
-u32 A_dsa_msgout_used[] = {
+static u32 A_dsa_msgout_used[] __attribute((unused)) = {
        0x00000086,
 };
 
 #define A_dsa_msgout_other     0x00000068
-u32 A_dsa_msgout_other_used[] = {
+static u32 A_dsa_msgout_other_used[] __attribute((unused)) = {
        0x00000180,
 };
 
 #define A_dsa_next     0x00000030
-u32 A_dsa_next_used[] = {
+static u32 A_dsa_next_used[] __attribute((unused)) = {
        0x0000005c,
 };
 
 #define A_dsa_restore_pointers 0x00000000
-u32 A_dsa_restore_pointers_used[] = {
+static u32 A_dsa_restore_pointers_used[] __attribute((unused)) = {
        0x0000012e,
 };
 
 #define A_dsa_save_data_pointer        0x00000000
-u32 A_dsa_save_data_pointer_used[] = {
+static u32 A_dsa_save_data_pointer_used[] __attribute((unused)) = {
        0x00000115,
 };
 
 #define A_dsa_select   0x0000003c
-u32 A_dsa_select_used[] = {
+static u32 A_dsa_select_used[] __attribute((unused)) = {
        0x00000081,
 };
 
 #define A_dsa_status   0x00000060
-u32 A_dsa_status_used[] = {
+static u32 A_dsa_status_used[] __attribute((unused)) = {
        0x00000184,
 };
 
 #define A_dsa_temp_addr_array_value    0x00000000
-u32 A_dsa_temp_addr_array_value_used[] = {
+static u32 A_dsa_temp_addr_array_value_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_temp_addr_dsa_value      0x00000000
-u32 A_dsa_temp_addr_dsa_value_used[] = {
+static u32 A_dsa_temp_addr_dsa_value_used[] __attribute((unused)) = {
        0x00000003,
 };
 
 #define A_dsa_temp_addr_new_value      0x00000000
-u32 A_dsa_temp_addr_new_value_used[] = {
+static u32 A_dsa_temp_addr_new_value_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_temp_addr_next   0x00000000
-u32 A_dsa_temp_addr_next_used[] = {
+static u32 A_dsa_temp_addr_next_used[] __attribute((unused)) = {
        0x00000015,
        0x0000004e,
 };
 
 #define A_dsa_temp_addr_residual       0x00000000
-u32 A_dsa_temp_addr_residual_used[] = {
+static u32 A_dsa_temp_addr_residual_used[] __attribute((unused)) = {
        0x0000002a,
        0x00000039,
 };
 
 #define A_dsa_temp_addr_saved_pointer  0x00000000
-u32 A_dsa_temp_addr_saved_pointer_used[] = {
+static u32 A_dsa_temp_addr_saved_pointer_used[] __attribute((unused)) = {
        0x00000026,
        0x00000033,
 };
 
 #define A_dsa_temp_addr_saved_residual 0x00000000
-u32 A_dsa_temp_addr_saved_residual_used[] = {
+static u32 A_dsa_temp_addr_saved_residual_used[] __attribute((unused)) = {
        0x0000002b,
        0x00000038,
 };
 
 #define A_dsa_temp_lun 0x00000000
-u32 A_dsa_temp_lun_used[] = {
+static u32 A_dsa_temp_lun_used[] __attribute((unused)) = {
        0x0000004b,
 };
 
 #define A_dsa_temp_next        0x00000000
-u32 A_dsa_temp_next_used[] = {
+static u32 A_dsa_temp_next_used[] __attribute((unused)) = {
        0x0000001a,
 };
 
 #define A_dsa_temp_sync        0x00000000
-u32 A_dsa_temp_sync_used[] = {
+static u32 A_dsa_temp_sync_used[] __attribute((unused)) = {
        0x00000053,
 };
 
 #define A_dsa_temp_target      0x00000000
-u32 A_dsa_temp_target_used[] = {
+static u32 A_dsa_temp_target_used[] __attribute((unused)) = {
        0x00000040,
 };
 
 #define A_int_debug_break      0x03000000
-u32 A_int_debug_break_used[] = {
+static u32 A_int_debug_break_used[] __attribute((unused)) = {
        0x00000217,
 };
 
 #define A_int_debug_panic      0x030b0000
-u32 A_int_debug_panic_used[] = {
+static u32 A_int_debug_panic_used[] __attribute((unused)) = {
        0x000001e8,
        0x000001f8,
 };
 
 #define A_int_err_check_condition      0x00030000
-u32 A_int_err_check_condition_used[] = {
+static u32 A_int_err_check_condition_used[] __attribute((unused)) = {
        0x00000194,
 };
 
 #define A_int_err_no_phase     0x00040000
-u32 A_int_err_no_phase_used[] = {
+static u32 A_int_err_no_phase_used[] __attribute((unused)) = {
 };
 
 #define A_int_err_selected     0x00010000
-u32 A_int_err_selected_used[] = {
+static u32 A_int_err_selected_used[] __attribute((unused)) = {
        0x000001da,
 };
 
 #define A_int_err_unexpected_phase     0x00000000
-u32 A_int_err_unexpected_phase_used[] = {
+static u32 A_int_err_unexpected_phase_used[] __attribute((unused)) = {
        0x0000008c,
        0x00000092,
        0x0000009a,
@@ -2444,67 +2444,67 @@ u32 A_int_err_unexpected_phase_used[] = {
 };
 
 #define A_int_err_unexpected_reselect  0x00020000
-u32 A_int_err_unexpected_reselect_used[] = {
+static u32 A_int_err_unexpected_reselect_used[] __attribute((unused)) = {
        0x000001ba,
 };
 
 #define A_int_msg_1    0x01020000
-u32 A_int_msg_1_used[] = {
+static u32 A_int_msg_1_used[] __attribute((unused)) = {
        0x0000010e,
        0x00000110,
 };
 
 #define A_int_msg_sdtr 0x01010000
-u32 A_int_msg_sdtr_used[] = {
+static u32 A_int_msg_sdtr_used[] __attribute((unused)) = {
        0x0000016c,
 };
 
 #define A_int_msg_wdtr 0x01000000
-u32 A_int_msg_wdtr_used[] = {
+static u32 A_int_msg_wdtr_used[] __attribute((unused)) = {
        0x00000160,
 };
 
 #define A_int_norm_aborted     0x02040000
-u32 A_int_norm_aborted_used[] = {
+static u32 A_int_norm_aborted_used[] __attribute((unused)) = {
        0x0000024d,
 };
 
 #define A_int_norm_command_complete    0x02020000
-u32 A_int_norm_command_complete_used[] = {
+static u32 A_int_norm_command_complete_used[] __attribute((unused)) = {
 };
 
 #define A_int_norm_disconnected        0x02030000
-u32 A_int_norm_disconnected_used[] = {
+static u32 A_int_norm_disconnected_used[] __attribute((unused)) = {
 };
 
 #define A_int_norm_reselect_complete   0x02010000
-u32 A_int_norm_reselect_complete_used[] = {
+static u32 A_int_norm_reselect_complete_used[] __attribute((unused)) = {
 };
 
 #define A_int_norm_reset       0x02050000
-u32 A_int_norm_reset_used[] = {
+static u32 A_int_norm_reset_used[] __attribute((unused)) = {
 };
 
 #define A_int_norm_select_complete     0x02000000
-u32 A_int_norm_select_complete_used[] = {
+static u32 A_int_norm_select_complete_used[] __attribute((unused)) = {
 };
 
 #define A_int_test_1   0x04000000
-u32 A_int_test_1_used[] = {
+static u32 A_int_test_1_used[] __attribute((unused)) = {
        0x000001fd,
 };
 
 #define A_int_test_2   0x04010000
-u32 A_int_test_2_used[] = {
+static u32 A_int_test_2_used[] __attribute((unused)) = {
        0x00000215,
 };
 
 #define A_int_test_3   0x04020000
-u32 A_int_test_3_used[] = {
+static u32 A_int_test_3_used[] __attribute((unused)) = {
 };
 
 #define A_msg_buf      0x00000000
-u32 A_msg_buf_used[] = {
+static u32 A_msg_buf_used[] __attribute((unused)) = {
        0x00000102,
        0x0000014e,
        0x00000158,
@@ -2514,24 +2514,24 @@ u32 A_msg_buf_used[] = {
 };
 
 #define A_reconnect_dsa_head   0x00000000
-u32 A_reconnect_dsa_head_used[] = {
+static u32 A_reconnect_dsa_head_used[] __attribute((unused)) = {
        0x0000006c,
        0x00000074,
        0x000001a0,
 };
 
 #define A_reselected_identify  0x00000000
-u32 A_reselected_identify_used[] = {
+static u32 A_reselected_identify_used[] __attribute((unused)) = {
        0x00000045,
        0x0000019c,
 };
 
 #define A_reselected_tag       0x00000000
-u32 A_reselected_tag_used[] = {
+static u32 A_reselected_tag_used[] __attribute((unused)) = {
 };
 
 #define A_schedule     0x00000000
-u32 A_schedule_used[] = {
+static u32 A_schedule_used[] __attribute((unused)) = {
        0x0000007e,
        0x00000192,
        0x000001e2,
@@ -2539,12 +2539,12 @@ u32 A_schedule_used[] = {
 };
 
 #define A_test_dest    0x00000000
-u32 A_test_dest_used[] = {
+static u32 A_test_dest_used[] __attribute((unused)) = {
        0x000001fb,
 };
 
 #define A_test_src     0x00000000
-u32 A_test_src_used[] = {
+static u32 A_test_src_used[] __attribute((unused)) = {
        0x000001fa,
 };
 
@@ -2582,7 +2582,7 @@ u32 A_test_src_used[] = {
 #define Ent_test_2     0x000007f8
 #define Ent_test_2_msgout      0x00000810
 #define Ent_wait_reselect      0x00000654
-u32 LABELPATCHES[] = {
+static u32 LABELPATCHES[] __attribute((unused)) = {
        0x00000008,
        0x0000000a,
        0x00000013,
@@ -2666,12 +2666,12 @@ u32 LABELPATCHES[] = {
        0x00000243,
 };
 
-struct {
+static struct {
        u32     offset;
        void            *address;
-} EXTERNAL_PATCHES[] = {
+} EXTERNAL_PATCHES[] __attribute((unused)) = {
 };
 
-u32 INSTRUCTIONS       = 301;
-u32 PATCHES    = 81;
-u32 EXTERNAL_PATCHES_LEN       = 0;
+static u32 INSTRUCTIONS __attribute((unused))  = 301;
+static u32 PATCHES __attribute((unused))       = 81;
+static u32 EXTERNAL_PATCHES_LEN __attribute((unused))  = 0;
index 22e0464786c234204a5c8bd0065371bf130ef4fd..b6305f806d9243d21d9cfd3ec5646ba395181be1 100644 (file)
@@ -1,4 +1,4 @@
-u32 SCRIPT[] = {
+static u32 SCRIPT[] = {
 /*
 
 
@@ -1776,12 +1776,12 @@ at 0x0000032c : */      0x98080000,0xab930018,
 };
 
 #define A_dsa_cmnd     0x00000010
-u32 A_dsa_cmnd_used[] = {
+static u32 A_dsa_cmnd_used[] __attribute((unused)) = {
        0x0000001d,
 };
 
 #define A_dsa_datain   0x00000028
-u32 A_dsa_datain_used[] = {
+static u32 A_dsa_datain_used[] __attribute((unused)) = {
        0x0000003d,
        0x0000003f,
        0x00000041,
@@ -1913,7 +1913,7 @@ u32 A_dsa_datain_used[] = {
 };
 
 #define A_dsa_dataout  0x00000428
-u32 A_dsa_dataout_used[] = {
+static u32 A_dsa_dataout_used[] __attribute((unused)) = {
        0x00000143,
        0x00000145,
        0x00000147,
@@ -2045,12 +2045,12 @@ u32 A_dsa_dataout_used[] = {
 };
 
 #define A_dsa_msgin    0x00000020
-u32 A_dsa_msgin_used[] = {
+static u32 A_dsa_msgin_used[] __attribute((unused)) = {
        0x0000002f,
 };
 
 #define A_dsa_msgout   0x00000008
-u32 A_dsa_msgout_used[] = {
+static u32 A_dsa_msgout_used[] __attribute((unused)) = {
        0x00000013,
        0x00000285,
        0x000002c5,
@@ -2058,50 +2058,50 @@ u32 A_dsa_msgout_used[] = {
 };
 
 #define A_dsa_select   0x00000000
-u32 A_dsa_select_used[] = {
+static u32 A_dsa_select_used[] __attribute((unused)) = {
        0x00000006,
 };
 
 #define A_dsa_size     0x00000828
-u32 A_dsa_size_used[] = {
+static u32 A_dsa_size_used[] __attribute((unused)) = {
 };
 
 #define A_dsa_status   0x00000018
-u32 A_dsa_status_used[] = {
+static u32 A_dsa_status_used[] __attribute((unused)) = {
        0x0000002b,
 };
 
 #define A_had_cmdout   0x00000004
-u32 A_had_cmdout_used[] = {
+static u32 A_had_cmdout_used[] __attribute((unused)) = {
        0x0000001a,
 };
 
 #define A_had_datain   0x00000008
-u32 A_had_datain_used[] = {
+static u32 A_had_datain_used[] __attribute((unused)) = {
        0x00000038,
 };
 
 #define A_had_dataout  0x00000010
-u32 A_had_dataout_used[] = {
+static u32 A_had_dataout_used[] __attribute((unused)) = {
        0x0000013e,
 };
 
 #define A_had_extmsg   0x00000080
-u32 A_had_extmsg_used[] = {
+static u32 A_had_extmsg_used[] __attribute((unused)) = {
        0x0000025a,
        0x0000029a,
        0x000002da,
 };
 
 #define A_had_msgin    0x00000040
-u32 A_had_msgin_used[] = {
+static u32 A_had_msgin_used[] __attribute((unused)) = {
        0x00000248,
        0x00000288,
        0x000002c8,
 };
 
 #define A_had_msgout   0x00000002
-u32 A_had_msgout_used[] = {
+static u32 A_had_msgout_used[] __attribute((unused)) = {
        0x00000010,
        0x00000282,
        0x000002c2,
@@ -2109,161 +2109,161 @@ u32 A_had_msgout_used[] = {
 };
 
 #define A_had_select   0x00000001
-u32 A_had_select_used[] = {
+static u32 A_had_select_used[] __attribute((unused)) = {
        0x0000000c,
 };
 
 #define A_had_status   0x00000020
-u32 A_had_status_used[] = {
+static u32 A_had_status_used[] __attribute((unused)) = {
 };
 
 #define A_int_bad_extmsg1a     0xab930000
-u32 A_int_bad_extmsg1a_used[] = {
+static u32 A_int_bad_extmsg1a_used[] __attribute((unused)) = {
        0x00000263,
 };
 
 #define A_int_bad_extmsg1b     0xab930001
-u32 A_int_bad_extmsg1b_used[] = {
+static u32 A_int_bad_extmsg1b_used[] __attribute((unused)) = {
        0x0000026b,
 };
 
 #define A_int_bad_extmsg2a     0xab930002
-u32 A_int_bad_extmsg2a_used[] = {
+static u32 A_int_bad_extmsg2a_used[] __attribute((unused)) = {
        0x000002a3,
 };
 
 #define A_int_bad_extmsg2b     0xab930003
-u32 A_int_bad_extmsg2b_used[] = {
+static u32 A_int_bad_extmsg2b_used[] __attribute((unused)) = {
        0x000002ab,
 };
 
 #define A_int_bad_extmsg3a     0xab930004
-u32 A_int_bad_extmsg3a_used[] = {
+static u32 A_int_bad_extmsg3a_used[] __attribute((unused)) = {
        0x000002e3,
 };
 
 #define A_int_bad_extmsg3b     0xab930005
-u32 A_int_bad_extmsg3b_used[] = {
+static u32 A_int_bad_extmsg3b_used[] __attribute((unused)) = {
        0x000002eb,
 };
 
 #define A_int_bad_msg1 0xab930006
-u32 A_int_bad_msg1_used[] = {
+static u32 A_int_bad_msg1_used[] __attribute((unused)) = {
        0x00000255,
 };
 
 #define A_int_bad_msg2 0xab930007
-u32 A_int_bad_msg2_used[] = {
+static u32 A_int_bad_msg2_used[] __attribute((unused)) = {
        0x00000295,
 };
 
 #define A_int_bad_msg3 0xab930008
-u32 A_int_bad_msg3_used[] = {
+static u32 A_int_bad_msg3_used[] __attribute((unused)) = {
        0x000002d5,
 };
 
 #define A_int_cmd_bad_phase    0xab930009
-u32 A_int_cmd_bad_phase_used[] = {
+static u32 A_int_cmd_bad_phase_used[] __attribute((unused)) = {
        0x00000027,
 };
 
 #define A_int_cmd_complete     0xab93000a
-u32 A_int_cmd_complete_used[] = {
+static u32 A_int_cmd_complete_used[] __attribute((unused)) = {
        0x00000037,
 };
 
 #define A_int_data_bad_phase   0xab93000b
-u32 A_int_data_bad_phase_used[] = {
+static u32 A_int_data_bad_phase_used[] __attribute((unused)) = {
        0x00000247,
 };
 
 #define A_int_disc1    0xab930019
-u32 A_int_disc1_used[] = {
+static u32 A_int_disc1_used[] __attribute((unused)) = {
        0x00000277,
 };
 
 #define A_int_disc2    0xab93001a
-u32 A_int_disc2_used[] = {
+static u32 A_int_disc2_used[] __attribute((unused)) = {
        0x000002b7,
 };
 
 #define A_int_disc3    0xab93001b
-u32 A_int_disc3_used[] = {
+static u32 A_int_disc3_used[] __attribute((unused)) = {
        0x000002f7,
 };
 
 #define A_int_msg_sdtr1        0xab93000c
-u32 A_int_msg_sdtr1_used[] = {
+static u32 A_int_msg_sdtr1_used[] __attribute((unused)) = {
        0x00000271,
 };
 
 #define A_int_msg_sdtr2        0xab93000d
-u32 A_int_msg_sdtr2_used[] = {
+static u32 A_int_msg_sdtr2_used[] __attribute((unused)) = {
        0x000002b1,
 };
 
 #define A_int_msg_sdtr3        0xab93000e
-u32 A_int_msg_sdtr3_used[] = {
+static u32 A_int_msg_sdtr3_used[] __attribute((unused)) = {
        0x000002f1,
 };
 
 #define A_int_no_msgout1       0xab93000f
-u32 A_int_no_msgout1_used[] = {
+static u32 A_int_no_msgout1_used[] __attribute((unused)) = {
        0x00000281,
 };
 
 #define A_int_no_msgout2       0xab930010
-u32 A_int_no_msgout2_used[] = {
+static u32 A_int_no_msgout2_used[] __attribute((unused)) = {
        0x000002c1,
 };
 
 #define A_int_no_msgout3       0xab930011
-u32 A_int_no_msgout3_used[] = {
+static u32 A_int_no_msgout3_used[] __attribute((unused)) = {
        0x00000301,
 };
 
 #define A_int_not_cmd_complete 0xab930012
-u32 A_int_not_cmd_complete_used[] = {
+static u32 A_int_not_cmd_complete_used[] __attribute((unused)) = {
        0x00000031,
 };
 
 #define A_int_not_rej  0xab93001c
-u32 A_int_not_rej_used[] = {
+static u32 A_int_not_rej_used[] __attribute((unused)) = {
        0x0000030d,
 };
 
 #define A_int_resel_not_msgin  0xab930016
-u32 A_int_resel_not_msgin_used[] = {
+static u32 A_int_resel_not_msgin_used[] __attribute((unused)) = {
        0x00000317,
 };
 
 #define A_int_reselected       0xab930017
-u32 A_int_reselected_used[] = {
+static u32 A_int_reselected_used[] __attribute((unused)) = {
        0x0000031b,
 };
 
 #define A_int_sel_no_ident     0xab930013
-u32 A_int_sel_no_ident_used[] = {
+static u32 A_int_sel_no_ident_used[] __attribute((unused)) = {
        0x0000000f,
 };
 
 #define A_int_sel_not_cmd      0xab930014
-u32 A_int_sel_not_cmd_used[] = {
+static u32 A_int_sel_not_cmd_used[] __attribute((unused)) = {
        0x00000019,
 };
 
 #define A_int_selected 0xab930018
-u32 A_int_selected_used[] = {
+static u32 A_int_selected_used[] __attribute((unused)) = {
        0x0000032d,
 };
 
 #define A_int_status_not_msgin 0xab930015
-u32 A_int_status_not_msgin_used[] = {
+static u32 A_int_status_not_msgin_used[] __attribute((unused)) = {
        0x0000002d,
 };
 
 #define A_msgin_buf    0x00000000
-u32 A_msgin_buf_used[] = {
+static u32 A_msgin_buf_used[] __attribute((unused)) = {
        0x0000024b,
        0x0000025f,
        0x00000267,
@@ -2280,7 +2280,7 @@ u32 A_msgin_buf_used[] = {
 };
 
 #define A_reselected_identify  0x00000000
-u32 A_reselected_identify_used[] = {
+static u32 A_reselected_identify_used[] __attribute((unused)) = {
        0x00000319,
 };
 
@@ -2304,7 +2304,7 @@ u32 A_reselected_identify_used[] = {
 #define Ent_wait_disc2 0x00000ad0
 #define Ent_wait_disc3 0x00000bd0
 #define Ent_wait_disc_complete 0x000000d0
-u32 LABELPATCHES[] = {
+static u32 LABELPATCHES[] __attribute((unused)) = {
        0x00000007,
        0x00000009,
        0x00000015,
@@ -2349,12 +2349,12 @@ u32 LABELPATCHES[] = {
        0x0000032b,
 };
 
-struct {
+static struct {
        u32     offset;
        void            *address;
-} EXTERNAL_PATCHES[] = {
+} EXTERNAL_PATCHES[] __attribute((unused)) = {
 };
 
-u32 INSTRUCTIONS       = 407;
-u32 PATCHES    = 42;
-u32 EXTERNAL_PATCHES_LEN       = 0;
+static u32 INSTRUCTIONS __attribute((unused))  = 407;
+static u32 PATCHES __attribute((unused))       = 42;
+static u32 EXTERNAL_PATCHES_LEN __attribute((unused))  = 0;
index efadc10bd68f7f18e5b6f39336867c4953c4f884..a07ddf34d8f5fc68cb2bb61b427c9f3d486f9de2 100644 (file)
@@ -5,7 +5,6 @@
 #define su_lf_ioff     u.bfs_sb.si_lf_ioff
 #define su_lf_sblk     u.bfs_sb.si_lf_sblk
 #define su_lf_eblk     u.bfs_sb.si_lf_eblk
-#define su_imap_len    u.bfs_sb.si_imap_len
 #define su_imap                u.bfs_sb.si_imap
 #define su_sbh         u.bfs_sb.si_sbh
 #define su_bfs_sb      u.bfs_sb.si_bfs_sb
index 2d037d8752c36b70d65b0154113d250ba2aedbe4..f46e9a6edfa95fcab2aa75ffbde96adb87cc0563 100644 (file)
@@ -106,8 +106,8 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode)
        if (!inode)
                return -ENOSPC;
        inode->i_sb = s;
-       ino = find_first_zero_bit(s->su_imap, s->su_imap_len);
-       if (ino >= s->su_lasti) {
+       ino = find_first_zero_bit(s->su_imap, s->su_lasti);
+       if (ino > s->su_lasti) {
                iput(inode);
                return -ENOSPC;
        }
index c0aed56651a57bbbc7eb77e92afff28e9117ee2b..f99cf7eb20768373abf6d2be4008a27e0829a9e4 100644 (file)
@@ -7,7 +7,8 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/locks.h>
 #include <linux/bfs_fs.h>
@@ -237,19 +238,21 @@ static struct super_operations bfs_sops = {
 void dump_imap(const char *prefix, struct super_block * s)
 {
 #if 0
-       int i, hibit = 8 * (s->su_imap_len) - 1;
-       char tmpbuf[400];
+       int i;
+       char *tmpbuf = (char *)get_free_page(GFP_KERNEL);
 
+       if (!tmpbuf)
+               return;
        memset(tmpbuf, 0, 400);
-       for (i=hibit; i>=0; i--) {
-               if (i>390) break;
+       for (i=s->su_lasti; i>=0; i--) {
+               if (i>PAGE_SIZE-100) break;
                if (test_bit(i, s->su_imap))
                        strcat(tmpbuf, "1");
                else
                        strcat(tmpbuf, "0");
        }
-       printk(KERN_ERR "BFS-fs: %s: lasti=%d <%s> (%d*8 bits)\n", 
-               prefix, s->su_lasti, tmpbuf, s->su_imap_len);
+       printk(KERN_ERR "BFS-fs: %s: lasti=%d <%s>\n", prefix, s->su_lasti, tmpbuf);
+       free_page((unsigned long)tmpbuf);
 #endif
 }
 
@@ -260,7 +263,7 @@ static struct super_block * bfs_read_super(struct super_block * s,
        struct buffer_head * bh;
        struct bfs_super_block * bfs_sb;
        struct inode * inode;
-       unsigned long i;
+       int i, imap_len;
 
        MOD_INC_USE_COUNT;
        lock_super(s);
@@ -292,11 +295,11 @@ static struct super_block * bfs_read_super(struct super_block * s,
        s->su_lasti = (bfs_sb->s_start - BFS_BSIZE)/sizeof(struct bfs_inode) 
                        + BFS_ROOT_INO - 1;
 
-       s->su_imap_len = s->su_lasti/8 + 1; /* 1 byte is 8 bit */
-       s->su_imap = kmalloc(s->su_imap_len, GFP_KERNEL);
+       imap_len = s->su_lasti/8 + 1;
+       s->su_imap = kmalloc(imap_len, GFP_KERNEL);
        if (!s->su_imap)
                goto out;
-       memset(s->su_imap, 0, s->su_imap_len);
+       memset(s->su_imap, 0, imap_len);
        for (i=0; i<BFS_ROOT_INO; i++)
                set_bit(i, s->su_imap);
 
index aa59a2f7fd990b67f520e401a4358dde1a1a1a97..409806fbf7f4bac6e5d55546f83849dfefdd15dd 100644 (file)
@@ -415,8 +415,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 
        retval = -ENOEXEC;
        /* First of all, some simple consistency checks */
-       if (elf_ex.e_ident[0] != 0x7f ||
-           strncmp(&elf_ex.e_ident[1], "ELF", 3) != 0)
+       if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
                goto out;
 
        if (elf_ex.e_type != ET_EXEC && elf_ex.e_type != ET_DYN)
@@ -538,8 +537,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                    (N_MAGIC(interp_ex) != QMAGIC))
                        interpreter_type = INTERPRETER_ELF;
 
-               if (interp_elf_ex.e_ident[0] != 0x7f ||
-                   strncmp(&interp_elf_ex.e_ident[1], "ELF", 3) != 0)
+               if (memcmp(interp_elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
                        interpreter_type &= ~INTERPRETER_ELF;
 
                retval = -ELIBBAD;
@@ -823,8 +821,7 @@ do_load_elf_library(int fd)
        if (retval != sizeof(elf_ex))
                goto out_putf;
 
-       if (elf_ex.e_ident[0] != 0x7f ||
-           strncmp(&elf_ex.e_ident[1], "ELF", 3) != 0)
+       if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
                goto out_putf;
 
        /* First of all, some simple consistency checks */
index aa2deaf6e78e985521f01a67887d4ac96f91e032..446a22623b050dace648039fec0b4a41d4b7c14f 100644 (file)
@@ -30,20 +30,17 @@ static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
        /* Make sure this is a Linux/Intel ELF executable... */
        elf_ex = *((struct elfhdr *)bprm->buf);
 
-        if (elf_ex.e_ident[0] != 0x7f ||
-            strncmp(&elf_ex.e_ident[1], "ELF",3) != 0) {
-                return  -ENOEXEC;
-        }
-
-
-        /* First of all, some simple consistency checks */
-        if ((elf_ex.e_type != ET_EXEC &&
-            elf_ex.e_type != ET_DYN) ||
-           (!((elf_ex.e_machine == EM_386) || (elf_ex.e_machine == EM_486))) ||
-           (!bprm->dentry->d_inode->i_op || !bprm->dentry->d_inode->i_op->default_file_ops ||
-            !bprm->dentry->d_inode->i_op->default_file_ops->mmap)){
-                return -ENOEXEC;
-        }
+       if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
+               return  -ENOEXEC;
+
+       /* First of all, some simple consistency checks */
+       if ((elf_ex.e_type != ET_EXEC && elf_ex.e_type != ET_DYN) ||
+               (!((elf_ex.e_machine == EM_386) || (elf_ex.e_machine == EM_486))) ||
+               (!bprm->dentry->d_inode->i_op || 
+               !bprm->dentry->d_inode->i_op->default_file_ops ||
+               !bprm->dentry->d_inode->i_op->default_file_ops->mmap)) {
+                       return -ENOEXEC;
+       }
 
        bprm->sh_bang++;        /* Well, the bang-shell is implicit... */
        dput(bprm->dentry);
index 40c1ef7ee8b32bafa48ee7893cd70c80724cabef..0016f759af54f879d60fdeb2eee3f202ee110ab8 100644 (file)
@@ -1293,13 +1293,15 @@ static void create_empty_buffers(struct page *page, struct inode *inode, unsigne
 static void unmap_underlying_metadata(struct buffer_head * bh)
 {
 #if 0
-       bh = get_hash_table(bh->b_dev, bh->b_blocknr, bh->b_size);
-       if (bh) {
-               unmap_buffer(bh);
-               /* Here we could run brelse or bforget. We use
-                  bforget because it will try to put the buffer
-                  in the freelist. */
-               __bforget(bh);
+       if (buffer_new(bh)) {
+               struct old_bh = get_hash_table(bh->b_dev, bh->b_blocknr, bh->b_size);
+               if (old_bh) {
+                       unmap_buffer(old_bh);
+                       /* Here we could run brelse or bforget. We use
+                          bforget because it will try to put the buffer
+                          in the freelist. */
+                       __bforget(old_bh);
+               }
        }
 #endif
 }
@@ -1326,7 +1328,7 @@ int block_write_full_page(struct file *file, struct page *page)
        /* The page cache is now PAGE_CACHE_SIZE aligned, period.  We handle old a.out
         * and others via unaligned private mappings.
         */
-       block = page->pg_offset << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
+       block = page->index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
 
        bh = head;
        i = 0;
@@ -1387,7 +1389,7 @@ int block_write_partial_page(struct file *file, struct page *page, unsigned long
        head = page->buffers;
 
        bbits = inode->i_sb->s_blocksize_bits;
-       block = page->pg_offset << (PAGE_CACHE_SHIFT - bbits);
+       block = page->index << (PAGE_CACHE_SHIFT - bbits);
        blocks = PAGE_CACHE_SIZE >> bbits;
        start_block = offset >> bbits;
        end_block = (offset + bytes - 1) >> bbits;
@@ -1532,8 +1534,8 @@ int block_write_cont_page(struct file *file, struct page *page, unsigned long of
        unsigned long data_offset = offset;
        int need_balance_dirty;
 
-       offset = inode->i_size - (page->pg_offset << PAGE_CACHE_SHIFT);
-       if (page->pg_offset > (inode->i_size >> PAGE_CACHE_SHIFT))
+       offset = inode->i_size - (page->index << PAGE_CACHE_SHIFT);
+       if (page->index > (inode->i_size >> PAGE_CACHE_SHIFT))
                offset = 0;
        else if (offset >= data_offset)
                offset = data_offset;
@@ -1551,7 +1553,7 @@ int block_write_cont_page(struct file *file, struct page *page, unsigned long of
        head = page->buffers;
 
        bbits = inode->i_sb->s_blocksize_bits;
-       block = page->pg_offset << (PAGE_CACHE_SHIFT - bbits);
+       block = page->index << (PAGE_CACHE_SHIFT - bbits);
        blocks = PAGE_CACHE_SIZE >> bbits;
        start_block = offset >> bbits;
        end_block = (offset + bytes - 1) >> bbits;
@@ -2008,7 +2010,7 @@ int block_read_full_page(struct file * file, struct page * page)
        head = page->buffers;
 
        blocks = PAGE_CACHE_SIZE >> inode->i_sb->s_blocksize_bits;
-       iblock = page->pg_offset << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
+       iblock = page->index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
        bh = head;
        nr = 0;
 
index 378c4f7a6b04d06b70511e29a860ddd3fd643a55..d5cf1afef3a56d72975600b9c45bb56d14822be5 100644 (file)
@@ -99,7 +99,7 @@ static int coda_readpage(struct file * coda_file, struct page * page)
                              &cont_file, &cont_dentry);
 
         CDEBUG(D_INODE, "coda ino: %ld, cached ino %ld, page offset: %lx\n", 
-              coda_inode->i_ino, cii->c_ovp->i_ino, page->offset);
+              coda_inode->i_ino, cii->c_ovp->i_ino, page->index);
 
         block_read_full_page(&cont_file, page);
         EXIT;
index 505dc4e06933ee58ea4d02d853d5fd557bc3d1fb..1706bbc3abb1869d6f3a8d672ccae38825b37181 100644 (file)
@@ -118,8 +118,8 @@ static int fat_write_partial_page(struct file *file, struct page *page, unsigned
        struct page *page_cache = NULL;
        long status;
 
-       pgpos = MSDOS_I(inode)->i_realsize & PAGE_CACHE_MASK;
-       while (pgpos < page->offset) {
+       pgpos = MSDOS_I(inode)->i_realsize >> PAGE_CACHE_SHIFT;
+       while (pgpos < page->index) {
                hash = page_hash(&inode->i_data, pgpos);
 repeat_find:   new_page = __find_lock_page(&inode->i_data, pgpos, hash);
                if (!new_page) {
@@ -140,7 +140,7 @@ repeat_find:        new_page = __find_lock_page(&inode->i_data, pgpos, hash);
                page_cache_release(new_page);
                if (status < 0)
                        goto out;
-               pgpos = MSDOS_I(inode)->i_realsize & PAGE_CACHE_MASK;
+               pgpos = MSDOS_I(inode)->i_realsize >> PAGE_CACHE_SHIFT;
        }
        status = block_write_cont_page(file, page, offset, bytes, buf);
 out:
index bb4e0031fa5985bd6bc403fde054f90a759dea88..811bf575de66e81a5484f46e2fe9f09eb9ef54bc 100644 (file)
@@ -518,8 +518,7 @@ static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, s
                spin_lock(&inode_lock);
                /* We released the lock, so.. */
                old = find_inode(sb, ino, head, find_actor, opaque);
-               if (!old)
-               {
+               if (!old) {
                        list_add(&inode->i_list, &inode_in_use);
                        list_add(&inode->i_hash, head);
                        inode->i_sb = sb;
@@ -546,7 +545,13 @@ static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, s
 
                        return inode;
                }
-               __iget(inode);
+
+               /*
+                * Uhhuh, somebody else created the same inode under
+                * us. Use the old inode instead of the one we just
+                * allocated.
+                */
+               __iget(old);
                spin_unlock(&inode_lock);
                destroy_inode(inode);
                inode = old;
index d3af541ddd2340f8812aa67f6e497e61f1a00b50..b9459c7d514bcd7ac8fc23b0c0e2ec1b32d1c247 100644 (file)
 
 #include "ncplib_kernel.h"
 
-static int ncp_read_volume_list(struct file *, void *, filldir_t);
-static int ncp_do_readdir(struct file *, void *, filldir_t);
+static void ncp_read_volume_list(struct file *, void *, filldir_t,
+                               struct ncp_cache_control *);
+static void ncp_do_readdir(struct file *, void *, filldir_t,
+                               struct ncp_cache_control *);
 
 static ssize_t ncp_dir_read(struct file *, char *, size_t, loff_t *);
 static int ncp_readdir(struct file *, void *, filldir_t);
@@ -171,10 +173,8 @@ ncp_delete_dentry(struct dentry * dentry)
                 * (Somebody might have used it again ...)
                 */
                if (dentry->d_count == 1 && NCP_FINFO(inode)->opened) {
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_delete_dentry: closing file %s/%s\n",
-dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+                       PPRINTK("ncp_delete_dentry: closing file %s/%s\n",
+                       dentry->d_parent->d_name.name, dentry->d_name.name);
                        ncp_make_closed(inode);
                }
        } else
@@ -310,7 +310,7 @@ ncp_lookup_validate(struct dentry * dentry, int flags)
 
        if (!dentry->d_inode || !dir)
                goto finished;
-        
+
        server = NCP_SERVER(dir);
 
        if (!ncp_conn_valid(server))
@@ -325,19 +325,18 @@ ncp_lookup_validate(struct dentry * dentry, int flags)
        val = NCP_TEST_AGE(server, dentry);
        if (val)
                goto finished;
-#ifdef NCPFS_PARANOIA
-       printk(KERN_DEBUG "ncp_lookup_validate: %s/%s not valid, age=%ld\n",
+
+       PPRINTK("ncp_lookup_validate: %s/%s not valid, age=%ld\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
                NCP_GET_AGE(dentry));
-#endif
 
        memcpy(__name, dentry->d_name.name, len);
        __name[len] = '\0';
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup_validate: %s, len %d\n", __name, len);
-printk(KERN_DEBUG "ncp_lookup_validate: server lookup for %s/%s\n",
-dentry->d_parent->d_name.name, __name);
-#endif
+
+       PPRINTK("ncp_lookup_validate: %s, len %d\n", __name, len);
+       PPRINTK("ncp_lookup_validate: server lookup for %s/%s\n",
+                       dentry->d_parent->d_name.name, __name);
+
        if (ncp_is_server_root(dir)) {
                io2vol(server, __name, 1);
                res = ncp_lookup_volume(server, __name, &(finfo.i));
@@ -345,10 +344,8 @@ dentry->d_parent->d_name.name, __name);
                io2vol(server, __name, !ncp_preserve_case(dir));
                res = ncp_obtain_info(server, dir, __name, &(finfo.i));
        }
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup_validate: looked for %s/%s, res=%d\n",
-dentry->d_parent->d_name.name, __name, res);
-#endif
+       PPRINTK("ncp_lookup_validate: looked for %s/%s, res=%d\n",
+               dentry->d_parent->d_name.name, __name, res);
        /*
         * If we didn't find it, or if it has a different dirEntNum to
         * what we remember, it's not valid any more.
@@ -356,359 +353,412 @@ dentry->d_parent->d_name.name, __name, res);
        if (!res) {
                if (finfo.i.dirEntNum == NCP_FINFO(dentry->d_inode)->dirEntNum)
                        val=1;
-#ifdef NCPFS_PARANOIA
                else
-                       printk(KERN_DEBUG "ncp_lookup_validate: found, but dirEntNum changed\n");
-#endif
+                       PPRINTK("ncp_lookup_validate: found, but dirEntNum changed\n");
+
                vol2io(server, finfo.i.entryName,
                        !ncp_preserve_entry_case(dir, finfo.i.NSCreator));
                ncp_update_inode2(dentry->d_inode, &finfo);
-               ncp_new_dentry(dentry);
+               if (val)
+                       ncp_new_dentry(dentry);
        }
 
 finished:
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup_validate: result=%d\n", val);
-#endif
-
+       PPRINTK("ncp_lookup_validate: result=%d\n", val);
        return val;
 }
 
+static struct page *
+ncp_get_cache_page(struct inode *inode, unsigned long offset, int used)
+{
+       struct page *page, **hash;
+       struct page *page_cache;
+
+       hash = page_hash(&inode->i_data, offset);
+       page = __find_lock_page(&inode->i_data, offset, hash);
+
+       if (used || page)
+               return page;
+
+       page_cache = page_cache_alloc();
+       if (page_cache) {
+               page = page_cache;
+               if (add_to_page_cache_unique(page, &inode->i_data, offset, hash)) {
+                       page_cache_release(page);
+                       page = NULL;
+                       page_cache_free(page_cache);
+               }
+       }
+       return page;
+}
+
+/* most parts from nfsd_d_validate() */
+static int
+ncp_d_validate(struct dentry *dentry)
+{
+       unsigned long dent_addr = (unsigned long) dentry;
+       unsigned long min_addr = PAGE_OFFSET;
+       unsigned long max_addr = min_addr + (max_mapnr << PAGE_SHIFT);
+       unsigned long align_mask = 0x0F;
+       unsigned int len;
+       int valid = 0;
+
+       if (dent_addr < min_addr)
+               goto bad_addr;
+       if (dent_addr > max_addr - sizeof(struct dentry))
+               goto bad_addr;
+       if ((dent_addr & ~align_mask) != dent_addr)
+               goto bad_align;
+       if (!kern_addr_valid(dent_addr))
+               goto bad_addr;
+       /*
+        * Looks safe enough to dereference ...
+        */
+       len = dentry->d_name.len;
+       if (len > NCP_MAXPATHLEN)
+               goto out;
+       /*
+        * Note: d_validate doesn't dereference the parent pointer ...
+        * just combines it with the name hash to find the hash chain.
+        */
+       valid = d_validate(dentry, dentry->d_parent, dentry->d_name.hash, len);
+out:
+       return valid;
+
+bad_addr:
+       PRINTK("ncp_d_validate: invalid address %lx\n", dent_addr);
+       goto out;
+bad_align:
+       PRINTK("ncp_d_validate: unaligned address %lx\n", dent_addr);
+       goto out;
+}
+
+static struct dentry *
+ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
+{
+       struct dentry *dent = dentry;
+       struct list_head *next;
+
+       if (ncp_d_validate(dent))
+               if ((dent->d_parent == parent) &&
+                   ((unsigned long)dent->d_fsdata == fpos))
+                       goto out;
+
+       /* If a pointer is invalid, we search the dentry. */
+       next = parent->d_subdirs.next;
+       while (next != &parent->d_subdirs) {
+               dent = list_entry(next, struct dentry, d_child);
+               if ((unsigned long)dent->d_fsdata == fpos)
+                       goto out;
+               next = next->next;
+       }
+       dent = NULL;
+out:
+       if (dent)
+               if (dent->d_inode)
+                       return dget(dent);
+       return NULL;
+}
 
 static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
        struct dentry *dentry = filp->f_dentry;
        struct inode *inode = dentry->d_inode;
+       struct page *page = NULL;
        struct ncp_server *server = NCP_SERVER(inode);
-       int entries, result;
+       union  ncp_dir_cache *cache = NULL;
+       struct ncp_cache_control ctl;
+       int result;
 
-       DDPRINTK(KERN_DEBUG "ncp_readdir: reading %s/%s, pos=%d\n",
+       ctl.page  = NULL;
+       ctl.cache = NULL;
+
+       DDPRINTK("ncp_readdir: reading %s/%s, pos=%d\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
                (int) filp->f_pos);
 
        result = -EIO;
        if (!ncp_conn_valid(server))
-               goto finished;
+               goto out;
 
        result = 0;
        if (filp->f_pos == 0) {
                if (filldir(dirent, ".", 1, 0, inode->i_ino))
-                       goto finished;
+                       goto out;
                filp->f_pos = 1;
        }
        if (filp->f_pos == 1) {
                if (filldir(dirent, "..", 2, 1,
                                dentry->d_parent->d_inode->i_ino))
-                       goto finished;
+                       goto out;
                filp->f_pos = 2;
        }
 
+       page = ncp_get_cache_page(inode, 0, 0);
+       if (!page)
+               goto read_really;
+       ctl.cache = cache = (union ncp_dir_cache *) page_address(page);
+       ctl.head  = cache->head;
+       if (!Page_Uptodate(page) || !ctl.head.eof)
+               goto init_cache;
+       if ((filp->f_pos == 2) &&
+           (jiffies - ctl.head.time >= NCP_MAX_AGE(server)))
+               /* Test, whether inode is changed. */
+/*             if (...)        */
+                       goto init_cache;
+               /* Todo, if inode is unchanged? */
+/*             else {
+                       ncp_renew_dentries(dentry);
+                       ctl.head.time = jiffies;
+               }       */
+       if (filp->f_pos > ctl.head.end)
+               goto finished;
+       /*
+        * Should we check the complete cache before using?
+        * If we have big dirs, it can take a long time.
+        */
+       ctl.fpos = filp->f_pos + (NCP_DIRCACHE_START - 2);
+       ctl.ofs  = ctl.fpos / NCP_DIRCACHE_SIZE;
+       ctl.idx  = ctl.fpos % NCP_DIRCACHE_SIZE;
+       for (;;) {
+               if (ctl.ofs != 0) {
+                       ctl.page = ncp_get_cache_page(inode, ctl.ofs, 1);
+                       if (!ctl.page)
+                               goto invalid_cache;
+                       if (!Page_Uptodate(ctl.page))
+                               goto invalid_cache;
+                       ctl.cache = (union ncp_dir_cache *)
+                                       page_address(ctl.page);
+               }
+               while (ctl.idx < NCP_DIRCACHE_SIZE) {
+                       struct dentry *dent;
+                       int res;
+                       dent = ncp_dget_fpos(ctl.cache->dentry[ctl.idx],
+                                               dentry, filp->f_pos);
+                       if (!dent)
+                               goto invalid_cache;
+                       res = filldir(dirent, dent->d_name.name,
+                                       dent->d_name.len, filp->f_pos,
+                                       dent->d_inode->i_ino);
+                       dput(dent);
+                       if (res)
+                               goto finished;
+                       filp->f_pos += 1;
+                       ctl.idx += 1;
+                       if (filp->f_pos > ctl.head.end)
+                               goto finished;
+               }
+               if (ctl.page) {
+                       SetPageUptodate(ctl.page);
+                       UnlockPage(ctl.page);
+                       page_cache_release(ctl.page);
+                       ctl.page = NULL;
+               }
+               ctl.idx  = 0;
+               ctl.ofs += 1;
+       }
+invalid_cache:
+       if (ctl.page) {
+               UnlockPage(ctl.page);
+               page_cache_release(ctl.page);
+               ctl.page = NULL;
+       }
+       ctl.cache = cache;
+init_cache:
+       ncp_invalidate_dircache_entries(dentry);
+       ctl.head.time = jiffies;
+       ctl.head.eof = 0;
+       ctl.fpos = 2;
+       ctl.ofs = 0;
+       ctl.idx = NCP_DIRCACHE_START;
+       ctl.filled = 0;
+       ctl.valid  = 1;
+read_really:
        if (ncp_is_server_root(inode)) {
-               entries = ncp_read_volume_list(filp, dirent, filldir);
-               DPRINTK(KERN_DEBUG "ncp_read_volume_list returned %d\n", entries);
+               ncp_read_volume_list(filp, dirent, filldir, &ctl);
        } else {
-               entries = ncp_do_readdir(filp, dirent, filldir);
-               DPRINTK(KERN_DEBUG "ncp_readdir: returned %d\n", entries);
+               ncp_do_readdir(filp, dirent, filldir, &ctl);
        }
-
-       if (entries < 0)
-               result = entries;
-
+       ctl.head.end = ctl.fpos - 1;
+       ctl.head.eof = ctl.valid;
 finished:
+       if (page) {
+               cache->head = ctl.head;
+               SetPageUptodate(page);
+               UnlockPage(page);
+               page_cache_release(page);
+       }
+       if (ctl.page) {
+               SetPageUptodate(ctl.page);
+               UnlockPage(ctl.page);
+               page_cache_release(ctl.page);
+       }
+out:
        return result;
 }
 
 static int
-ncp_do_simple_filldir(struct file *filp, char* name, int len,
-               void* dirent, filldir_t filldir)
+ncp_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
+               struct ncp_cache_control *ctrl, struct ncp_entry_info *entry)
 {
-       struct dentry *dentry = filp->f_dentry;
+       struct dentry *newdent, *dentry = filp->f_dentry;
+       struct inode *newino, *inode = dentry->d_inode;
+       struct ncp_server *server = NCP_SERVER(inode);
+       struct ncp_cache_control ctl = *ctrl;
        struct qstr qname;
        ino_t ino = 0;
-       int result;
-       
-       qname.name = name;
-       qname.len = len;
-       
-       ino = find_inode_number(dentry, &qname);
+       int valid = 0;
 
-       if (!ino)
-               ino = iunique(dentry->d_inode->i_sb, 2);
-
-       result = filldir(dirent, name, len, filp->f_pos, ino);
-       if (!result)
-               filp->f_pos += 1;
-
-       return result;
-}      
-       
-static int
-ncp_do_filldir(struct file *filp, struct ncp_entry_info *entry, void *dirent,
-                       filldir_t filldir)
-{
-       struct dentry *dentry = filp->f_dentry;
-       struct inode *inode = dentry->d_inode;
-       struct qstr qname;
-       ino_t ino = 0;
-       int result;
+       vol2io(server, entry->i.entryName,
+               !ncp_preserve_entry_case(inode, entry->i.NSCreator));
 
-       /* For getwd() we have to return the correct inode in d_ino if the
-        * inode is currently in use. Otherwise the inode number does not
-        * matter. (You can argue a lot about this..)
-        */
        qname.name = entry->i.entryName;
        qname.len  = entry->i.nameLen;
+       qname.hash = full_name_hash(qname.name, qname.len);
 
-       {
-               struct dentry *newdent;
-               struct inode *newino;
-
-               qname.hash = full_name_hash(qname.name, qname.len);
-               if (dentry->d_op && dentry->d_op->d_hash)
-                       if (dentry->d_op->d_hash(dentry, &qname) != 0)
-                               goto end_advance;
-
-               newdent = d_lookup(dentry, &qname);
+       if (dentry->d_op && dentry->d_op->d_hash)
+               if (dentry->d_op->d_hash(dentry, &qname) != 0)
+                       goto end_advance;
 
-               if (!newdent) {
-                       newdent = d_alloc(dentry, &qname);
-                       if (!newdent)
-                               goto end_advance;
-               }
+       newdent = d_lookup(dentry, &qname);
 
-               if (!newdent->d_inode) {
-                       entry->opened = 0;
-                       entry->ino = iunique(inode->i_sb, 2);
-                       newino = ncp_iget(inode->i_sb, entry);
-                       if (newino) {
-                               newdent->d_op = &ncp_dentry_operations;
-                               d_add(newdent, newino);
-                               ncp_new_dentry(newdent);
-                       }
-               } else {
-                       ncp_update_inode2(newdent->d_inode, entry);
-                       ncp_new_dentry(newdent);
+       if (!newdent) {
+               newdent = d_alloc(dentry, &qname);
+               if (!newdent)
+                       goto end_advance;
+       } else
+               memcpy((char *) newdent->d_name.name, qname.name,
+                                                       newdent->d_name.len);
+
+       if (!newdent->d_inode) {
+               entry->opened = 0;
+               entry->ino = iunique(inode->i_sb, 2);
+               newino = ncp_iget(inode->i_sb, entry);
+               if (newino) {
+                       newdent->d_op = &ncp_dentry_operations;
+                       d_add(newdent, newino);
                }
+       } else
+               ncp_update_inode2(newdent->d_inode, entry);
 
-               if (newdent->d_inode)
-                       ino = newdent->d_inode->i_ino;
-
-               dput(newdent);
+       if (newdent->d_inode) {
+               ino = newdent->d_inode->i_ino;
+               newdent->d_fsdata = (void *) ctl.fpos;
+               ncp_new_dentry(newdent);
+       }
 
+       if (ctl.idx >= NCP_DIRCACHE_SIZE) {
+               if (ctl.page) {
+                       SetPageUptodate(ctl.page);
+                       UnlockPage(ctl.page);
+                       page_cache_release(ctl.page);
+               }
+               ctl.cache = NULL;
+               ctl.idx  -= NCP_DIRCACHE_SIZE;
+               ctl.ofs  += 1;
+               ctl.page  = ncp_get_cache_page(inode, ctl.ofs, 0);
+               if (ctl.page)
+                       ctl.cache = (union ncp_dir_cache *)
+                                       page_address(ctl.page);
+       }
+       if (ctl.cache) {
+               ctl.cache->dentry[ctl.idx] = newdent;
+               valid = 1;
+       }
+       dput(newdent);
 end_advance:
+       if (!valid)
+               ctl.valid = 0;
+       if (!ctl.filled && (ctl.fpos == filp->f_pos)) {
+               if (!ino)
+                       ino = find_inode_number(dentry, &qname);
+               if (!ino)
+                       ino = iunique(inode->i_sb, 2);
+               ctl.filled = filldir(dirent, entry->i.entryName,
+                                       entry->i.nameLen, filp->f_pos, ino);
+               if (!ctl.filled)
+                       filp->f_pos += 1;
        }
-       if (!ino)
-               ino = find_inode_number(dentry, &qname);
-
-       if (!ino)
-               ino = iunique(inode->i_sb, 2);
-
-       result = filldir(dirent, entry->i.entryName, entry->i.nameLen,
-                               filp->f_pos, ino);
-       if (!result)
-               filp->f_pos += 1;
-
-       return result;
+       ctl.fpos += 1;
+       ctl.idx  += 1;
+       *ctrl = ctl;
+       return (ctl.valid || !ctl.filled);
 }
 
-static int 
-ncp_read_volume_list(struct file *filp, void *dirent, filldir_t filldir)
+static void
+ncp_read_volume_list(struct file *filp, void *dirent, filldir_t filldir,
+                       struct ncp_cache_control *ctl)
 {
        struct dentry *dentry = filp->f_dentry;
        struct inode *inode = dentry->d_inode;
        struct ncp_server *server = NCP_SERVER(inode);
        struct ncp_volume_info info;
        struct ncp_entry_info entry;
-       unsigned long total_count = 2, fpos = filp->f_pos;
        int i;
 
-       DPRINTK(KERN_DEBUG "ncp_read_volume_list: pos=%ld\n", fpos);
+       DPRINTK("ncp_read_volume_list: pos=%ld\n",
+                       (unsigned long) filp->f_pos);
 
        for (i = 0; i < NCP_NUMBER_OF_VOLUMES; i++) {
 
                if (ncp_get_volume_info_with_number(server, i, &info) != 0)
-                       break;
+                       return;
                if (!strlen(info.volume_name))
                        continue;
 
-               if (total_count < fpos) {
-                       DPRINTK(KERN_DEBUG "ncp_read_volume_list: skipped vol: %s\n",
-                               info.volume_name);
-               } else {
-                       DPRINTK(KERN_DEBUG "ncp_read_volume_list: found vol: %s\n",
-                               info.volume_name);
+               DPRINTK("ncp_read_volume_list: found vol: %s\n",
+                       info.volume_name);
 
-                       if (ncp_lookup_volume(server, info.volume_name,
-                                               &entry.i)) {
-                               DPRINTK(KERN_DEBUG "ncpfs: could not lookup vol %s\n",
-                                       info.volume_name);
-                               continue;
-                       }
-                       vol2io(server, entry.i.entryName,
-                               !ncp_preserve_entry_case(inode, entry.i.NSCreator));
-                       if (ncp_do_filldir(filp, &entry, dirent, filldir))
-                               break;
+               if (ncp_lookup_volume(server, info.volume_name,
+                                       &entry.i)) {
+                       DPRINTK("ncpfs: could not lookup vol %s\n",
+                               info.volume_name);
+                       continue;
                }
-               total_count += 1;
+               if (!ncp_fill_cache(filp, dirent, filldir, ctl, &entry))
+                       return;
        }
-
-       return (total_count - fpos);
 }
 
-static int ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir)
+static void ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
+                               struct ncp_cache_control *ctl)
 {
        struct dentry *dentry = filp->f_dentry;
        struct inode *dir = dentry->d_inode;
        struct ncp_server *server = NCP_SERVER(dir);
-       struct ncp_seq_cache *cache = NULL;
-       struct ncp_cache_control ctl;
+       struct nw_search_sequence seq;
        struct ncp_entry_info entry;
-       struct page *page, **hash;
-       unsigned long total_count = 0, fpos = filp->f_pos;
        int err;
 
-       DPRINTK(KERN_DEBUG "ncp_do_readdir: %s/%s, fpos=%ld\n",
-               dentry->d_parent->d_name.name, dentry->d_name.name, fpos);
-
-#ifdef NCPFS_DEBUG_VERBOSE
-printk("ncp_do_readdir: finding cache for %s/%s\n",
-       dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
-
-       /* cache using inspired by smbfs and nfs */
-       hash = page_hash(&dir->i_data, 0);
-
-       page = __find_lock_page(&dir->i_data, 0, hash);
-
-       if (!page) {
-               unsigned long page_cache;
-
-               page_cache = page_cache_alloc();
-               if (page_cache) {
-                       page = page_cache_entry(page_cache);
-                       if (add_to_page_cache_unique(page, &dir->i_data, 0, hash)) {
-                               page_cache_release(page);
-                               page = NULL;
-                               page_cache_free(page_cache);
-                       }
-               }
-       }
-
-       if (!page)
-               goto start_search;
-
-       cache = (struct ncp_seq_cache *) page_address(page);
-       ctl = cache->ctl;
-
-       if (!Page_Uptodate(page))
-               ctl.currentpos = NCP_FPOS_EMPTY;
-
-       if ((fpos == 2) || (fpos < ctl.firstcache))
-               ctl.currentpos = NCP_FPOS_EMPTY;
-
-       if (ctl.currentpos == NCP_FPOS_EMPTY)
-               goto start_search;
-
-       {
-               int fetchpos = ctl.cachehead;
-               int readpos = ctl.firstcache;
-               
-               while (readpos < fpos) {
-                       fetchpos += cache->cache[fetchpos] + 1;
-                       readpos++;
-               }
-               while (fpos < ctl.currentpos) {
-                       err = ncp_do_simple_filldir(filp, 
-                               (char*)(cache->cache+fetchpos+1), 
-                               cache->cache[fetchpos], 
-                               dirent, filldir);
-                       if (err)
-                               goto out;
-                       fetchpos += cache->cache[fetchpos] + 1;
-                       fpos++;
-                       total_count++;
-               }
+       DPRINTK("ncp_do_readdir: %s/%s, fpos=%ld\n",
+               dentry->d_parent->d_name.name, dentry->d_name.name,
+               (unsigned long) filp->f_pos);
+       PPRINTK("ncp_do_readdir: init %s, volnum=%d, dirent=%u\n",
+               dentry->d_name.name, NCP_FINFO(dir)->volNumber,
+               NCP_FINFO(dir)->dirEntNum);
+
+       err = ncp_initialize_search(server, dir, &seq);
+       if (err) {
+               DPRINTK("ncp_do_readdir: init failed, err=%d\n", err);
+               return;
        }
-       
-start_search:
-
-       DDPRINTK(KERN_DEBUG "ncp_do_readdir: %s: f_pos=%ld,total_count=%ld\n",
-                       dentry->d_name.name, fpos, total_count);
-
-       if (ctl.currentpos == NCP_FPOS_EMPTY) {
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_do_readdir: init %s, volnum=%d, dirent=%u\n",
-dentry->d_name.name, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum);
-#endif
-               err = ncp_initialize_search(server, dir, &ctl.seq); 
-               if (err) {
-                       DPRINTK(KERN_DEBUG "ncp_do_readdir: init failed, err=%d\n", err);
-                       goto out;
-               }
-               ctl.eof = 0;
-               ctl.cachehead = ctl.cachetail = 0;
-               ctl.firstcache = ctl.currentpos = 2;
-       } else
-               DDPRINTK(KERN_DEBUG "ncp_do_readdir: reused seq for %s, fpos=%li\n",
-                               dentry->d_name.name, total_count);
-
        for (;;) {
-               err = ncp_search_for_file_or_subdir(server, &ctl.seq,
-                                                   &entry.i);
+               err = ncp_search_for_file_or_subdir(server, &seq, &entry.i);
                if (err) {
-                       DPRINTK(KERN_DEBUG "ncp_do_readdir: search failed, err=%d\n", err);
-                       ctl.eof = 1;
-                       break;
-               }
-
-               ctl.currentpos++;
-               
-               vol2io(server, entry.i.entryName,
-                       !ncp_preserve_entry_case(dir, entry.i.NSCreator));
-                       
-               if (page) {
-                       int tlen = ctl.cachetail + entry.i.nameLen + 1;
-                       
-                       if (tlen > NCP_DIRCACHE_SIZE) {
-                               int ofs = ctl.cachehead;
-                               
-                               while (tlen - ofs > NCP_DIRCACHE_SIZE) {
-                                       ofs += cache->cache[ofs] + 1;
-                                       ctl.firstcache++;
-                               }
-                               ctl.cachetail -= ofs;
-                               memmove(cache->cache+0,
-                                       cache->cache+ofs,
-                                       ctl.cachetail);
-                       }
-                       cache->cache[ctl.cachetail++] = entry.i.nameLen;
-                       memcpy(cache->cache+ctl.cachetail, 
-                              entry.i.entryName, entry.i.nameLen);
-                       ctl.cachetail += entry.i.nameLen;
-               }
-               if (ctl.currentpos < fpos) {
-                       DPRINTK(KERN_DEBUG "ncp_do_readdir: skipped file: %s/%s\n",
-                               dentry->d_name.name, entry.i.entryName);
-               } else {
-                       DDPRINTK(KERN_DEBUG "ncp_do_r: file: %s, f_pos=%ld,total_count=%ld",
-                               entry.i.entryName, fpos, total_count);
-                       if (ncp_do_filldir(filp, &entry, dirent, filldir))
-                               break;
+                       DPRINTK("ncp_do_readdir: search failed, err=%d\n", err);
+                       return;
                }
-               total_count++;
-               fpos++;
+               if (!ncp_fill_cache(filp, dirent, filldir, ctl, &entry))
+                       return;
        }
-out:
-       if (page) {
-               cache->ctl = ctl;
-               SetPageUptodate(page);
-               UnlockPage(page);
-               page_cache_release(page);
-       }
-
-       DDPRINTK(KERN_DEBUG "ncp_do_readdir: %s: return=%ld\n",
-                       dentry->d_name.name, total_count);
-       return total_count;
 }
 
 int ncp_conn_logged_in(struct super_block *sb)
@@ -723,9 +773,8 @@ int ncp_conn_logged_in(struct super_block *sb)
                result = -ENOENT;
                io2vol(server, server->m.mounted_vol, 1);
                if (ncp_lookup_volume(server, server->m.mounted_vol, &i)) {
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_conn_logged_in: %s not found\n", server->m.mounted_vol);
-#endif
+                       PPRINTK("ncp_conn_logged_in: %s not found\n",
+                               server->m.mounted_vol);
                        goto out;
                }
                vol2io(server, i.entryName, 1);
@@ -737,10 +786,10 @@ printk(KERN_DEBUG "ncp_conn_logged_in: %s not found\n", server->m.mounted_vol);
                                NCP_FINFO(ino)->dirEntNum = i.dirEntNum;
                                NCP_FINFO(ino)->DosDirNum = i.DosDirNum;
                        } else {
-                               DPRINTK(KERN_DEBUG "ncpfs: sb->s_root->d_inode == NULL!\n");
+                               DPRINTK("ncpfs: sb->s_root->d_inode == NULL!\n");
                        }
                } else {
-                       DPRINTK(KERN_DEBUG "ncpfs: sb->s_root == NULL!\n");
+                       DPRINTK("ncpfs: sb->s_root == NULL!\n");
                }
        }
        result = 0;
@@ -765,11 +814,9 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry)
 
        memcpy(__name, dentry->d_name.name, len);
        __name[len] = '\0';
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup: %s, len %d\n", __name, len);
-printk(KERN_DEBUG "ncp_lookup: server lookup for %s/%s\n",
-dentry->d_parent->d_name.name, __name);
-#endif
+       PPRINTK("ncp_lookup: %s, len %d\n", __name, len);
+       PPRINTK("ncp_lookup: server lookup for %s/%s\n",
+               dentry->d_parent->d_name.name, __name);
        if (ncp_is_server_root(dir)) {
                io2vol(server, __name, 1);
                res = ncp_lookup_volume(server, __name, &(finfo.i));
@@ -777,10 +824,8 @@ dentry->d_parent->d_name.name, __name);
                io2vol(server, __name, !ncp_preserve_case(dir));
                res = ncp_obtain_info(server, dir, __name, &(finfo.i));
        }
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup: looked for %s/%s, res=%d\n",
-dentry->d_parent->d_name.name, __name, res);
-#endif
+       PPRINTK("ncp_lookup: looked for %s/%s, res=%d\n",
+               dentry->d_parent->d_name.name, __name, res);
        /*
         * If we didn't find an entry, make a negative dentry.
         */
@@ -807,9 +852,7 @@ add_entry:
        }
 
 finished:
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_lookup: result=%d\n", error);
-#endif
+       PPRINTK("ncp_lookup: result=%d\n", error);
        return ERR_PTR(error);
 }
 
@@ -832,10 +875,8 @@ out:
        return error;
 
 out_close:
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_instantiate: %s/%s failed, closing file\n",
-dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+       PPRINTK("ncp_instantiate: %s/%s failed, closing file\n",
+               dentry->d_parent->d_name.name, dentry->d_name.name);
        ncp_close_file(NCP_SERVER(dir), finfo->file_handle);
        goto out;
 }
@@ -848,10 +889,8 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
        struct ncp_server *server = NCP_SERVER(dir);
        __u8 _name[dentry->d_name.len + 1];
        
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_create_new: creating %s/%s, mode=%x\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, mode);
-#endif
+       PPRINTK("ncp_create_new: creating %s/%s, mode=%x\n",
+               dentry->d_parent->d_name.name, dentry->d_name.name, mode);
        error = -EIO;
        if (!ncp_conn_valid(server))
                goto out;
@@ -872,7 +911,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, mode);
                error = ncp_instantiate(dir, dentry, &finfo);
        } else {
                if (result == 0x87) error = -ENAMETOOLONG;
-               DPRINTK(KERN_DEBUG "ncp_create: %s/%s failed\n",
+               DPRINTK("ncp_create: %s/%s failed\n",
                        dentry->d_parent->d_name.name, dentry->d_name.name);
        }
 
@@ -892,7 +931,7 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        struct ncp_server *server = NCP_SERVER(dir);
        __u8 _name[dentry->d_name.len + 1];
 
-       DPRINTK(KERN_DEBUG "ncp_mkdir: making %s/%s\n",
+       DPRINTK("ncp_mkdir: making %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
        error = -EIO;
        if (!ncp_conn_valid(server))
@@ -921,7 +960,7 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry)
        struct ncp_server *server = NCP_SERVER(dir);
        __u8 _name[dentry->d_name.len + 1];
 
-       DPRINTK(KERN_DEBUG "ncp_rmdir: removing %s/%s\n",
+       DPRINTK("ncp_rmdir: removing %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
 
        error = -EIO;
@@ -972,7 +1011,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry)
        struct ncp_server *server = NCP_SERVER(dir);
        int error;
 
-       DPRINTK(KERN_DEBUG "ncp_unlink: unlinking %s/%s\n",
+       DPRINTK("ncp_unlink: unlinking %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
        
        error = -EIO;
@@ -983,9 +1022,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry)
         * Check whether to close the file ...
         */
        if (inode && NCP_FINFO(inode)->opened) {
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_unlink: closing file\n");
-#endif
+               PPRINTK("ncp_unlink: closing file\n");
                ncp_make_closed(inode);
        }
 
@@ -999,7 +1036,7 @@ printk(KERN_DEBUG "ncp_unlink: closing file\n");
 #endif
        switch (error) {
                case 0x00:
-                       DPRINTK(KERN_DEBUG "ncp: removed %s/%s\n",
+                       DPRINTK("ncp: removed %s/%s\n",
                                dentry->d_parent->d_name.name, dentry->d_name.name);
                        d_delete(dentry);
                        break;
@@ -1037,7 +1074,7 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
        char _old_name[old_dentry->d_name.len + 1];
        char _new_name[new_dentry->d_name.len + 1];
 
-       DPRINTK(KERN_DEBUG "ncp_rename: %s/%s to %s/%s\n",
+       DPRINTK("ncp_rename: %s/%s to %s/%s\n",
                old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
                new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
 
@@ -1067,7 +1104,7 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
 #endif
        switch (error) {
                case 0x00:
-                               DPRINTK(KERN_DEBUG "ncp renamed %s -> %s.\n",
+                               DPRINTK("ncp renamed %s -> %s.\n",
                                 old_dentry->d_name.name,new_dentry->d_name.name);
                        /* d_move(old_dentry, new_dentry); */
                        break;
index e39578d75ec7b1238160d90c1ec89cb18beb1abd..4a907a9b123654595df643b300734b824ee5349b 100644 (file)
@@ -46,7 +46,7 @@ int ncp_make_open(struct inode *inode, int right)
                goto out;
        }
 
-       DPRINTK(KERN_DEBUG "ncp_make_open: opened=%d, volume # %u, dir entry # %u\n",
+       DPRINTK("ncp_make_open: opened=%d, volume # %u, dir entry # %u\n",
                NCP_FINFO(inode)->opened, 
                NCP_FINFO(inode)->volNumber, 
                NCP_FINFO(inode)->dirEntNum);
@@ -67,9 +67,7 @@ int ncp_make_open(struct inode *inode, int right)
                                        NULL, NULL, OC_MODE_OPEN,
                                        0, AR_READ, &finfo);
                if (result) {
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_make_open: failed, result=%d\n", result);
-#endif
+                       PPRINTK("ncp_make_open: failed, result=%d\n", result);
                        goto out_unlock;
                }
                /*
@@ -80,9 +78,7 @@ printk(KERN_DEBUG "ncp_make_open: failed, result=%d\n", result);
        }
 
        access = NCP_FINFO(inode)->access;
-#ifdef NCPFS_PARANOIA
-printk(KERN_DEBUG "ncp_make_open: file open, access=%x\n", access);
-#endif
+       PPRINTK("ncp_make_open: file open, access=%x\n", access);
        if (access == right || access == O_RDWR)
                error = 0;
 
@@ -104,12 +100,12 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
        void* freepage;
        size_t freelen;
 
-       DPRINTK(KERN_DEBUG "ncp_file_read: enter %s/%s\n",
+       DPRINTK("ncp_file_read: enter %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
 
        error = -EINVAL;
        if (inode == NULL) {
-               DPRINTK(KERN_DEBUG "ncp_file_read: inode = NULL\n");
+               DPRINTK("ncp_file_read: inode = NULL\n");
                goto out;
        }
        error = -EIO;
@@ -117,7 +113,7 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
                goto out;
        error = -EINVAL;
        if (!S_ISREG(inode->i_mode)) {
-               DPRINTK(KERN_DEBUG "ncp_file_read: read from non-file, mode %07o\n",
+               DPRINTK("ncp_file_read: read from non-file, mode %07o\n",
                        inode->i_mode);
                goto out;
        }
@@ -177,7 +173,7 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
                inode->i_atime = CURRENT_TIME;
        }
        
-       DPRINTK(KERN_DEBUG "ncp_file_read: exit %s/%s\n",
+       DPRINTK("ncp_file_read: exit %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
 out:
        return already_read ? already_read : error;
@@ -194,17 +190,17 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
        int errno;
        void* bouncebuffer;
 
-       DPRINTK(KERN_DEBUG "ncp_file_write: enter %s/%s\n",
+       DPRINTK("ncp_file_write: enter %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
        if (inode == NULL) {
-               DPRINTK(KERN_DEBUG "ncp_file_write: inode = NULL\n");
+               DPRINTK("ncp_file_write: inode = NULL\n");
                return -EINVAL;
        }
        errno = -EIO;
        if (!ncp_conn_valid(NCP_SERVER(inode)))
                goto out;
        if (!S_ISREG(inode->i_mode)) {
-               DPRINTK(KERN_DEBUG "ncp_file_write: write to non-file, mode %07o\n",
+               DPRINTK("ncp_file_write: write to non-file, mode %07o\n",
                        inode->i_mode);
                return -EINVAL;
        }
@@ -260,7 +256,7 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
        if (pos > inode->i_size) {
                inode->i_size = pos;
        }
-       DPRINTK(KERN_DEBUG "ncp_file_write: exit %s/%s\n",
+       DPRINTK("ncp_file_write: exit %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
 out:
        return already_written ? already_written : errno;
index e2d8a8a0fd9dced8556c88f75b407437ba8c6321..36da6986d328a4effbba9ab2237ec79480ffa337 100644 (file)
@@ -72,10 +72,9 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo)
        NCP_FINFO(inode)->server_file_handle = nwinfo->server_file_handle;
        memcpy(NCP_FINFO(inode)->file_handle, nwinfo->file_handle,
                        sizeof(nwinfo->file_handle));
-#ifdef NCPFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "ncp_update_inode: updated %s, volnum=%d, dirent=%u\n",
-nwinfo->i.entryName, NCP_FINFO(inode)->volNumber, NCP_FINFO(inode)->dirEntNum);
-#endif
+       DPRINTK("ncp_update_inode: updated %s, volnum=%d, dirent=%u\n",
+               nwinfo->i.entryName, NCP_FINFO(inode)->volNumber,
+               NCP_FINFO(inode)->dirEntNum);
 }
 
 void ncp_update_inode2(struct inode* inode, struct ncp_entry_info *nwinfo)
@@ -163,8 +162,8 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo)
                        switch (nwi->attributes & (aHIDDEN|aSYSTEM)) {
                                case aHIDDEN:
                                        if (server->m.flags & NCP_MOUNT_SYMLINKS) {
-                                               if ((inode->i_size >= NCP_MIN_SYMLINK_SIZE)
-                                                && (inode->i_size <= NCP_MAX_SYMLINK_SIZE)) {
+                                               if (/* (inode->i_size >= NCP_MIN_SYMLINK_SIZE)
+                                                && */ (inode->i_size <= NCP_MAX_SYMLINK_SIZE)) {
                                                        inode->i_mode = (inode->i_mode & ~S_IFMT) | S_IFLNK;
                                                        break;
                                                }
@@ -188,7 +187,7 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo)
        }
        if (nwi->attributes & aRONLY) inode->i_mode &= ~0222;
 
-       DDPRINTK(KERN_DEBUG "ncp_read_inode: inode->i_mode = %u\n", inode->i_mode);
+       DDPRINTK("ncp_read_inode: inode->i_mode = %u\n", inode->i_mode);
 
        inode->i_nlink = 1;
        inode->i_uid = server->m.uid;
@@ -255,7 +254,7 @@ static void
 ncp_delete_inode(struct inode *inode)
 {
        if (S_ISDIR(inode->i_mode)) {
-               DDPRINTK(KERN_DEBUG "ncp_delete_inode: put directory %ld\n", inode->i_ino);
+               DDPRINTK("ncp_delete_inode: put directory %ld\n", inode->i_ino);
        }
 
        if (NCP_FINFO(inode)->opened && ncp_make_closed(inode) != 0) {
@@ -323,10 +322,11 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
        server->m = *data;
        /* Althought anything producing this is buggy, it happens
           now because of PATH_MAX changes.. */
-       if (server->m.time_out < 10) {
+       if (server->m.time_out < 1) {
                server->m.time_out = 10;
                printk(KERN_INFO "You need to recompile your ncpfs utils..\n");
        }
+       server->m.time_out = server->m.time_out * HZ / 100;
        server->m.file_mode = (server->m.file_mode &
                               (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG;
        server->m.dir_mode = (server->m.dir_mode &
@@ -350,7 +350,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
        ncp_unlock_server(server);
        if (error < 0)
                goto out_no_connect;
-       DPRINTK(KERN_DEBUG "ncp_read_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb));
+       DPRINTK("ncp_read_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb));
 
 #ifdef CONFIG_NCPFS_PACKET_SIGNING
        if (ncp_negotiate_size_and_options(server, NCP_DEFAULT_BUFSIZE,
@@ -375,7 +375,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
        if (ncp_negotiate_buffersize(server, NCP_DEFAULT_BUFSIZE,
                                     &(server->buffer_size)) != 0)
                goto out_no_bufsize;
-       DPRINTK(KERN_DEBUG "ncpfs: bufsize = %d\n", server->buffer_size);
+       DPRINTK("ncpfs: bufsize = %d\n", server->buffer_size);
 
        memset(&finfo, 0, sizeof(finfo));
        finfo.i.attributes      = aDIR;
@@ -402,7 +402,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
         root_inode = ncp_iget(sb, &finfo);
         if (!root_inode)
                goto out_no_root;
-       DPRINTK(KERN_DEBUG "ncp_read_super: root vol=%d\n", NCP_FINFO(root_inode)->volNumber);
+       DPRINTK("ncp_read_super: root vol=%d\n", NCP_FINFO(root_inode)->volNumber);
        sb->s_root = d_alloc_root(root_inode);
         if (!sb->s_root)
                goto out_no_root;
@@ -650,7 +650,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
        if ((attr->ia_valid & ATTR_SIZE) != 0) {
                int written;
 
-               DPRINTK(KERN_DEBUG "ncpfs: trying to change size to %ld\n",
+               DPRINTK("ncpfs: trying to change size to %ld\n",
                        attr->ia_size);
 
                if ((result = ncp_make_open(inode, O_RDWR)) < 0) {
@@ -689,7 +689,7 @@ EXPORT_NO_SYMBOLS;
 
 int init_module(void)
 {
-       DPRINTK(KERN_DEBUG "ncpfs: init_module called\n");
+       DPRINTK("ncpfs: init_module called\n");
 
 #ifdef DEBUG_NCP_MALLOC
        ncp_malloced = 0;
@@ -700,11 +700,11 @@ int init_module(void)
 
 void cleanup_module(void)
 {
-       DPRINTK(KERN_DEBUG "ncpfs: cleanup_module called\n");
+       DPRINTK("ncpfs: cleanup_module called\n");
        unregister_filesystem(&ncp_fs_type);
 #ifdef DEBUG_NCP_MALLOC
-       printk(KERN_DEBUG "ncp_malloced: %d\n", ncp_malloced);
-       printk(KERN_DEBUG "ncp_current_malloced: %d\n", ncp_current_malloced);
+       PRINTK("ncp_malloced: %d\n", ncp_malloced);
+       PRINTK("ncp_current_malloced: %d\n", ncp_current_malloced);
 #endif
 }
 
index ca2b534eb23aae2db401961475684366944d6bd0..05def9d6c3d258d50169fd47e04741850b86ed70 100644 (file)
@@ -93,7 +93,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
                else
                        result = server->reply_size;
                ncp_unlock_server(server);
-               DPRINTK(KERN_DEBUG "ncp_ioctl: copy %d bytes\n",
+               DPRINTK("ncp_ioctl: copy %d bytes\n",
                        result);
                if (result >= 0)
                        if (copy_to_user(request.data, bouncebuffer, result))
@@ -124,7 +124,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
                copy_from_user(&info, (struct ncp_fs_info *) arg, sizeof(info));
 
                if (info.version != NCP_GET_FS_INFO_VERSION) {
-                       DPRINTK(KERN_DEBUG "info.version invalid: %d\n", info.version);
+                       DPRINTK("info.version invalid: %d\n", info.version);
                        return -EINVAL;
                }
                /* TODO: info.addr = server->m.serv_addr; */
@@ -171,9 +171,9 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
                                                sr.dirEntNum = NCP_FINFO(inode)->dirEntNum;
                                                sr.namespace = server->name_space[sr.volNumber];
                                        } else
-                                               DPRINTK(KERN_DEBUG "ncpfs: s_root->d_inode==NULL\n");
+                                               DPRINTK("ncpfs: s_root->d_inode==NULL\n");
                                } else
-                                       DPRINTK(KERN_DEBUG "ncpfs: s_root==NULL\n");
+                                       DPRINTK("ncpfs: s_root==NULL\n");
                        } else {
                                sr.volNumber = -1;
                                sr.namespace = 0;
@@ -221,9 +221,9 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
                                        NCP_FINFO(inode)->dirEntNum = i.dirEntNum;
                                        NCP_FINFO(inode)->DosDirNum = i.DosDirNum;
                                } else
-                                       DPRINTK(KERN_DEBUG "ncpfs: s_root->d_inode==NULL\n");
+                                       DPRINTK("ncpfs: s_root->d_inode==NULL\n");
                        } else
-                               DPRINTK(KERN_DEBUG "ncpfs: s_root==NULL\n");
+                               DPRINTK("ncpfs: s_root==NULL\n");
 
                        return 0;
                }
index 776e9366b0040aec427b1cfcd431ca91c2112c42..2d1bf6adb9a6fdd0d65238d2781498133344467d 100644 (file)
@@ -30,23 +30,25 @@ static inline int min(int a, int b)
 /*
  * Fill in the supplied page for mmap
  */
-static unsigned long ncp_file_mmap_nopage(struct vm_area_struct *area,
-                                    unsigned long address, int no_share)
+static struct page* ncp_file_mmap_nopage(struct vm_area_struct *area,
+                                    unsigned long address, int write_access)
 {
        struct file *file = area->vm_file;
        struct dentry *dentry = file->f_dentry;
        struct inode *inode = dentry->d_inode;
-       unsigned long page;
+       struct page* page;
+       unsigned long pg_addr;
        unsigned int already_read;
        unsigned int count;
        int bufsize;
        int pos;
 
-       page = __get_free_page(GFP_KERNEL);
+       page = __get_pages(GFP_KERNEL, 0);
        if (!page)
                return page;
+       pg_addr = page_address(page);
        address &= PAGE_MASK;
-       pos = address - area->vm_start + area->vm_offset;
+       pos = address - area->vm_start + (area->vm_pgoff << PAGE_SHIFT);
 
        count = PAGE_SIZE;
        if (address + PAGE_SIZE > area->vm_end) {
@@ -68,7 +70,7 @@ static unsigned long ncp_file_mmap_nopage(struct vm_area_struct *area,
                        if (ncp_read_kernel(NCP_SERVER(inode),
                                     NCP_FINFO(inode)->file_handle,
                                     pos, to_read,
-                                    (char *) (page + already_read),
+                                    (char *) (pg_addr + already_read),
                                     &read_this_time) != 0) {
                                read_this_time = 0;
                        }
@@ -83,7 +85,7 @@ static unsigned long ncp_file_mmap_nopage(struct vm_area_struct *area,
        }
 
        if (already_read < PAGE_SIZE)
-               memset((char*)(page + already_read), 0, 
+               memset((char*)(pg_addr + already_read), 0, 
                       PAGE_SIZE - already_read);
        return page;
 }
@@ -107,7 +109,7 @@ int ncp_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct inode *inode = file->f_dentry->d_inode;
        
-       DPRINTK(KERN_DEBUG "ncp_mmap: called\n");
+       DPRINTK("ncp_mmap: called\n");
 
        if (!ncp_conn_valid(NCP_SERVER(inode))) {
                return -EIO;
index 2881c74fa160d0e24dd6a10f011aeff3093c1be5..8f77f7b62946b0b95fa618a53326d823c0378bbf 100644 (file)
@@ -17,10 +17,10 @@ static inline int min(int a, int b)
        return a < b ? a : b;
 }
 
-static void assert_server_locked(struct ncp_server *server)
+static inline void assert_server_locked(struct ncp_server *server)
 {
        if (server->lock == 0) {
-               DPRINTK(KERN_DEBUG "ncpfs: server not locked!\n");
+               DPRINTK("ncpfs: server not locked!\n");
        }
 }
 
@@ -69,7 +69,7 @@ static void ncp_add_pstring(struct ncp_server *server, const char *s)
        int len = strlen(s);
        assert_server_locked(server);
        if (len > 255) {
-               DPRINTK(KERN_DEBUG "ncpfs: string too long: %s\n", s);
+               DPRINTK("ncpfs: string too long: %s\n", s);
                len = 255;
        }
        ncp_add_byte(server, len);
@@ -77,7 +77,7 @@ static void ncp_add_pstring(struct ncp_server *server, const char *s)
        return;
 }
 
-static void ncp_init_request(struct ncp_server *server)
+static inline void ncp_init_request(struct ncp_server *server)
 {
        ncp_lock_server(server);
 
@@ -95,7 +95,7 @@ static void ncp_init_request_s(struct ncp_server *server, int subfunction)
        server->has_subfunction = 1;
 }
 
-static char *
+static inline char *
  ncp_reply_data(struct ncp_server *server, int offset)
 {
        return &(server->packet[sizeof(struct ncp_reply_header) + offset]);
@@ -196,7 +196,7 @@ ncp_get_volume_info_with_number(struct ncp_server *server, int n,
        result = -EIO;
        len = ncp_reply_byte(server, 29);
        if (len > NCP_VOLNAME_LEN) {
-               DPRINTK(KERN_DEBUG "ncpfs: volume name too long: %d\n", len);
+               DPRINTK("ncpfs: volume name too long: %d\n", len);
                goto out;
        }
        memcpy(&(target->volume_name), ncp_reply_data(server, 30), len);
@@ -229,11 +229,11 @@ ncp_make_closed(struct inode *inode)
        int err;
        NCP_FINFO(inode)->opened = 0;
        err = ncp_close_file(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle);
-#ifdef NCPFS_PARANOIA
-if (!err)
-printk(KERN_DEBUG "ncp_make_closed: volnum=%d, dirent=%u, error=%d\n",
-NCP_FINFO(inode)->volNumber, NCP_FINFO(inode)->dirEntNum, err);
-#endif
+
+       if (!err)
+               PPRINTK("ncp_make_closed: volnum=%d, dirent=%u, error=%d\n",
+                       NCP_FINFO(inode)->volNumber,
+                       NCP_FINFO(inode)->dirEntNum, err);
        return err;
 }
 
@@ -350,7 +350,7 @@ ncp_get_known_namespace(struct ncp_server *server, __u8 volume)
        namespace = ncp_reply_data(server, 2);
 
        while (no_namespaces > 0) {
-               DPRINTK(KERN_DEBUG "get_namespaces: found %d on %d\n", *namespace, volume);
+               DPRINTK("get_namespaces: found %d on %d\n", *namespace, volume);
 
 #ifdef CONFIG_NCPFS_NFS_NS
                if ((*namespace == NW_NS_NFS) && !(server->m.flags&NCP_MOUNT_NO_NFS)) 
@@ -436,7 +436,7 @@ ncp_lookup_volume(struct ncp_server *server, char *volname,
        int result;
        int volnum;
 
-       DPRINTK(KERN_DEBUG "ncp_lookup_volume: looking up vol %s\n", volname);
+       DPRINTK("ncp_lookup_volume: looking up vol %s\n", volname);
 
        ncp_init_request(server);
        ncp_add_byte(server, 22);       /* Subfunction: Generate dir handle */
@@ -462,7 +462,7 @@ ncp_lookup_volume(struct ncp_server *server, char *volname,
 
        server->name_space[volnum] = ncp_get_known_namespace(server, volnum);
 
-       DPRINTK(KERN_DEBUG "lookup_vol: namespace[%d] = %d\n",
+       DPRINTK("lookup_vol: namespace[%d] = %d\n",
                volnum, server->name_space[volnum]);
 
        target->nameLen = strlen(volname);
@@ -537,7 +537,7 @@ ncp_del_file_or_subdir2(struct ncp_server *server,
 
        if (!inode) {
 #if CONFIG_NCPFS_DEBUGDENTRY
-               printk(KERN_DEBUG "ncpfs: ncpdel2: dentry->d_inode == NULL\n");
+               PRINTK("ncpfs: ncpdel2: dentry->d_inode == NULL\n");
 #endif
                return 0xFF;    /* Any error */
        }
index f4cc6425b9a4a3f55fa7c9e1ebe630a48a38279b..4466f3be74d243ab4db74f159187cb47719203ce 100644 (file)
@@ -173,8 +173,8 @@ vol2io(struct ncp_server *server, char *name, int case_trans)
 #endif /* CONFIG_NCPFS_NLS */
 
 #define NCP_GET_AGE(dentry)    (jiffies - (dentry)->d_time)
-#define NCP_MAX_AGE            (server->dentry_ttl)
-#define NCP_TEST_AGE(server,dentry)    (NCP_GET_AGE(dentry) < NCP_MAX_AGE)
+#define NCP_MAX_AGE(server)    ((server)->dentry_ttl)
+#define NCP_TEST_AGE(server,dentry)    (NCP_GET_AGE(dentry) < NCP_MAX_AGE(server))
 
 static inline void
 ncp_age_dentry(struct ncp_server* server, struct dentry* dentry)
@@ -188,21 +188,64 @@ ncp_new_dentry(struct dentry* dentry)
        dentry->d_time = jiffies;
 }
 
-#define NCP_FPOS_EMPTY 0       /* init value for fpos variables. */
+static inline void
+ncp_renew_dentries(struct dentry *parent)
+{
+       struct ncp_server *server = NCP_SERVER(parent->d_inode);
+       struct list_head *next = parent->d_subdirs.next;
+       struct dentry *dentry;
 
-struct ncp_cache_control {
-       struct nw_search_sequence seq;
-       int             firstcache;
-       int             currentpos;
-       int             cachehead;
-       int             cachetail;
-       int             eof;
+       while (next != &parent->d_subdirs) {
+               dentry = list_entry(next, struct dentry, d_child);
+
+               if (dentry->d_fsdata == NULL)
+                       ncp_age_dentry(server, dentry);
+               else
+                       ncp_new_dentry(dentry);
+
+               next = next->next;
+       }
+}
+
+static inline void
+ncp_invalidate_dircache_entries(struct dentry *parent)
+{
+       struct ncp_server *server = NCP_SERVER(parent->d_inode);
+       struct list_head *next = parent->d_subdirs.next;
+       struct dentry *dentry;
+
+       while (next != &parent->d_subdirs) {
+               dentry = list_entry(next, struct dentry, d_child);
+               dentry->d_fsdata = NULL;
+               ncp_age_dentry(server, dentry);
+               next = next->next;
+       }
+}
+
+struct ncp_cache_head {
+       unsigned long                   time;   /* cache age */
+       unsigned long                   end;    /* last valid fpos in cache */
+       int                             eof;
 };
 
-#define NCP_DIRCACHE_SIZE      (PAGE_CACHE_SIZE-sizeof(struct ncp_cache_control))
-struct ncp_seq_cache {
-       struct ncp_cache_control ctl;
-       unsigned char cache[NCP_DIRCACHE_SIZE];
+#define NCP_DIRCACHE_SIZE      ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *)))
+union ncp_dir_cache {
+       struct ncp_cache_head head;
+       struct dentry *dentry[NCP_DIRCACHE_SIZE];
+};
+
+#define NCP_FIRSTCACHE_SIZE    ((int)((NCP_DIRCACHE_SIZE * \
+       sizeof(struct dentry *) - sizeof(struct ncp_cache_head)) / \
+       sizeof(struct dentry *)))
+
+#define NCP_DIRCACHE_START     (NCP_DIRCACHE_SIZE - NCP_FIRSTCACHE_SIZE)
+
+struct ncp_cache_control {
+       struct  ncp_cache_head          head;
+       struct  page                    *page;
+       union   ncp_dir_cache           *cache;
+       unsigned long                   fpos, ofs;
+       int                             filled, valid, idx;
 };
 
 #endif /* _NCPLIB_H */
index 2d43ec9ad9f31bbda3fbf04028899bc3a5c703b2..33a4293c4ab4efd18757f149620e893379272d07 100644 (file)
@@ -144,7 +144,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
        set_fs(get_ds());
        for (n = 0, timeout = init_timeout;; n++, timeout <<= 1) {
                /*
-               DDPRINTK(KERN_DEBUG "ncpfs: %08lX:%02X%02X%02X%02X%02X%02X:%04X\n",
+               DDPRINTK("ncpfs: %08lX:%02X%02X%02X%02X%02X%02X:%04X\n",
                         htonl(server->m.serv_addr.sipx_network),
                         server->m.serv_addr.sipx_node[0],
                         server->m.serv_addr.sipx_node[1],
@@ -154,12 +154,12 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
                         server->m.serv_addr.sipx_node[5],
                         ntohs(server->m.serv_addr.sipx_port));
                */
-               DDPRINTK(KERN_DEBUG "ncpfs: req.typ: %04X, con: %d, "
+               DDPRINTK("ncpfs: req.typ: %04X, con: %d, "
                         "seq: %d",
                         request.type,
                         (request.conn_high << 8) + request.conn_low,
                         request.sequence);
-               DDPRINTK(KERN_DEBUG " func: %d\n",
+               DDPRINTK(" func: %d\n",
                         request.function);
 
                result = _send(sock, (void *) start, size);
@@ -223,11 +223,11 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
                               MSG_PEEK | MSG_DONTWAIT);
                if (result < 0) {
                        if (result == -EAGAIN) {
-                               DDPRINTK(KERN_DEBUG "ncp_rpc_call: bad select ready\n");
+                               DDPRINTK("ncp_rpc_call: bad select ready\n");
                                goto re_select;
                        }
                        if (result == -ECONNREFUSED) {
-                               DPRINTK(KERN_WARNING "ncp_rpc_call: server playing coy\n");
+                               DPRINTK("ncp_rpc_call: server playing coy\n");
                                goto re_select;
                        }
                        if (result != -ERESTARTSYS) {
@@ -239,7 +239,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
                if ((result == sizeof(reply))
                    && (reply.type == NCP_POSITIVE_ACK)) {
                        /* Throw away the packet */
-                       DPRINTK(KERN_DEBUG "ncp_rpc_call: got positive acknowledge\n");
+                       DPRINTK("ncp_rpc_call: got positive acknowledge\n");
                        _recv(sock, (void *) &reply, sizeof(reply),
                              MSG_DONTWAIT);
                        n = 0;
@@ -247,7 +247,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
                        acknowledge_seen = 1;
                        goto re_select;
                }
-               DDPRINTK(KERN_DEBUG "ncpfs: rep.typ: %04X, con: %d, tsk: %d,"
+               DDPRINTK("ncpfs: rep.typ: %04X, con: %d, tsk: %d,"
                         "seq: %d\n",
                         reply.type,
                         (reply.conn_high << 8) + reply.conn_low,
@@ -271,7 +271,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
                 * a null buffer yet. */
                _recv(sock, (void *) &reply, sizeof(reply), MSG_DONTWAIT);
 
-               DPRINTK(KERN_WARNING "ncp_rpc_call: reply mismatch\n");
+               DPRINTK("ncp_rpc_call: reply mismatch\n");
                goto re_select;
        }
        /* 
@@ -321,7 +321,7 @@ static int ncp_do_request(struct ncp_server *server, int size,
 #endif /* CONFIG_NCPFS_PACKET_SIGNING */
        result = do_ncp_rpc_call(server, size, reply, max_reply_size);
 
-       DDPRINTK(KERN_DEBUG "do_ncp_rpc_call returned %d\n", result);
+       DDPRINTK("do_ncp_rpc_call returned %d\n", result);
 
        if (result < 0) {
                /* There was a problem with I/O, so the connections is
@@ -363,7 +363,7 @@ int ncp_request2(struct ncp_server *server, int function,
 
        result = ncp_do_request(server, request_size + sizeof(*h), reply, size);
        if (result < 0) {
-               DPRINTK(KERN_WARNING "ncp_request_error: %d\n", result);
+               DPRINTK("ncp_request_error: %d\n", result);
                goto out;
        }
        server->completion = reply->completion_code;
@@ -373,10 +373,8 @@ int ncp_request2(struct ncp_server *server, int function,
 
        result = reply->completion_code;
 
-#ifdef NCPFS_PARANOIA
-if (result != 0)
-printk(KERN_DEBUG "ncp_request: completion code=%x\n", result);
-#endif
+       if (result != 0)
+               PPRINTK("ncp_request: completion code=%x\n", result);
 out:
        return result;
 }
@@ -428,7 +426,7 @@ void ncp_lock_server(struct ncp_server *server)
 #if 0
        /* For testing, only 1 process */
        if (server->lock != 0) {
-               DPRINTK(KERN_WARNING "ncpfs: server locked!!!\n");
+               DPRINTK("ncpfs: server locked!!!\n");
        }
 #endif
        down(&server->sem);
index 578b2b9859a9a0e565e49493826b336f72c9a975..81151959a85e47a0902bda29e08239b3072b4799 100644 (file)
@@ -80,7 +80,7 @@ static struct dentry *ncp_follow_link(struct dentry *dentry,
        char *link;
 
 #ifdef DEBUG
-       printk("ncp_follow_link(dentry=%p,base=%p,follow=%u)\n",dentry,base,follow);
+       PRINTK("ncp_follow_link(dentry=%p,base=%p,follow=%u)\n",dentry,base,follow);
 #endif
 
        if(!S_ISLNK(inode->i_mode)) {
@@ -131,7 +131,7 @@ static int ncp_readlink(struct dentry * dentry, char * buffer, int buflen)
        int length,error;
 
 #ifdef DEBUG
-       printk("ncp_readlink(dentry=%p,buffer=%p,buflen=%d)\n",dentry,buffer,buflen);
+       PRINTK("ncp_readlink(dentry=%p,buffer=%p,buflen=%d)\n",dentry,buffer,buflen);
 #endif
 
        if(!S_ISLNK(inode->i_mode))
@@ -173,7 +173,7 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
        char *link;
 
 #ifdef DEBUG
-       printk("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
+       PRINTK("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
 #endif
 
        if (!(NCP_SERVER(dir)->m.flags & NCP_MOUNT_SYMLINKS))
index 8e61bc9a5e1bd23dfcb7a3e8126d523361c780f6..6b2e3d73a01c55dc0116ed78076f645f40ce5494 100644 (file)
@@ -70,7 +70,7 @@ static int
 nfs_readpage_sync(struct dentry *dentry, struct inode *inode, struct page *page)
 {
        struct nfs_rreq rqst;
-       unsigned long   offset = page->pg_offset << PAGE_CACHE_SHIFT;
+       unsigned long   offset = page->index << PAGE_CACHE_SHIFT;
        char            *buffer = (char *) page_address(page);
        int             rsize = NFS_SERVER(inode)->rsize;
        int             result, refresh = 0;
@@ -179,7 +179,7 @@ nfs_readpage_async(struct dentry *dentry, struct inode *inode,
 
        /* Initialize request */
        /* N.B. Will the dentry remain valid for life of request? */
-       nfs_readreq_setup(req, NFS_FH(dentry), page->pg_offset << PAGE_CACHE_SHIFT,
+       nfs_readreq_setup(req, NFS_FH(dentry), page->index << PAGE_CACHE_SHIFT,
                                (void *) address, PAGE_SIZE);
        req->ra_inode = inode;
        req->ra_page = page; /* count has been incremented by caller */
@@ -225,7 +225,7 @@ nfs_readpage(struct file *file, struct page *page)
 
        lock_kernel();
        dprintk("NFS: nfs_readpage (%p %ld@%lu)\n",
-               page, PAGE_SIZE, page->pg_offset);
+               page, PAGE_SIZE, page->index);
        get_page(page);
 
        /*
index 57dd243e8e3ce0da00642f50c44d175e54bf5ff7..abc048dc24a246f21a099d13631ee4a3be7e7d00 100644 (file)
@@ -97,10 +97,10 @@ nfs_writepage_sync(struct dentry *dentry, struct inode *inode,
        lock_kernel();
        dprintk("NFS:      nfs_writepage_sync(%s/%s %d@%lu/%ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               count, page->pg_offset, offset);
+               count, page->index, offset);
 
        buffer = (u8 *) page_address(page) + offset;
-       offset += page->pg_offset << PAGE_CACHE_SHIFT;
+       offset += page->index << PAGE_CACHE_SHIFT;
 
        do {
                if (count < wsize && !IS_SWAPFILE(inode))
@@ -287,7 +287,7 @@ create_write_request(struct file * file, struct page *page, unsigned int offset,
 
        dprintk("NFS:      create_write_request(%s/%s, %ld+%d)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               (page->pg_offset << PAGE_CACHE_SHIFT) + offset, bytes);
+               (page->index << PAGE_CACHE_SHIFT) + offset, bytes);
 
        /* FIXME: Enforce hard limit on number of concurrent writes? */
        wreq = kmem_cache_alloc(nfs_wreq_cachep, SLAB_KERNEL);
@@ -435,7 +435,7 @@ nfs_updatepage(struct file *file, struct page *page, unsigned long offset, unsig
 
        dprintk("NFS:      nfs_updatepage(%s/%s %d@%ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               count, (page->pg_offset << PAGE_CACHE_SHIFT) +offset);
+               count, (page->index << PAGE_CACHE_SHIFT) +offset);
 
        /*
         * Try to find a corresponding request on the writeback queue.
@@ -620,7 +620,7 @@ nfs_wback_begin(struct rpc_task *task)
        /* Setup the task struct for a writeback call */
        req->wb_flags |= NFS_WRITE_INPROGRESS;
        req->wb_args.fh     = NFS_FH(dentry);
-       req->wb_args.offset = (page->pg_offset << PAGE_CACHE_SHIFT) + req->wb_offset;
+       req->wb_args.offset = (page->index << PAGE_CACHE_SHIFT) + req->wb_offset;
        req->wb_args.count  = req->wb_bytes;
        req->wb_args.buffer = (void *) (page_address(page) + req->wb_offset);
 
index 05a1a3537f25f516255b486122dad027123d94ad..d5a195ee614866e296d435c15c2ecfaf80bcc317 100644 (file)
@@ -57,7 +57,8 @@ extern int get_ksyms_list(char *, char **, off_t, int);
 extern int get_device_list(char *);
 extern int get_partition_list(char *);
 extern int get_filesystem_list(char *);
-extern int get_filesystem_info( char * );
+extern int get_filesystem_info(char *);
+extern int get_exec_domain_list(char *);
 extern int get_irq_list(char *);
 extern int get_dma_list(char *);
 extern int get_rtc_status (char *);
@@ -496,6 +497,18 @@ static int mounts_read_proc(char *page, char **start, off_t off,
        return len;
 }
 
+static int execdomains_read_proc(char *page, char **start, off_t off,
+                                int count, int *eof, void *data)
+{
+       int len = get_exec_domain_list(page);
+       if (len <= off+count) *eof = 1;
+       *start = page + off;
+       len -= off;
+       if (len>count) len = count;
+       if (len<0) len = 0;
+       return len;
+}
+
 static int swaps_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
 {
@@ -591,6 +604,7 @@ void proc_misc_init(void)
                {"swaps",       swaps_read_proc},
                {"slabinfo",    slabinfo_read_proc},
                {"iomem",       memory_read_proc},
+               {"execdomains", execdomains_read_proc},
                {NULL,NULL}
        };
        for(p=simple_ones;p->name;p++)
index c816667963de889ef1d4d3c048ae3b2866e6ce88..7ef18302ffda9f4df3a76b4d31882bf9b3a63e88 100644 (file)
@@ -49,7 +49,7 @@ static int
 smb_readpage_sync(struct dentry *dentry, struct page *page)
 {
        char *buffer = (char *) page_address(page);
-       unsigned long offset = page->pg_offset << PAGE_CACHE_SHIFT;
+       unsigned long offset = page->index << PAGE_CACHE_SHIFT;
        int rsize = smb_get_rsize(server_from_dentry(dentry));
        int count = PAGE_SIZE;
        int result;
@@ -128,7 +128,7 @@ smb_writepage_sync(struct dentry *dentry, struct page *page,
        int wsize = smb_get_wsize(server_from_dentry(dentry));
        int result, written = 0;
 
-       offset += page->pg_offset << PAGE_CACHE_SHIFT;
+       offset += page->index << PAGE_CACHE_SHIFT;
 #ifdef SMBFS_DEBUG_VERBOSE
 printk("smb_writepage_sync: file %s/%s, count=%d@%ld, wsize=%d\n",
 dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, wsize);
@@ -191,7 +191,7 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset, unsig
 
        pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               count, (page->pg_offset << PAGE_CACHE_SHIFT)+offset);
+               count, (page->index << PAGE_CACHE_SHIFT)+offset);
 
        return smb_writepage_sync(dentry, page, offset, count);
 }
index e19f628fe878a9ad67b59ee06abde2b9af6dc27f..ad25dcbbcd7e0b9c586ed526c3191f50e8d24958 100644 (file)
@@ -211,7 +211,7 @@ extern void iounmap(void *addr);
  */
 
 #define eth_io_copy_and_sum(a,b,c,d)           eth_copy_and_sum((a),__io_virt(b),(c),(d))
-#define isa_eth_io_copy_and_csum(a,b,c,d)      eth_copy_and_sum((a),__io_virt(__ISA_IO_base + (b)),(c),(d))
+#define isa_eth_io_copy_and_sum(a,b,c,d)       eth_copy_and_sum((a),__io_virt(__ISA_IO_base + (b)),(c),(d))
 
 static inline int check_signature(unsigned long io_addr,
        const unsigned char *signature, int length)
index 721a8e9338849f20e2ec4db0543c1985f16cc74f..46b71da99869a782641fd60dfe3a85cdb0a367d8 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/types.h>
  
 extern void *_mmx_memcpy(void *to, const void *from, size_t size);
-extern void mmx_clear_page(long page);
-extern void mmx_copy_page(long to, long from);
+extern void mmx_clear_page(void *page);
+extern void mmx_copy_page(void *to, void *from);
 
 #endif
index 9cfc401fadc973873f6de37b783dc31dd1896db3..b3cb91024027e769f786b1aa3f597ba0a87956ea 100644 (file)
@@ -80,7 +80,7 @@
 #define __NR_sigpending                 73
 #define __NR_sethostname        74
 #define __NR_setrlimit          75
-#define __NR_getrlimit          76
+#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
 #define __NR_getrusage          77
 #define __NR_gettimeofday       78
 #define __NR_settimeofday       79
 #define __NR_getpmsg           188     /* some people actually want streams */
 #define __NR_putpmsg           189     /* some people actually want streams */
 #define __NR_vfork             190
+#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
 
index 1d5ba201620173e766f20e754a908ac6861b4609..18dd9bba820ba8c5e487f030a5ab0fa50596edf4 100644 (file)
@@ -17,7 +17,6 @@ struct bfs_sb_info {
        __u32 si_lf_sblk;
        __u32 si_lf_eblk;
        __u32 si_lasti;
-       __u32 si_imap_len;
        __u8 *si_imap;
        struct buffer_head * si_sbh;            /* buffer header w/superblock */
        struct bfs_super_block * si_bfs_sb;     /* superblock in si_sbh->b_data */
index 46c7169554c5e71cd929085450aeb452a976e1c3..d15608868cec33d0960db809ecf2619e1a0222c3 100644 (file)
@@ -111,7 +111,7 @@ struct vm_operations_struct {
 
 /*
  * A swap entry has to fit into a "unsigned long", as
- * the entry is hidden in the "pg_offset" field of the
+ * the entry is hidden in the "index" field of the
  * swapper address space.
  */
 typedef struct {
@@ -130,7 +130,7 @@ typedef struct page {
        /* these must be first (free area handling) */
        struct list_head list;
        struct address_space *mapping;
-       unsigned long pg_offset;
+       unsigned long index;
        struct page *next_hash;
        atomic_t count;
        unsigned long flags;    /* atomic flags, some possibly updated asynchronously */
index 1be68cfb5dc2477479dd11f88f1c12b13eae042e..11acbd7b755a93cfc682bc84573a734d890337e5 100644 (file)
@@ -136,18 +136,28 @@ struct ncp_nls_ioctl
 
 #include <linux/config.h>
 
+/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */
+#undef PRINTK
+/* define because it is easy to change PRINTK to {*}PRINTK */
+#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)
+
 #undef NCPFS_PARANOIA
+#ifdef NCPFS_PARANOIA
+#define PPRINTK(format, args...) PRINTK(format , ## args)
+#else
+#define PPRINTK(format, args...)
+#endif
+
 #ifndef DEBUG_NCP
 #define DEBUG_NCP 0
 #endif
 #if DEBUG_NCP > 0
-#define DPRINTK(format, args...) printk(format , ## args)
+#define DPRINTK(format, args...) PRINTK(format , ## args)
 #else
 #define DPRINTK(format, args...)
 #endif
-
 #if DEBUG_NCP > 1
-#define DDPRINTK(format, args...) printk(format , ## args)
+#define DDPRINTK(format, args...) PRINTK(format , ## args)
 #else
 #define DDPRINTK(format, args...)
 #endif
index 9e05db19180a3f46a7f97ad972d03983bb55d017..a2e270d64153d65d60c4a6ffbf516307f6b0cf65 100644 (file)
@@ -12,7 +12,6 @@ extern unsigned char nvram_read_byte( int i );
 extern void nvram_write_byte( unsigned char c, int i );
 extern int nvram_check_checksum( void );
 extern void nvram_set_checksum( void );
-extern int nvram_init( void );
 #endif
 
 #endif  /* _LINUX_NVRAM_H */
index b7fdc14d161838877def6fc9387be8eb5499c06c..57c9a60c4ccdf2b4f9d43b9954463511d94fa73f 100644 (file)
@@ -48,42 +48,42 @@ extern void page_cache_init(unsigned long);
 /*
  * We use a power-of-two hash table to avoid a modulus,
  * and get a reasonable hash by knowing roughly how the
- * inode pointer and offsets are distributed (ie, we
+ * inode pointer and indexes are distributed (ie, we
  * roughly know which bits are "significant")
  *
  * For the time being it will work for struct address_space too (most of
  * them sitting inside the inodes). We might want to change it later.
  */
-extern inline unsigned long _page_hashfn(struct address_space * mapping, unsigned long offset)
+extern inline unsigned long _page_hashfn(struct address_space * mapping, unsigned long index)
 {
 #define i (((unsigned long) mapping)/(sizeof(struct inode) & ~ (sizeof(struct inode) - 1)))
 #define s(x) ((x)+((x)>>PAGE_HASH_BITS))
-       return s(i+offset) & (PAGE_HASH_SIZE-1);
+       return s(i+index) & (PAGE_HASH_SIZE-1);
 #undef i
 #undef o
 #undef s
 }
 
-#define page_hash(mapping,offset) (page_hash_table+_page_hashfn(mapping,offset))
+#define page_hash(mapping,index) (page_hash_table+_page_hashfn(mapping,index))
 
 extern struct page * __find_get_page (struct address_space *mapping,
-                               unsigned long offset, struct page **hash);
-#define find_get_page(mapping, offset) \
-               __find_get_page(mapping, offset, page_hash(mapping, offset))
+                               unsigned long index, struct page **hash);
+#define find_get_page(mapping, index) \
+               __find_get_page(mapping, index, page_hash(mapping, index))
 extern struct page * __find_lock_page (struct address_space * mapping,
-                               unsigned long offset, struct page **hash);
+                               unsigned long index, struct page **hash);
 extern void lock_page(struct page *page);
-#define find_lock_page(mapping, offset) \
-               __find_lock_page(mapping, offset, page_hash(mapping, offset))
+#define find_lock_page(mapping, index) \
+               __find_lock_page(mapping, index, page_hash(mapping, index))
 
 extern void __add_page_to_hash_queue(struct page * page, struct page **p);
 
-extern void add_to_page_cache(struct page * page, struct address_space *mapping, unsigned long offset);
-extern int add_to_page_cache_unique(struct page * page, struct address_space *mapping, unsigned long offset, struct page **hash);
+extern void add_to_page_cache(struct page * page, struct address_space *mapping, unsigned long index);
+extern int add_to_page_cache_unique(struct page * page, struct address_space *mapping, unsigned long index, struct page **hash);
 
-extern inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long offset)
+extern inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long index)
 {
-       __add_page_to_hash_queue(page, page_hash(&inode->i_data,offset));
+       __add_page_to_hash_queue(page, page_hash(&inode->i_data,index));
 }
 
 extern inline void add_page_to_inode_queue(struct address_space *mapping, struct page * page)
index c92081d3eca964948678237d4ff5b4dc0bb5d27b..dc9b6a40f62d96d1c8929f74ec61a0e3c5469402 100644 (file)
@@ -489,8 +489,9 @@ struct pci_simple_probe_entry {
        void *dev_data;         /* driver-private, entry-specific data */
 };
 
-int pci_simple_probe (struct pci_simple_probe_entry *list, size_t match_limit,
-                     pci_simple_probe_callback cb, void *drvr_data);
+int pci_simple_probe (const struct pci_simple_probe_entry *list,
+                     size_t match_limit, pci_simple_probe_callback cb,
+                     void *drvr_data);
 
 
 
index ca14eb305f8fbb75963e8bb347aa1e4a1ec74dd0..2c3a7fb21f33b228dbb896a8ae1d77717083739a 100644 (file)
 #define PCI_DEVICE_ID_LAVA_PARALLEL    0x8000
 #define PCI_DEVICE_ID_LAVA_DUAL_PAR_A  0x8002 /* The Lava Dual Parallel is */
 #define PCI_DEVICE_ID_LAVA_DUAL_PAR_B  0x8003 /* two PCI devices on a card */
+#define PCI_DEVICE_ID_LAVA_BOCA_IOPPAR 0x8800
 
 #define PCI_VENDOR_ID_PANACOM          0x14d4
 #define PCI_DEVICE_ID_PANACOM_QUADMODEM        0x0400
index 02108c91d51a8d8042a17fc369e8d997ddc49a2b..aa6006ff80f99b1ed2f5aaa2832151e8b0a2bcac 100644 (file)
@@ -7,7 +7,7 @@
 
 struct shmid_ds {
        struct ipc_perm         shm_perm;       /* operation perms */
-       int                     shm_segsz;      /* size of segment (bytes) */
+       size_t                  shm_segsz;      /* size of segment (bytes) */
        __kernel_time_t         shm_atime;      /* last attach time */
        __kernel_time_t         shm_dtime;      /* last detach time */
        __kernel_time_t         shm_ctime;      /* last change time */
@@ -46,7 +46,7 @@ struct shmid_kernel
 #define SHM_INFO       14
 
 struct shminfo {
-       int shmmax;
+       size_t shmmax;
        int shmmin;
        int shmmni;
        int shmseg;
@@ -68,7 +68,7 @@ struct shm_info {
 #define        SHM_DEST        01000   /* segment will be destroyed on last detach */
 #define SHM_LOCKED      02000   /* segment will not be swapped */
 
-asmlinkage long sys_shmget (key_t key, int size, int flag);
+asmlinkage long sys_shmget (key_t key, size_t size, int flag);
 asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, unsigned long *addr);
 asmlinkage long sys_shmdt (char *shmaddr);
 asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf);
index dfcd8d73cc72d3caa80e49c1a6c032c2f5812d63..4406c5a752fbb239d63b0e747ede3d8df8667d81 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -27,7 +27,7 @@
 
 extern int ipcperms (struct ipc_perm *ipcp, short shmflg);
 static int findkey (key_t key);
-static int newseg (key_t key, int shmflg, int size);
+static int newseg (key_t key, int shmflg, size_t size);
 static int shm_map (struct vm_area_struct *shmd);
 static void killseg (int id);
 static void shm_open (struct vm_area_struct *shmd);
@@ -100,7 +100,7 @@ static int findkey (key_t key)
 /*
  * allocate new shmid_kernel and pgtable. protected by shm_segs[id] = NOID.
  */
-static int newseg (key_t key, int shmflg, int size)
+static int newseg (key_t key, int shmflg, size_t size)
 {
        struct shmid_kernel *shp;
        int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
@@ -164,16 +164,16 @@ found:
        return (unsigned int) shp->u.shm_perm.seq * SHMMNI + id;
 }
 
-int shmmax = SHMMAX;
+size_t shmmax = SHMMAX;
 
-asmlinkage long sys_shmget (key_t key, int size, int shmflg)
+asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
 {
        struct shmid_kernel *shp;
        int err, id = 0;
 
        down(&current->mm->mmap_sem);
        spin_lock(&shm_lock);
-       if (size < 0 || size > shmmax) {
+       if (size > shmmax) {
                err = -EINVAL;
        } else if (key == IPC_PRIVATE) {
                err = newseg(key, shmflg, size);
@@ -490,7 +490,7 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
                err = -ENOMEM;
                addr = 0;
        again:
-               if (!(addr = get_unmapped_area(addr, shp->u.shm_segsz)))
+               if (!(addr = get_unmapped_area(addr, (unsigned long)shp->u.shm_segsz)))
                        goto out;
                if(addr & (SHMLBA - 1)) {
                        addr = (addr + (SHMLBA - 1)) & ~(SHMLBA - 1);
@@ -516,7 +516,7 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
        if (addr < current->mm->start_stack &&
            addr > current->mm->start_stack - PAGE_SIZE*(shp->shm_npages + 4))
                goto out;
-       if (!(shmflg & SHM_REMAP) && find_vma_intersection(current->mm, addr, addr + shp->u.shm_segsz))
+       if (!(shmflg & SHM_REMAP) && find_vma_intersection(current->mm, addr, addr + (unsigned long)shp->u.shm_segsz))
                goto out;
 
        err = -EACCES;
@@ -867,7 +867,15 @@ static int sysvipc_shm_read_proc(char *buffer, char **start, off_t offset, int l
        spin_lock(&shm_lock);
        for(i = 0; i < SHMMNI; i++)
                if(shm_segs[i] != IPC_UNUSED) {
-                       len += sprintf(buffer + len, "%10d %10d  %4o %10d %5u %5u  %5d %5u %5u %5u %5u %10lu %10lu %10lu\n",
+#define SMALL_STRING "%10d %10d  %4o %10u %5u %5u  %5d %5u %5u %5u %5u %10lu %10lu %10lu\n"
+#define BIG_STRING   "%10d %10d  %4o %21u %5u %5u  %5d %5u %5u %5u %5u %10lu %10lu %10lu\n"
+                       char *format;
+
+                       if (sizeof(size_t) <= sizeof(int))
+                               format = SMALL_STRING;
+                       else
+                               format = BIG_STRING;
+                       len += sprintf(buffer + len, format,
                        shm_segs[i]->u.shm_perm.key,
                        shm_segs[i]->u.shm_perm.seq * SHMMNI + i,
                        shm_segs[i]->u.shm_perm.mode,
index a1a6826cd8369a609e2e57b653b5ec28a9174214..7e0e9bfdb00543c440c0bf7eaf9bd08cb15d4f09 100644 (file)
@@ -119,7 +119,7 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
        return -ENOSYS;
 }
 
-void shm_unuse(pte_t entry, struct page *page)
+void shm_unuse(swp_entry_t entry, struct page *page)
 {
 }
 
index 4aa968ee12fd242c78b4ce5464e111fd97841e4a..c31678a4e2c088d9fb6060d4d1f38d3cc3e83aa2 100644 (file)
@@ -125,3 +125,15 @@ out:
        unlock_kernel();
        return ret;
 }
+
+int get_exec_domain_list(char * page)
+{
+       int len = 0;
+       struct exec_domain * e;
+
+       for (e=exec_domains; e && len < PAGE_SIZE - 80; e=e->next)
+               len += sprintf(page+len, "%d-%d\t%-16s\t[%s]\n",
+                       e->pers_low, e->pers_high, e->name,
+                       e->module ? e->module->name : "kernel");
+       return len;
+}
index bc4012cac22e5a06cac1c5a60d3ee685efcfac0d..b5ce2e8ec20630d8747d60571393577aacf50f1f 100644 (file)
@@ -889,6 +889,25 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit *rlim)
                        ? -EFAULT : 0;
 }
 
+/*
+ *     Back compatibility for getrlimit. Needed for some apps.
+ */
+asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit *rlim)
+{
+       struct rlimit x;
+       if (resource >= RLIM_NLIMITS)
+               return -EINVAL;
+
+       memcpy(&x, current->rlim + resource, sizeof(*rlim));
+       if(x.rlim_cur > 0x7FFFFFFF)
+               x.rlim_cur = 0x7FFFFFFF;
+       if(x.rlim_max > 0x7FFFFFFF)
+               x.rlim_max = 0x7FFFFFFF;
+       return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
+}
+
+
 asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim)
 {
        struct rlimit new_rlim, *old_rlim;
index da818f5d26e972963ac30ca47789279f10307236..302c44ccb402150f77fd2e9b3797562191f27dee 100644 (file)
@@ -49,7 +49,7 @@ extern char modprobe_path[];
 extern int sg_big_buff;
 #endif
 #ifdef CONFIG_SYSVIPC
-extern int shmmax;
+extern size_t shmmax;
 #endif
 
 #ifdef __sparc__
@@ -213,8 +213,8 @@ static ctl_table kern_table[] = {
        {KERN_RTSIGMAX, "rtsig-max", &max_queued_signals, sizeof(int),
         0644, NULL, &proc_dointvec},
 #ifdef CONFIG_SYSVIPC
-       {KERN_SHMMAX, "shmmax", &shmmax, sizeof (int),
-        0644, NULL, &proc_dointvec},
+       {KERN_SHMMAX, "shmmax", &shmmax, sizeof (size_t),
+        0644, NULL, &proc_doulongvec_minmax},
 #endif
 #ifdef CONFIG_MAGIC_SYSRQ
        {KERN_SYSRQ, "sysrq", &sysrq_enabled, sizeof (int),
index 7f121f1f64fef53019e5bbf3244de7ff6968e61b..5e6981b0043d43e2aee0d2c90ca578acf62633f5 100644 (file)
@@ -140,7 +140,7 @@ repeat:
                page = list_entry(curr, struct page, list);
                curr = curr->next;
 
-               offset = page->pg_offset;
+               offset = page->index;
 
                /* page wholly truncated - free it */
                if (offset >= start) {
@@ -369,7 +369,7 @@ inside:
                        goto not_found;
                if (page->mapping != mapping)
                        continue;
-               if (page->pg_offset == offset)
+               if (page->index == offset)
                        break;
        }
        set_bit(PG_referenced, &page->flags);
@@ -427,9 +427,9 @@ static int do_buffer_fdatasync(struct inode *inode, unsigned long start, unsigne
                curr = curr->next;
                if (!page->buffers)
                        continue;
-               if (page->pg_offset >= end)
+               if (page->index >= end)
                        continue;
-               if (page->pg_offset < start)
+               if (page->index < start)
                        continue;
 
                get_page(page);
@@ -479,7 +479,7 @@ static inline void __add_to_page_cache(struct page * page,
        flags = page->flags & ~((1 << PG_uptodate) | (1 << PG_error) | (1 << PG_referenced));
        page->flags = flags | (1 << PG_locked);
        get_page(page);
-       page->pg_offset = offset;
+       page->index = offset;
        add_page_to_inode_queue(mapping, page);
        __add_page_to_hash_queue(page, hash);
        lru_cache_add(page);
@@ -1475,7 +1475,7 @@ static int filemap_write_page(struct file *file,
 extern void wakeup_bdflush(int);
 int filemap_swapout(struct page * page, struct file * file)
 {
-       int retval = filemap_write_page(file, page->pg_offset, page, 0);
+       int retval = filemap_write_page(file, page->index, page, 0);
        wakeup_bdflush(0);
        return retval;
 }
@@ -1519,9 +1519,9 @@ static inline int filemap_sync_pte(pte_t * ptep, struct vm_area_struct *vma,
                BUG();
        pgoff = (address - vma->vm_start) >> PAGE_CACHE_SHIFT;
        pgoff += vma->vm_pgoff;
-       if (page->pg_offset != pgoff) {
-               printk("weirdness: pgoff=%lu pg_offset=%lu address=%lu vm_start=%lu vm_pgoff=%lu\n",
-                       pgoff, page->pg_offset, address, vma->vm_start, vma->vm_pgoff);
+       if (page->index != pgoff) {
+               printk("weirdness: pgoff=%lu index=%lu address=%lu vm_start=%lu vm_pgoff=%lu\n",
+                       pgoff, page->index, address, vma->vm_start, vma->vm_pgoff);
        }
        error = filemap_write_page(vma->vm_file, pgoff, page, 1);
        page_cache_free(page);
index fb7558863e3811f2b9a8820c6ee15b1715fa9498..def9ca7e36e90a2cdda9da11af2bf25608913494 100644 (file)
@@ -68,7 +68,7 @@ struct page * replace_with_highmem(struct page * page)
        kunmap(vaddr, KM_WRITE);
 
        /* Preserve the caching of the swap_entry. */
-       highpage->pg_offset = page->pg_offset;
+       highpage->index = page->index;
        highpage->mapping = page->mapping;
 
        /*
index c50753f3124ef4bae46197c580ca0334ccdfd0b0..4752806dea9828dc7921a0f052a65b7c78ba3812 100644 (file)
@@ -72,11 +72,13 @@ static void change_protection(unsigned long start, unsigned long end, pgprot_t n
        flush_cache_range(current->mm, beg, end);
        if (start >= end)
                BUG();
+       spin_lock(&current->mm->page_table_lock);
        do {
                change_pmd_range(dir, start, end - start, newprot);
                start = (start + PGDIR_SIZE) & PGDIR_MASK;
                dir++;
        } while (start && (start < end));
+       spin_unlock(&current->mm->page_table_lock);
        flush_tlb_range(current->mm, beg, end);
        return;
 }
index a77c20e4176a47c05e45a4090019a8bd1e8a17cc..012ab79123b6c96c4cae16e890e832fe3616fe4e 100644 (file)
@@ -93,7 +93,6 @@ static int move_page_tables(struct mm_struct * mm,
        unsigned long offset = len;
 
        flush_cache_range(mm, old_addr, old_addr + len);
-       flush_tlb_range(mm, old_addr, old_addr + len);
 
        /*
         * This is not the clever way to do this, but we're taking the
@@ -105,6 +104,7 @@ static int move_page_tables(struct mm_struct * mm,
                if (move_one_page(mm, old_addr + offset, new_addr + offset))
                        goto oops_we_failed;
        }
+       flush_tlb_range(mm, old_addr, old_addr + len);
        return 0;
 
        /*
index e63239a44d0c3f69e214f15b7bab5e8c169ae5cf..0012fe23451abf4b001f1c83bd935150d4ecca6c 100644 (file)
@@ -132,7 +132,7 @@ void rw_swap_page(int rw, struct page *page, int wait)
 {
        swp_entry_t entry;
 
-       entry.val = page->pg_offset;
+       entry.val = page->index;
 
        if (!PageLocked(page))
                PAGE_BUG(page);
index bc5cd725097217f4ebd146750dee1250f5cc1e35..4e886001880182f1dd9eb96b78d045b8336ef606 100644 (file)
@@ -111,7 +111,7 @@ int swap_count(struct page *page)
        swp_entry_t entry;
        int retval = 0;
 
-       entry.val = page->pg_offset;
+       entry.val = page->index;
        if (!entry.val)
                goto bad_entry;
        type = SWP_TYPE(entry);
@@ -164,7 +164,7 @@ void __delete_from_swap_cache(struct page *page)
 {
        swp_entry_t entry;
 
-       entry.val = page->pg_offset;
+       entry.val = page->index;
 
 #ifdef SWAP_CACHE_INFO
        swap_cache_del_total++;
index f88625e59c3224fe88a4fafa0760932bdc217be4..dc4b800733c89365aa9965c9b6e0b24f5fd02df8 100644 (file)
@@ -186,9 +186,9 @@ swp_entry_t acquire_swap_entry(struct page *page)
                goto new_swap_entry;
 
        /* We have the old entry in the page offset still */
-       if (!page->pg_offset)
+       if (!page->index)
                goto new_swap_entry;
-       entry.val = page->pg_offset;
+       entry.val = page->index;
        type = SWP_TYPE(entry);
        if (type & SHM_SWP_TYPE)
                goto new_swap_entry;
index d65c572d6508242768850d4734d2c2691bb4f37a..102e97e3a65011b72c976926779e3f6b8a0a888d 100644 (file)
@@ -73,7 +73,7 @@ static int try_to_swap_out(struct vm_area_struct* vma, unsigned long address, pt
         * memory, and we should just continue our scan.
         */
        if (PageSwapCache(page)) {
-               entry.val = page->pg_offset;
+               entry.val = page->index;
                swap_duplicate(entry);
                set_pte(page_table, swp_entry_to_pte(entry));
 drop_pte:
index 8781699d29d2839442b0f6576981173e366ee259..2fe7e0fdb78cb69a811efad72ee811aeaa9e99d2 100644 (file)
@@ -2165,6 +2165,6 @@ void __init ip_rt_init(void)
 
        proc_net_create ("rt_cache", 0, rt_cache_get_info);
 #ifdef CONFIG_NET_CLS_ROUTE
-       create_proc_read_entry("net/rt_acct", 0, 0, ip_rt_acct_read);
+       create_proc_read_entry("net/rt_acct", 0, 0, ip_rt_acct_read, NULL);
 #endif
 }
index 2a91fdf64b527431ac48058a380c93b59db778f0..48c9578e3784229e4fcfd46a13eb7da31326e0be 100644 (file)
@@ -1698,7 +1698,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
        int err = -EINVAL;
        int i;
 
-       if (vma->vm_offset)
+       if (vma->vm_pgoff)
                return -EINVAL;
 
        size = vma->vm_end - vma->vm_start;