]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.5 2.3.5
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:25:18 +0000 (15:25 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:25:18 +0000 (15:25 -0500)
95 files changed:
Documentation/isdn/CREDITS
Documentation/kernel-parameters.txt [new file with mode: 0644]
Documentation/video4linux/bttv/CONTRIBUTORS
Documentation/video4linux/bttv/README.WINVIEW [new file with mode: 0644]
Makefile
arch/i386/defconfig
arch/i386/kernel/smp.c
drivers/acorn/block/ide-ics.c
drivers/char/acquirewdt.c
drivers/char/pc110pad.c
drivers/char/pms.c
drivers/char/softdog.c
drivers/char/videodev.c
drivers/char/wdt.c
drivers/isdn/avmb1/b1pci.c
drivers/isdn/hisax/hscx_irq.c
drivers/isdn/hisax/telespci.c
drivers/misc/parport_ax.c
drivers/misc/parport_procfs.c
drivers/misc/parport_share.c
drivers/net/ptifddi.c
drivers/net/shaper.c
drivers/sbus/dvma.c
drivers/sound/audio.c
drivers/sound/bin2hex.c
drivers/sound/hex2hex.c
drivers/sound/sound_timer.c
drivers/video/fbcmap.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/binfmt_em86.c
fs/binfmt_java.c
fs/binfmt_misc.c
fs/binfmt_script.c
fs/coda/cnode.c
fs/coda/psdev.c
fs/devpts/inode.c
fs/efs/namei.c
fs/efs/symlink.c
fs/exec.c
fs/file_table.c
fs/hpfs/buffer.c
fs/hpfs/ea.c
fs/hpfs/file.c
fs/hpfs/name.c
fs/hpfs/namei.c
fs/hpfs/super.c
fs/isofs/symlink.c
fs/lockd/svcshare.c
fs/lockd/svcsubs.c
fs/ncpfs/file.c
fs/nfs/file.c
fs/nfs/write.c
fs/ntfs/util.c
fs/qnx4/inode.c
fs/qnx4/symlinks.c
fs/smbfs/file.c
fs/ufs/util.c
include/asm-i386/locks.h
include/asm-i386/softirq.h
include/linux/binfmts.h
include/linux/fs.h
include/linux/if_ether.h
include/linux/if_fddi.h
include/linux/if_hippi.h
include/linux/nfs_fs.h
include/linux/smp.h
init/main.c
mm/filemap.c
net/802/llc_macinit.c
net/core/datagram.c
net/core/dev.c
net/core/neighbour.c
net/decnet/dn_dev.c
net/ethernet/eth.c
net/ipv4/devinet.c
net/ipv4/icmp.c
net/ipv4/ip_masq_quake.c
net/ipv4/ip_masq_vdolive.c
net/ipv4/ip_options.c
net/ipv4/ipmr.c
net/ipv4/tcp_input.c
net/ipv6/ip6_fw.c
net/ipv6/ip6_output.c
net/ipv6/mcast.c
net/ipv6/reassembly.c
net/irda/discovery.c
net/irda/irda_device.c
net/irda/irlap_comp.c
net/irda/wrapper.c
net/netlink/af_netlink.c
net/netlink/netlink_dev.c
net/sunrpc/auth.c
net/sunrpc/auth_unix.c
net/x25/af_x25.c

index 6fd4c9ed5beba7dfaef4b81be2f49e3d0a89dc5a..9faad9c601d180257c761e6e8404562c3f397bd4 100644 (file)
@@ -5,7 +5,7 @@ I want to thank all who contributed to this project and especially to:
 Thomas Bogendörfer (tsbogend@bigbug.franken.de)
   Tester, lots of bugfixes and hints.
 
-Alan Cox (alan@cymru.net)
+Alan Cox (alan@redhat.com)
   For help getting into standard-kernel.
 
 Henner Eisen (eis@baty.hanse.de)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
new file mode 100644 (file)
index 0000000..9c293fb
--- /dev/null
@@ -0,0 +1,336 @@
+June 1999                Kernel Parameters                     v2.2.9
+                         ~~~~~~~~~~~~~~~~~
+
+The following is a consolidated list of the kernel parameters as defined
+in the file init/main.c and sorted into English Dictionary order (defined
+as ignoring all punctuation and sorting digits before letters in a case
+insensitive manner), and with descriptions where known.
+
+The text in square brackets at the beginning of the description state the
+restrictions on the kernel for the said kernel parameter to be valid. The
+restrictions referred to are that the relevant option is valid if:
+
+    APIC       APIC support is enabled.
+    APM        Automatic Power Management support is enabled.
+    AX25       Appropriate AX.25 support is enabled.
+    CD         Appropriate CD support is enabled.
+    EIDE       EIDE/ATAPI support is enabled.
+    FB         The frame buffer device is enabled.
+    HW         Appropriate hardware is enabled.
+    ISDN       Appropriate ISDN support is enabled.
+    JOY        Appropriate joystick support is enabled.
+    LPT        Printer support is enabled.
+    MCA        MCA bus support is enabled.
+    MDA        The MDA console is enabled.
+    MOUSE      Appropriate mouse support is enabled.
+    NET        Appropriate network support is enabled.
+    NFS        Appropriate NFS support is enabled.
+    PARIDE     The ParIDE subsystem is enabled.
+    PCI        PCI bus support is enabled.
+    PCMCIA     The PCMCIA subsystem is enabled.
+    PNP        Plug & Play support is enabled.
+    PS2        Appropriate PS/2 support is enabled.
+    RAM        RAMdisc support is enabled.
+    SCSI       Appropriate SCSI support is enabled.
+    SERIAL     Serial support is enabled.
+    SMP        The kernel is an SMP kernel.
+    SOUND      Appropriate sound system support is enabled.
+    VGA        The VGA console has been enabled.
+    VT         Virtual terminal support is enabled.
+    XT         IBM PC/XT support is enabled.
+
+In addition, the following text indicates that the option:
+
+    BUGS=      Relates to possible processor bugs on the said processor.
+    KNL        Is a kernel start-up parameter.
+
+Note that ALL kernel parameters listed below are CASE SENSITIVE, and that
+a trailing = on the name of any parameter states that that parameter will
+be entered as an environment variable, whereas its absence indicates that
+it will appear as a kernel argument readable via /proc/cmdline by programs
+running once the system is up.
+
+    53c7xx=            [HW,SCSI]
+
+    adb_buttons=       [HW,MOUSE]
+
+    advansys=          [HW,SCSI]
+
+    aha152x=           [HW,SCSI]
+
+    aha1542=           [HW,SCSI]
+
+    aic7xxx=           [HW,SCSI]
+
+    AM53C974=          [HW,SCSI]
+
+    apm=               [APM] Automatic Power Management.
+
+    arcrimi=           [HW,NET]
+
+    atamouse=          [HW,MOUSE] Atari Mouse.
+
+    atascsi=           [HW,SCSI] Atari SCSI.
+
+    aztcd=             [HW,CD] Aztec CD driver.
+
+    baycom_par=        [HW,AX25] BayCom Parallel Port AX.25 Modem.
+
+    baycom_ser_fdx=    [HW,AX25] BayCom Serial Port AX.25 Modem in Full
+                       Duplex Mode.
+
+    baycom_ser_hdx=    [HW,AX25] BayCom Serial Port AX.25 Modem in Half
+                       Duplex Mode.
+
+    bmouse=            [HW,MOUSE,PS2] Bus mouse.
+
+    BusLogic=          [HW,SCSI]
+
+    cdu31a=            [HW,CD]
+
+    cm206=             [HW,CD]
+
+    com20020=          [HW,NET]
+
+    com90io=           [HW,NET]
+
+    com90xx=           [HW,NET]
+
+    console=           
+
+    cyclades=          [HW,SERIAL] Cyclades multi-serial port adapter.
+
+    debug              [KNL] Enable kernel debugging.
+
+    decnet=            [HW,NET]
+
+    digi=              [HW,SERIAL]
+
+    digiepca=          [HW,SERIAL]
+
+    dmascc=            [HW,AX25,SERIAL] AX.25 Z80SCC driver with DMA
+                       support available.
+
+    dmasound=          [HW,SOUND]
+
+    dtc3181e=          [HW,SCSI]
+
+    eata=              [HW,SCSI]
+
+    eda=               [HW,PS2]
+
+    edb=               [HW,PS2]
+
+    ether=             [HW,NET] Ethernet.
+
+    fd_mcs=            [HW,SCSI]
+
+    fdomain=           [HW,SCSI]
+
+    floppy=            [HW]
+
+    ftape=             [HW] Floppy Tape subsystem.
+
+    gdth=              [HW,SCSI]
+
+    gscd=              [HW,CD]
+
+    gvp11=             [HW,SCSI]
+
+    hd=                [EIDE] IDE and EIDE hard drive subsystem.
+
+    hfmodem=           [HW,AX25]
+
+    HiSax=             [HW,ISDN]
+
+    hisax=             [HW,ISDN]
+
+    ibmmcascsi=        [HW,MCA,SCSI] IBM MicroChannel SCSI adapter.
+
+    icn=               [HW,ISDN]
+
+    in2000=            [HW,SCSI]
+
+    init=              [KNL]
+
+    ip=                [PNP]
+
+    isp16=             [HW,CD]
+
+    js_14=             [HW,JOY]
+
+    js_am=             [HW,JOY]
+
+    js_an=             [HW,JOY]
+
+    js_as=             [HW.JOY]
+
+    js_console=        [HW,JOY]
+
+    js_console2=       [HW,JOY]
+
+    js_console3=       [HW,JOY]
+
+    js_db9=            [HW,JOY]
+
+    js_db9_2=          [HW,JOY]
+
+    js_db9_3=          [HW,JOY]
+
+    js_tg=             [HW,JOY]
+
+    js_tg_2=           [HW,JOY]
+
+    js_tg_3=           [HW,JOY]
+
+    kbd-reset          [VT]
+
+    load_ramdisk=      [RAM]
+
+    lp=                [LPT] Parallel Printer.
+
+    ltpc=              [HW]
+
+    mac5380=           [HW,SCSI]
+
+    maxcpus=           [SMP] States the maximum number of processors that
+                       an SMP kernel should make use of.
+
+    max_scsi_luns=     [SCSI]
+
+    mca-pentium        [BUGS=ix86]
+
+    mcd=               [HW,CD]
+
+    mcdx=              [HW,CD]
+
+    md=                [HW]
+
+    mdacon=            [MDA]
+
+    msmouse=           [HW,MOUSE] Microsoft Mouse.
+
+    ncr5380=           [HW,SCSI]
+
+    ncr53c400=         [HW,SCSI]
+
+    ncr53c400a=        [HW,SCSI]
+
+    ncr53c406a=        [HW,SCSI]
+
+    ncr53c8xx=         [HW,SCSI]
+
+    nfsaddrs=          [NFS]
+
+    nfsroot=           [NFS]
+
+    no387              [BUGS=ix86] Tells the kernel to use the 387 maths
+                       emulation library even if a 387 maths coprocessor
+                       is present.
+
+    noapic             [SMP,APIC] Tells the kernel not to make use of any
+                       APIC that may be present on the system.
+
+    no-halt            [BUGS=ix86]
+
+    noinitrd           [RAM] Tells the kernel not to load any configured
+                       initial ramdisc.
+
+    no-scroll          [VGA]
+
+    nosmp              [SMP] Tells an SMP kernel to act as a UP kernel.
+
+    optcd=             [HW,CD]
+
+    panic=             
+
+    parport=           [HW,LP]
+
+    pas16=             [HW,SCSI]
+
+    pcbit=             [HW,ISDN]
+
+    pcd.               [PARIDE]
+
+    pci=               [PCI]
+
+    pd.                [PARIDE]
+
+    pf.                [PARIDE]
+
+    pg.                [PARIDE]
+
+    pirq=              [SMP,APIC]
+
+    plip=              [LP,NET] Parallel port network link.
+
+    profile=
+
+    prompt_ramdisk=    [RAM] Whether to prompt for ramdisk before loading
+                       its contents into memory.
+
+    pt.                [PARIDE]
+
+    ramdisk=           [RAM]
+
+    ramdisk_size=      [RAM]
+
+    ramdisk_start=     [RAM]
+
+    reboot=            [BUGS=ix86]
+
+    reserve=
+
+    riscom8=           [HW,SERIAL]
+
+    ro                 [KNL] Mount root device read-only on boot.
+
+    root=              
+
+    rw                 [KNL] Mount root device read-write on boot.
+
+    sbpcd=             [HW,CD] Soundblaster CD adapter.
+
+    scsi_logging=      [SCSI]
+
+    sjcd=              [HW,CD]
+
+    sonycd535=         [HW,CD]
+
+    sound=             [SOUND]
+
+    soundmodem=        [HW,AX25,SOUND] Sound cards used as AX.25 modems.
+
+    specialix=         [HW,SERIAL] Specialix multi-serial port adapter.
+
+    st=                [HW]
+
+    st0x=              [HW,SCSI]
+
+    stram_swap=        [HW]
+
+    sym53c416=         [HW,SCSI]
+
+    sym53c8xx=         [HW,SCSI]
+
+    t128=              [HW,SCSI]
+
+    tmc8xx=            [HW,SCSI]
+
+    tmscsim=           [HW,SCSI]
+
+    tp720=             [HW,PS2]
+
+    u14-34f=           [HW,SCSI]
+
+    video=             [FB]
+
+    wd33c93=           [HW,SCSI]
+
+    wd7000=            [HW,SCSI]
+
+    wdt=               [HW]
+
+    xd=                [HW,XT]
+
+    xd_geo=            [HW,XT]
index cf7d2300a11cc30a8e60540898b6b2235185ceac..b2dc4d2708c74ca25293604180c6ac40b20abce0 100644 (file)
@@ -3,7 +3,7 @@ Contributors to bttv:
 Michael Chu <mmchu@pobox.com>
   AverMedia fix and more flexible card recognition
 
-Alan Cox <alan@cymru.net>
+Alan Cox <alan@redhat.com>
   Video4Linux interface and 2.1.x kernel adaptation
 
 Chris Kleitsch
diff --git a/Documentation/video4linux/bttv/README.WINVIEW b/Documentation/video4linux/bttv/README.WINVIEW
new file mode 100644 (file)
index 0000000..c61cf28
--- /dev/null
@@ -0,0 +1,33 @@
+
+Support for the Leadtek WinView 601 TV/FM by Jon Tombs <jon@gte.esi.us.es>
+
+This card is basically the same as all the rest (Bt484A, Philips tuner),
+the main difference is that they have attached a programmable attenuator to 3
+GPIO lines in order to give some volume control. They have also stuck an
+infra-red remote control decoded on the board, I will add support for this
+when I get time (it simple generates an interrupt for each key press, with
+the key code is placed in the GPIO port).
+
+I don't yet have any application to test the radio support. The tuner
+frequency setting should work but it is possible that the audio multiplexer
+is wrong. If it doesn't work, send me email.
+
+
+- No Thanks to Leadtek they refused to answer any questions about their
+hardware. The driver was written by visual inspection of the card. If you
+use this driver, send an email insult to them, and tell them you won't
+continue buying their hardware unless they support Linux.
+
+- Little thanks to Princeton Technology Corp (http://www.princeton.com.tw)
+who make the audio attenuator. Their publicly available data-sheet available
+on their web site doesn't include the chip programming information! Hidden
+on their server are the full data-sheets, but don't ask how I found it.
+
+To use the driver I use the following options, the tuner and pll settings might
+be different in your country
+
+insmod videodev
+insmod i2c scan=1 i2c_debug=0 verbose=0
+insmod tuner type=1 debug=0
+insmod bttv  pll=1 radio=1 card=17
+
index 3b89528ee2b12a266535502d9e57eafda74a35eb..2466fb952c8ca84967b1fe2850fe1ee8f088e001 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 3
-SUBLEVEL = 4
+SUBLEVEL = 5
 EXTRAVERSION =
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
index 7960c4dc371509ec719deb3754fe1a25e7bd7de0..2f4242a18da9fb47f38884ccadbd86806a4d0221 100644 (file)
@@ -302,9 +302,9 @@ CONFIG_USB=y
 CONFIG_USB_UHCI=y
 # CONFIG_USB_OHCI is not set
 # CONFIG_USB_OHCI_HCD is not set
+CONFIG_USB_HUB=y
 CONFIG_USB_MOUSE=y
 CONFIG_USB_KBD=y
-CONFIG_USB_HUB=y
 # CONFIG_USB_AUDIO is not set
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
@@ -350,6 +350,7 @@ CONFIG_LOCKD=y
 # CONFIG_MAC_PARTITION is not set
 # CONFIG_SMD_DISKLABEL is not set
 # CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_SGI_DISKLABEL is not set
 # CONFIG_NLS is not set
 
 #
index 4d13635aed5c42a05fff85bb5684230368a26d54..5588f5ca8174f1cd7c58efaf746bc87204b33da7 100644 (file)
@@ -2,7 +2,7 @@
  *     Intel MP v1.1/v1.4 specification support routines for multi-pentium
  *     hosts.
  *
- *     (c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
+ *     (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
  *     (c) 1998 Ingo Molnar
  *
  *     Supported by Caldera http://www.caldera.com.
index 17bc5e6fdcf08d213db1b1600bced016298f6679..24ac28094626f61320de19c6cd33d57e8621e688 100644 (file)
@@ -8,6 +8,7 @@
  *  12-09-1997 RMK     Added interrupt enable/disable
  */
 
+#include <linux/string.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
 #include <linux/malloc.h>
index a9aa7671467ff5324c8ed845c12b23a03d5e2f42..74ad52cfcc0292537de9879d7bdc7e99dfb2a60c 100644 (file)
@@ -3,8 +3,8 @@
  *
  *      Based on wdt.c. Original copyright messages:
  *
- *     (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *                             http://www.cymru.net
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.com
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
  *     warranty for any of this software. This material is provided 
  *     "AS-IS" and at no charge.       
  *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
  *
  */
 
index d5bc4cc0bbad99c251f32aaef29fe16938f2c726..0c00dcfa5be9e7d232dbdede8ced9e9385419e92 100644 (file)
@@ -9,11 +9,11 @@
  *     This is read internally and used to synthesize a stream of
  *     triples in the form expected from a PS/2 device.
  *
- *     0.0 1997-05-16 Alan Cox <alan@cymru.net> - Pad reader
+ *     0.0 1997-05-16 Alan Cox <alan@redhat.com> - Pad reader
  *     0.1 1997-05-19 Robin O'Leary <robin@acm.org> - PS/2 emulation
  *     0.2 1997-06-03 Robin O'Leary <robin@acm.org> - tap gesture
- *     0.3 1997-06-27 Alan Cox <alan@cymru.net> - 2.1 commit
- *     0.4 1997-11-09 Alan Cox <alan@cymru.net> - Single Unix VFS API changes
+ *     0.3 1997-06-27 Alan Cox <alan@redhat.com> - 2.1 commit
+ *     0.4 1997-11-09 Alan Cox <alan@redhat.com> - Single Unix VFS API changes
  */
 
 #include <linux/module.h>
index 252929f82774d3c3a51c84001afe3d316a21a7ba..72653aa1975e6c295347b214cc45724d4a5e6f40 100644 (file)
@@ -10,7 +10,7 @@
  *     14478 Potsdam, Germany
  *
  *     Most of this code is directly derived from his userspace driver.
- *     His driver works so send any reports to alan@cymru.net unless the
+ *     His driver works so send any reports to alan@redhat.com unless the
  *     userspace driver also doesnt work for you...
  */
 
index 9dc9cbfe4d60028e985962a34966b5e592e14e6f..c8f21a184c64d0a0684b7aeb8b8976ef8ea51176 100644 (file)
@@ -1,8 +1,8 @@
 /*
  *     SoftDog 0.05:   A Software Watchdog Device
  *
- *     (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *                             http://www.cymru.net
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.com
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
index 21ed48c615aed3ea933bb1e501a9a65ec3dbd2dc..141fcf1bcd1625cf10b0cd96f374870405da9f0b 100644 (file)
@@ -9,7 +9,7 @@
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  *
- * Author:     Alan Cox, <alan@cymru.net>
+ * Author:     Alan Cox, <alan@redhat.com>
  *
  * Fixes:
  */
index a5e0fac4e373b9fede84eec45b38130af0f9d9d8..174175808a62dfd9f59e64df7501ef985c633c48 100644 (file)
@@ -1,8 +1,8 @@
 /*
  *     Industrial Computer Source WDT500/501 driver for Linux 2.1.x
  *
- *     (c) Copyright 1996-1997 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *                             http://www.cymru.net
+ *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.com
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
  *
  *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
- *     Release 0.07.
+ *     Release 0.08.
  *
  *     Fixes
  *             Dave Gregorich  :       Modularisation and minor bugs
@@ -24,6 +24,8 @@
  *                                     Matt Crocker).
  *             Alan Cox        :       Added wdt= boot option
  *             Alan Cox        :       Cleaned up copy/user stuff
+ *             Tim Hockin      :       Added insmod parameters, comment cleanup
+ *                                     Parameterized timeout
  */
 
 #include <linux/config.h>
index 5bdf8505b25855406525e1c945f9f5cbb92a4f3b..112ddbb81f9877ca38c1c812bb126be68e51cf2c 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/string.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index fcd65d32ff2d67ef755d7e843b762ba3181743aa..217d241c31e0fdfe064aa23faacaa10cd1385582 100644 (file)
@@ -42,6 +42,8 @@
  *
  */
 
+#include <linux/string.h>
+
 
 static inline void
 waitforCEC(struct IsdnCardState *cs, int hscx)
index dcbdd48020d454dbc55dadf09ee7ae840ae7df99..88592aa8d919404d65e776cef948d2c13fa84ebc 100644 (file)
@@ -24,6 +24,7 @@
  */
 #define __NO_VERSION__
 #include <linux/config.h>
+#include <linux/string.h>
 #include "hisax.h"
 #include "isac.h"
 #include "hscx.h"
index 8b5652c5701920ca5760d5271caa8597637105d6..55c932528fd09d17f4e5e4ad8a50243280d2681d 100644 (file)
@@ -11,6 +11,7 @@
  *          Grant Guenther <grant@torque.net>
  */
 
+#include <linux/string.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
index 2d276a573d08890f379b0529e9dabb827d63a68d..1a0a04d31d682878c4e596dfcc93d8f0dcffd311 100644 (file)
@@ -12,6 +12,7 @@
  * Cleaned up include files - Russell King <linux@arm.uk.linux.org>
  */
 
+#include <linux/string.h>
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 929c0ad73e0ea65f66d076d8365a1264067fa852..d60fcb0bcd26e80329f35edaae44f861768772c3 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <linux/config.h>
 
+#include <linux/string.h>
+
 #include <linux/tasks.h>
 
 #include <linux/parport.h>
index efd6f3eafc5f8f419dd11654c00da720ca2c312f..7c427b1dcd9d166b39596a98246e0c76a2d3e63c 100644 (file)
@@ -8,6 +8,7 @@
 static char *version =
         "ptifddi.c:v1.0 10/Dec/96 David S. Miller (davem@caipfs.rutgers.edu)\n";
 
+#include <linux/string.h>
 #include <linux/init.h>
 
 #include "ptifddi.h"
index 82d73baaa5b447ad74790a18605aa9f2b7b184d3..318f4c19a9f840d6eefc1b754b6ed539d3853c5c 100644 (file)
@@ -1,8 +1,8 @@
 /*
  *                     Simple traffic shaper for Linux NET3.
  *
- *     (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
- *                             http://www.cymru.net
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.com
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
index ec7f2a275761f4684e30904b142ebc1de448ef51..cf60be7981fa82fcc8352fb5427eae94ab4be543 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/malloc.h>
 #include <linux/init.h>
index ac2b6d40a20be5a8408ea69ac1127e09c23f257f..716e738e4e6b8549846582d232592c25a61f5812 100644 (file)
  * Thomas Sailer   : use more logical O_NONBLOCK semantics
  * Daniel Rodriksson: reworked the use of the device specific copy_user
  *                    still generic
+ * Horst von Brand:  Add missing #include <linux/string.h>
  */
 
 #include <linux/config.h>
 #include <linux/stddef.h>
+#include <linux/string.h>
 #include <linux/kmod.h>
 
 #include "sound_config.h"
index fc49c99d9fd139e62ef495e06f7ad69cca00cf72..100f18f9c0a090c598e7b37c7b74328e085038a5 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 
 int main( int argc, const char * argv [] )
 {
index 8f6cd11b17b7e7684de926b7336666c700777aa1..5460faae98c9a305015fbf8ee57fb20c883dcb84 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <stdlib.h>
 
 #define ABANDON(why) { fprintf(stderr, "%s\n", why); exit(1); }
index 8033437f151f9e6d5e0e3e96a47be9dfffbada1d..60f031ac885b001a015c551e528fc649a7b1ed94 100644 (file)
@@ -12,6 +12,7 @@
  * Thomas Sailer   : ioctl code reworked (vmalloc/vfree removed)
  */
 #include <linux/config.h>
+#include <linux/string.h>
 
 
 #include "sound_config.h"
index 5f1780bd8ded380fab2dea5a52abcf81c503b824..9207df06efcbe680dd4a7e274f4526723804329c 100644 (file)
@@ -8,6 +8,7 @@
  *  more details.
  */
 
+#include <linux/string.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/fb.h>
index 8a7e7bcd2f5231c4514f664acf49512bfaf756b9..0804d048cc8d2495efb2854c1ff2ed3a20faad9c 100644 (file)
@@ -307,7 +307,6 @@ static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs
        struct file * file;
        int fd;
        unsigned long error;
-       unsigned long p = bprm->p;
        unsigned long fd_offset;
        unsigned long rlim;
        int retval;
@@ -468,14 +467,18 @@ beyond_if:
 
        set_brk(current->mm->start_brk, current->mm->brk);
 
-       p = setup_arg_pages(p, bprm);
+       retval = setup_arg_pages(bprm); 
+       if (retval < 0) { 
+               /* Someone check-me: is this error path enough? */ 
+               send_sig(SIGKILL, current, 0); 
+               return retval;
+       }
 
-       p = (unsigned long) create_aout_tables((char *)p, bprm);
-       current->mm->start_stack = p;
+       current->mm->start_stack = create_aout_tables(bprm->p, bprm);
 #ifdef __alpha__
        regs->gp = ex.a_gpvalue;
 #endif
-       start_thread(regs, ex.a_entry, p);
+       start_thread(regs, ex.a_entry, current->mm->start_stack);
        if (current->flags & PF_PTRACED)
                send_sig(SIGTRAP, current, 0);
        return 0;
index 3ea19bb535bbc7ab4c62765423c223902f6ac618..29536b25477c0cc63ae69d63f48f389e857c8b51 100644 (file)
@@ -573,13 +573,12 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                  passed_p = passed_fileno;
 
                  if (elf_interpreter) {
-                   bprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2);
+                   retval = copy_strings_kernel(1,&passed_p,bprm);
+                       if (retval)
+                               goto out_free_dentry; 
                    bprm->argc++;
                  }
                }
-               retval = -E2BIG;
-               if (!bprm->p)
-                       goto out_free_dentry;
        }
 
        /* Flush all traces of the currently running executable */
@@ -601,7 +600,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        /* Do this so that we can load the interpreter, if need be.  We will
           change some of these later */
        current->mm->rss = 0;
-       bprm->p = setup_arg_pages(bprm->p, bprm);
+       setup_arg_pages(bprm); /* XXX: check error */
        current->mm->start_stack = bprm->p;
 
        /* Try and get dynamic programs out of the way of the default mmap
index d1992ca0643bc94c0338789d10efb6ead451df6f..f102f2dec87e1cb29ec83389ab913209f78e066a 100644 (file)
@@ -65,16 +65,18 @@ static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
         * user environment and arguments are stored.
         */
        remove_arg_zero(bprm);
-       bprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &bprm->filename, bprm);
+       if (retval < 0) return retval; 
        bprm->argc++;
        if (i_arg) {
-               bprm->p = copy_strings(1, &i_arg, bprm->page, bprm->p, 2);
+               retval = copy_strings_kernel(1, &i_arg, bprm);
+               if (retval < 0) return retval; 
                bprm->argc++;
        }
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &i_name, bprm);
+       if (retval < 0) return retval;
        bprm->argc++;
-       if (!bprm->p) 
-               return -E2BIG;
+
        /*
         * OK, now restart the process with the interpreter's inode.
         * Note that we use open_namei() as the name is now in kernel
index ca1ad396c34b6fca6ba1b4ac71bf9ca1cac147ba..2bd036d98e685a91fc819eff6eed5bc387f8a964 100644 (file)
@@ -67,15 +67,18 @@ static int do_load_java(struct linux_binprm *bprm,struct pt_regs *regs)
                i_name++;
        else
                i_name = bprm->filename;
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+
+       retval = copy_strings_kernel(1, &i_name, bprm); 
+       if (retval < 0) 
+               return retval; 
        bprm->argc++;
 
        i_name = binfmt_java_interpreter;
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &i_name, bprm); 
+       if (retval < 0) 
+               return retval; 
        bprm->argc++;
 
-       if (!bprm->p) 
-               return -E2BIG;
        /*
         * OK, now restart the process with the interpreter's dentry.
         */
@@ -114,15 +117,15 @@ static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
         */
        remove_arg_zero(bprm);
        i_name = bprm->filename;
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &i_name, bprm);
+       if (retval < 0) return retval; 
        bprm->argc++;
 
        i_name = binfmt_java_appletviewer;
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &i_name, bprm);
+       if (retval < 0) return retval; 
        bprm->argc++;
 
-       if (!bprm->p) 
-               return -E2BIG;
        /*
         * OK, now restart the process with the interpreter's dentry.
         */
index cb062d5b10769fa2b48d9ef9d6ef9c19c50282d5..7b9cead81959bb570cc07d22e21be6b75159b52b 100644 (file)
@@ -210,13 +210,12 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 
        /* Build args for interpreter */
        remove_arg_zero(bprm);
-       bprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &bprm->filename, bprm);
+       if (retval < 0) goto _ret; 
        bprm->argc++;
-       bprm->p = copy_strings(1, &iname_addr, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &iname_addr, bprm);
+       if (retval < 0) goto _ret; 
        bprm->argc++;
-       retval = -E2BIG;
-       if (!bprm->p)
-               goto _ret;
        bprm->filename = iname; /* for binfmt_script */
 
        dentry = open_namei(iname, 0, 0);
index 6aa1508a4b9bcfe54f83e2c0340b178231ad84f2..8cc685acaeb79b35561ae79076c069f792a586cc 100644 (file)
@@ -66,16 +66,17 @@ static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
         * user environment and arguments are stored.
         */
        remove_arg_zero(bprm);
-       bprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &bprm->filename, bprm);
+       if (retval < 0) return retval; 
        bprm->argc++;
        if (i_arg) {
-               bprm->p = copy_strings(1, &i_arg, bprm->page, bprm->p, 2);
+               retval = copy_strings_kernel(1, &i_arg, bprm);
+               if (retval < 0) return retval; 
                bprm->argc++;
        }
-       bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
+       retval = copy_strings_kernel(1, &i_name, bprm);
+       if (retval) return retval; 
        bprm->argc++;
-       if (!bprm->p) 
-               return -E2BIG;
        /*
         * OK, now restart the process with the interpreter's dentry.
         */
index 9fc3e9bc66f3d7438cc4c27595df68ac2d58e162..dd1e03f5feda3f9f8439ad04ef674b6c987cff6a 100644 (file)
@@ -3,6 +3,7 @@
    */
 
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/time.h>
 
 #include <linux/coda.h>
index b58c8802c56a47e31539eaa59cbd5d6e904696b8..abef74563a65860bc447a57bb30fbc47ae65da0d 100644 (file)
@@ -2,7 +2,7 @@
  *             An implementation of a loadable kernel mode driver providing
  *             multiple kernel/user space bidirectional communications links.
  *
- *             Author:         Alan Cox <alan@cymru.net>
+ *             Author:         Alan Cox <alan@redhat.com>
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
index 78d3ae6250c7d238694d2d224abdb77e9cf646a0..f5f8469d8270091a0a4ea41894cd6d05796bca61 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/module.h>
 
+#include <linux/string.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kdev_t.h>
index f19ba9469d5530e8f1dfcf9cd2a11ae682e5d716..cc85f5d9a8691033606c72e1b26269b121c28c3a 100644 (file)
@@ -6,6 +6,7 @@
  * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
  */
 
+#include <linux/string.h>
 #include <linux/efs_fs.h>
 
 static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) {
index 4204468c57c4e682dac65caf9d74a7602c03ce6b..705599eb0566b4e8e081c839523bec226d43e94a 100644 (file)
@@ -6,6 +6,7 @@
  * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
  */
 
+#include <linux/string.h>
 #include <linux/malloc.h>
 #include <linux/efs_fs.h>
 
index dfb111c9b8adb9ed2629b4757da0ec532006c2ae..e5b55e247c390ead1b75f0c162b1c5cabd29f7b7 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -222,78 +222,64 @@ static int count(char ** argv)
 }
 
 /*
- * 'copy_string()' copies argument/envelope strings from user
+ * 'copy_strings()' copies argument/envelope strings from user
  * memory to free pages in kernel mem. These are in a format ready
  * to be put directly into the top of new user memory.
- *
- * Modified by TYT, 11/24/91 to add the from_kmem argument, which specifies
- * whether the string and the string array are from user or kernel segments:
- * 
- * from_kmem     argv *        argv **
- *    0          user space    user space
- *    1          kernel space  user space
- *    2          kernel space  kernel space
- * 
- * We do this by playing games with the fs segment register.  Since it
- * is expensive to load a segment register, we try to avoid calling
- * set_fs() unless we absolutely have to.
  */
-unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
-               unsigned long p, int from_kmem)
+int copy_strings(int argc,char ** argv, struct linux_binprm *bprm) 
 {
-       char *str;
-       mm_segment_t old_fs;
-
-       if (!p)
-               return 0;       /* bullet-proofing */
-       old_fs = get_fs();
-       if (from_kmem==2)
-               set_fs(KERNEL_DS);
        while (argc-- > 0) {
+               char *str;
                int len;
                unsigned long pos;
 
-               if (from_kmem == 1)
-                       set_fs(KERNEL_DS);
-               get_user(str, argv+argc);
-               if (!str)
-                       panic("VFS: argc is wrong");
-               if (from_kmem == 1)
-                       set_fs(old_fs);
-               len = strlen_user(str); /* includes the '\0' */
-               if (p < len) {  /* this shouldn't happen - 128kB */
-                       set_fs(old_fs);
-                       return 0;
-               }
-               p -= len;
-               pos = p;
+               if (get_user(str, argv+argc) || !str || !(len = strlen_user(str))) 
+                       return -EFAULT;
+               if (bprm->p < len) 
+                       return -E2BIG; 
+
+               bprm->p -= len;
+               /* XXX: add architecture specific overflow check here. */ 
+
+               pos = bprm->p;
                while (len) {
                        char *pag;
                        int offset, bytes_to_copy;
 
                        offset = pos % PAGE_SIZE;
-                       if (!(pag = (char *) page[pos/PAGE_SIZE]) &&
-                           !(pag = (char *) page[pos/PAGE_SIZE] =
-                             (unsigned long *) get_free_page(GFP_USER))) {
-                               if (from_kmem==2)
-                                       set_fs(old_fs);
-                               return 0;
-                       }
+                       if (!(pag = (char *) bprm->page[pos/PAGE_SIZE]) &&
+                           !(pag = (char *) bprm->page[pos/PAGE_SIZE] =
+                             (unsigned long *) get_free_page(GFP_USER))) 
+                               return -ENOMEM; 
+
                        bytes_to_copy = PAGE_SIZE - offset;
                        if (bytes_to_copy > len)
                                bytes_to_copy = len;
-                       copy_from_user(pag + offset, str, bytes_to_copy);
+                       if (copy_from_user(pag + offset, str, bytes_to_copy)) 
+                               return -EFAULT; 
+
                        pos += bytes_to_copy;
                        str += bytes_to_copy;
                        len -= bytes_to_copy;
                }
        }
-       if (from_kmem==2)
-               set_fs(old_fs);
-       return p;
+       return 0;
 }
 
-unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm)
+/*
+ * Like copy_strings, but get argv and its values from kernel memory.
+ */
+int copy_strings_kernel(int argc,char ** argv, struct linux_binprm *bprm)
+{
+       int r;
+       mm_segment_t oldfs = get_fs();
+       set_fs(KERNEL_DS); 
+       r = copy_strings(argc, argv, bprm);
+       set_fs(oldfs);
+       return r; 
+}
+
+int setup_arg_pages(struct linux_binprm *bprm)
 {
        unsigned long stack_base;
        struct vm_area_struct *mpnt;
@@ -301,15 +287,18 @@ unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm)
 
        stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
 
-       p += stack_base;
+       bprm->p += stack_base;
        if (bprm->loader)
                bprm->loader += stack_base;
        bprm->exec += stack_base;
 
        mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
-       if (mpnt) {
+       if (!mpnt) 
+               return -ENOMEM; 
+       
+       {
                mpnt->vm_mm = current->mm;
-               mpnt->vm_start = PAGE_MASK & (unsigned long) p;
+               mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
                mpnt->vm_end = STACK_TOP;
                mpnt->vm_page_prot = PAGE_COPY;
                mpnt->vm_flags = VM_STACK_FLAGS;
@@ -319,7 +308,7 @@ unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm)
                mpnt->vm_pte = 0;
                insert_vm_struct(current->mm, mpnt);
                current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
-       }
+       } 
 
        for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
                if (bprm->page[i]) {
@@ -328,7 +317,8 @@ unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm)
                }
                stack_base += PAGE_SIZE;
        }
-       return p;
+       
+       return 0;
 }
 
 /*
@@ -804,8 +794,7 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
        int i;
 
        bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-       for (i=0 ; i<MAX_ARG_PAGES ; i++)       /* clear page-table */
-               bprm.page[i] = 0;
+       memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0])); 
 
        dentry = open_namei(filename, 0, 0);
        retval = PTR_ERR(dentry);
@@ -829,26 +818,34 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
        }
 
        retval = prepare_binprm(&bprm);
-       
-       if (retval >= 0) {
-               bprm.p = copy_strings(1, &bprm.filename, bprm.page, bprm.p, 2);
-               bprm.exec = bprm.p;
-               bprm.p = copy_strings(bprm.envc,envp,bprm.page,bprm.p,0);
-               bprm.p = copy_strings(bprm.argc,argv,bprm.page,bprm.p,0);
-               if (!bprm.p)
-                       retval = -E2BIG;
-       }
+       if (retval < 0) 
+               goto out; 
 
-       if (retval >= 0)
-               retval = search_binary_handler(&bprm,regs);
+       retval = copy_strings_kernel(1, &bprm.filename, &bprm);
+       if (retval < 0) 
+               goto out; 
+
+       bprm.exec = bprm.p;
+       retval = copy_strings(bprm.envc, envp, &bprm);
+       if (retval < 0) 
+               goto out; 
+
+       retval = copy_strings(bprm.argc, argv, &bprm);
+       if (retval < 0) 
+               goto out; 
+
+       retval = search_binary_handler(&bprm,regs);
        if (retval >= 0)
                /* execve success */
                return retval;
 
+out:
        /* Something went wrong, return the inode and free the argument pages*/
        if (bprm.dentry)
                dput(bprm.dentry);
 
+       /* Assumes that free_page() can take a NULL argument. */ 
+       /* I hope this is ok for all architectures */ 
        for (i=0 ; i<MAX_ARG_PAGES ; i++)
                free_page(bprm.page[i]);
 
index f7679dba374dead68e8843b0bc93aaca31a07046..45b68daecbd3992f3fe84b674a7a01c6b0c6193c 100644 (file)
@@ -5,6 +5,7 @@
  *  Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  */
 
+#include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/init.h>
index ca1f2919423b8938865b404df679965a40796ea1..8bcbf28fcabdefebf4804cd8d032fb0a2443200a 100644 (file)
@@ -6,6 +6,7 @@
  *  general buffer i/o
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 
 void hpfs_lock_creation(struct super_block *s)
index 502f25f9a25d31e6f4d4e85134e14a2c27c1680d..6dac91fd8d93cfd063d1648c6a769b6925bfddc5 100644 (file)
@@ -6,6 +6,7 @@
  *  handling extended attributes
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 
 /* Remove external extended attributes. ano specifies wheter a is a 
index 74b5609e09806fb1924cd592418c78168e3b3bcb..7cea8dcdc099c35b5c93e9a0b0da0f4c7fb6cf46 100644 (file)
@@ -6,6 +6,7 @@
  *  file VFS functions
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 
 int hpfs_open(struct inode *i, struct file *f)
index 865ebcab6f89f5cc8fba2838bcd276f5b847ef5d..f9fa94c7ef8665fbc075a9381906b99564a68c76 100644 (file)
@@ -6,6 +6,7 @@
  *  operations with filenames
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 
 char *text_postfix[]={
index 5e4d7c9f441adb8a58dd430a5f9fe1ee286bbb28..a49edf57e26d47c93e2ad019074747295663e6d0 100644 (file)
@@ -6,6 +6,7 @@
  *  adding & removing files & directories
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 
 int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
index 0c8c14060c0934b8e9af005501f76dc785a4ffb9..5a466d04ffd23bdbaf2db10e1465d4c10c652a16 100644 (file)
@@ -6,6 +6,7 @@
  *  mouning, unmounting, error handling
  */
 
+#include <linux/string.h>
 #include "hpfs_fn.h"
 #include <linux/module.h>
 
index 0f909c4286a19258531c0c348d152682be3ce955..5de4a874839963003513f9c1efd387a8fcee01d8 100644 (file)
@@ -9,6 +9,7 @@
  *  extensions to iso9660
  */
 
+#include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
index a8e7af942dddff518a63e6c7b64cd29ce5af5b03..4b34b97862d6246aef8cb897144b6a63e5563d88 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/sched.h>
 #include <linux/unistd.h>
+#include <linux/string.h>
 #include <linux/malloc.h>
 
 #include <linux/sunrpc/clnt.h>
index cfbbb26ef855a5f9f93d49c22b49124f2f4dbeae..1b1c4106984c4afff820625a0f2fec46bd7519ae 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/sched.h>
 #include <linux/in.h>
 #include <linux/sunrpc/svc.h>
index d42ae0a5b64579ac98867f2c90006733dcfdd4bf..bb61e2464b9af662ec217241a5fcb309ae9fc93d 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/ncp_fs.h>
 #include "ncplib_kernel.h"
 
-static inline int min(int a, int b)
+static inline unsigned int min(unsigned int a, unsigned int b)
 {
        return a < b ? a : b;
 }
@@ -99,9 +99,10 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
        struct inode *inode = dentry->d_inode;
        size_t already_read = 0;
        off_t pos;
-       int bufsize, error;
+       size_t bufsize;
+       int error;
        void* freepage;
-       int freelen;
+       size_t freelen;
 
        DPRINTK(KERN_DEBUG "ncp_file_read: enter %s/%s\n",
                dentry->d_parent->d_name.name, dentry->d_name.name);
@@ -121,10 +122,12 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
                goto out;
        }
 
-       pos = file->f_pos;
+       pos = *ppos;
+/* leave it out on server ...
        if (pos + count > inode->i_size) {
                count = inode->i_size - pos;
        }
+*/
        error = 0;
        if (!count)     /* size_t is never < 0 */
                goto out;
@@ -146,7 +149,7 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
        /* First read in as much as possible for each bufsize. */
        while (already_read < count) {
                int read_this_time;
-               int to_read = min(bufsize - (pos % bufsize),
+               size_t to_read = min(bufsize - (pos % bufsize),
                                  count - already_read);
 
                error = ncp_read_bounce(NCP_SERVER(inode),
@@ -162,13 +165,13 @@ ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
                buf += read_this_time;
                already_read += read_this_time;
 
-               if (read_this_time < to_read) {
+               if (read_this_time != to_read) {
                        break;
                }
        }
        kfree(freepage);
 
-       file->f_pos = pos;
+       *ppos = pos;
 
        if (!IS_RDONLY(inode)) {
                inode->i_atime = CURRENT_TIME;
@@ -187,7 +190,8 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
        struct inode *inode = dentry->d_inode;
        size_t already_written = 0;
        off_t pos;
-       int bufsize, errno;
+       size_t bufsize;
+       int errno;
        void* bouncebuffer;
 
        DPRINTK(KERN_DEBUG "ncp_file_write: enter %s/%s\n",
@@ -213,7 +217,7 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
                printk(KERN_ERR "ncp_file_write: open failed, error=%d\n", errno);
                return errno;
        }
-       pos = file->f_pos;
+       pos = *ppos;
 
        if (file->f_flags & O_APPEND) {
                pos = inode->i_size;
@@ -227,7 +231,7 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
                return -EIO;    /* -ENOMEM */
        while (already_written < count) {
                int written_this_time;
-               int to_write = min(bufsize - (pos % bufsize),
+               size_t to_write = min(bufsize - (pos % bufsize),
                                   count - already_written);
 
                if (copy_from_user(bouncebuffer, buf, to_write)) {
@@ -244,14 +248,14 @@ ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
                buf += written_this_time;
                already_written += written_this_time;
 
-               if (written_this_time < to_write) {
+               if (written_this_time != to_write) {
                        break;
                }
        }
        kfree(bouncebuffer);
        inode->i_mtime = inode->i_atime = CURRENT_TIME;
        
-       file->f_pos = pos;
+       *ppos = pos;
 
        if (pos > inode->i_size) {
                inode->i_size = pos;
index 1cf40d3ae3f3c73a05b9a401205bb951b534a125..75b14988669e30feb71f48c47fd80d374bf8c725 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pagemap.h>
 #include <linux/lockd/bind.h>
 
+#include <asm/uaccess.h>
 #include <asm/segment.h>
 #include <asm/system.h>
 
@@ -75,7 +76,7 @@ struct inode_operations nfs_file_inode_operations = {
        NULL,                   /* truncate */
        NULL,                   /* permission */
        NULL,                   /* smap */
-       nfs_updatepage,         /* updatepage */
+       NULL,                   /* updatepage */
        nfs_revalidate,         /* revalidate */
 };
 
@@ -156,6 +157,25 @@ nfs_fsync(struct file *file, struct dentry *dentry)
        return status;
 }
 
+/*
+ * This does the "real" work of the write. The generic routine has
+ * allocated the page, locked it, done all the page alignment stuff
+ * calculations etc. Now we should just copy the data from user
+ * space and write it back to the real medium..
+ *
+ * If the writer ends up delaying the write, the writer needs to
+ * increment the page use counts until he is done with the page.
+ */
+static long nfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf)
+{
+       long status;
+
+       bytes -= copy_from_user((u8*)page_address(page) + offset, buf, bytes);
+       status = -EFAULT;
+       if (bytes)
+               status = nfs_updatepage(file, page, offset, bytes);
+       return status;
+}
 
 /* 
  * Write to a file (through the page cache).
@@ -182,7 +202,7 @@ nfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
        if (!count)
                goto out;
 
-       result = generic_file_write(file, buf, count, ppos);
+       result = generic_file_write(file, buf, count, ppos, nfs_write_one_page);
 out:
        return result;
 
index bcf20f2f1b12fd62b9e2e0fc6767e4f73d29b031..d254f1824f3e4787db1baeeb871a790d9d6cac3e 100644 (file)
@@ -408,17 +408,17 @@ nfs_writepage(struct file * file, struct page *page)
  * things with a page scheduled for an RPC call (e.g. invalidate it).
  */
 int
-nfs_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count, int sync)
+nfs_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count)
 {
        struct dentry   *dentry = file->f_dentry;
        struct inode    *inode = dentry->d_inode;
        struct nfs_wreq *req;
-       int             synchronous = sync;
+       int             synchronous = file->f_flags & O_SYNC;
        int             retval;
 
-       dprintk("NFS:      nfs_updatepage(%s/%s %d@%ld, sync=%d)\n",
+       dprintk("NFS:      nfs_updatepage(%s/%s %d@%ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               count, page->offset+offset, sync);
+               count, page->offset+offset);
 
        /*
         * Try to find a corresponding request on the writeback queue.
@@ -454,7 +454,7 @@ nfs_updatepage(struct file *file, struct page *page, unsigned long offset, unsig
        file->f_count++;
 
        /* Schedule request */
-       synchronous = schedule_write_request(req, sync);
+       synchronous = schedule_write_request(req, synchronous);
 
 updated:
        if (req->wb_bytes == PAGE_SIZE)
index d6d7921eb8ad74168bf80014dd20c69097652c52..e0f9b236299f8708046d1b8a6300ab813bf7ecac 100644 (file)
@@ -12,6 +12,7 @@
 #include "struct.h"
 #include "util.h"
 
+#include <linux/string.h>
 #include <linux/errno.h>
 /* FreeBSD doesn't seem to have EILSEQ in errno.h */
 #ifndef EILSEQ
index 388593cc1cc86a4094b363f5bf1f2eab26df61a0..924ce049b9c1e4501b85c20d0e4cb5cb7fa42605 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/malloc.h>
 #include <linux/qnx4_fs.h>
index 083042d711d6d2d5cc46a68bd915c7425d6aa982..4572586709876179cbe827667ec7cd8feb43ffa4 100644 (file)
@@ -13,6 +13,7 @@
 
 /* THIS FILE HAS TO BE REWRITTEN */
 
+#include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
index aff45ef9b713dc581ec290c49655028595d81e28..2611ceb61c0124a4d39609ded30e465fb1e83e9f 100644 (file)
@@ -188,13 +188,13 @@ smb_writepage(struct file *file, struct page *page)
 }
 
 static int
-smb_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count, int sync)
+smb_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count)
 {
        struct dentry *dentry = file->f_dentry;
 
-       pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld, sync=%d)\n",
+       pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld)\n",
                dentry->d_parent->d_name.name, dentry->d_name.name,
-               count, page->offset+offset, sync);
+               count, page->offset+offset);
 
        return smb_writepage_sync(dentry, page, offset, count);
 }
@@ -256,6 +256,26 @@ out:
        return status;
 }
 
+/*
+ * This does the "real" work of the write. The generic routine has
+ * allocated the page, locked it, done all the page alignment stuff
+ * calculations etc. Now we should just copy the data from user
+ * space and write it back to the real medium..
+ *
+ * If the writer ends up delaying the write, the writer needs to
+ * increment the page use counts until he is done with the page.
+ */
+static long smb_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf)
+{
+       long status;
+
+       bytes -= copy_from_user((u8*)page_address(page) + offset, buf, bytes);
+       status = -EFAULT;
+       if (bytes)
+               status = smb_updatepage(file, page, offset, bytes);
+       return status;
+}
+
 /* 
  * Write to a file (through the page cache).
  */
@@ -287,7 +307,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, result);
 
        if (count > 0)
        {
-               result = generic_file_write(file, buf, count, ppos);
+               result = generic_file_write(file, buf, count, ppos, smb_write_one_page);
 #ifdef SMBFS_DEBUG_VERBOSE
 printk("smb_file_write: pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
 (long) file->f_pos, dentry->d_inode->i_size, dentry->d_inode->i_mtime,
@@ -386,6 +406,6 @@ struct inode_operations smb_file_inode_operations =
        NULL,                   /* truncate */
        smb_file_permission,    /* permission */
        NULL,                   /* smap */
-       smb_updatepage,         /* updatepage */
+       NULL,                   /* updatepage */
        smb_revalidate_inode,   /* revalidate */
 };
index 23f5052bb523e3c3a041f2ee747713899e46127c..11978a7524166688c2324903a310cbd65f0272d3 100644 (file)
@@ -6,6 +6,7 @@
  * Charles University, Faculty of Mathematics and Physics
  */
  
+#include <linux/string.h>
 #include <linux/malloc.h>
 #include <linux/locks.h>
 
index a46015d21f660f9bce964347f9991918bd78703a..1cc171f9b600e758640d0af097c7c3a20419588c 100644 (file)
@@ -2,7 +2,7 @@
  *     SMP locks primitives for building ix86 locks
  *     (not yet used).
  *
- *             Alan Cox, alan@cymru.net, 1995
+ *             Alan Cox, alan@redhat.com, 1995
  */
  
 /*
index 9df1f83aba500dedd7778825538cb1b74bb560d6..b8f33d7af7a104349fd33bd57880541e2525ce1f 100644 (file)
@@ -6,6 +6,15 @@
 
 extern unsigned int local_bh_count[NR_CPUS];
 
+#define cpu_bh_disable(cpu)    do { local_bh_count[(cpu)]++; barrier(); } while (0)
+#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count[(cpu)]--; } while (0)
+
+#define cpu_bh_trylock(cpu)    (local_bh_count[(cpu)] ? 0 : (local_bh_count[(cpu)] = 1))
+#define cpu_bh_endlock(cpu)    (local_bh_count[(cpu)] = 0)
+
+#define local_bh_disable()     cpu_bh_disable(smp_processor_id())
+#define local_bh_enable()      cpu_bh_enable(smp_processor_id())
+
 #define get_active_bhs()       (bh_mask & bh_active)
 #define clear_active_bhs(x)    atomic_clear_mask((x),&bh_active)
 
@@ -40,13 +49,6 @@ extern atomic_t global_bh_count;
 
 extern void synchronize_bh(void);
 
-/*
- * This is suboptimal. We only need to disable bh's locally
- * on this CPU...
- */
-#define local_bh_disable()     atomic_inc(&global_bh_lock)
-#define local_bh_enable()      atomic_dec(&global_bh_lock)
-
 static inline void start_bh_atomic(void)
 {
        atomic_inc(&global_bh_lock);
@@ -61,19 +63,20 @@ static inline void end_bh_atomic(void)
 /* These are for the IRQs testing the lock */
 static inline int softirq_trylock(int cpu)
 {
-       if (!test_and_set_bit(0,&global_bh_count)) {
-               if (atomic_read(&global_bh_lock) == 0) {
-                       ++local_bh_count[cpu];
-                       return 1;
+       if (cpu_bh_trylock(cpu)) {
+               if (!test_and_set_bit(0,&global_bh_count)) {
+                       if (atomic_read(&global_bh_lock) == 0)
+                               return 1;
+                       clear_bit(0,&global_bh_count);
                }
-               clear_bit(0,&global_bh_count);
+               cpu_bh_endlock(cpu);
        }
        return 0;
 }
 
 static inline void softirq_endlock(int cpu)
 {
-       local_bh_count[cpu]--;
+       cpu_bh_enable(cpu);
        clear_bit(0,&global_bh_count);
 }
 
@@ -81,22 +84,19 @@ static inline void softirq_endlock(int cpu)
 
 extern inline void start_bh_atomic(void)
 {
-       local_bh_count[smp_processor_id()]++;
+       local_bh_disable();
        barrier();
 }
 
 extern inline void end_bh_atomic(void)
 {
        barrier();
-       local_bh_count[smp_processor_id()]--;
+       local_bh_enable();
 }
 
-#define local_bh_disable()     (local_bh_count[smp_processor_id()]++)
-#define local_bh_enable()      (local_bh_count[smp_processor_id()]--)
-
 /* These are for the irq's testing the lock */
-#define softirq_trylock(cpu)   (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
-#define softirq_endlock(cpu)   (local_bh_count[cpu] = 0)
+#define softirq_trylock(cpu)   (cpu_bh_trylock(cpu))
+#define softirq_endlock(cpu)   (cpu_bh_endlock(cpu))
 #define synchronize_bh()       barrier()
 
 #endif /* SMP */
index b44cd83de1e69bf87200e4797f1f1f6d5f36964d..a5d4cd3b429c1ef08926866a37eb3beacefff41c 100644 (file)
@@ -19,7 +19,7 @@
 struct linux_binprm{
        char buf[128];
        unsigned long page[MAX_ARG_PAGES];
-       unsigned long p;
+       unsigned long p; /* current top of mem */
        int sh_bang;
        int java;               /* Java binary, prevent recursive invocation */
        struct dentry * dentry;
@@ -63,14 +63,16 @@ extern int prepare_binprm(struct linux_binprm *);
 extern void remove_arg_zero(struct linux_binprm *);
 extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
 extern int flush_old_exec(struct linux_binprm * bprm);
-extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
-extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
-               unsigned long p, int from_kmem);
-
+extern int setup_arg_pages(struct linux_binprm * bprm);
+extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm); 
+extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
 extern void compute_creds(struct linux_binprm *binprm);
 
-/* this eventually goes away */
+
+#if 0
+/* this went away now */
 #define change_ldt(a,b) setup_arg_pages(a,b)
+#endif
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_BINFMTS_H */
index b2e0b3125b4fa9d1a5209aa536dcc17c273013a5..e80d75d136f612860960fa105a1eade1f208df91 100644 (file)
@@ -625,7 +625,7 @@ struct inode_operations {
        void (*truncate) (struct inode *);
        int (*permission) (struct inode *, int);
        int (*smap) (struct inode *,int);
-       int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int, int);
+       int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int);
        int (*revalidate) (struct dentry *);
 };
 
@@ -874,10 +874,12 @@ extern struct buffer_head * breada(kdev_t dev,int block, int size,
 
 extern int brw_page(int, struct page *, kdev_t, int [], int, int);
 
+typedef long (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *);
+
 extern int generic_readpage(struct file *, struct page *);
 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
 extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
-extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);
+extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t *, writepage_t);
 
 extern struct super_block *get_super(kdev_t dev);
 extern void put_super(kdev_t dev);
index 3fae9a9def443fdc89fe6e9620512968d11c4f9d..99bb97fa253ec85db6e5dde8a9f1f83198354989 100644 (file)
@@ -9,7 +9,7 @@
  *
  * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *             Donald Becker, <becker@super.org>
- *             Alan Cox, <alan@cymru.net>
+ *             Alan Cox, <alan@redhat.com>
  *             Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *
  *             This program is free software; you can redistribute it and/or
index 30bde75d9c78586802cae9e4df5987ea3cbccf9d..221796362253b889095eccb6d71ed7d29246fad4 100644 (file)
@@ -12,7 +12,7 @@
  *             if_fddi.h is based on previous if_ether.h and if_tr.h work by
  *                     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *                     Donald Becker, <becker@super.org>
- *                     Alan Cox, <alan@cymru.net>
+ *                     Alan Cox, <alan@redhat.com>
  *                     Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *                     Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
  *
index 4ed065939bf96c1d7fb5a99c1bef32a3e2ac3cd6..52c4a80baec93dc691ed8ebfce8c04476523c6a3 100644 (file)
@@ -9,7 +9,7 @@
  *
  * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *             Donald Becker, <becker@super.org>
- *             Alan Cox, <alan@cymru.net>
+ *             Alan Cox, <alan@redhat.com>
  *             Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
  *             Jes Sorensen, <Jes.Sorensen@cern.ch>
  *
index 9a4a08df4a630e5676a9f9c3d49b12750f596f91..677940dc68331faa24b15a8b5a4acd21643ce161 100644 (file)
@@ -228,7 +228,7 @@ extern int  nfs_wb_file(struct inode *, struct file *);
  * back first..
  */
 extern void nfs_inval(struct inode *);
-extern int  nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int, int);
+extern int  nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int);
 
 /*
  * linux/fs/nfs/read.c
index 75c34e87ff39a626c2c7a61541d132c4e95284df..eae1290701ba29c2923c4a4390c368eed5566dbf 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
  *     Generic SMP support
- *             Alan Cox. <alan@cymru.net>
+ *             Alan Cox. <alan@redhat.com>
  */
 
 #ifdef __SMP__
index e973df74a073081b792c4cc80f6e6c09669ffc02..bc0b2faf3eed1d1ce922fb025250c6650fe78ca8 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/config.h>
 #include <linux/proc_fs.h>
 #include <linux/unistd.h>
+#include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/delay.h>
 #include <linux/utsname.h>
index 049cf90dab45050bcc52c02d4b03eda8827713be..455f334f306d5b6597f3c5b3266d4e3d1087e58e 100644 (file)
@@ -1425,7 +1425,8 @@ out:
  */
 ssize_t
 generic_file_write(struct file *file, const char *buf,
-                  size_t count, loff_t *ppos)
+                  size_t count, loff_t *ppos,
+                  writepage_t write_one_page)
 {
        struct dentry   *dentry = file->f_dentry; 
        struct inode    *inode = dentry->d_inode; 
@@ -1434,10 +1435,7 @@ generic_file_write(struct file *file, const char *buf,
        struct page     *page, **hash;
        unsigned long   page_cache = 0;
        unsigned long   written;
-       long            status, sync;
-
-       if (!inode->i_op || !inode->i_op->updatepage)
-               return -EIO;
+       long            status;
 
        if (file->f_error) {
                int error = file->f_error;
@@ -1445,7 +1443,6 @@ generic_file_write(struct file *file, const char *buf,
                return error;
        }
 
-       sync    = file->f_flags & O_SYNC;
        written = 0;
 
        if (file->f_flags & O_APPEND)
@@ -1501,15 +1498,7 @@ generic_file_write(struct file *file, const char *buf,
                wait_on_page(page);
                set_bit(PG_locked, &page->flags);
 
-               /*
-                * Do the real work.. If the writer ends up delaying the write,
-                * the writer needs to increment the page use counts until he
-                * is done with the page.
-                */
-               bytes -= copy_from_user((u8*)page_address(page) + offset, buf, bytes);
-               status = -EFAULT;
-               if (bytes)
-                       status = inode->i_op->updatepage(file, page, offset, bytes, sync);
+               status = write_one_page(file, page, offset, bytes, buf);
 
                /* Mark it unlocked again and drop the page.. */
                clear_bit(PG_locked, &page->flags);
index a51a868f2d52ba51485c20ab42ec4742756e34e2..da47f4883ee3208815cabd0ae5876a5bf1ec155b 100644 (file)
@@ -17,6 +17,8 @@
  *             Alan Cox        :       Chainsawed to Linux format
  *                                     Added llc_ to names
  *                                     Started restructuring handlers
+ *
+ *              Horst von Brand :      Add #include <linux/string.h>
  */
 
 #include <linux/module.h>
@@ -24,6 +26,7 @@
 #include <linux/kernel.h>
 #include <linux/malloc.h>
 #include <linux/unistd.h>
+#include <linux/string.h>
 #include <linux/netdevice.h>
 #include <linux/init.h>
 #include <net/p8022.h>
index ae82da6d51a5aeac37238dc82fad9d0d1860c7a9..98233a224c140b8a7c61e46504f00c82fd6c1105 100644 (file)
@@ -6,7 +6,7 @@
  *     This is used because UDP, RAW, PACKET, DDP, IPX, AX.25 and NetROM layer all have identical poll code and mostly
  *     identical recvmsg() code. So we share it here. The poll was shared before but buried in udp.c so I moved it.
  *
- *     Authors:        Alan Cox <alan@cymru.net>. (datagram_poll() from old udp.c code)
+ *     Authors:        Alan Cox <alan@redhat.com>. (datagram_poll() from old udp.c code)
  *
  *     Fixes:
  *             Alan Cox        :       NULL return from skb_peek_copy() understood
index 4cd1573c32ac7544ab754e44935118db467adfe6..ca1fdea5f5279852afa6c14b42fbce8831c35244 100644 (file)
@@ -453,11 +453,8 @@ void dev_clear_fastroute(struct device *dev)
                dev_do_clear_fastroute(dev);
        } else {
                read_lock_bh(&dev_base_lock);
-               for (dev = dev_base; dev; dev = dev->next) {
-                       read_unlock_bh(&dev_base_lock);
+               for (dev = dev_base; dev; dev = dev->next)
                        dev_do_clear_fastroute(dev);
-                       read_lock_bh(&dev_base_lock);
-               }
                read_unlock_bh(&dev_base_lock);
        }
 }
@@ -1128,8 +1125,13 @@ static int dev_ifconf(char *arg)
        if (copy_from_user(&ifc, arg, sizeof(struct ifconf)))
                return -EFAULT;
 
-       pos = ifc.ifc_buf;
        len = ifc.ifc_len;
+       if (ifc.ifc_buf) {
+               pos = (char *) kmalloc(len, GFP_KERNEL);
+               if(pos == NULL)
+                       return -ENOBUFS;
+       } else
+               pos = NULL;
 
        /*
         *      Loop over the interfaces, and write an info block for each. 
@@ -1138,7 +1140,6 @@ static int dev_ifconf(char *arg)
        total = 0;
        read_lock_bh(&dev_base_lock);
        for (dev = dev_base; dev != NULL; dev = dev->next) {
-               read_unlock_bh(&dev_base_lock);
                for (i=0; i<NPROTO; i++) {
                        if (gifconf_list[i]) {
                                int done;
@@ -1147,16 +1148,20 @@ static int dev_ifconf(char *arg)
                                } else {
                                        done = gifconf_list[i](dev, pos+total, len-total);
                                }
-                               if (done<0) {
-                                       return -EFAULT;
-                               }
                                total += done;
                        }
                }
-               read_lock_bh(&dev_base_lock);
        }
        read_unlock_bh(&dev_base_lock);
 
+       if(pos != NULL) {
+               int err = copy_to_user(ifc.ifc_buf, pos, total);
+
+               kfree(pos);
+               if(err)
+                       return -EFAULT;
+       }
+
        /*
         *      All done.  Write the updated control block back to the caller. 
         */
@@ -2016,7 +2021,6 @@ __initfunc(int net_dev_init(void))
         */
 
        dp = &dev_base;
-       write_lock_bh(&dev_base_lock);
        while ((dev = *dp) != NULL) {
                dev->iflink = -1;
                if (dev->init && dev->init(dev)) {
@@ -2026,15 +2030,12 @@ __initfunc(int net_dev_init(void))
                        *dp = dev->next;
                } else {
                        dp = &dev->next;
-                       write_unlock_bh(&dev_base_lock);
                        dev->ifindex = dev_new_index();
-                       write_lock_bh(&dev_base_lock);
                        if (dev->iflink == -1)
                                dev->iflink = dev->ifindex;
                        dev_init_scheduler(dev);
                }
        }
-       write_unlock_bh(&dev_base_lock);
 
 #ifdef CONFIG_PROC_FS
        proc_net_register(&proc_net_dev);
index b96650bcdcf733ca5f8bf34ea0d0835418c1c5e1..781791d08c05979dfa0f4662ef6d8293af7e3a5e 100644 (file)
  *
  *     Fixes:
  *     Vitaly E. Lavrov        releasing NULL neighbor in neigh_add.
+ *      Horst von Brand        Add #include <linux/string.h>
  */
 
 #include <linux/config.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/socket.h>
 #include <linux/sched.h>
index b8660044f95db4a11a3189537b8e698ce523bab1..e46fdbcc0b055eddcf10d2bb5fb6381f4d4bc8cf 100644 (file)
@@ -1189,15 +1189,14 @@ int dnet_gifconf(struct device *dev, char *buf, int len)
 {
        struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr;
        struct dn_ifaddr *ifa;
-       char buffer[DN_IFREQ_SIZE];
-       struct ifreq *ifr = (struct ifreq *)buffer;
+       struct ifreq *ifr = (struct ifreq *)buf;
        int done = 0;
 
        if ((dn_db == NULL) || ((ifa = dn_db->ifa_list) == NULL))
                return 0;
 
        for(; ifa; ifa = ifa->ifa_next) {
-               if (!buf) {
+               if (!ifr) {
                        done += sizeof(DN_IFREQ_SIZE);
                        continue;
                }
@@ -1214,10 +1213,7 @@ int dnet_gifconf(struct device *dev, char *buf, int len)
                (*(struct sockaddr_dn *) &ifr->ifr_addr).sdn_add.a_len = 2;
                (*(dn_address *)(*(struct sockaddr_dn *) &ifr->ifr_addr).sdn_add.a_addr) = ifa->ifa_local;
 
-               if (copy_to_user(buf, ifr, DN_IFREQ_SIZE))
-                       return -EFAULT;
-
-               buf  += DN_IFREQ_SIZE;
+               ifr = (struct ifreq *)((char *)ifr + DN_IFREQ_SIZE);
                len  -= DN_IFREQ_SIZE;
                done += DN_IFREQ_SIZE;
        }
index e3392749a7fb5e67ffd07f52c8e27b5f7c3fd628..1cee2791f4aa54eff76d0bb0c2377e923db65e27 100644 (file)
@@ -67,7 +67,7 @@ __initfunc(void eth_setup(char *str, int *ints))
 
        if (!str || !*str)
                return;
-       read_lock_bh(&dev_base_lock);
+
        d = dev_base;
        while (d) 
        {
@@ -85,7 +85,6 @@ __initfunc(void eth_setup(char *str, int *ints))
                }
                d=d->next;
        }
-       read_unlock_bh(&dev_base_lock);
 }
 
 
index 6963045f598df11de58c28112978da9271c3ab1e..1f540628da0bf0491ae19c97fb7667ccfde407f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     NET3    IP device support routines.
  *
- *     Version: $Id: devinet.c,v 1.29 1999/05/27 00:37:57 davem Exp $
+ *     Version: $Id: devinet.c,v 1.30 1999/06/01 07:49:59 davem Exp $
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
@@ -607,31 +607,29 @@ inet_gifconf(struct device *dev, char *buf, int len)
 {
        struct in_device *in_dev = dev->ip_ptr;
        struct in_ifaddr *ifa;
-       struct ifreq ifr;
+       struct ifreq *ifr = (struct ifreq *) buf;
        int done=0;
 
        if (in_dev==NULL || (ifa=in_dev->ifa_list)==NULL)
                return 0;
 
        for ( ; ifa; ifa = ifa->ifa_next) {
-               if (!buf) {
+               if (!ifr) {
                        done += sizeof(ifr);
                        continue;
                }
                if (len < (int) sizeof(ifr))
                        return done;
-               memset(&ifr, 0, sizeof(struct ifreq));
+               memset(ifr, 0, sizeof(struct ifreq));
                if (ifa->ifa_label)
-                       strcpy(ifr.ifr_name, ifa->ifa_label);
+                       strcpy(ifr->ifr_name, ifa->ifa_label);
                else
-                       strcpy(ifr.ifr_name, dev->name);
+                       strcpy(ifr->ifr_name, dev->name);
 
-               (*(struct sockaddr_in *) &ifr.ifr_addr).sin_family = AF_INET;
-               (*(struct sockaddr_in *) &ifr.ifr_addr).sin_addr.s_addr = ifa->ifa_local;
+               (*(struct sockaddr_in *) &ifr->ifr_addr).sin_family = AF_INET;
+               (*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr.s_addr = ifa->ifa_local;
 
-               if (copy_to_user(buf, &ifr, sizeof(struct ifreq)))
-                       return -EFAULT;
-               buf += sizeof(struct ifreq);
+               ifr++;
                len -= sizeof(struct ifreq);
                done += sizeof(struct ifreq);
        }
index 4ca84f6ac19f8bf0c101b421ce156838b6e2a812..0bc39f3efc5848f0e0ef1dbb8e2dcba362a539e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     NET3:   Implementation of the ICMP protocol layer. 
  *     
- *             Alan Cox, <alan@cymru.net>
+ *             Alan Cox, <alan@redhat.com>
  *
  *     Version: $Id: icmp.c,v 1.54 1999/05/30 01:16:22 davem Exp $
  *
index 995c3a0a36195f4bdd1cf9e8ceb5a8fe799ca950..17b11a799072f1416810f727af7699bd403b5597 100644 (file)
@@ -12,6 +12,7 @@
  *                                 http://www.gamers.org/dEngine/quake/spec/ 
  *      Harald Hoyer            :       Check for QUAKE-STRING
  *     Juan Jose Ciarlante     :  litl bits for 2.1
+ *      Horst von Brand         :  Add #include <linux/string.h>
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -24,6 +25,7 @@
 #include <linux/module.h>
 #include <asm/system.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/in.h>
index 4724e3b934185ac71f273f8d1d4140f18888ee18..ecee09225b49dee55946d531f772fe2b85bea0fe 100644 (file)
@@ -10,6 +10,9 @@
  * Fixes:      Minor changes for 2.1 by
  *             Steven Clarke <Steven.Clarke@ThePlanet.Net>, Planet Online Ltd
  *
+ *              Add missing #include <linux/string.h>
+ *              Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
+ *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
  *     as published by the Free Software Foundation; either version
@@ -25,6 +28,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/kernel.h>
 #include <asm/system.h>
 #include <linux/skbuff.h>
index fae22cbe7deb3a112f048dc05b56f6628c91020c..39f4b9e7b4fd53136d9b382b481392b00124bf20 100644 (file)
@@ -452,7 +452,6 @@ eol:
 error:
        if (skb) {
                icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((pp_ptr-iph)<<24));
-               kfree_skb(skb);
        }
        return -EINVAL;
 }
index d7db0c007343b6979c08ce91385cd16d0ef61aa8..63356bdec1f213ba99d835960e6a568d1a420f73 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     IP multicast routing support for mrouted 3.6/3.8
  *
- *             (c) 1995 Alan Cox, <alan@cymru.net>
+ *             (c) 1995 Alan Cox, <alan@redhat.com>
  *       Linux Consultancy and Custom Driver Development
  *
  *     This program is free software; you can redistribute it and/or
index 541e6b92fccad43c7312582bec08026b4486692f..9a3ec92429f795d3582637c86b87af4e631774fc 100644 (file)
@@ -2321,8 +2321,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
            !(th->fin && TCP_SKB_CB(skb)->end_seq == tp->rcv_nxt)) {
                if (!th->rst) {
                        tcp_send_ack(sk);
-                       goto discard;
                }
+               goto discard;
        }
 
        /* step 2: check RST bit */
index c19a561e98f5469043b9317e97f5196fb385e47f..560f1feeff875efec50569c3d83cb8d239318677 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/sockios.h>
 #include <linux/net.h>
index 26ec51c4d1ca3c15cb5b93fc5b52a1d9961b081a..4f470c972a96ff00ae0b641295cc1511129a04ee 100644 (file)
  *                             route changes now work.
  *                             ip6_forward does not confuse sniffers.
  *                             etc.
- *                             
+ *
+ *      H. von Brand    :       Added missing #include <linux/string.h>
  */
 
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/net.h>
 #include <linux/netdevice.h>
index 3eb02a8917967cc824c77dfacf097497f37b003a..2c836abba320758f0ef4f993b9fad3c7838f6365 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/sockios.h>
 #include <linux/sched.h>
index e455b053355429d2b7773af05a65d5e673e6608b..dba43ae65822745d933419389f9cfd03d7952027 100644 (file)
  *     Fixes:  
  *     Andi Kleen      Make it work with multiple hosts.
  *                     More RFC compliance.
+ *
+ *      Horst von Brand Add missing #include <linux/string.h>
  */
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/sockios.h>
 #include <linux/sched.h>
index 41fc4d20a5e80ef3b674c96de4a5fd41e38f1a97..42cadc05c0553d7f79266b15e7d76eccf50b1854 100644 (file)
@@ -8,6 +8,8 @@
  * Created at:    Tue Apr  6 15:33:50 1999
  * Modified at:   Sun May  9 22:40:43 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * Modified at:   Fri May 28  3:11 CST 1999
+ * Modified by:   Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  * 
  *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
  *     
@@ -28,6 +30,7 @@
  *     
  ********************************************************************/
 
+#include <linux/string.h>
 #include <linux/socket.h>
 #include <linux/irda.h>
 
index d6452769fa7b581c2e155b6ea2b40cf0602b7a7d..d088eda13647cf3b706548b6b72e11989c5e7237 100644 (file)
@@ -8,6 +8,8 @@
  * Created at:    Wed Sep  2 20:22:08 1998
  * Modified at:   Mon May 10 23:02:47 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * Modified at:   Fri May 28  3:11 CST 1999
+ * Modified by:   Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  * 
  *     Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
  *      
@@ -23,6 +25,7 @@
  ********************************************************************/
 
 #include <linux/config.h>
+#include <linux/string.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
 #include <linux/if.h>
index 57a6b420bebc4f7dfa6a241c6978cb95869cef65..299d1705cf29266dfb312aab2da3d98c6fb185b0 100644 (file)
@@ -8,6 +8,8 @@
  * Created at:    Fri Oct  9 09:18:07 1998
  * Modified at:   Sun May  9 11:37:06 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * Modified at:   Fri May 28  3:11 CST 1999
+ * Modified by:   Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  * Sources:       ppp.c, isdn_ppp.c
  * 
  *     Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
@@ -23,6 +25,8 @@
  *     
  ********************************************************************/
 
+#include <linux/string.h>
+
 #include <net/irda/irda.h>
 #include <net/irda/irqueue.h>
 #include <net/irda/irlap.h>
index b78368bc0e69c17d7da206ce9576c063fa75467f..8a7aaa0183b288d9df6cfa82baaeeed9e4aebfd9 100644 (file)
@@ -8,6 +8,8 @@
  * Created at:    Mon Aug  4 20:40:53 1997
  * Modified at:   Sun May  2 21:58:00 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * Modified at:   Fri May 28  3:11 CST 1999
+ * Modified by:   Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  * 
  *     Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, 
  *     All Rights Reserved.
@@ -24,6 +26,7 @@
  ********************************************************************/
 
 #include <linux/skbuff.h>
+#include <linux/string.h>
 #include <asm/byteorder.h>
 
 #include <net/irda/irda.h>
index dffb48ef4195d528691256c62cb39a915109d1fd..eed55f8ac6814267f4828aca09a8590c722991af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * NETLINK      Kernel-user communication protocol.
  *
- *             Authors:        Alan Cox <alan@cymru.net>
+ *             Authors:        Alan Cox <alan@redhat.com>
  *                             Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
  *
  *             This program is free software; you can redistribute it and/or
index b127137b2a9adbaae9a08299f6a37cb70a92c855..c4b600729af517032dbf76f5bf671ea76710cc66 100644 (file)
@@ -2,7 +2,7 @@
  * NETLINK     An implementation of a loadable kernel mode driver providing
  *             multiple kernel/user space bidirectional communications links.
  *
- *             Author:         Alan Cox <alan@cymru.net>
+ *             Author:         Alan Cox <alan@redhat.com>
  *
  *             This program is free software; you can redistribute it and/or
  *             modify it under the terms of the GNU General Public License
index 2b8db00ccd3654bc47fea75247a1a520f8e7a9f7..7c966779b464751c5b80433bb4ba639f7d9c88c6 100644 (file)
@@ -4,9 +4,12 @@
  * Generic RPC authentication API.
  *
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
+ *
+ * Modified May 1999, Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  */
 
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/sched.h>
 #include <linux/malloc.h>
 #include <linux/errno.h>
index 6912c229d72778575043d160b4a591853ed18a8f..6596085b31ee0034e6e7dba1553dd243021058a0 100644 (file)
@@ -4,9 +4,12 @@
  * UNIX-style authentication; no AUTH_SHORT support
  *
  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
+ *
+ * Modified May 1999 Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  */
 
 #include <linux/types.h>
+#include <linux/string.h>
 #include <linux/malloc.h>
 #include <linux/socket.h>
 #include <linux/in.h>
index b2e802c0d993ed78949633754db1794633001ba4..632f994ad89f6d894383935f7bdc013facd72f15 100644 (file)
@@ -1342,11 +1342,8 @@ int init_module(void)
 #if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
                                           || dev->type == ARPHRD_ETHER
 #endif
-                       )) {
-                       read_unlock_bh(&dev_base_lock);
+                       ))
                        x25_link_device_up(dev);
-                       read_lock_bh(&dev_base_lock);
-               }
        }
        read_unlock_bh(&dev_base_lock);