## Automatically generated incremental diff ## From: linux-2.5.4-pre5 ## To: linux-2.5.4-pre6 ## Robot: $Id: make-incremental-diff,v 1.9 2001/12/10 00:06:56 hpa Exp $ diff -urN linux-2.5.4-pre5/CREDITS linux/CREDITS --- linux-2.5.4-pre5/CREDITS Mon Jan 21 15:57:51 2002 +++ linux/CREDITS Sun Feb 10 12:27:31 2002 @@ -990,8 +990,8 @@ N: Nigel Gamble E: nigel@nrg.org -E: nigel@sgi.com D: Interrupt-driven printer driver +D: Preemptible kernel S: 120 Alley Way S: Mountain View, California 94040 S: USA diff -urN linux-2.5.4-pre5/Documentation/preempt-locking.txt linux/Documentation/preempt-locking.txt --- linux-2.5.4-pre5/Documentation/preempt-locking.txt Wed Dec 31 16:00:00 1969 +++ linux/Documentation/preempt-locking.txt Sun Feb 10 12:27:31 2002 @@ -0,0 +1,104 @@ + Proper Locking Under a Preemptible Kernel: + Keeping Kernel Code Preempt-Safe + Robert Love + Last Updated: 22 Jan 2002 + + +INTRODUCTION + + +A preemptible kernel creates new locking issues. The issues are the same as +those under SMP: concurrency and reentrancy. Thankfully, the Linux preemptible +kernel model leverages existing SMP locking mechanisms. Thus, the kernel +requires explicit additional locking for very few additional situations. + +This document is for all kernel hackers. Developing code in the kernel +requires protecting these situations. + + +RULE #1: Per-CPU data structures need explicit protection + + +Two similar problems arise. An example code snippet: + + struct this_needs_locking tux[NR_CPUS]; + tux[smp_processor_id()] = some_value; + /* task is preempted here... */ + something = tux[smp_processor_id()]; + +First, since the data is per-CPU, it may not have explicit SMP locking, but +require it otherwise. Second, when a preempted task is finally rescheduled, +the previous value of smp_processor_id may not equal the current. You must +protect these situations by disabling preemption around them. + + +RULE #2: CPU state must be protected. + + +Under preemption, the state of the CPU must be protected. This is arch- +dependent, but includes CPU structures and state not preserved over a context +switch. For example, on x86, entering and exiting FPU mode is now a critical +section that must occur while preemption is disabled. Think what would happen +if the kernel is executing a floating-point instruction and is then preempted. +Remember, the kernel does not save FPU state except for user tasks. Therefore, +upon preemption, the FPU registers will be sold to the lowest bidder. Thus, +preemption must be disabled around such regions. + +Note, some FPU functions are already explicitly preempt safe. For example, +kernel_fpu_begin and kernel_fpu_end will disable and enable preemption. +However, math_state_restore must be called with preemption disabled. + + +RULE #3: Lock acquire and release must be performed by same task + + +A lock acquired in one task must be released by the same task. This +means you can't do oddball things like acquire a lock and go off to +play while another task releases it. If you want to do something +like this, acquire and release the task in the same code path and +have the caller wait on an event by the other task. + + +SOLUTION + + +Data protection under preemption is achieved by disabling preemption for the +duration of the critical region. + +preempt_enable() decrement the preempt counter +preempt_disable() increment the preempt counter +preempt_enable_no_resched() decrement, but do not immediately preempt +preempt_get_count() return the preempt counter + +The functions are nestable. In other words, you can call preempt_disable +n-times in a code path, and preemption will not be reenabled until the n-th +call to preempt_enable. The preempt statements define to nothing if +preemption is not enabled. + +Note that you do not need to explicitly prevent preemption if you are holding +any locks or interrupts are disabled, since preemption is implicitly disabled +in those cases. + +Example: + + cpucache_t *cc; /* this is per-CPU */ + preempt_disable(); + cc = cc_data(searchp); + if (cc && cc->avail) { + __free_block(searchp, cc_entry(cc), cc->avail); + cc->avail = 0; + } + preempt_enable(); + return 0; + +Notice how the preemption statements must encompass every reference of the +critical variables. Another example: + + int buf[NR_CPUS]; + set_cpu_val(buf); + if (buf[smp_processor_id()] == -1) printf(KERN_INFO "wee!\n"); + spin_lock(&buf_lock); + /* ... */ + +This code is not preempt-safe, but see how easily we can fix it by simply +moving the spin_lock up two lines. diff -urN linux-2.5.4-pre5/MAINTAINERS linux/MAINTAINERS --- linux-2.5.4-pre5/MAINTAINERS Sun Feb 10 12:27:28 2002 +++ linux/MAINTAINERS Sun Feb 10 12:27:31 2002 @@ -1239,6 +1239,14 @@ M: mostrows@styx.uwaterloo.ca S: Maintained +PREEMPTIBLE KERNEL +P: Robert Love +M: rml@tech9.net +L: linux-kernel@vger.kernel.org +L: kpreempt-tech@lists.sourceforge.net +W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel +S: Supported + PROMISE DC4030 CACHING DISK CONTROLLER DRIVER P: Peter Denison M: promise@pnd-pc.demon.co.uk diff -urN linux-2.5.4-pre5/Makefile linux/Makefile --- linux-2.5.4-pre5/Makefile Sun Feb 10 12:27:28 2002 +++ linux/Makefile Sun Feb 10 12:27:31 2002 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 4 -EXTRAVERSION =-pre5 +EXTRAVERSION =-pre6 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) @@ -140,7 +140,6 @@ DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o DRIVERS-$(CONFIG_DRM) += drivers/char/drm/drm.o DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a -DRIVERS-$(CONFIG_ISDN) += drivers/isdn/isdn.a DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o DRIVERS-$(CONFIG_APPLETALK) += drivers/net/appletalk/appletalk.o DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o @@ -187,6 +186,7 @@ DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o +DRIVERS-$(CONFIG_ISDN) += drivers/isdn/vmlinux-obj.o DRIVERS := $(DRIVERS-y) @@ -207,7 +207,7 @@ drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \ drivers/scsi/aic7xxx/aicasm/y.tab.h \ drivers/scsi/aic7xxx/aicasm/aicasm \ - drivers/scsi/53c700-mem.c \ + drivers/scsi/53c700_d.h \ net/khttpd/make_times_h \ net/khttpd/times.h \ submenu* diff -urN linux-2.5.4-pre5/arch/alpha/Config.help linux/arch/alpha/Config.help --- linux-2.5.4-pre5/arch/alpha/Config.help Fri Jan 25 16:04:31 2002 +++ linux/arch/alpha/Config.help Sun Feb 10 12:27:31 2002 @@ -597,31 +597,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_SRM_ENV If you enable this option, a subdirectory called srm_environment will give you access to the most important SRM environment diff -urN linux-2.5.4-pre5/arch/arm/Config.help linux/arch/arm/Config.help --- linux-2.5.4-pre5/arch/arm/Config.help Fri Jan 25 16:04:31 2002 +++ linux/arch/arm/Config.help Sun Feb 10 12:27:31 2002 @@ -471,31 +471,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_ARCH_ARCA5K This selects what ARM system you wish to build the kernel for. It also selects to some extent the CPU type. If you are unsure what diff -urN linux-2.5.4-pre5/arch/cris/Config.help linux/arch/cris/Config.help --- linux-2.5.4-pre5/arch/cris/Config.help Fri Jan 25 16:04:29 2002 +++ linux/arch/cris/Config.help Sun Feb 10 12:27:31 2002 @@ -171,31 +171,6 @@ Kernel patches and supporting utilities to do that are in the pcsp package, available at . -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_ETRAX100LX Support version 1 of the Etrax 100LX. diff -urN linux-2.5.4-pre5/arch/i386/Config.help linux/arch/i386/Config.help --- linux-2.5.4-pre5/arch/i386/Config.help Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/Config.help Sun Feb 10 12:27:31 2002 @@ -25,6 +25,16 @@ If you don't know what to do here, say N. +CONFIG_PREEMPT + This option reduces the latency of the kernel when reacting to + real-time or interactive events by allowing a low priority process to + be preempted even if it is in kernel mode executing a system call. + This allows applications to run more reliably even when the system is + under load. + + Say Y here if you are building a kernel for a desktop, embedded + or real-time system. Say N if you are unsure. + CONFIG_X86 This is Linux's home port. Linux was originally native to the Intel 386, and runs on all the later x86 processors including the Intel @@ -889,31 +899,6 @@ send a BREAK and then within 5 seconds a command keypress. The keys are documented in . Don't say Y unless you really know what this hack does. - -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. CONFIG_DEBUG_HIGHMEM This options enables addition error checking for high memory systems. diff -urN linux-2.5.4-pre5/arch/i386/config.in linux/arch/i386/config.in --- linux-2.5.4-pre5/arch/i386/config.in Thu Jan 24 12:18:54 2002 +++ linux/arch/i386/config.in Sun Feb 10 12:27:31 2002 @@ -167,6 +167,7 @@ bool 'Math emulation' CONFIG_MATH_EMULATION bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR bool 'Symmetric multi-processing support' CONFIG_SMP +bool 'Preemptible Kernel' CONFIG_PREEMPT if [ "$CONFIG_SMP" != "y" ]; then bool 'Local APIC support on uniprocessors' CONFIG_X86_UP_APIC dep_bool 'IO-APIC support on uniprocessors' CONFIG_X86_UP_IOAPIC $CONFIG_X86_UP_APIC @@ -180,9 +181,12 @@ bool 'Multiquad NUMA system' CONFIG_MULTIQUAD fi -if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then - define_bool CONFIG_HAVE_DEC_LOCK y +if [ "$CONFIG_SMP" = "y" -o "$CONFIG_PREEMPT" = "y" ]; then + if [ "$CONFIG_X86_CMPXCHG" = "y" ]; then + define_bool CONFIG_HAVE_DEC_LOCK y + fi fi + endmenu mainmenu_option next_comment diff -urN linux-2.5.4-pre5/arch/i386/defconfig linux/arch/i386/defconfig --- linux-2.5.4-pre5/arch/i386/defconfig Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/defconfig Sun Feb 10 12:27:31 2002 @@ -7,6 +7,11 @@ CONFIG_UID16=y # +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set + +# # General setup # CONFIG_NET=y @@ -15,11 +20,6 @@ CONFIG_SYSCTL=y # -# Code maturity level options -# -# CONFIG_EXPERIMENTAL is not set - -# # Loadable module support # CONFIG_MODULES=y @@ -68,6 +68,7 @@ # CONFIG_MATH_EMULATION is not set # CONFIG_MTRR is not set CONFIG_SMP=y +# CONFIG_PREEMPT is not set # CONFIG_MULTIQUAD is not set CONFIG_HAVE_DEC_LOCK=y diff -urN linux-2.5.4-pre5/arch/i386/kernel/cpuid.c linux/arch/i386/kernel/cpuid.c --- linux-2.5.4-pre5/arch/i386/kernel/cpuid.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/cpuid.c Sun Feb 10 12:27:31 2002 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S --- linux-2.5.4-pre5/arch/i386/kernel/entry.S Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/entry.S Sun Feb 10 12:27:31 2002 @@ -69,6 +69,37 @@ NT_MASK = 0x00004000 VM_MASK = 0x00020000 +/* These are offsets into the irq_stat structure + * There is one per cpu and it is aligned to 32 + * byte boundry (we put that here as a shift count) + */ +irq_array_shift = CONFIG_X86_L1_CACHE_SHIFT +irq_stat_local_irq_count = 4 +irq_stat_local_bh_count = 8 + +#ifdef CONFIG_SMP +#define GET_CPU_INDX movl TI_CPU(%ebx),%eax; \ + shll $irq_array_shift,%eax +#define GET_CURRENT_CPU_INDX GET_THREAD_INFO(%ebx); \ + GET_CPU_INDX +#define CPU_INDX (,%eax) +#else +#define GET_CPU_INDX +#define GET_CURRENT_CPU_INDX GET_THREAD_INFO(%ebx) +#define CPU_INDX +#endif + +#ifdef CONFIG_PREEMPT +#define preempt_stop cli +#define init_ret_intr \ + cli; \ + decl TI_PRE_COUNT(%ebx); +#else +#define preempt_stop +#define init_ret_intr +#define resume_kernel restore_all +#endif + #define SAVE_ALL \ cld; \ pushl %es; \ @@ -176,11 +207,12 @@ ALIGN ENTRY(ret_from_intr) GET_THREAD_INFO(%ebx) + init_ret_intr ret_from_exception: movl EFLAGS(%esp),%eax # mix EFLAGS and CS movb CS(%esp),%al testl $(VM_MASK | 3),%eax - jz restore_all # returning to kernel-space or vm86-space + jz resume_kernel # returning to kernel or vm86-space ENTRY(resume_userspace) cli # make sure we don't miss an interrupt setting need_resched # or sigpending between sampling and the iret @@ -189,6 +221,22 @@ jne work_pending jmp restore_all +#ifdef CONFIG_PREEMPT +ENTRY(resume_kernel) + cmpl $0,TI_PRE_COUNT(%ebx) + jnz restore_all + movl TI_FLAGS(%ebx),%ecx + testb $_TIF_NEED_RESCHED,%cl + jz restore_all + movl SYMBOL_NAME(irq_stat)+irq_stat_local_bh_count CPU_INDX,%ecx + addl SYMBOL_NAME(irq_stat)+irq_stat_local_irq_count CPU_INDX,%ecx + jnz restore_all + incl TI_PRE_COUNT(%ebx) + sti + call SYMBOL_NAME(preempt_schedule) + jmp ret_from_intr +#endif + # system call handler stub ALIGN ENTRY(system_call) @@ -302,6 +350,7 @@ GET_THREAD_INFO(%ebx) call *%edi addl $8,%esp + preempt_stop jmp ret_from_exception ENTRY(coprocessor_error) @@ -321,12 +370,14 @@ movl %cr0,%eax testl $0x4,%eax # EM (math emulation bit) jne device_not_available_emulate + preempt_stop call SYMBOL_NAME(math_state_restore) jmp ret_from_exception device_not_available_emulate: pushl $0 # temporary storage for ORIG_EIP call SYMBOL_NAME(math_emulate) addl $4,%esp + preempt_stop jmp ret_from_exception ENTRY(debug) diff -urN linux-2.5.4-pre5/arch/i386/kernel/i387.c linux/arch/i386/kernel/i387.c --- linux-2.5.4-pre5/arch/i386/kernel/i387.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/i387.c Sun Feb 10 12:27:31 2002 @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -63,6 +64,7 @@ void kernel_fpu_begin(void) { + preempt_disable(); if (test_thread_flag(TIF_USEDFPU)) { __save_init_fpu(current); return; diff -urN linux-2.5.4-pre5/arch/i386/kernel/init_task.c linux/arch/i386/kernel/init_task.c --- linux-2.5.4-pre5/arch/i386/kernel/init_task.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/init_task.c Sun Feb 10 12:27:31 2002 @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/arch/i386/kernel/msr.c linux/arch/i386/kernel/msr.c --- linux-2.5.4-pre5/arch/i386/kernel/msr.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/msr.c Sun Feb 10 12:27:31 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c --- linux-2.5.4-pre5/arch/i386/kernel/process.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/process.c Sun Feb 10 12:27:31 2002 @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -47,6 +48,7 @@ #endif #include +#include asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); diff -urN linux-2.5.4-pre5/arch/i386/kernel/semaphore.c linux/arch/i386/kernel/semaphore.c --- linux-2.5.4-pre5/arch/i386/kernel/semaphore.c Fri Nov 30 08:54:18 2001 +++ linux/arch/i386/kernel/semaphore.c Sun Feb 10 12:27:31 2002 @@ -14,6 +14,7 @@ */ #include #include +#include #include /* diff -urN linux-2.5.4-pre5/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c --- linux-2.5.4-pre5/arch/i386/kernel/smp.c Mon Jan 21 15:46:50 2002 +++ linux/arch/i386/kernel/smp.c Sun Feb 10 12:27:31 2002 @@ -497,7 +497,7 @@ /* * The target CPU will unlock the migration spinlock: */ - spin_lock(&migration_lock); + _raw_spin_lock(&migration_lock); new_task = p; send_IPI_mask(1 << cpu, TASK_MIGRATION_VECTOR); } @@ -511,7 +511,7 @@ ack_APIC_irq(); p = new_task; - spin_unlock(&migration_lock); + _raw_spin_unlock(&migration_lock); sched_task_migrated(p); } /* diff -urN linux-2.5.4-pre5/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c --- linux-2.5.4-pre5/arch/i386/kernel/traps.c Sun Feb 10 12:27:28 2002 +++ linux/arch/i386/kernel/traps.c Sun Feb 10 12:27:31 2002 @@ -710,6 +710,8 @@ * * Careful.. There are problems with IBM-designed IRQ13 behaviour. * Don't touch unless you *really* know how it works. + * + * Must be called with kernel preemption disabled. */ asmlinkage void math_state_restore(struct pt_regs regs) { diff -urN linux-2.5.4-pre5/arch/ia64/Config.help linux/arch/ia64/Config.help --- linux-2.5.4-pre5/arch/ia64/Config.help Fri Jan 25 16:04:31 2002 +++ linux/arch/ia64/Config.help Sun Feb 10 12:27:31 2002 @@ -424,31 +424,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_ITANIUM Select your IA64 processor type. The default is Intel Itanium. diff -urN linux-2.5.4-pre5/arch/mips/Config.help linux/arch/mips/Config.help --- linux-2.5.4-pre5/arch/mips/Config.help Fri Jan 25 16:04:33 2002 +++ linux/arch/mips/Config.help Sun Feb 10 12:27:31 2002 @@ -899,31 +899,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_GDB_CONSOLE If you are using GDB for remote debugging over a serial port and would like kernel messages to be formatted into GDB $O packets so diff -urN linux-2.5.4-pre5/arch/mips64/Config.help linux/arch/mips64/Config.help --- linux-2.5.4-pre5/arch/mips64/Config.help Fri Jan 25 16:04:12 2002 +++ linux/arch/mips64/Config.help Sun Feb 10 12:27:31 2002 @@ -438,31 +438,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_BINFMT_ELF32 This allows you to run 32-bit Linux/ELF binaries on your Ultra. Everybody wants this; say Y. diff -urN linux-2.5.4-pre5/arch/ppc/Config.help linux/arch/ppc/Config.help --- linux-2.5.4-pre5/arch/ppc/Config.help Fri Jan 25 16:04:31 2002 +++ linux/arch/ppc/Config.help Sun Feb 10 12:27:31 2002 @@ -551,31 +551,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_PROC_HARDWARE Say Y here to support the /proc/hardware file, which gives you access to information about the machine you're running on, diff -urN linux-2.5.4-pre5/arch/sparc/Config.help linux/arch/sparc/Config.help --- linux-2.5.4-pre5/arch/sparc/Config.help Fri Jan 25 16:04:13 2002 +++ linux/arch/sparc/Config.help Sun Feb 10 12:27:31 2002 @@ -1054,31 +1054,6 @@ keys are documented in . Don't say Y unless you really know what this hack does. -CONFIG_ISDN - ISDN ("Integrated Services Digital Networks", called RNIS in France) - is a special type of fully digital telephone service; it's mostly - used to connect to your Internet service provider (with SLIP or - PPP). The main advantage is that the speed is higher than ordinary - modem/telephone connections, and that you can have voice - conversations while downloading stuff. It only works if your - computer is equipped with an ISDN card and both you and your service - provider purchased an ISDN line from the phone company. For - details, read on the WWW. - - This driver allows you to use an ISDN-card for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - for more information. - - If you want to compile the ISDN code as a module ( = code which can - be inserted in and removed from the running kernel whenever you - want), say M here and read . The - module will be called isdn.o. If unsure, say N. - CONFIG_SUN4 Say Y here if, and only if, your machine is a Sun4. Note that a kernel compiled with this option will run only on Sun4. diff -urN linux-2.5.4-pre5/drivers/base/core.c linux/drivers/base/core.c --- linux-2.5.4-pre5/drivers/base/core.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/base/core.c Sun Feb 10 12:27:31 2002 @@ -9,6 +9,7 @@ #include #include #include +#include #undef DEBUG diff -urN linux-2.5.4-pre5/drivers/base/fs.c linux/drivers/base/fs.c --- linux-2.5.4-pre5/drivers/base/fs.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/base/fs.c Sun Feb 10 12:27:31 2002 @@ -9,6 +9,8 @@ #include #include #include +#include +#include extern struct driver_file_entry * device_default_files[]; diff -urN linux-2.5.4-pre5/drivers/base/interface.c linux/drivers/base/interface.c --- linux-2.5.4-pre5/drivers/base/interface.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/base/interface.c Sun Feb 10 12:27:31 2002 @@ -6,6 +6,8 @@ */ #include +#include +#include /** * device_read_status - report some device information diff -urN linux-2.5.4-pre5/drivers/char/agp/agpgart_be.c linux/drivers/char/agp/agpgart_be.c --- linux-2.5.4-pre5/drivers/char/agp/agpgart_be.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/char/agp/agpgart_be.c Sun Feb 10 12:27:31 2002 @@ -2391,7 +2391,7 @@ agp_bridge.gatt_table_real = page_dir.real; agp_bridge.gatt_table = page_dir.remapped; - agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real); + agp_bridge.gatt_bus_addr = virt_to_phys(page_dir.real); /* Get the address for the gart region. * This is a bus address even on the alpha, b/c its @@ -2405,7 +2405,7 @@ /* Calculate the agp offset */ for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { page_dir.remapped[GET_PAGE_DIR_OFF(addr)] = - virt_to_bus(amd_irongate_private.gatt_pages[i]->real); + virt_to_phys(amd_irongate_private.gatt_pages[i]->real); page_dir.remapped[GET_PAGE_DIR_OFF(addr)] |= 0x00000001; } @@ -3027,7 +3027,7 @@ for(i = 0; i < 1024; i++) { serverworks_private.scratch_dir.remapped[i] = (unsigned long) agp_bridge.scratch_page; page_dir.remapped[i] = - virt_to_bus(serverworks_private.scratch_dir.real); + virt_to_phys(serverworks_private.scratch_dir.real); page_dir.remapped[i] |= 0x00000001; } @@ -3040,7 +3040,7 @@ agp_bridge.gatt_table_real = page_dir.real; agp_bridge.gatt_table = page_dir.remapped; - agp_bridge.gatt_bus_addr = virt_to_bus(page_dir.real); + agp_bridge.gatt_bus_addr = virt_to_phys(page_dir.real); /* Get the address for the gart region. * This is a bus address even on the alpha, b/c its @@ -3056,7 +3056,7 @@ for(i = 0; i < value->num_entries / 1024; i++) { page_dir.remapped[i] = - virt_to_bus(serverworks_private.gatt_pages[i]->real); + virt_to_phys(serverworks_private.gatt_pages[i]->real); page_dir.remapped[i] |= 0x00000001; } diff -urN linux-2.5.4-pre5/drivers/char/random.c linux/drivers/char/random.c --- linux-2.5.4-pre5/drivers/char/random.c Tue Jan 15 13:53:51 2002 +++ linux/drivers/char/random.c Sun Feb 10 12:27:31 2002 @@ -251,6 +251,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/drivers/isdn/Makefile linux/drivers/isdn/Makefile --- linux-2.5.4-pre5/drivers/isdn/Makefile Mon Jul 2 14:07:55 2001 +++ linux/drivers/isdn/Makefile Sun Feb 10 12:27:31 2002 @@ -2,7 +2,7 @@ # The target object and module list name. -O_TARGET := isdn.a +O_TARGET := vmlinux-obj.o # Objects that export symbols. diff -urN linux-2.5.4-pre5/drivers/isdn/hisax/elsa.c linux/drivers/isdn/hisax/elsa.c --- linux-2.5.4-pre5/drivers/isdn/hisax/elsa.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/isdn/hisax/elsa.c Sun Feb 10 12:27:31 2002 @@ -1017,7 +1017,7 @@ return(0); } if (cs->hw.elsa.cfg & 0x80 && pci_rev == 1) { - printk(KERN_INFO "Elsa: PLX9050 rev1 workaround activated"); + printk(KERN_INFO "Elsa: PLX9050 rev1 workaround activated\n"); set_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags); } cs->hw.elsa.ale = cs->hw.elsa.base; diff -urN linux-2.5.4-pre5/drivers/isdn/hisax/gazel.c linux/drivers/isdn/hisax/gazel.c --- linux-2.5.4-pre5/drivers/isdn/hisax/gazel.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/isdn/hisax/gazel.c Sun Feb 10 12:27:31 2002 @@ -636,7 +636,7 @@ if (cs->hw.gazel.cfg_reg & 0x80) { pci_read_config_byte(dev_tel, PCI_REVISION_ID, &pci_rev); if (pci_rev == 1) { - printk(KERN_INFO "Gazel: PLX9050 rev1 workaround activated"); + printk(KERN_INFO "Gazel: PLX9050 rev1 workaround activated\n"); set_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags); } } diff -urN linux-2.5.4-pre5/drivers/net/aironet4500_proc.c linux/drivers/net/aironet4500_proc.c --- linux-2.5.4-pre5/drivers/net/aironet4500_proc.c Sun Sep 30 12:26:06 2001 +++ linux/drivers/net/aironet4500_proc.c Sun Feb 10 12:27:31 2002 @@ -33,15 +33,10 @@ #include #include - #ifdef CONFIG_PROC_FS -#ifdef CONFIG_PROC_FS #include -#else -#error awc driver needs CONFIG_PROC_FS -#endif - +#include #include "aironet4500.h" #include "aironet4500_rid.c" @@ -602,6 +597,9 @@ module_init(aironet_proc_init); module_exit(aironet_proc_exit); + +#else +#error awc driver needs CONFIG_PROC_FS #endif // whole proc system styff MODULE_LICENSE("GPL"); diff -urN linux-2.5.4-pre5/drivers/net/bsd_comp.c linux/drivers/net/bsd_comp.c --- linux-2.5.4-pre5/drivers/net/bsd_comp.c Fri Nov 9 14:01:22 2001 +++ linux/drivers/net/bsd_comp.c Sun Feb 10 12:27:31 2002 @@ -73,6 +73,8 @@ #include #undef PACKETPTR +#include + /* * PPP "BSD compress" compression * The differences between this compression and the classic BSD LZW diff -urN linux-2.5.4-pre5/drivers/net/eepro100.c linux/drivers/net/eepro100.c --- linux-2.5.4-pre5/drivers/net/eepro100.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/net/eepro100.c Sun Feb 10 12:27:32 2002 @@ -162,13 +162,6 @@ (dev)->watchdog_timeo = (tm); \ } while(0) -#ifndef PCI_DEVICE_ID_INTEL_ID1029 -#define PCI_DEVICE_ID_INTEL_ID1029 0x1029 -#endif -#ifndef PCI_DEVICE_ID_INTEL_ID1030 -#define PCI_DEVICE_ID_INTEL_ID1030 0x1030 -#endif - static int speedo_debug = 1; @@ -2272,18 +2265,24 @@ static struct pci_device_id eepro100_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82557, PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82562ET, - PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82559ER, PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CAM, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ID1029, - PCI_ANY_ID, PCI_ANY_ID, }, - { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ID1030, - PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_7, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1029, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1030, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1031, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1032, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1033, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1034, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1035, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1036, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1037, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1038, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1227, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x1228, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x5200, PCI_ANY_ID, PCI_ANY_ID, }, + { PCI_VENDOR_ID_INTEL, 0x5201, PCI_ANY_ID, PCI_ANY_ID, }, { 0,} }; MODULE_DEVICE_TABLE(pci, eepro100_pci_tbl); diff -urN linux-2.5.4-pre5/drivers/pcmcia/cardbus.c linux/drivers/pcmcia/cardbus.c --- linux-2.5.4-pre5/drivers/pcmcia/cardbus.c Sun Feb 10 12:27:29 2002 +++ linux/drivers/pcmcia/cardbus.c Sun Feb 10 12:27:32 2002 @@ -279,12 +279,12 @@ pci_readw(dev, PCI_DEVICE_ID, &dev->device); dev->hdr_type = hdr & 0x7f; + pci_setup_device(dev); + dev->dev.parent = bus->dev; strcpy(dev->dev.name, dev->name); strcpy(dev->dev.bus_id, dev->slot_name); device_register(&dev->dev); - - pci_setup_device(dev); /* FIXME: Do we need to enable the expansion ROM? */ for (r = 0; r < 7; r++) { diff -urN linux-2.5.4-pre5/drivers/pnp/pnpbios_core.c linux/drivers/pnp/pnpbios_core.c --- linux-2.5.4-pre5/drivers/pnp/pnpbios_core.c Tue Jan 29 18:24:01 2002 +++ linux/drivers/pnp/pnpbios_core.c Sun Feb 10 12:27:32 2002 @@ -45,6 +45,7 @@ #include #include #include +#include /* diff -urN linux-2.5.4-pre5/drivers/scsi/53c700.c linux/drivers/scsi/53c700.c --- linux-2.5.4-pre5/drivers/scsi/53c700.c Mon Jan 28 14:36:58 2002 +++ linux/drivers/scsi/53c700.c Sun Feb 10 12:27:32 2002 @@ -51,6 +51,14 @@ /* CHANGELOG * + * Version 2.7 + * + * Fixed scripts problem which caused certain devices (notably CDRWs) + * to hang on initial INQUIRY. Updated NCR_700_readl/writel to use + * __raw_readl/writel for parisc compatibility (Thomas + * Bogendoerfer). Added missing SCp->request_bufflen initialisation + * for sense requests (Ryan Bradetich). + * * Version 2.6 * * Following test of the 64 bit parisc kernel by Richard Hirst, @@ -96,7 +104,7 @@ * Initial modularisation from the D700. See NCR_D700.c for the rest of * the changelog. * */ -#define NCR_700_VERSION "2.6" +#define NCR_700_VERSION "2.7" #include #include @@ -310,7 +318,6 @@ hostdata->pScript = pScript; NCR_700_dma_cache_wback((unsigned long)script, sizeof(SCRIPT)); hostdata->state = NCR_700_HOST_FREE; - spin_lock_init(&hostdata->lock); hostdata->cmd = NULL; host->max_id = 7; host->max_lun = NCR_700_MAX_LUNS; @@ -1048,6 +1055,7 @@ slot->pCmd, SCp->cmd_len, PCI_DMA_TODEVICE); + SCp->request_bufflen = sizeof(SCp->sense_buffer); slot->dma_handle = pci_map_single(hostdata->pci_dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), PCI_DMA_FROMDEVICE); slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer)); slot->SG[0].pAddr = bS_to_host(slot->dma_handle); @@ -1508,6 +1516,11 @@ __u8 pun = 0xff, lun = 0xff; unsigned long flags; + /* Use the host lock to serialise acess to the 53c700 + * hardware. Note: In future, we may need to take the queue + * lock to enter the done routines. When that happens, we + * need to ensure that for this driver, the host lock and the + * queue lock point to the same thing. */ spin_lock_irqsave(host->host_lock, flags); if((istat = NCR_700_readb(host, ISTAT_REG)) & (SCSI_INT_PENDING | DMA_INT_PENDING)) { diff -urN linux-2.5.4-pre5/drivers/scsi/53c700.h linux/drivers/scsi/53c700.h --- linux-2.5.4-pre5/drivers/scsi/53c700.h Thu Oct 11 09:43:29 2001 +++ linux/drivers/scsi/53c700.h Sun Feb 10 12:27:32 2002 @@ -210,7 +210,7 @@ struct NCR_700_Host_Parameters { /* These must be filled in by the calling driver */ int clock; /* board clock speed in MHz */ - __u32 base; /* the base for the port (copied to host) */ + unsigned long base; /* the base for the port (copied to host) */ struct pci_dev *pci_dev; __u32 dmode_extra; /* adjustable bus settings */ __u32 differential:1; /* if we are differential */ @@ -234,10 +234,6 @@ __u32 *script; /* pointer to script location */ __u32 pScript; /* physical mem addr of script */ - /* This will be the host lock. Unfortunately, we can't use it - * at the moment because of the necessity of holding the - * io_request_lock */ - spinlock_t lock; enum NCR_700_Host_State state; /* protected by state lock */ Scsi_Cmnd *cmd; /* Note: pScript contains the single consistent block of @@ -503,7 +499,7 @@ static inline __u32 NCR_700_readl(struct Scsi_Host *host, __u32 reg) { - __u32 value = readl(host->base + reg); + __u32 value = __raw_readl(host->base + reg); const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0]; #if 1 @@ -536,7 +532,7 @@ BUG(); #endif - writel(bS_to_host(value), host->base + reg); + __raw_writel(bS_to_host(value), host->base + reg); } #elif defined(CONFIG_53C700_IO_MAPPED) static inline __u8 diff -urN linux-2.5.4-pre5/drivers/scsi/53c700.scr linux/drivers/scsi/53c700.scr --- linux-2.5.4-pre5/drivers/scsi/53c700.scr Sun Sep 30 12:26:08 2001 +++ linux/drivers/scsi/53c700.scr Sun Feb 10 12:27:32 2002 @@ -242,7 +242,7 @@ SendIdentifyMsg: CALL SendMessage - JUMP SendCommand + CLEAR ATN IgnoreMsgBeforeCommand: CLEAR ACK diff -urN linux-2.5.4-pre5/drivers/scsi/NCR_D700.c linux/drivers/scsi/NCR_D700.c --- linux-2.5.4-pre5/drivers/scsi/NCR_D700.c Sun Sep 9 11:58:36 2001 +++ linux/drivers/scsi/NCR_D700.c Sun Feb 10 12:27:32 2002 @@ -36,6 +36,10 @@ /* CHANGELOG * + * Version 2.2 + * + * Added mca_set_adapter_name(). + * * Version 2.1 * * Modularise the driver into a Board piece (this file) and a chip @@ -86,7 +90,7 @@ * disconnections and reselections are being processed correctly. * */ -#define NCR_D700_VERSION "2.1" +#define NCR_D700_VERSION "2.2" #include #include @@ -299,6 +303,7 @@ continue; } found++; + mca_set_adapter_name(slot, "NCR D700 SCSI Adapter (version " NCR_D700_VERSION ")"); } } diff -urN linux-2.5.4-pre5/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c --- linux-2.5.4-pre5/drivers/scsi/aha1542.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/scsi/aha1542.c Sun Feb 10 12:27:33 2002 @@ -58,7 +58,7 @@ { printk(KERN_CRIT "buf vaddress %p paddress 0x%lx length %d\n", address, - SCSI_BUS_PA(address), + SCSI_BUF_PA(address), length); panic("Buffer at physical address > 16Mb used for aha1542"); } @@ -68,7 +68,7 @@ int nseg, int badseg) { - printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%lx length %d\n", + printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%x length %d\n", badseg, nseg, page_address(sgpnt[badseg].page) + sgpnt[badseg].offset, SCSI_SG_PA(&sgpnt[badseg]), @@ -727,7 +727,7 @@ panic("Foooooooood fight!"); }; any2scsi(cptr[i].dataptr, SCSI_SG_PA(&sgpnt[i])); - if (SCSI_SG_PA(&sgpnt[i].page) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD) + if (SCSI_SG_PA(&sgpnt[i]) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD) BAD_SG_DMA(SCpnt, sgpnt, SCpnt->use_sg, i); any2scsi(cptr[i].datalen, sgpnt[i].length); }; diff -urN linux-2.5.4-pre5/drivers/scsi/lasi700.c linux/drivers/scsi/lasi700.c --- linux-2.5.4-pre5/drivers/scsi/lasi700.c Sun Sep 30 12:26:08 2001 +++ linux/drivers/scsi/lasi700.c Sun Feb 10 12:27:34 2002 @@ -136,7 +136,6 @@ lasi700_driver_callback(struct parisc_device *dev) { unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET; - int irq = busdevice_alloc_irq(dev); char *driver_name; struct Scsi_Host *host; struct NCR_700_Host_Parameters *hostdata = @@ -170,14 +169,15 @@ hostdata->chip710 = 1; hostdata->dmode_extra = DMODE_FC2; } + hostdata->pci_dev = ccio_get_fake(dev); if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) { kfree(hostdata); release_mem_region(host->base, 64); return 1; } - host->irq = irq; - if(request_irq(irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) { - printk(KERN_ERR "%s: irq problem, detatching\n", + host->irq = dev->irq; + if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) { + printk(KERN_ERR "%s: irq problem, detaching\n", driver_name); scsi_unregister(host); NCR_700_release(host); @@ -197,6 +197,7 @@ kfree(hostdata); free_irq(host->irq, host); release_mem_region(host->base, 64); + unregister_parisc_driver(&lasi700_driver); return 1; } diff -urN linux-2.5.4-pre5/drivers/sound/cs4281/cs4281m.c linux/drivers/sound/cs4281/cs4281m.c --- linux-2.5.4-pre5/drivers/sound/cs4281/cs4281m.c Tue Jan 15 10:56:35 2002 +++ linux/drivers/sound/cs4281/cs4281m.c Sun Feb 10 12:27:34 2002 @@ -75,6 +75,7 @@ #include #include #include +#include #include #include //#include "cs_dm.h" diff -urN linux-2.5.4-pre5/drivers/sound/opl3sa2.c linux/drivers/sound/opl3sa2.c --- linux-2.5.4-pre5/drivers/sound/opl3sa2.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/sound/opl3sa2.c Sun Feb 10 12:27:34 2002 @@ -63,6 +63,7 @@ #include #include #include +#include #include #include "sound_config.h" diff -urN linux-2.5.4-pre5/drivers/sound/ymfpci.c linux/drivers/sound/ymfpci.c --- linux-2.5.4-pre5/drivers/sound/ymfpci.c Wed Jan 23 15:48:21 2002 +++ linux/drivers/sound/ymfpci.c Sun Feb 10 12:27:34 2002 @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.4-pre5/drivers/telephony/phonedev.c linux/drivers/telephony/phonedev.c --- linux-2.5.4-pre5/drivers/telephony/phonedev.c Thu Jan 10 13:56:09 2002 +++ linux/drivers/telephony/phonedev.c Sun Feb 10 12:27:34 2002 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/drivers/usb/acm.c linux/drivers/usb/acm.c --- linux-2.5.4-pre5/drivers/usb/acm.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/acm.c Sun Feb 10 12:27:34 2002 @@ -57,6 +57,7 @@ #include #undef DEBUG #include +#include /* * Version Information diff -urN linux-2.5.4-pre5/drivers/usb/auerswald.c linux/drivers/usb/auerswald.c --- linux-2.5.4-pre5/drivers/usb/auerswald.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/auerswald.c Sun Feb 10 12:27:34 2002 @@ -25,6 +25,7 @@ /* Standard Linux module include files */ #include +#include #include #include #include diff -urN linux-2.5.4-pre5/drivers/usb/devio.c linux/drivers/usb/devio.c --- linux-2.5.4-pre5/drivers/usb/devio.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/devio.c Sun Feb 10 12:27:34 2002 @@ -44,6 +44,7 @@ #include #include #include +#include struct async { diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ehci-hub.c linux/drivers/usb/hcd/ehci-hub.c --- linux-2.5.4-pre5/drivers/usb/hcd/ehci-hub.c Thu Jan 17 14:06:53 2002 +++ linux/drivers/usb/hcd/ehci-hub.c Sun Feb 10 12:27:34 2002 @@ -18,6 +18,8 @@ /* this file is part of ehci-hcd.c */ +#include + /*-------------------------------------------------------------------------*/ /* diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ehci-mem.c linux/drivers/usb/hcd/ehci-mem.c --- linux-2.5.4-pre5/drivers/usb/hcd/ehci-mem.c Tue Jan 1 13:52:10 2002 +++ linux/drivers/usb/hcd/ehci-mem.c Sun Feb 10 12:27:34 2002 @@ -18,6 +18,8 @@ /* this file is part of ehci-hcd.c */ +#include + /*-------------------------------------------------------------------------*/ /* diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ehci-q.c linux/drivers/usb/hcd/ehci-q.c --- linux-2.5.4-pre5/drivers/usb/hcd/ehci-q.c Thu Jan 17 14:06:53 2002 +++ linux/drivers/usb/hcd/ehci-q.c Sun Feb 10 12:27:34 2002 @@ -18,6 +18,8 @@ /* this file is part of ehci-hcd.c */ +#include + /*-------------------------------------------------------------------------*/ /* diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ehci-sched.c linux/drivers/usb/hcd/ehci-sched.c --- linux-2.5.4-pre5/drivers/usb/hcd/ehci-sched.c Mon Jan 21 15:44:21 2002 +++ linux/drivers/usb/hcd/ehci-sched.c Sun Feb 10 12:27:34 2002 @@ -20,6 +20,8 @@ /*-------------------------------------------------------------------------*/ +#include "ehci.h" + /* * EHCI scheduled transaction support: interrupt, iso, split iso * These are called "periodic" transactions in the EHCI spec. diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ohci-hcd.c linux/drivers/usb/hcd/ohci-hcd.c --- linux-2.5.4-pre5/drivers/usb/hcd/ohci-hcd.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/hcd/ohci-hcd.c Sun Feb 10 12:27:34 2002 @@ -87,6 +87,7 @@ #include #include #include +#include #ifdef CONFIG_PMAC_PBOOK #include diff -urN linux-2.5.4-pre5/drivers/usb/hcd/ohci-q.c linux/drivers/usb/hcd/ohci-q.c --- linux-2.5.4-pre5/drivers/usb/hcd/ohci-q.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/hcd/ohci-q.c Sun Feb 10 12:27:34 2002 @@ -7,6 +7,8 @@ * This file is licenced under the GPL. * $Id: ohci-q.c,v 1.6 2002/01/19 00:23:15 dbrownell Exp $ */ + +#include static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) { diff -urN linux-2.5.4-pre5/drivers/usb/hcd.c linux/drivers/usb/hcd.c --- linux-2.5.4-pre5/drivers/usb/hcd.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/hcd.c Sun Feb 10 12:27:34 2002 @@ -50,6 +50,7 @@ #include #include #include +#include /*-------------------------------------------------------------------------*/ diff -urN linux-2.5.4-pre5/drivers/usb/hid-core.c linux/drivers/usb/hid-core.c --- linux-2.5.4-pre5/drivers/usb/hid-core.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/hid-core.c Sun Feb 10 12:27:34 2002 @@ -39,6 +39,7 @@ #include #include #include +#include #include #undef DEBUG diff -urN linux-2.5.4-pre5/drivers/usb/inode.c linux/drivers/usb/inode.c --- linux-2.5.4-pre5/drivers/usb/inode.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/inode.c Sun Feb 10 12:27:34 2002 @@ -37,6 +37,7 @@ #include #include #include +#include static struct super_operations usbfs_ops; static struct address_space_operations usbfs_aops; diff -urN linux-2.5.4-pre5/drivers/usb/kaweth.c linux/drivers/usb/kaweth.c --- linux-2.5.4-pre5/drivers/usb/kaweth.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/kaweth.c Sun Feb 10 12:27:34 2002 @@ -55,6 +55,7 @@ #include #include #include +#include #define DEBUG diff -urN linux-2.5.4-pre5/drivers/usb/mdc800.c linux/drivers/usb/mdc800.c --- linux-2.5.4-pre5/drivers/usb/mdc800.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/mdc800.c Sun Feb 10 12:27:34 2002 @@ -98,6 +98,7 @@ #include #include +#include /* * Version Information diff -urN linux-2.5.4-pre5/drivers/usb/pegasus.c linux/drivers/usb/pegasus.c --- linux-2.5.4-pre5/drivers/usb/pegasus.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/pegasus.c Sun Feb 10 12:27:34 2002 @@ -48,6 +48,7 @@ #include #include #include +#include #include "pegasus.h" /* diff -urN linux-2.5.4-pre5/drivers/usb/scanner.c linux/drivers/usb/scanner.c --- linux-2.5.4-pre5/drivers/usb/scanner.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/scanner.c Sun Feb 10 12:27:34 2002 @@ -328,6 +328,8 @@ * 24 Bit Color ~ 70 secs - 3.6 Mbit/sec * 8 Bit Gray ~ 17 secs - 4.2 Mbit/sec */ +#include + /* * Scanner definitions, macros, module info, * debug/ioctl/data_dump enable, and other constants. diff -urN linux-2.5.4-pre5/drivers/usb/usb-ohci.c linux/drivers/usb/usb-ohci.c --- linux-2.5.4-pre5/drivers/usb/usb-ohci.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/usb-ohci.c Sun Feb 10 12:27:34 2002 @@ -68,6 +68,7 @@ #include #include #include +#include #define OHCI_USE_NPS // force NoPowerSwitching mode // #define OHCI_VERBOSE_DEBUG /* not always helpful */ diff -urN linux-2.5.4-pre5/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c --- linux-2.5.4-pre5/drivers/usb/usb-uhci.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/usb-uhci.c Sun Feb 10 12:27:34 2002 @@ -40,6 +40,7 @@ #include #include #include +#include /* This enables more detailed sanity checks in submit_iso */ //#define ISO_SANITY_CHECK diff -urN linux-2.5.4-pre5/drivers/usb/usb.c linux/drivers/usb/usb.c --- linux-2.5.4-pre5/drivers/usb/usb.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/usb/usb.c Sun Feb 10 12:27:34 2002 @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef CONFIG_USB_DEBUG #define DEBUG diff -urN linux-2.5.4-pre5/drivers/zorro/proc.c linux/drivers/zorro/proc.c --- linux-2.5.4-pre5/drivers/zorro/proc.c Sun Feb 10 12:27:30 2002 +++ linux/drivers/zorro/proc.c Sun Feb 10 12:27:34 2002 @@ -24,6 +24,7 @@ { loff_t new = -1; + lock_kernel(); switch (whence) { case 0: new = off; diff -urN linux-2.5.4-pre5/fs/adfs/dir.c linux/fs/adfs/dir.c --- linux-2.5.4-pre5/fs/adfs/dir.c Mon Jan 28 13:20:44 2002 +++ linux/fs/adfs/dir.c Sun Feb 10 12:27:34 2002 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/adfs/dir_f.c linux/fs/adfs/dir_f.c --- linux-2.5.4-pre5/fs/adfs/dir_f.c Sun Dec 16 12:22:46 2001 +++ linux/fs/adfs/dir_f.c Sun Feb 10 12:27:34 2002 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/adfs/dir_fplus.c linux/fs/adfs/dir_fplus.c --- linux-2.5.4-pre5/fs/adfs/dir_fplus.c Sun Dec 16 12:22:46 2001 +++ linux/fs/adfs/dir_fplus.c Sun Feb 10 12:27:34 2002 @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/adfs/file.c linux/fs/adfs/file.c --- linux-2.5.4-pre5/fs/adfs/file.c Sun Aug 12 10:56:56 2001 +++ linux/fs/adfs/file.c Sun Feb 10 12:27:34 2002 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "adfs.h" diff -urN linux-2.5.4-pre5/fs/adfs/inode.c linux/fs/adfs/inode.c --- linux-2.5.4-pre5/fs/adfs/inode.c Mon Jan 28 13:20:44 2002 +++ linux/fs/adfs/inode.c Sun Feb 10 12:27:34 2002 @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/adfs/super.c linux/fs/adfs/super.c --- linux-2.5.4-pre5/fs/adfs/super.c Sun Feb 10 12:27:30 2002 +++ linux/fs/adfs/super.c Sun Feb 10 12:27:34 2002 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/amigaffs.c linux/fs/affs/amigaffs.c --- linux-2.5.4-pre5/fs/affs/amigaffs.c Mon Jan 21 15:37:32 2002 +++ linux/fs/affs/amigaffs.c Sun Feb 10 12:27:34 2002 @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/bitmap.c linux/fs/affs/bitmap.c --- linux-2.5.4-pre5/fs/affs/bitmap.c Mon Jan 21 15:37:32 2002 +++ linux/fs/affs/bitmap.c Sun Feb 10 12:27:34 2002 @@ -7,7 +7,7 @@ * block allocation, deallocation, calculation of free space. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/file.c linux/fs/affs/file.c --- linux-2.5.4-pre5/fs/affs/file.c Mon Jan 21 15:37:32 2002 +++ linux/fs/affs/file.c Sun Feb 10 12:27:34 2002 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/inode.c linux/fs/affs/inode.c --- linux-2.5.4-pre5/fs/affs/inode.c Mon Jan 21 15:37:32 2002 +++ linux/fs/affs/inode.c Sun Feb 10 12:27:34 2002 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/namei.c linux/fs/affs/namei.c --- linux-2.5.4-pre5/fs/affs/namei.c Tue Sep 11 08:19:35 2001 +++ linux/fs/affs/namei.c Sun Feb 10 12:27:34 2002 @@ -8,7 +8,7 @@ * (C) 1991 Linus Torvalds - minix filesystem */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/affs/super.c linux/fs/affs/super.c --- linux-2.5.4-pre5/fs/affs/super.c Sun Feb 10 12:27:30 2002 +++ linux/fs/affs/super.c Sun Feb 10 12:27:34 2002 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -270,9 +270,8 @@ struct buffer_head *root_bh = NULL; struct buffer_head *boot_bh; struct inode *root_inode = NULL; - kdev_t dev = sb->s_dev; s32 root_block; - int blocks, size, blocksize; + int size, blocksize; u32 chksum; int num_bm; int i, j; @@ -308,12 +307,7 @@ * blocks, we will have to change it. */ - blocks = blk_size[major(dev)] ? blk_size[major(dev)][minor(dev)] : 0; - if (!blocks) { - printk(KERN_ERR "AFFS: Could not determine device size\n"); - goto out_error; - } - size = (BLOCK_SIZE / 512) * blocks; + size = sb->s_bdev->bd_inode->i_size >> 9; pr_debug("AFFS: initial blksize=%d, blocks=%d\n", 512, blocks); affs_set_blocksize(sb, PAGE_SIZE); diff -urN linux-2.5.4-pre5/fs/attr.c linux/fs/attr.c --- linux-2.5.4-pre5/fs/attr.c Thu Oct 11 09:43:30 2001 +++ linux/fs/attr.c Sun Feb 10 12:27:34 2002 @@ -5,7 +5,7 @@ * changes by Thomas Schoebel-Theuer */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/autofs/autofs_i.h linux/fs/autofs/autofs_i.h --- linux-2.5.4-pre5/fs/autofs/autofs_i.h Sun Feb 10 12:27:30 2002 +++ linux/fs/autofs/autofs_i.h Sun Feb 10 12:27:34 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/autofs/root.c linux/fs/autofs/root.c --- linux-2.5.4-pre5/fs/autofs/root.c Fri Sep 14 14:04:07 2001 +++ linux/fs/autofs/root.c Sun Feb 10 12:27:34 2002 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include "autofs_i.h" diff -urN linux-2.5.4-pre5/fs/autofs/waitq.c linux/fs/autofs/waitq.c --- linux-2.5.4-pre5/fs/autofs/waitq.c Fri Feb 9 11:29:44 2001 +++ linux/fs/autofs/waitq.c Sun Feb 10 12:27:34 2002 @@ -11,7 +11,7 @@ * ------------------------------------------------------------------------- */ #include -#include +#include #include #include #include "autofs_i.h" diff -urN linux-2.5.4-pre5/fs/autofs4/autofs_i.h linux/fs/autofs4/autofs_i.h --- linux-2.5.4-pre5/fs/autofs4/autofs_i.h Sun Feb 10 12:27:30 2002 +++ linux/fs/autofs4/autofs_i.h Sun Feb 10 12:27:34 2002 @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/autofs4/root.c linux/fs/autofs4/root.c --- linux-2.5.4-pre5/fs/autofs4/root.c Fri Nov 30 08:26:04 2001 +++ linux/fs/autofs4/root.c Sun Feb 10 12:27:34 2002 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include "autofs_i.h" diff -urN linux-2.5.4-pre5/fs/autofs4/waitq.c linux/fs/autofs4/waitq.c --- linux-2.5.4-pre5/fs/autofs4/waitq.c Fri Feb 9 11:29:44 2001 +++ linux/fs/autofs4/waitq.c Sun Feb 10 12:27:34 2002 @@ -11,7 +11,7 @@ * ------------------------------------------------------------------------- */ #include -#include +#include #include #include #include "autofs_i.h" diff -urN linux-2.5.4-pre5/fs/bad_inode.c linux/fs/bad_inode.c --- linux-2.5.4-pre5/fs/bad_inode.c Wed Apr 12 09:47:28 2000 +++ linux/fs/bad_inode.c Sun Feb 10 12:27:34 2002 @@ -8,7 +8,7 @@ #include #include -#include +#include /* * The follow_link operation is special: it must behave as a no-op diff -urN linux-2.5.4-pre5/fs/bfs/dir.c linux/fs/bfs/dir.c --- linux-2.5.4-pre5/fs/bfs/dir.c Mon Jan 28 13:20:44 2002 +++ linux/fs/bfs/dir.c Sun Feb 10 12:27:34 2002 @@ -4,7 +4,7 @@ * Copyright (C) 1999,2000 Tigran Aivazian */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/binfmt_aout.c linux/fs/binfmt_aout.c --- linux-2.5.4-pre5/fs/binfmt_aout.c Fri Nov 2 17:39:20 2001 +++ linux/fs/binfmt_aout.c Sun Feb 10 12:27:34 2002 @@ -6,7 +6,7 @@ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/binfmt_elf.c linux/fs/binfmt_elf.c --- linux-2.5.4-pre5/fs/binfmt_elf.c Mon Jan 7 12:55:16 2002 +++ linux/fs/binfmt_elf.c Sun Feb 10 12:27:34 2002 @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/binfmt_script.c linux/fs/binfmt_script.c --- linux-2.5.4-pre5/fs/binfmt_script.c Fri Feb 9 11:29:44 2001 +++ linux/fs/binfmt_script.c Sun Feb 10 12:27:34 2002 @@ -13,6 +13,8 @@ #include #include #include +#include +#include static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) { diff -urN linux-2.5.4-pre5/fs/buffer.c linux/fs/buffer.c --- linux-2.5.4-pre5/fs/buffer.c Tue Jan 29 10:47:10 2002 +++ linux/fs/buffer.c Sun Feb 10 12:27:34 2002 @@ -29,7 +29,7 @@ /* async buffer flushing, 1999 Andrea Arcangeli */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/cache.c linux/fs/coda/cache.c --- linux-2.5.4-pre5/fs/coda/cache.c Sun Dec 30 10:31:51 2001 +++ linux/fs/coda/cache.c Sun Feb 10 12:27:34 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/coda_linux.c linux/fs/coda/coda_linux.c --- linux-2.5.4-pre5/fs/coda/coda_linux.c Sun Dec 30 10:31:51 2001 +++ linux/fs/coda/coda_linux.c Sun Feb 10 12:27:34 2002 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/dir.c linux/fs/coda/dir.c --- linux-2.5.4-pre5/fs/coda/dir.c Wed Dec 5 13:02:14 2001 +++ linux/fs/coda/dir.c Sun Feb 10 12:27:34 2002 @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/file.c linux/fs/coda/file.c --- linux-2.5.4-pre5/fs/coda/file.c Sun Dec 30 10:31:51 2001 +++ linux/fs/coda/file.c Sun Feb 10 12:27:34 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/pioctl.c linux/fs/coda/pioctl.c --- linux-2.5.4-pre5/fs/coda/pioctl.c Mon Jan 14 10:10:43 2002 +++ linux/fs/coda/pioctl.c Sun Feb 10 12:27:34 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/psdev.c linux/fs/coda/psdev.c --- linux-2.5.4-pre5/fs/coda/psdev.c Mon Jan 21 15:37:32 2002 +++ linux/fs/coda/psdev.c Sun Feb 10 12:27:34 2002 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/symlink.c linux/fs/coda/symlink.c --- linux-2.5.4-pre5/fs/coda/symlink.c Wed Apr 25 16:18:54 2001 +++ linux/fs/coda/symlink.c Sun Feb 10 12:27:34 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/sysctl.c linux/fs/coda/sysctl.c --- linux-2.5.4-pre5/fs/coda/sysctl.c Sun Dec 30 10:31:51 2001 +++ linux/fs/coda/sysctl.c Sun Feb 10 12:27:34 2002 @@ -12,7 +12,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/coda/upcall.c linux/fs/coda/upcall.c --- linux-2.5.4-pre5/fs/coda/upcall.c Sun Dec 30 10:31:51 2001 +++ linux/fs/coda/upcall.c Sun Feb 10 12:27:34 2002 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/devfs/base.c linux/fs/devfs/base.c --- linux-2.5.4-pre5/fs/devfs/base.c Sun Feb 10 12:27:30 2002 +++ linux/fs/devfs/base.c Sun Feb 10 12:27:34 2002 @@ -615,7 +615,7 @@ */ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/devices.c linux/fs/devices.c --- linux-2.5.4-pre5/fs/devices.c Fri Jan 4 13:02:26 2002 +++ linux/fs/devices.c Sun Feb 10 12:27:34 2002 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/dquot.c linux/fs/dquot.c --- linux-2.5.4-pre5/fs/dquot.c Thu Jan 3 12:20:18 2002 +++ linux/fs/dquot.c Sun Feb 10 12:27:34 2002 @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include @@ -289,7 +289,7 @@ sizeof(struct dqblk), &offset); if (ret != sizeof(struct dqblk)) printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", - kdevname(dquot->dq_sb->s_dev)); + dquot->dq_sb->s_id); set_fs(fs); up(sem); @@ -440,7 +440,7 @@ if (!dquot->dq_count) { printk("VFS: dqput: trying to free free dquot\n"); printk("VFS: device %s, dquot of %s %d\n", - kdevname(dquot->dq_sb->s_dev), + dquot->dq_sb->s_id, quotatypes[dquot->dq_type], dquot->dq_id); return; @@ -715,7 +715,7 @@ if (!need_print_warning(dquot, flag)) return; dquot->dq_flags |= flag; - tty_write_message(current->tty, (char *)bdevname(dquot->dq_sb->s_dev)); + tty_write_message(current->tty, dquot->dq_sb->s_id); if (warntype == ISOFTWARN || warntype == BSOFTWARN) tty_write_message(current->tty, ": warning, "); else diff -urN linux-2.5.4-pre5/fs/driverfs/inode.c linux/fs/driverfs/inode.c --- linux-2.5.4-pre5/fs/driverfs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/driverfs/inode.c Sun Feb 10 12:27:34 2002 @@ -701,7 +701,8 @@ vfs_unlink(dentry->d_parent->d_inode,dentry); - unlock_dir(dentry); + up(&dentry->d_inode->i_sem); + dput(dentry); /* remove reference count from when file was created */ dput(dentry); @@ -741,7 +742,8 @@ } node = node->next; } - unlock_dir(dentry); + up(&dentry->d_inode->i_sem); + dput(dentry); } /** @@ -760,8 +762,9 @@ if (!dir->dentry) goto done; - /* lock the directory while we remove the files */ dentry = dget(dir->dentry); + dget(dentry->d_parent); + down(&dentry->d_parent->d_inode->i_sem); down(&dentry->d_inode->i_sem); node = dir->files.next; @@ -776,11 +779,9 @@ node = dir->files.next; } - /* now lock the parent, so we can remove this directory */ - lock_parent(dentry); - vfs_rmdir(dentry->d_parent->d_inode,dentry); - double_unlock(dentry,dentry->d_parent); + up(&dentry->d_parent->d_inode->i_sem); + up(&dentry->d_inode->i_sem); /* remove reference count from when directory was created */ dput(dentry); diff -urN linux-2.5.4-pre5/fs/efs/inode.c linux/fs/efs/inode.c --- linux-2.5.4-pre5/fs/efs/inode.c Sun Dec 16 12:23:00 2001 +++ linux/fs/efs/inode.c Sun Feb 10 12:27:34 2002 @@ -10,6 +10,7 @@ #include #include #include +#include extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); diff -urN linux-2.5.4-pre5/fs/exec.c linux/fs/exec.c --- linux-2.5.4-pre5/fs/exec.c Sun Dec 30 10:51:45 2001 +++ linux/fs/exec.c Sun Feb 10 12:27:34 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #define __NO_VERSION__ #include @@ -420,8 +421,8 @@ active_mm = current->active_mm; current->mm = mm; current->active_mm = mm; - task_unlock(current); activate_mm(active_mm, mm); + task_unlock(current); mm_release(); if (old_mm) { if (active_mm != old_mm) BUG(); diff -urN linux-2.5.4-pre5/fs/ext2/balloc.c linux/fs/ext2/balloc.c --- linux-2.5.4-pre5/fs/ext2/balloc.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext2/balloc.c Sun Feb 10 12:27:34 2002 @@ -32,15 +32,15 @@ */ -#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1) +#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1) struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, unsigned int block_group, struct buffer_head ** bh) { unsigned long group_desc; - unsigned long desc; - struct ext2_group_desc * gdp; + unsigned long offset; + struct ext2_group_desc * desc; struct ext2_sb_info *sbi = &sb->u.ext2_sb; if (block_group >= sbi->s_groups_count) { @@ -53,19 +53,19 @@ } group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); - desc = block_group % EXT2_DESC_PER_BLOCK(sb); + offset = block_group % EXT2_DESC_PER_BLOCK(sb); if (!sbi->s_group_desc[group_desc]) { ext2_error (sb, "ext2_get_group_desc", "Group descriptor not loaded - " "block_group = %d, group_desc = %lu, desc = %lu", - block_group, group_desc, desc); + block_group, group_desc, offset); return NULL; } - gdp = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data; + desc = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data; if (bh) *bh = sbi->s_group_desc[group_desc]; - return gdp + desc; + return desc + offset; } /* @@ -78,18 +78,18 @@ static struct buffer_head *read_block_bitmap(struct super_block *sb, unsigned int block_group) { - struct ext2_group_desc * gdp; + struct ext2_group_desc * desc; struct buffer_head * bh = NULL; - gdp = ext2_get_group_desc (sb, block_group, NULL); - if (!gdp) + desc = ext2_get_group_desc (sb, block_group, NULL); + if (!desc) goto error_out; - bh = sb_bread(sb, le32_to_cpu(gdp->bg_block_bitmap)); + bh = sb_bread(sb, le32_to_cpu(desc->bg_block_bitmap)); if (!bh) ext2_error (sb, "read_block_bitmap", "Cannot read block bitmap - " "block_group = %d, block_bitmap = %lu", - block_group, (unsigned long) gdp->bg_block_bitmap); + block_group, (unsigned long) desc->bg_block_bitmap); error_out: return bh; } @@ -135,7 +135,7 @@ goto read_it; if (sbi->s_block_bitmap_number[slot] == slot) goto found; - ext2_panic (sb, "__load_block_bitmap", + ext2_panic (sb, "load_block_bitmap", "block_group != block_bitmap_number"); } @@ -166,6 +166,73 @@ return bh; } +static inline int reserve_blocks(struct super_block *sb, int count) +{ + struct ext2_sb_info * sbi = EXT2_SB(sb); + struct ext2_super_block * es = sbi->s_es; + unsigned free_blocks = le32_to_cpu(es->s_free_blocks_count); + unsigned root_blocks = le32_to_cpu(es->s_r_blocks_count); + + if (free_blocks < count) + count = free_blocks; + + if (free_blocks < root_blocks + count && !capable(CAP_SYS_RESOURCE) && + sbi->s_resuid != current->fsuid && + (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { + /* + * We are too close to reserve and we are not privileged. + * Can we allocate anything at all? + */ + if (free_blocks > root_blocks) + count = free_blocks - root_blocks; + else + return 0; + } + + es->s_free_blocks_count = cpu_to_le32(free_blocks - count); + mark_buffer_dirty(sbi->s_sbh); + sb->s_dirt = 1; + return count; +} + +static inline void release_blocks(struct super_block *sb, int count) +{ + if (count) { + struct ext2_sb_info * sbi = EXT2_SB(sb); + struct ext2_super_block * es = sbi->s_es; + unsigned free_blocks = le32_to_cpu(es->s_free_blocks_count); + es->s_free_blocks_count = cpu_to_le32(free_blocks + count); + mark_buffer_dirty(sbi->s_sbh); + sb->s_dirt = 1; + } +} + +static inline int group_reserve_blocks(struct ext2_group_desc *desc, + struct buffer_head *bh, int count) +{ + unsigned free_blocks; + + if (!desc->bg_free_blocks_count) + return 0; + + free_blocks = le16_to_cpu(desc->bg_free_blocks_count); + if (free_blocks < count) + count = free_blocks; + desc->bg_free_blocks_count = cpu_to_le16(free_blocks - count); + mark_buffer_dirty(bh); + return count; +} + +static inline void group_release_blocks(struct ext2_group_desc *desc, + struct buffer_head *bh, int count) +{ + if (count) { + unsigned free_blocks = le16_to_cpu(desc->bg_free_blocks_count); + desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count); + mark_buffer_dirty(bh); + } +} + /* Free given blocks, update quota and i_blocks field */ void ext2_free_blocks (struct inode * inode, unsigned long block, unsigned long count) @@ -176,15 +243,11 @@ unsigned long bit; unsigned long i; unsigned long overflow; - struct super_block * sb; - struct ext2_group_desc * gdp; + struct super_block * sb = inode->i_sb; + struct ext2_group_desc * desc; struct ext2_super_block * es; + unsigned freed = 0, group_freed; - sb = inode->i_sb; - if (!sb) { - printk ("ext2_free_blocks: nonexistent device"); - return; - } lock_super (sb); es = sb->u.ext2_sb.s_es; if (block < le32_to_cpu(es->s_first_data_block) || @@ -214,53 +277,99 @@ bh = load_block_bitmap (sb, block_group); if (IS_ERR(bh)) goto error_return; - - gdp = ext2_get_group_desc (sb, block_group, &bh2); - if (!gdp) + + desc = ext2_get_group_desc (sb, block_group, &bh2); + if (!desc) goto error_return; - if (in_range (le32_to_cpu(gdp->bg_block_bitmap), block, count) || - in_range (le32_to_cpu(gdp->bg_inode_bitmap), block, count) || - in_range (block, le32_to_cpu(gdp->bg_inode_table), + if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) || + in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) || + in_range (block, le32_to_cpu(desc->bg_inode_table), sb->u.ext2_sb.s_itb_per_group) || - in_range (block + count - 1, le32_to_cpu(gdp->bg_inode_table), + in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table), sb->u.ext2_sb.s_itb_per_group)) ext2_error (sb, "ext2_free_blocks", "Freeing blocks in system zones - " "Block = %lu, count = %lu", block, count); - for (i = 0; i < count; i++) { + for (i = 0, group_freed = 0; i < count; i++) { if (!ext2_clear_bit (bit + i, bh->b_data)) ext2_error (sb, "ext2_free_blocks", "bit already cleared for block %lu", block + i); - else { - DQUOT_FREE_BLOCK(inode, 1); - gdp->bg_free_blocks_count = - cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)+1); - es->s_free_blocks_count = - cpu_to_le32(le32_to_cpu(es->s_free_blocks_count)+1); - } + else + group_freed++; } - - mark_buffer_dirty(bh2); - mark_buffer_dirty(sb->u.ext2_sb.s_sbh); mark_buffer_dirty(bh); if (sb->s_flags & MS_SYNCHRONOUS) { ll_rw_block (WRITE, 1, &bh); wait_on_buffer (bh); } + + group_release_blocks(desc, bh2, group_freed); + freed += group_freed; + if (overflow) { block += count; count = overflow; goto do_more; } - sb->s_dirt = 1; error_return: + release_blocks(sb, freed); unlock_super (sb); - return; + DQUOT_FREE_BLOCK(inode, freed); +} + +static int grab_block(char *map, unsigned size, int goal) +{ + int k; + char *p, *r; + + if (!ext2_test_bit(goal, map)) + goto got_it; + if (goal) { + /* + * The goal was occupied; search forward for a free + * block within the next XX blocks. + * + * end_goal is more or less random, but it has to be + * less than EXT2_BLOCKS_PER_GROUP. Aligning up to the + * next 64-bit boundary is simple.. + */ + k = (goal + 63) & ~63; + goal = ext2_find_next_zero_bit(map, k, goal); + if (goal < k) + goto got_it; + /* + * Search in the remainder of the current group. + */ + } + + p = map + (goal >> 3); + r = memscan(p, 0, (size - goal + 7) >> 3); + k = (r - map) << 3; + if (k < size) { + /* + * We have succeeded in finding a free byte in the block + * bitmap. Now search backwards to find the start of this + * group of free blocks - won't take more than 7 iterations. + */ + for (goal = k; goal && !ext2_test_bit (goal - 1, map); goal--) + ; + goto got_it; + } + + k = ext2_find_next_zero_bit ((u32 *)map, size, goal); + if (k < size) { + goal = k; + goto got_it; + } + return -1; +got_it: + ext2_set_bit(goal, map); + return goal; } /* @@ -274,224 +383,148 @@ int ext2_new_block (struct inode * inode, unsigned long goal, u32 * prealloc_count, u32 * prealloc_block, int * err) { - struct buffer_head * bh; - struct buffer_head * bh2; - char * p, * r; + struct buffer_head *bh; + struct buffer_head *bh2; + struct ext2_group_desc *desc; int i, j, k, tmp; - struct super_block * sb; - struct ext2_group_desc * gdp; - struct ext2_super_block * es; -#ifdef EXT2FS_DEBUG - static int goal_hits = 0, goal_attempts = 0; -#endif + int block = 0; + struct super_block *sb = inode->i_sb; + struct ext2_sb_info *sbi = EXT2_SB(sb); + struct ext2_super_block *es = sbi->s_es; + unsigned group_size = EXT2_BLOCKS_PER_GROUP(sb); + unsigned prealloc_goal = es->s_prealloc_blocks; + unsigned group_alloc = 0, es_alloc, dq_alloc; + + if (!prealloc_goal--) + prealloc_goal = EXT2_DEFAULT_PREALLOC_BLOCKS - 1; + if (!prealloc_count || *prealloc_count) + prealloc_goal = 0; + + *err = -EDQUOT; + if (DQUOT_ALLOC_BLOCK(inode, 1)) + goto out; + + while (prealloc_goal && DQUOT_PREALLOC_BLOCK(inode, prealloc_goal)) + prealloc_goal--; + + dq_alloc = prealloc_goal + 1; + *err = -ENOSPC; - sb = inode->i_sb; - if (!sb) { - printk ("ext2_new_block: nonexistent device"); - return 0; - } lock_super (sb); - es = sb->u.ext2_sb.s_es; - if (le32_to_cpu(es->s_free_blocks_count) <= le32_to_cpu(es->s_r_blocks_count) && - ((sb->u.ext2_sb.s_resuid != current->fsuid) && - (sb->u.ext2_sb.s_resgid == 0 || - !in_group_p (sb->u.ext2_sb.s_resgid)) && - !capable(CAP_SYS_RESOURCE))) - goto out; + + es_alloc = reserve_blocks(sb, dq_alloc); + if (!es_alloc) + goto out_unlock; ext2_debug ("goal=%lu.\n", goal); -repeat: - /* - * First, test whether the goal block is free. - */ if (goal < le32_to_cpu(es->s_first_data_block) || goal >= le32_to_cpu(es->s_blocks_count)) goal = le32_to_cpu(es->s_first_data_block); - i = (goal - le32_to_cpu(es->s_first_data_block)) / EXT2_BLOCKS_PER_GROUP(sb); - gdp = ext2_get_group_desc (sb, i, &bh2); - if (!gdp) + i = (goal - le32_to_cpu(es->s_first_data_block)) / group_size; + desc = ext2_get_group_desc (sb, i, &bh2); + if (!desc) goto io_error; - if (le16_to_cpu(gdp->bg_free_blocks_count) > 0) { - j = ((goal - le32_to_cpu(es->s_first_data_block)) % EXT2_BLOCKS_PER_GROUP(sb)); -#ifdef EXT2FS_DEBUG - if (j) - goal_attempts++; -#endif + group_alloc = group_reserve_blocks(desc, bh2, es_alloc); + if (group_alloc) { + j = ((goal - le32_to_cpu(es->s_first_data_block)) % group_size); bh = load_block_bitmap (sb, i); if (IS_ERR(bh)) goto io_error; ext2_debug ("goal is at %d:%d.\n", i, j); - if (!ext2_test_bit(j, bh->b_data)) { - ext2_debug("goal bit allocated, %d hits\n",++goal_hits); + j = grab_block(bh->b_data, group_size, j); + if (j >= 0) goto got_block; - } - if (j) { - /* - * The goal was occupied; search forward for a free - * block within the next XX blocks. - * - * end_goal is more or less random, but it has to be - * less than EXT2_BLOCKS_PER_GROUP. Aligning up to the - * next 64-bit boundary is simple.. - */ - int end_goal = (j + 63) & ~63; - j = ext2_find_next_zero_bit(bh->b_data, end_goal, j); - if (j < end_goal) - goto got_block; - } - - ext2_debug ("Bit not found near goal\n"); - - /* - * There has been no free block found in the near vicinity - * of the goal: do a search forward through the block groups, - * searching in each group first for an entire free byte in - * the bitmap and then for any free bit. - * - * Search first in the remainder of the current group; then, - * cyclicly search through the rest of the groups. - */ - p = ((char *) bh->b_data) + (j >> 3); - r = memscan(p, 0, (EXT2_BLOCKS_PER_GROUP(sb) - j + 7) >> 3); - k = (r - ((char *) bh->b_data)) << 3; - if (k < EXT2_BLOCKS_PER_GROUP(sb)) { - j = k; - goto search_back; - } - - k = ext2_find_next_zero_bit ((unsigned long *) bh->b_data, - EXT2_BLOCKS_PER_GROUP(sb), - j); - if (k < EXT2_BLOCKS_PER_GROUP(sb)) { - j = k; - goto got_block; - } + group_release_blocks(desc, bh2, group_alloc); + group_alloc = 0; } ext2_debug ("Bit not found in block group %d.\n", i); /* * Now search the rest of the groups. We assume that - * i and gdp correctly point to the last group visited. + * i and desc correctly point to the last group visited. */ - for (k = 0; k < sb->u.ext2_sb.s_groups_count; k++) { + for (k = 0; !group_alloc && k < sbi->s_groups_count; k++) { i++; - if (i >= sb->u.ext2_sb.s_groups_count) + if (i >= sbi->s_groups_count) i = 0; - gdp = ext2_get_group_desc (sb, i, &bh2); - if (!gdp) + desc = ext2_get_group_desc (sb, i, &bh2); + if (!desc) goto io_error; - if (le16_to_cpu(gdp->bg_free_blocks_count) > 0) - break; + group_alloc = group_reserve_blocks(desc, bh2, es_alloc); } - if (k >= sb->u.ext2_sb.s_groups_count) - goto out; + if (k >= sbi->s_groups_count) + goto out_release; bh = load_block_bitmap (sb, i); if (IS_ERR(bh)) goto io_error; - r = memscan(bh->b_data, 0, EXT2_BLOCKS_PER_GROUP(sb) >> 3); - j = (r - bh->b_data) << 3; - if (j < EXT2_BLOCKS_PER_GROUP(sb)) - goto search_back; - else - j = ext2_find_first_zero_bit ((unsigned long *) bh->b_data, - EXT2_BLOCKS_PER_GROUP(sb)); - if (j >= EXT2_BLOCKS_PER_GROUP(sb)) { + j = grab_block(bh->b_data, group_size, 0); + if (j < 0) { ext2_error (sb, "ext2_new_block", "Free blocks count corrupted for block group %d", i); - goto out; + group_alloc = 0; + goto out_release; } -search_back: - /* - * We have succeeded in finding a free byte in the block - * bitmap. Now search backwards up to 7 bits to find the - * start of this group of free blocks. - */ - for (k = 0; k < 7 && j > 0 && !ext2_test_bit (j - 1, bh->b_data); k++, j--); - got_block: + ext2_debug("using block group %d(%d)\n", i, desc->bg_free_blocks_count); - ext2_debug ("using block group %d(%d)\n", i, gdp->bg_free_blocks_count); + tmp = j + i * group_size + le32_to_cpu(es->s_first_data_block); - /* - * Check quota for allocation of this block. - */ - if(DQUOT_ALLOC_BLOCK(inode, 1)) { - *err = -EDQUOT; - goto out; - } - - tmp = j + i * EXT2_BLOCKS_PER_GROUP(sb) + le32_to_cpu(es->s_first_data_block); - - if (tmp == le32_to_cpu(gdp->bg_block_bitmap) || - tmp == le32_to_cpu(gdp->bg_inode_bitmap) || - in_range (tmp, le32_to_cpu(gdp->bg_inode_table), - sb->u.ext2_sb.s_itb_per_group)) + if (tmp == le32_to_cpu(desc->bg_block_bitmap) || + tmp == le32_to_cpu(desc->bg_inode_bitmap) || + in_range (tmp, le32_to_cpu(desc->bg_inode_table), + sbi->s_itb_per_group)) ext2_error (sb, "ext2_new_block", "Allocating block in system zone - " "block = %u", tmp); - if (ext2_set_bit (j, bh->b_data)) { - ext2_warning (sb, "ext2_new_block", - "bit already set for block %d", j); - DQUOT_FREE_BLOCK(inode, 1); - goto repeat; + if (tmp >= le32_to_cpu(es->s_blocks_count)) { + ext2_error (sb, "ext2_new_block", + "block(%d) >= blocks count(%d) - " + "block_group = %d, es == %p ",j, + le32_to_cpu(es->s_blocks_count), i, es); + goto out_release; } + block = tmp; + /* OK, we _had_ allocated something */ ext2_debug ("found bit %d\n", j); + dq_alloc--; + es_alloc--; + group_alloc--; + /* * Do block preallocation now if required. */ -#ifdef EXT2_PREALLOCATE /* Writer: ->i_prealloc* */ - if (prealloc_count && !*prealloc_count) { - int prealloc_goal; - unsigned long next_block = tmp + 1; - - prealloc_goal = es->s_prealloc_blocks ? - es->s_prealloc_blocks : EXT2_DEFAULT_PREALLOC_BLOCKS; + if (group_alloc && !*prealloc_count) { + unsigned long next_block = block + 1; *prealloc_block = next_block; /* Writer: end */ - for (k = 1; - k < prealloc_goal && (j + k) < EXT2_BLOCKS_PER_GROUP(sb); - k++, next_block++) { - if (DQUOT_PREALLOC_BLOCK(inode, 1)) - break; + while (group_alloc && ++j < group_size) { /* Writer: ->i_prealloc* */ if (*prealloc_block + *prealloc_count != next_block || - ext2_set_bit (j + k, bh->b_data)) { + ext2_set_bit (j, bh->b_data)) { /* Writer: end */ - DQUOT_FREE_BLOCK(inode, 1); break; } (*prealloc_count)++; /* Writer: end */ + next_block++; + es_alloc--; + dq_alloc--; + group_alloc--; } - /* - * As soon as we go for per-group spinlocks we'll need these - * done inside the loop above. - */ - gdp->bg_free_blocks_count = - cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count) - - (k - 1)); - es->s_free_blocks_count = - cpu_to_le32(le32_to_cpu(es->s_free_blocks_count) - - (k - 1)); - ext2_debug ("Preallocated a further %lu bits.\n", - (k - 1)); } -#endif - - j = tmp; mark_buffer_dirty(bh); if (sb->s_flags & MS_SYNCHRONOUS) { @@ -499,32 +532,21 @@ wait_on_buffer (bh); } - if (j >= le32_to_cpu(es->s_blocks_count)) { - ext2_error (sb, "ext2_new_block", - "block(%d) >= blocks count(%d) - " - "block_group = %d, es == %p ",j, - le32_to_cpu(es->s_blocks_count), i, es); - goto out; - } - - ext2_debug ("allocating block %d. " - "Goal hits %d of %d.\n", j, goal_hits, goal_attempts); + ext2_debug ("allocating block %d. ", block); - gdp->bg_free_blocks_count = cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count) - 1); - mark_buffer_dirty(bh2); - es->s_free_blocks_count = cpu_to_le32(le32_to_cpu(es->s_free_blocks_count) - 1); - mark_buffer_dirty(sb->u.ext2_sb.s_sbh); - sb->s_dirt = 1; - unlock_super (sb); +out_release: + group_release_blocks(desc, bh2, group_alloc); + release_blocks(sb, es_alloc); *err = 0; - return j; - +out_unlock: + unlock_super (sb); + DQUOT_FREE_BLOCK(inode, dq_alloc); +out: + return block; + io_error: *err = -EIO; -out: - unlock_super (sb); - return 0; - + goto out_release; } unsigned long ext2_count_free_blocks (struct super_block * sb) @@ -532,27 +554,27 @@ #ifdef EXT2FS_DEBUG struct ext2_super_block * es; unsigned long desc_count, bitmap_count, x; - struct ext2_group_desc * gdp; + struct ext2_group_desc * desc; int i; lock_super (sb); es = sb->u.ext2_sb.s_es; desc_count = 0; bitmap_count = 0; - gdp = NULL; + desc = NULL; for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { struct buffer_head *bh; - gdp = ext2_get_group_desc (sb, i, NULL); - if (!gdp) + desc = ext2_get_group_desc (sb, i, NULL); + if (!desc) continue; - desc_count += le16_to_cpu(gdp->bg_free_blocks_count); + desc_count += le16_to_cpu(desc->bg_free_blocks_count); bh = load_block_bitmap (sb, i); if (IS_ERR(bh)) continue; x = ext2_count_free (bh, sb->s_blocksize); printk ("group %d: stored = %d, counted = %lu\n", - i, le16_to_cpu(gdp->bg_free_blocks_count), x); + i, le16_to_cpu(desc->bg_free_blocks_count), x); bitmap_count += x; } printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n", @@ -632,18 +654,18 @@ struct ext2_super_block * es; unsigned long desc_count, bitmap_count, x, j; unsigned long desc_blocks; - struct ext2_group_desc * gdp; + struct ext2_group_desc * desc; int i; es = sb->u.ext2_sb.s_es; desc_count = 0; bitmap_count = 0; - gdp = NULL; + desc = NULL; for (i = 0; i < sb->u.ext2_sb.s_groups_count; i++) { - gdp = ext2_get_group_desc (sb, i, NULL); - if (!gdp) + desc = ext2_get_group_desc (sb, i, NULL); + if (!desc) continue; - desc_count += le16_to_cpu(gdp->bg_free_blocks_count); + desc_count += le16_to_cpu(desc->bg_free_blocks_count); bh = load_block_bitmap (sb, i); if (IS_ERR(bh)) continue; @@ -659,28 +681,28 @@ "Descriptor block #%ld in group " "%d is marked free", j, i); - if (!block_in_use (le32_to_cpu(gdp->bg_block_bitmap), sb, bh->b_data)) + if (!block_in_use (le32_to_cpu(desc->bg_block_bitmap), sb, bh->b_data)) ext2_error (sb, "ext2_check_blocks_bitmap", "Block bitmap for group %d is marked free", i); - if (!block_in_use (le32_to_cpu(gdp->bg_inode_bitmap), sb, bh->b_data)) + if (!block_in_use (le32_to_cpu(desc->bg_inode_bitmap), sb, bh->b_data)) ext2_error (sb, "ext2_check_blocks_bitmap", "Inode bitmap for group %d is marked free", i); for (j = 0; j < sb->u.ext2_sb.s_itb_per_group; j++) - if (!block_in_use (le32_to_cpu(gdp->bg_inode_table) + j, sb, bh->b_data)) + if (!block_in_use (le32_to_cpu(desc->bg_inode_table) + j, sb, bh->b_data)) ext2_error (sb, "ext2_check_blocks_bitmap", "Block #%ld of the inode table in " "group %d is marked free", j, i); x = ext2_count_free (bh, sb->s_blocksize); - if (le16_to_cpu(gdp->bg_free_blocks_count) != x) + if (le16_to_cpu(desc->bg_free_blocks_count) != x) ext2_error (sb, "ext2_check_blocks_bitmap", "Wrong free blocks count for group %d, " "stored = %d, counted = %lu", i, - le16_to_cpu(gdp->bg_free_blocks_count), x); + le16_to_cpu(desc->bg_free_blocks_count), x); bitmap_count += x; } if (le32_to_cpu(es->s_free_blocks_count) != bitmap_count) diff -urN linux-2.5.4-pre5/fs/ext2/file.c linux/fs/ext2/file.c --- linux-2.5.4-pre5/fs/ext2/file.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext2/file.c Sun Feb 10 12:27:34 2002 @@ -19,7 +19,7 @@ */ #include "ext2.h" -#include +#include /* * Called when an inode is released. Note that this is different diff -urN linux-2.5.4-pre5/fs/ext2/inode.c linux/fs/ext2/inode.c --- linux-2.5.4-pre5/fs/ext2/inode.c Mon Jan 28 13:20:44 2002 +++ linux/fs/ext2/inode.c Sun Feb 10 12:27:34 2002 @@ -25,7 +25,7 @@ #include "ext2.h" #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c --- linux-2.5.4-pre5/fs/ext2/ioctl.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext2/ioctl.c Sun Feb 10 12:27:34 2002 @@ -8,7 +8,7 @@ */ #include "ext2.h" -#include +#include #include diff -urN linux-2.5.4-pre5/fs/ext3/balloc.c linux/fs/ext3/balloc.c --- linux-2.5.4-pre5/fs/ext3/balloc.c Sun Dec 16 12:23:00 2001 +++ linux/fs/ext3/balloc.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/file.c linux/fs/ext3/file.c --- linux-2.5.4-pre5/fs/ext3/file.c Thu Nov 15 13:37:55 2001 +++ linux/fs/ext3/file.c Sun Feb 10 12:27:35 2002 @@ -18,7 +18,7 @@ * (jj@sunsite.ms.mff.cuni.cz) */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/fsync.c linux/fs/ext3/fsync.c --- linux-2.5.4-pre5/fs/ext3/fsync.c Tue Nov 20 21:34:13 2001 +++ linux/fs/ext3/fsync.c Sun Feb 10 12:27:35 2002 @@ -22,7 +22,7 @@ * we can depend on generic_block_fdatasync() to sync the data blocks. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/ialloc.c linux/fs/ext3/ialloc.c --- linux-2.5.4-pre5/fs/ext3/ialloc.c Mon Jan 28 22:49:27 2002 +++ linux/fs/ext3/ialloc.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ * David S. Miller (davem@caip.rutgers.edu), 1995 */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/inode.c linux/fs/ext3/inode.c --- linux-2.5.4-pre5/fs/ext3/inode.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext3/inode.c Sun Feb 10 12:27:35 2002 @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/ioctl.c linux/fs/ext3/ioctl.c --- linux-2.5.4-pre5/fs/ext3/ioctl.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext3/ioctl.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include diff -urN linux-2.5.4-pre5/fs/ext3/namei.c linux/fs/ext3/namei.c --- linux-2.5.4-pre5/fs/ext3/namei.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ext3/namei.c Sun Feb 10 12:27:35 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ext3/super.c linux/fs/ext3/super.c --- linux-2.5.4-pre5/fs/ext3/super.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ext3/super.c Sun Feb 10 12:27:35 2002 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/fat/dir.c linux/fs/fat/dir.c --- linux-2.5.4-pre5/fs/fat/dir.c Mon Jan 28 13:20:44 2002 +++ linux/fs/fat/dir.c Sun Feb 10 12:27:35 2002 @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/fat/file.c linux/fs/fat/file.c --- linux-2.5.4-pre5/fs/fat/file.c Mon Jan 28 13:20:44 2002 +++ linux/fs/fat/file.c Sun Feb 10 12:27:35 2002 @@ -6,7 +6,7 @@ * regular file handling primitives for fat-based filesystems */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/fat/inode.c linux/fs/fat/inode.c --- linux-2.5.4-pre5/fs/fat/inode.c Mon Jan 28 13:20:44 2002 +++ linux/fs/fat/inode.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/fifo.c linux/fs/fifo.c --- linux-2.5.4-pre5/fs/fifo.c Fri Feb 9 11:29:44 2001 +++ linux/fs/fifo.c Sun Feb 10 12:27:35 2002 @@ -12,6 +12,7 @@ #include #include #include +#include static void wait_for_partner(struct inode* inode, unsigned int* cnt) { diff -urN linux-2.5.4-pre5/fs/file.c linux/fs/file.c --- linux-2.5.4-pre5/fs/file.c Tue Jan 15 11:07:01 2002 +++ linux/fs/file.c Sun Feb 10 12:27:35 2002 @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/file_table.c linux/fs/file_table.c --- linux-2.5.4-pre5/fs/file_table.c Sun Feb 10 12:27:30 2002 +++ linux/fs/file_table.c Sun Feb 10 12:27:35 2002 @@ -12,6 +12,7 @@ #include #include #include +#include /* sysctl tunables... */ struct files_stat_struct files_stat = {0, 0, NR_FILE}; diff -urN linux-2.5.4-pre5/fs/filesystems.c linux/fs/filesystems.c --- linux-2.5.4-pre5/fs/filesystems.c Tue Apr 17 23:23:12 2001 +++ linux/fs/filesystems.c Sun Feb 10 12:27:35 2002 @@ -8,10 +8,11 @@ #include #include -#include +#include #include #include #include +#include #if defined(CONFIG_NFSD_MODULE) struct nfsd_linkage *nfsd_linkage = NULL; diff -urN linux-2.5.4-pre5/fs/freevxfs/vxfs_lookup.c linux/fs/freevxfs/vxfs_lookup.c --- linux-2.5.4-pre5/fs/freevxfs/vxfs_lookup.c Fri Jan 4 18:09:42 2002 +++ linux/fs/freevxfs/vxfs_lookup.c Sun Feb 10 12:27:35 2002 @@ -33,7 +33,7 @@ * Veritas filesystem driver - lookup and other directory related code. */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/hpfs/dir.c linux/fs/hpfs/dir.c --- linux-2.5.4-pre5/fs/hpfs/dir.c Tue Jan 29 21:15:47 2002 +++ linux/fs/hpfs/dir.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include "hpfs_fn.h" -#include +#include #include int hpfs_dir_release(struct inode *inode, struct file *filp) diff -urN linux-2.5.4-pre5/fs/hpfs/file.c linux/fs/hpfs/file.c --- linux-2.5.4-pre5/fs/hpfs/file.c Mon Jan 21 15:37:32 2002 +++ linux/fs/hpfs/file.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include "hpfs_fn.h" diff -urN linux-2.5.4-pre5/fs/hpfs/hpfs_fn.h linux/fs/hpfs/hpfs_fn.h --- linux-2.5.4-pre5/fs/hpfs/hpfs_fn.h Mon Jan 21 15:37:32 2002 +++ linux/fs/hpfs/hpfs_fn.h Sun Feb 10 12:27:35 2002 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/hpfs/inode.c linux/fs/hpfs/inode.c --- linux-2.5.4-pre5/fs/hpfs/inode.c Mon Jan 21 15:37:32 2002 +++ linux/fs/hpfs/inode.c Sun Feb 10 12:27:35 2002 @@ -6,7 +6,7 @@ * inode VFS functions */ -#include +#include #include #include "hpfs_fn.h" diff -urN linux-2.5.4-pre5/fs/intermezzo/cache.c linux/fs/intermezzo/cache.c --- linux-2.5.4-pre5/fs/intermezzo/cache.c Mon Jan 14 10:10:43 2002 +++ linux/fs/intermezzo/cache.c Sun Feb 10 12:27:35 2002 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/dcache.c linux/fs/intermezzo/dcache.c --- linux-2.5.4-pre5/fs/intermezzo/dcache.c Sun Dec 30 10:31:51 2001 +++ linux/fs/intermezzo/dcache.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #define __NO_VERSION__ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/dir.c linux/fs/intermezzo/dir.c --- linux-2.5.4-pre5/fs/intermezzo/dir.c Tue Nov 13 09:20:56 2001 +++ linux/fs/intermezzo/dir.c Sun Feb 10 12:27:35 2002 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/file.c linux/fs/intermezzo/file.c --- linux-2.5.4-pre5/fs/intermezzo/file.c Sun Dec 30 16:59:00 2001 +++ linux/fs/intermezzo/file.c Sun Feb 10 12:27:35 2002 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/journal_ext2.c linux/fs/intermezzo/journal_ext2.c --- linux-2.5.4-pre5/fs/intermezzo/journal_ext2.c Sun Dec 30 10:31:51 2001 +++ linux/fs/intermezzo/journal_ext2.c Sun Feb 10 12:27:35 2002 @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/journal_ext3.c linux/fs/intermezzo/journal_ext3.c --- linux-2.5.4-pre5/fs/intermezzo/journal_ext3.c Mon Jan 21 15:37:32 2002 +++ linux/fs/intermezzo/journal_ext3.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/journal_obdfs.c linux/fs/intermezzo/journal_obdfs.c --- linux-2.5.4-pre5/fs/intermezzo/journal_obdfs.c Mon Jan 21 15:37:32 2002 +++ linux/fs/intermezzo/journal_obdfs.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/journal_reiserfs.c linux/fs/intermezzo/journal_reiserfs.c --- linux-2.5.4-pre5/fs/intermezzo/journal_reiserfs.c Mon Jan 21 15:37:32 2002 +++ linux/fs/intermezzo/journal_reiserfs.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/journal_xfs.c linux/fs/intermezzo/journal_xfs.c --- linux-2.5.4-pre5/fs/intermezzo/journal_xfs.c Sun Dec 30 10:31:51 2001 +++ linux/fs/intermezzo/journal_xfs.c Sun Feb 10 12:27:35 2002 @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/methods.c linux/fs/intermezzo/methods.c --- linux-2.5.4-pre5/fs/intermezzo/methods.c Tue Nov 13 09:20:56 2001 +++ linux/fs/intermezzo/methods.c Sun Feb 10 12:27:35 2002 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/presto.c linux/fs/intermezzo/presto.c --- linux-2.5.4-pre5/fs/intermezzo/presto.c Mon Jan 14 10:10:43 2002 +++ linux/fs/intermezzo/presto.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ */ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/psdev.c linux/fs/intermezzo/psdev.c --- linux-2.5.4-pre5/fs/intermezzo/psdev.c Mon Jan 14 10:10:43 2002 +++ linux/fs/intermezzo/psdev.c Sun Feb 10 12:27:35 2002 @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/super.c linux/fs/intermezzo/super.c --- linux-2.5.4-pre5/fs/intermezzo/super.c Thu Jan 3 13:59:50 2002 +++ linux/fs/intermezzo/super.c Sun Feb 10 12:27:35 2002 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/sysctl.c linux/fs/intermezzo/sysctl.c --- linux-2.5.4-pre5/fs/intermezzo/sysctl.c Mon Jan 14 10:10:43 2002 +++ linux/fs/intermezzo/sysctl.c Sun Feb 10 12:27:35 2002 @@ -5,7 +5,7 @@ #define __NO_VERSION__ #include /* for CONFIG_PROC_FS */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/intermezzo/upcall.c linux/fs/intermezzo/upcall.c --- linux-2.5.4-pre5/fs/intermezzo/upcall.c Sun Dec 30 10:31:51 2001 +++ linux/fs/intermezzo/upcall.c Sun Feb 10 12:27:35 2002 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ioctl.c linux/fs/ioctl.c --- linux-2.5.4-pre5/fs/ioctl.c Fri Feb 9 11:29:44 2001 +++ linux/fs/ioctl.c Sun Feb 10 12:27:35 2002 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/fs/isofs/compress.c linux/fs/isofs/compress.c --- linux-2.5.4-pre5/fs/isofs/compress.c Mon Jan 28 13:20:44 2002 +++ linux/fs/isofs/compress.c Sun Feb 10 12:27:35 2002 @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/isofs/dir.c linux/fs/isofs/dir.c --- linux-2.5.4-pre5/fs/isofs/dir.c Sun Dec 16 12:23:05 2001 +++ linux/fs/isofs/dir.c Sun Feb 10 12:27:35 2002 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/isofs/inode.c linux/fs/isofs/inode.c --- linux-2.5.4-pre5/fs/isofs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/isofs/inode.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/isofs/namei.c linux/fs/isofs/namei.c --- linux-2.5.4-pre5/fs/isofs/namei.c Mon Jan 28 13:20:44 2002 +++ linux/fs/isofs/namei.c Sun Feb 10 12:27:35 2002 @@ -6,7 +6,7 @@ * (C) 1991 Linus Torvalds - minix filesystem */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/isofs/rock.c linux/fs/isofs/rock.c --- linux-2.5.4-pre5/fs/isofs/rock.c Mon Jan 28 13:20:44 2002 +++ linux/fs/isofs/rock.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/checkpoint.c linux/fs/jbd/checkpoint.c --- linux-2.5.4-pre5/fs/jbd/checkpoint.c Fri Nov 9 14:25:04 2001 +++ linux/fs/jbd/checkpoint.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ * reused. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/commit.c linux/fs/jbd/commit.c --- linux-2.5.4-pre5/fs/jbd/commit.c Tue Jan 15 13:53:51 2002 +++ linux/fs/jbd/commit.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ * part of the ext2fs journaling system. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/journal.c linux/fs/jbd/journal.c --- linux-2.5.4-pre5/fs/jbd/journal.c Mon Jan 14 09:38:37 2002 +++ linux/fs/jbd/journal.c Sun Feb 10 12:27:35 2002 @@ -23,14 +23,13 @@ */ #include -#include +#include #include #include #include #include #include #include -#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/recovery.c linux/fs/jbd/recovery.c --- linux-2.5.4-pre5/fs/jbd/recovery.c Sun Jan 6 12:26:23 2002 +++ linux/fs/jbd/recovery.c Sun Feb 10 12:27:35 2002 @@ -16,7 +16,7 @@ #ifndef __KERNEL__ #include "jfs_user.h" #else -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/revoke.c linux/fs/jbd/revoke.c --- linux-2.5.4-pre5/fs/jbd/revoke.c Mon Jan 14 09:38:37 2002 +++ linux/fs/jbd/revoke.c Sun Feb 10 12:27:35 2002 @@ -60,7 +60,7 @@ #ifndef __KERNEL__ #include "jfs_user.h" #else -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jbd/transaction.c linux/fs/jbd/transaction.c --- linux-2.5.4-pre5/fs/jbd/transaction.c Mon Jan 14 09:38:37 2002 +++ linux/fs/jbd/transaction.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ * filesystem). */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c --- linux-2.5.4-pre5/fs/jffs/inode-v23.c Sun Feb 10 12:27:30 2002 +++ linux/fs/jffs/inode-v23.c Sun Feb 10 12:27:35 2002 @@ -32,7 +32,7 @@ dwmw2 */ #define __KERNEL_SYSCALLS__ -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/jffs/intrep.c linux/fs/jffs/intrep.c --- linux-2.5.4-pre5/fs/jffs/intrep.c Thu Oct 4 15:13:18 2001 +++ linux/fs/jffs/intrep.c Sun Feb 10 12:27:35 2002 @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include "intrep.h" diff -urN linux-2.5.4-pre5/fs/jffs/jffs_proc.c linux/fs/jffs/jffs_proc.c --- linux-2.5.4-pre5/fs/jffs/jffs_proc.c Thu Oct 4 15:13:18 2001 +++ linux/fs/jffs/jffs_proc.c Sun Feb 10 12:27:35 2002 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "jffs_fm.h" #include "jffs_proc.h" diff -urN linux-2.5.4-pre5/fs/jffs2/background.c linux/fs/jffs2/background.c --- linux-2.5.4-pre5/fs/jffs2/background.c Tue Jan 15 13:53:51 2002 +++ linux/fs/jffs2/background.c Sun Feb 10 12:27:35 2002 @@ -38,7 +38,7 @@ #define __KERNEL_SYSCALLS__ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/jffs2/dir.c linux/fs/jffs2/dir.c --- linux-2.5.4-pre5/fs/jffs2/dir.c Mon Jan 28 13:20:44 2002 +++ linux/fs/jffs2/dir.c Sun Feb 10 12:27:35 2002 @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include "nodelist.h" static int jffs2_readdir (struct file *, void *, filldir_t); diff -urN linux-2.5.4-pre5/fs/jffs2/gc.c linux/fs/jffs2/gc.c --- linux-2.5.4-pre5/fs/jffs2/gc.c Thu Jan 10 16:23:46 2002 +++ linux/fs/jffs2/gc.c Sun Feb 10 12:27:35 2002 @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/clntlock.c linux/fs/lockd/clntlock.c --- linux-2.5.4-pre5/fs/lockd/clntlock.c Mon Oct 1 13:45:47 2001 +++ linux/fs/lockd/clntlock.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/lockd_syms.c linux/fs/lockd/lockd_syms.c --- linux-2.5.4-pre5/fs/lockd/lockd_syms.c Mon Oct 1 13:45:47 2001 +++ linux/fs/lockd/lockd_syms.c Sun Feb 10 12:27:35 2002 @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/svc4proc.c linux/fs/lockd/svc4proc.c --- linux-2.5.4-pre5/fs/lockd/svc4proc.c Mon Oct 1 13:45:47 2001 +++ linux/fs/lockd/svc4proc.c Sun Feb 10 12:27:35 2002 @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/svclock.c linux/fs/lockd/svclock.c --- linux-2.5.4-pre5/fs/lockd/svclock.c Tue Jan 1 12:23:29 2002 +++ linux/fs/lockd/svclock.c Sun Feb 10 12:27:35 2002 @@ -306,9 +306,8 @@ struct nlm_block *block; int error; - dprintk("lockd: nlmsvc_lock(%02x:%02x/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", - major(file->f_file.f_dentry->d_inode->i_dev), - minor(file->f_file.f_dentry->d_inode->i_dev), + dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", + file->f_file.f_dentry->d_inode->i_sb->s_id, file->f_file.f_dentry->d_inode->i_ino, lock->fl.fl_type, lock->fl.fl_pid, (long long)lock->fl.fl_start, @@ -386,9 +385,8 @@ { struct file_lock *fl; - dprintk("lockd: nlmsvc_testlock(%02x:%02x/%ld, ty=%d, %Ld-%Ld)\n", - major(file->f_file.f_dentry->d_inode->i_dev), - minor(file->f_file.f_dentry->d_inode->i_dev), + dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n", + file->f_file.f_dentry->d_inode->i_sb->s_id, file->f_file.f_dentry->d_inode->i_ino, lock->fl.fl_type, (long long)lock->fl.fl_start, @@ -419,9 +417,8 @@ { int error; - dprintk("lockd: nlmsvc_unlock(%02x:%02x/%ld, pi=%d, %Ld-%Ld)\n", - major(file->f_file.f_dentry->d_inode->i_dev), - minor(file->f_file.f_dentry->d_inode->i_dev), + dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n", + file->f_file.f_dentry->d_inode->i_sb->s_id, file->f_file.f_dentry->d_inode->i_ino, lock->fl.fl_pid, (long long)lock->fl.fl_start, @@ -448,9 +445,8 @@ { struct nlm_block *block; - dprintk("lockd: nlmsvc_cancel(%02x:%02x/%ld, pi=%d, %Ld-%Ld)\n", - major(file->f_file.f_dentry->d_inode->i_dev), - minor(file->f_file.f_dentry->d_inode->i_dev), + dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n", + file->f_file.f_dentry->d_inode->i_sb->s_id, file->f_file.f_dentry->d_inode->i_ino, lock->fl.fl_pid, (long long)lock->fl.fl_start, diff -urN linux-2.5.4-pre5/fs/lockd/svcproc.c linux/fs/lockd/svcproc.c --- linux-2.5.4-pre5/fs/lockd/svcproc.c Thu Oct 11 07:52:18 2001 +++ linux/fs/lockd/svcproc.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/svcshare.c linux/fs/lockd/svcshare.c --- linux-2.5.4-pre5/fs/lockd/svcshare.c Fri Feb 9 11:29:44 2001 +++ linux/fs/lockd/svcshare.c Sun Feb 10 12:27:35 2002 @@ -6,7 +6,7 @@ * Copyright (C) 1996 Olaf Kirch */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/lockd/svcsubs.c linux/fs/lockd/svcsubs.c --- linux-2.5.4-pre5/fs/lockd/svcsubs.c Mon Oct 1 13:45:47 2001 +++ linux/fs/lockd/svcsubs.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -128,7 +128,7 @@ struct nlm_file **fp, *f; dprintk("lockd: closing file %s/%ld\n", - kdevname(inode->i_dev), inode->i_ino); + inode->i_sb->s_id, inode->i_ino); fp = nlm_files + file->f_hash; while ((f = *fp) != NULL) { if (f == file) { diff -urN linux-2.5.4-pre5/fs/locks.c linux/fs/locks.c --- linux-2.5.4-pre5/fs/locks.c Mon Jan 7 12:55:16 2002 +++ linux/fs/locks.c Sun Feb 10 12:27:35 2002 @@ -120,7 +120,8 @@ #include #include #include -#include +#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/msdos/namei.c linux/fs/msdos/namei.c --- linux-2.5.4-pre5/fs/msdos/namei.c Sun Feb 10 12:27:30 2002 +++ linux/fs/msdos/namei.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #define __NO_VERSION__ #include -#include +#include #include #define MSDOS_DEBUG 0 diff -urN linux-2.5.4-pre5/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c --- linux-2.5.4-pre5/fs/ncpfs/dir.c Wed Mar 7 16:53:48 2001 +++ linux/fs/ncpfs/dir.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/file.c linux/fs/ncpfs/file.c --- linux-2.5.4-pre5/fs/ncpfs/file.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ncpfs/file.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c --- linux-2.5.4-pre5/fs/ncpfs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ncpfs/inode.c Sun Feb 10 12:27:35 2002 @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/ioctl.c linux/fs/ncpfs/ioctl.c --- linux-2.5.4-pre5/fs/ncpfs/ioctl.c Mon Sep 10 07:31:30 2001 +++ linux/fs/ncpfs/ioctl.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/mmap.c linux/fs/ncpfs/mmap.c --- linux-2.5.4-pre5/fs/ncpfs/mmap.c Mon Sep 10 09:04:53 2001 +++ linux/fs/ncpfs/mmap.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c --- linux-2.5.4-pre5/fs/ncpfs/sock.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ncpfs/sock.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ncpfs/symlink.c linux/fs/ncpfs/symlink.c --- linux-2.5.4-pre5/fs/ncpfs/symlink.c Sun Dec 30 10:31:51 2001 +++ linux/fs/ncpfs/symlink.c Sun Feb 10 12:27:35 2002 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include "ncplib_kernel.h" diff -urN linux-2.5.4-pre5/fs/nfs/dir.c linux/fs/nfs/dir.c --- linux-2.5.4-pre5/fs/nfs/dir.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfs/dir.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ * 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/file.c linux/fs/nfs/file.c --- linux-2.5.4-pre5/fs/nfs/file.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfs/file.c Sun Feb 10 12:27:35 2002 @@ -16,7 +16,7 @@ * nfs regular file handling functions */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/flushd.c linux/fs/nfs/flushd.c --- linux-2.5.4-pre5/fs/nfs/flushd.c Fri Nov 9 14:28:15 2001 +++ linux/fs/nfs/flushd.c Sun Feb 10 12:27:35 2002 @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/inode.c linux/fs/nfs/inode.c --- linux-2.5.4-pre5/fs/nfs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfs/inode.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/nfs2xdr.c linux/fs/nfs/nfs2xdr.c --- linux-2.5.4-pre5/fs/nfs/nfs2xdr.c Thu Dec 20 08:57:31 2001 +++ linux/fs/nfs/nfs2xdr.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/nfs3xdr.c linux/fs/nfs/nfs3xdr.c --- linux-2.5.4-pre5/fs/nfs/nfs3xdr.c Fri Nov 2 17:40:09 2001 +++ linux/fs/nfs/nfs3xdr.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/nfsroot.c linux/fs/nfs/nfsroot.c --- linux-2.5.4-pre5/fs/nfs/nfsroot.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfs/nfsroot.c Sun Feb 10 12:27:35 2002 @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/proc.c linux/fs/nfs/proc.c --- linux-2.5.4-pre5/fs/nfs/proc.c Fri Feb 9 11:29:44 2001 +++ linux/fs/nfs/proc.c Sun Feb 10 12:27:35 2002 @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/read.c linux/fs/nfs/read.c --- linux-2.5.4-pre5/fs/nfs/read.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfs/read.c Sun Feb 10 12:27:35 2002 @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfs/symlink.c linux/fs/nfs/symlink.c --- linux-2.5.4-pre5/fs/nfs/symlink.c Fri Feb 9 11:29:44 2001 +++ linux/fs/nfs/symlink.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ */ #define NFS_NEED_XDR_TYPES -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/export.c linux/fs/nfsd/export.c --- linux-2.5.4-pre5/fs/nfsd/export.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfsd/export.c Sun Feb 10 12:27:35 2002 @@ -375,7 +375,6 @@ struct nameidata nd; struct inode *inode; struct svc_fh fh; - kdev_t dev; int err; err = -EPERM; @@ -386,11 +385,10 @@ return err; } inode = nd.dentry->d_inode; - dev = inode->i_dev; - dprintk("nfsd: exp_rootfh(%s [%p] %s:%02x:%02x/%ld)\n", + dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n", path, nd.dentry, clp->cl_ident, - major(dev), minor(dev), (long) inode->i_ino); + inode->i_sb->s_id, inode->i_ino); exp = exp_parent(clp, inode->i_sb, nd.dentry); if (!exp) { dprintk("nfsd: exp_rootfh export not found.\n"); diff -urN linux-2.5.4-pre5/fs/nfsd/nfs3proc.c linux/fs/nfsd/nfs3proc.c --- linux-2.5.4-pre5/fs/nfsd/nfs3proc.c Thu Sep 20 21:02:01 2001 +++ linux/fs/nfsd/nfs3proc.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfs3xdr.c linux/fs/nfsd/nfs3xdr.c --- linux-2.5.4-pre5/fs/nfsd/nfs3xdr.c Thu Jan 3 12:20:18 2002 +++ linux/fs/nfsd/nfs3xdr.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfscache.c linux/fs/nfsd/nfscache.c --- linux-2.5.4-pre5/fs/nfsd/nfscache.c Thu Feb 15 10:56:29 2001 +++ linux/fs/nfsd/nfscache.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ */ #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfsctl.c linux/fs/nfsd/nfsctl.c --- linux-2.5.4-pre5/fs/nfsd/nfsctl.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfsd/nfsctl.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfsfh.c linux/fs/nfsd/nfsfh.c --- linux-2.5.4-pre5/fs/nfsd/nfsfh.c Tue Jan 1 12:32:13 2002 +++ linux/fs/nfsd/nfsfh.c Sun Feb 10 12:27:35 2002 @@ -424,8 +424,7 @@ /* It's a directory, or we are required to confirm the file's * location in the tree. */ - dprintk("nfs_fh: need to look harder for %02x:%02x/%d\n", - major(sb->s_dev), minor(sb->s_dev), datap[0]); + dprintk("nfs_fh: need to look harder for %s/%d\n", sb->s_id, datap[0]); if (!S_ISDIR(result->d_inode->i_mode)) { nfsdstats.fh_nocache_nondir++; diff -urN linux-2.5.4-pre5/fs/nfsd/nfsproc.c linux/fs/nfsd/nfsproc.c --- linux-2.5.4-pre5/fs/nfsd/nfsproc.c Tue Jan 1 12:28:59 2002 +++ linux/fs/nfsd/nfsproc.c Sun Feb 10 12:27:35 2002 @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfssvc.c linux/fs/nfsd/nfssvc.c --- linux-2.5.4-pre5/fs/nfsd/nfssvc.c Wed Jan 23 15:28:39 2002 +++ linux/fs/nfsd/nfssvc.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/nfsxdr.c linux/fs/nfsd/nfsxdr.c --- linux-2.5.4-pre5/fs/nfsd/nfsxdr.c Tue Jan 1 12:48:41 2002 +++ linux/fs/nfsd/nfsxdr.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/nfsd/stats.c linux/fs/nfsd/stats.c --- linux-2.5.4-pre5/fs/nfsd/stats.c Tue Jul 18 23:04:06 2000 +++ linux/fs/nfsd/stats.c Sun Feb 10 12:27:35 2002 @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include #define __NO_VERSION__ diff -urN linux-2.5.4-pre5/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c --- linux-2.5.4-pre5/fs/nfsd/vfs.c Sun Feb 10 12:27:30 2002 +++ linux/fs/nfsd/vfs.c Sun Feb 10 12:27:35 2002 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -1410,8 +1410,8 @@ oldlen = cd.buflen; /* - dprintk("nfsd: f_op->readdir(%x/%ld @ %d) buflen = %d (%d)\n", - file.f_inode->i_dev, file.f_inode->i_ino, + dprintk("nfsd: f_op->readdir(%s/%ld @ %d) buflen = %d (%d)\n", + file.f_inode->i_sb->s_id, file.f_inode->i_ino, (int) file.f_pos, (int) oldlen, (int) cd.buflen); */ err = file.f_op->readdir(&file, &cd, (filldir_t) func); diff -urN linux-2.5.4-pre5/fs/pipe.c linux/fs/pipe.c --- linux-2.5.4-pre5/fs/pipe.c Sun Feb 10 12:27:30 2002 +++ linux/fs/pipe.c Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/fs/proc/array.c linux/fs/proc/array.c --- linux-2.5.4-pre5/fs/proc/array.c Sun Feb 10 12:27:30 2002 +++ linux/fs/proc/array.c Sun Feb 10 12:27:35 2002 @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/proc/base.c linux/fs/proc/base.c --- linux-2.5.4-pre5/fs/proc/base.c Sun Feb 10 12:27:30 2002 +++ linux/fs/proc/base.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/proc/generic.c linux/fs/proc/generic.c --- linux-2.5.4-pre5/fs/proc/generic.c Sun Feb 10 12:27:30 2002 +++ linux/fs/proc/generic.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #define __NO_VERSION__ diff -urN linux-2.5.4-pre5/fs/proc/inode.c linux/fs/proc/inode.c --- linux-2.5.4-pre5/fs/proc/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/proc/inode.c Sun Feb 10 12:27:35 2002 @@ -4,7 +4,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/proc/kmsg.c linux/fs/proc/kmsg.c --- linux-2.5.4-pre5/fs/proc/kmsg.c Sun Sep 16 21:22:40 2001 +++ linux/fs/proc/kmsg.c Sun Feb 10 12:27:35 2002 @@ -7,9 +7,10 @@ #include #include -#include +#include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/fs/proc/proc_devtree.c linux/fs/proc/proc_devtree.c --- linux-2.5.4-pre5/fs/proc/proc_devtree.c Sun May 21 20:34:37 2000 +++ linux/fs/proc/proc_devtree.c Sun Feb 10 12:27:35 2002 @@ -4,7 +4,7 @@ * Copyright 1997 Paul Mackerras */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/proc/proc_misc.c linux/fs/proc/proc_misc.c --- linux-2.5.4-pre5/fs/proc/proc_misc.c Mon Jan 7 12:55:16 2002 +++ linux/fs/proc/proc_misc.c Sun Feb 10 12:27:35 2002 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -50,9 +50,6 @@ * have a way to deal with that gracefully. Right now I used straightforward * wrappers, but this needs further analysis wrt potential overflows. */ -#ifdef CONFIG_MODULES -extern int get_module_list(char *); -#endif extern int get_device_list(char *); extern int get_partition_list(char *, char **, off_t, int); extern int get_filesystem_list(char *); @@ -203,13 +200,17 @@ }; #ifdef CONFIG_MODULES -static int modules_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) +extern struct seq_operations modules_op; +static int modules_open(struct inode *inode, struct file *file) { - int len = get_module_list(page); - return proc_calc_metrics(page, start, off, count, eof, len); + return seq_open(file, &modules_op); } - +static struct file_operations proc_modules_operations = { + open: modules_open, + read: seq_read, + llseek: seq_lseek, + release: seq_release, +}; extern struct seq_operations ksyms_op; static int ksyms_open(struct inode *inode, struct file *file) { @@ -223,6 +224,20 @@ }; #endif +extern struct seq_operations slabinfo_op; +extern ssize_t slabinfo_write(struct file *, const char *, size_t, loff_t *); +static int slabinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &slabinfo_op); +} +static struct file_operations proc_slabinfo_operations = { + open: slabinfo_open, + read: seq_read, + write: slabinfo_write, + llseek: seq_lseek, + release: seq_release, +}; + static int kstat_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -521,9 +536,6 @@ {"uptime", uptime_read_proc}, {"meminfo", meminfo_read_proc}, {"version", version_read_proc}, -#ifdef CONFIG_MODULES - {"modules", modules_read_proc}, -#endif {"stat", kstat_read_proc}, {"devices", devices_read_proc}, {"partitions", partitions_read_proc}, @@ -551,7 +563,9 @@ entry->proc_fops = &proc_kmsg_operations; create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); create_seq_entry("interrupts", 0, &proc_interrupts_operations); + create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); #ifdef CONFIG_MODULES + create_seq_entry("modules", 0, &proc_modules_operations); create_seq_entry("ksyms", 0, &proc_ksyms_operations); #endif proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL); @@ -575,8 +589,4 @@ entry->proc_fops = &ppc_htab_operations; } #endif - entry = create_proc_read_entry("slabinfo", S_IWUSR | S_IRUGO, NULL, - slabinfo_read_proc, NULL); - if (entry) - entry->write_proc = slabinfo_write_proc; } diff -urN linux-2.5.4-pre5/fs/proc/proc_tty.c linux/fs/proc/proc_tty.c --- linux-2.5.4-pre5/fs/proc/proc_tty.c Fri Apr 21 15:17:57 2000 +++ linux/fs/proc/proc_tty.c Sun Feb 10 12:27:35 2002 @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/proc/root.c linux/fs/proc/root.c --- linux-2.5.4-pre5/fs/proc/root.c Sun Feb 10 12:27:30 2002 +++ linux/fs/proc/root.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/qnx4/bitmap.c linux/fs/qnx4/bitmap.c --- linux-2.5.4-pre5/fs/qnx4/bitmap.c Mon Jan 21 15:37:32 2002 +++ linux/fs/qnx4/bitmap.c Sun Feb 10 12:27:35 2002 @@ -14,7 +14,8 @@ */ #include -#include +#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/qnx4/file.c linux/fs/qnx4/file.c --- linux-2.5.4-pre5/fs/qnx4/file.c Sun Aug 12 11:13:59 2001 +++ linux/fs/qnx4/file.c Sun Feb 10 12:27:35 2002 @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include /* diff -urN linux-2.5.4-pre5/fs/qnx4/fsync.c linux/fs/qnx4/fsync.c --- linux-2.5.4-pre5/fs/qnx4/fsync.c Mon Jan 21 15:37:32 2002 +++ linux/fs/qnx4/fsync.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/qnx4/namei.c linux/fs/qnx4/namei.c --- linux-2.5.4-pre5/fs/qnx4/namei.c Fri Jan 4 09:42:12 2002 +++ linux/fs/qnx4/namei.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,8 @@ */ #include -#include +#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/readdir.c linux/fs/readdir.c --- linux-2.5.4-pre5/fs/readdir.c Mon Nov 26 16:41:46 2001 +++ linux/fs/readdir.c Sun Feb 10 12:27:35 2002 @@ -4,12 +4,13 @@ * Copyright (C) 1995 Linus Torvalds */ -#include +#include #include #include #include #include #include +#include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/bitmap.c linux/fs/reiserfs/bitmap.c --- linux-2.5.4-pre5/fs/reiserfs/bitmap.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/bitmap.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/buffer2.c linux/fs/reiserfs/buffer2.c --- linux-2.5.4-pre5/fs/reiserfs/buffer2.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/buffer2.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/do_balan.c linux/fs/reiserfs/do_balan.c --- linux-2.5.4-pre5/fs/reiserfs/do_balan.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/do_balan.c Sun Feb 10 12:27:35 2002 @@ -18,7 +18,7 @@ #include #include -#include +#include #include #ifdef CONFIG_REISERFS_CHECK diff -urN linux-2.5.4-pre5/fs/reiserfs/file.c linux/fs/reiserfs/file.c --- linux-2.5.4-pre5/fs/reiserfs/file.c Tue Jan 29 10:47:10 2002 +++ linux/fs/reiserfs/file.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/fix_node.c linux/fs/reiserfs/fix_node.c --- linux-2.5.4-pre5/fs/reiserfs/fix_node.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/fix_node.c Sun Feb 10 12:27:35 2002 @@ -36,7 +36,7 @@ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/ibalance.c linux/fs/reiserfs/ibalance.c --- linux-2.5.4-pre5/fs/reiserfs/ibalance.c Fri Nov 9 14:18:25 2001 +++ linux/fs/reiserfs/ibalance.c Sun Feb 10 12:27:35 2002 @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include /* this is one and only function that is used outside (do_balance.c) */ diff -urN linux-2.5.4-pre5/fs/reiserfs/inode.c linux/fs/reiserfs/inode.c --- linux-2.5.4-pre5/fs/reiserfs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/inode.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/ioctl.c linux/fs/reiserfs/ioctl.c --- linux-2.5.4-pre5/fs/reiserfs/ioctl.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/ioctl.c Sun Feb 10 12:27:35 2002 @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/item_ops.c linux/fs/reiserfs/item_ops.c --- linux-2.5.4-pre5/fs/reiserfs/item_ops.c Fri Oct 12 14:19:28 2001 +++ linux/fs/reiserfs/item_ops.c Sun Feb 10 12:27:35 2002 @@ -2,7 +2,7 @@ * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README */ -#include +#include #include // this contains item handlers for old item types: sd, direct, diff -urN linux-2.5.4-pre5/fs/reiserfs/journal.c linux/fs/reiserfs/journal.c --- linux-2.5.4-pre5/fs/reiserfs/journal.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/journal.c Sun Feb 10 12:27:35 2002 @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/lbalance.c linux/fs/reiserfs/lbalance.c --- linux-2.5.4-pre5/fs/reiserfs/lbalance.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/lbalance.c Sun Feb 10 12:27:35 2002 @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include /* these are used in do_balance.c */ diff -urN linux-2.5.4-pre5/fs/reiserfs/namei.c linux/fs/reiserfs/namei.c --- linux-2.5.4-pre5/fs/reiserfs/namei.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/namei.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/objectid.c linux/fs/reiserfs/objectid.c --- linux-2.5.4-pre5/fs/reiserfs/objectid.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/objectid.c Sun Feb 10 12:27:35 2002 @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/prints.c linux/fs/reiserfs/prints.c --- linux-2.5.4-pre5/fs/reiserfs/prints.c Tue Jan 29 10:47:05 2002 +++ linux/fs/reiserfs/prints.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/procfs.c linux/fs/reiserfs/procfs.c --- linux-2.5.4-pre5/fs/reiserfs/procfs.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/procfs.c Sun Feb 10 12:27:35 2002 @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/stree.c linux/fs/reiserfs/stree.c --- linux-2.5.4-pre5/fs/reiserfs/stree.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/stree.c Sun Feb 10 12:27:35 2002 @@ -54,7 +54,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/super.c linux/fs/reiserfs/super.c --- linux-2.5.4-pre5/fs/reiserfs/super.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/super.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/reiserfs/tail_conversion.c linux/fs/reiserfs/tail_conversion.c --- linux-2.5.4-pre5/fs/reiserfs/tail_conversion.c Sun Feb 10 12:27:30 2002 +++ linux/fs/reiserfs/tail_conversion.c Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/select.c linux/fs/select.c --- linux-2.5.4-pre5/fs/select.c Mon Sep 10 13:04:33 2001 +++ linux/fs/select.c Sun Feb 10 12:27:35 2002 @@ -19,6 +19,7 @@ #include #include /* for STICKY_TIMEOUTS */ #include +#include #include diff -urN linux-2.5.4-pre5/fs/smbfs/cache.c linux/fs/smbfs/cache.c --- linux-2.5.4-pre5/fs/smbfs/cache.c Tue Oct 2 17:03:34 2001 +++ linux/fs/smbfs/cache.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/smbfs/dir.c linux/fs/smbfs/dir.c --- linux-2.5.4-pre5/fs/smbfs/dir.c Mon Jan 28 13:20:34 2002 +++ linux/fs/smbfs/dir.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/smbfs/file.c linux/fs/smbfs/file.c --- linux-2.5.4-pre5/fs/smbfs/file.c Sun Feb 10 12:27:30 2002 +++ linux/fs/smbfs/file.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/smbfs/inode.c linux/fs/smbfs/inode.c --- linux-2.5.4-pre5/fs/smbfs/inode.c Sun Feb 10 12:27:30 2002 +++ linux/fs/smbfs/inode.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/smbfs/ioctl.c linux/fs/smbfs/ioctl.c --- linux-2.5.4-pre5/fs/smbfs/ioctl.c Tue Oct 2 17:03:34 2001 +++ linux/fs/smbfs/ioctl.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/smbfs/sock.c linux/fs/smbfs/sock.c --- linux-2.5.4-pre5/fs/smbfs/sock.c Sun Feb 10 12:27:30 2002 +++ linux/fs/smbfs/sock.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,8 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ -#include +#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/stat.c linux/fs/stat.c --- linux-2.5.4-pre5/fs/stat.c Sun Feb 10 12:27:30 2002 +++ linux/fs/stat.c Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #include #include #include +#include #include diff -urN linux-2.5.4-pre5/fs/udf/symlink.c linux/fs/udf/symlink.c --- linux-2.5.4-pre5/fs/udf/symlink.c Sun Dec 16 12:23:05 2001 +++ linux/fs/udf/symlink.c Sun Feb 10 12:27:35 2002 @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/balloc.c linux/fs/ufs/balloc.c --- linux-2.5.4-pre5/fs/ufs/balloc.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ufs/balloc.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/cylinder.c linux/fs/ufs/cylinder.c --- linux-2.5.4-pre5/fs/ufs/cylinder.c Sun Dec 16 12:23:05 2001 +++ linux/fs/ufs/cylinder.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/dir.c linux/fs/ufs/dir.c --- linux-2.5.4-pre5/fs/ufs/dir.c Sun Dec 16 12:23:05 2001 +++ linux/fs/ufs/dir.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ * on code by Martin von Loewis . */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/file.c linux/fs/ufs/file.c --- linux-2.5.4-pre5/fs/ufs/file.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ufs/file.c Sun Feb 10 12:27:35 2002 @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/ialloc.c linux/fs/ufs/ialloc.c --- linux-2.5.4-pre5/fs/ufs/ialloc.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ufs/ialloc.c Sun Feb 10 12:27:35 2002 @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/inode.c linux/fs/ufs/inode.c --- linux-2.5.4-pre5/fs/ufs/inode.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ufs/inode.c Sun Feb 10 12:27:35 2002 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/namei.c linux/fs/ufs/namei.c --- linux-2.5.4-pre5/fs/ufs/namei.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ufs/namei.c Sun Feb 10 12:27:35 2002 @@ -24,7 +24,7 @@ * David S. Miller (davem@caip.rutgers.edu), 1995 */ -#include +#include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/super.c linux/fs/ufs/super.c --- linux-2.5.4-pre5/fs/ufs/super.c Sun Feb 10 12:27:30 2002 +++ linux/fs/ufs/super.c Sun Feb 10 12:27:35 2002 @@ -74,7 +74,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/ufs/truncate.c linux/fs/ufs/truncate.c --- linux-2.5.4-pre5/fs/ufs/truncate.c Mon Jan 21 15:37:32 2002 +++ linux/fs/ufs/truncate.c Sun Feb 10 12:27:35 2002 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/dir.c linux/fs/umsdos/dir.c --- linux-2.5.4-pre5/fs/umsdos/dir.c Mon Jan 21 15:37:32 2002 +++ linux/fs/umsdos/dir.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ * Extended MS-DOS directory handling functions */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/emd.c linux/fs/umsdos/emd.c --- linux-2.5.4-pre5/fs/umsdos/emd.c Sat Sep 1 10:59:08 2001 +++ linux/fs/umsdos/emd.c Sun Feb 10 12:27:35 2002 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/inode.c linux/fs/umsdos/inode.c --- linux-2.5.4-pre5/fs/umsdos/inode.c Mon Jan 21 15:37:32 2002 +++ linux/fs/umsdos/inode.c Sun Feb 10 12:27:35 2002 @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/ioctl.c linux/fs/umsdos/ioctl.c --- linux-2.5.4-pre5/fs/umsdos/ioctl.c Tue Aug 28 08:16:07 2001 +++ linux/fs/umsdos/ioctl.c Sun Feb 10 12:27:35 2002 @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/namei.c linux/fs/umsdos/namei.c --- linux-2.5.4-pre5/fs/umsdos/namei.c Mon Jan 21 15:37:32 2002 +++ linux/fs/umsdos/namei.c Sun Feb 10 12:27:35 2002 @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/fs/umsdos/rdir.c linux/fs/umsdos/rdir.c --- linux-2.5.4-pre5/fs/umsdos/rdir.c Mon Jan 21 15:37:32 2002 +++ linux/fs/umsdos/rdir.c Sun Feb 10 12:27:35 2002 @@ -7,7 +7,7 @@ * (For directory without EMD file). */ -#include +#include #include #include #include diff -urN linux-2.5.4-pre5/include/asm-i386/hardirq.h linux/include/asm-i386/hardirq.h --- linux-2.5.4-pre5/include/asm-i386/hardirq.h Tue Jan 29 21:41:15 2002 +++ linux/include/asm-i386/hardirq.h Sun Feb 10 12:27:35 2002 @@ -36,6 +36,8 @@ #define synchronize_irq() barrier() +#define release_irqlock(cpu) do { } while (0) + #else #include diff -urN linux-2.5.4-pre5/include/asm-i386/highmem.h linux/include/asm-i386/highmem.h --- linux-2.5.4-pre5/include/asm-i386/highmem.h Tue Jan 29 21:41:15 2002 +++ linux/include/asm-i386/highmem.h Sun Feb 10 12:27:35 2002 @@ -88,6 +88,7 @@ enum fixed_addresses idx; unsigned long vaddr; + preempt_disable(); if (page < highmem_start_page) return page_address(page); @@ -109,8 +110,10 @@ unsigned long vaddr = (unsigned long) kvaddr; enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); - if (vaddr < FIXADDR_START) // FIXME + if (vaddr < FIXADDR_START) { // FIXME + preempt_enable(); return; + } if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx)) BUG(); @@ -122,6 +125,8 @@ pte_clear(kmap_pte-idx); __flush_tlb_one(vaddr); #endif + + preempt_enable(); } #endif /* __KERNEL__ */ diff -urN linux-2.5.4-pre5/include/asm-i386/hw_irq.h linux/include/asm-i386/hw_irq.h --- linux-2.5.4-pre5/include/asm-i386/hw_irq.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/hw_irq.h Sun Feb 10 12:27:35 2002 @@ -96,6 +96,18 @@ #define __STR(x) #x #define STR(x) __STR(x) +#define GET_THREAD_INFO \ + "movl $-8192, %ebx\n\t" \ + "andl %esp, %ebx\n\t" + +#ifdef CONFIG_PREEMPT +#define BUMP_LOCK_COUNT \ + GET_THREAD_INFO \ + "incl 16(%ebx)\n\t" +#else +#define BUMP_LOCK_COUNT +#endif + #define SAVE_ALL \ "cld\n\t" \ "pushl %es\n\t" \ @@ -109,7 +121,8 @@ "pushl %ebx\n\t" \ "movl $" STR(__KERNEL_DS) ",%edx\n\t" \ "movl %edx,%ds\n\t" \ - "movl %edx,%es\n\t" + "movl %edx,%es\n\t" \ + BUMP_LOCK_COUNT #define IRQ_NAME2(nr) nr##_interrupt(void) #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) diff -urN linux-2.5.4-pre5/include/asm-i386/i387.h linux/include/asm-i386/i387.h --- linux-2.5.4-pre5/include/asm-i386/i387.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/i387.h Sun Feb 10 12:27:35 2002 @@ -12,6 +12,7 @@ #define __ASM_I386_I387_H #include +#include #include #include #include @@ -24,7 +25,7 @@ extern void restore_fpu( struct task_struct *tsk ); extern void kernel_fpu_begin(void); -#define kernel_fpu_end() stts() +#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) #define unlazy_fpu( tsk ) do { \ diff -urN linux-2.5.4-pre5/include/asm-i386/io_apic.h linux/include/asm-i386/io_apic.h --- linux-2.5.4-pre5/include/asm-i386/io_apic.h Tue Jan 29 21:41:09 2002 +++ linux/include/asm-i386/io_apic.h Sun Feb 10 12:27:35 2002 @@ -3,6 +3,7 @@ #include #include +#include /* * Intel IO-APIC support for SMP and UP systems. diff -urN linux-2.5.4-pre5/include/asm-i386/pgalloc.h linux/include/asm-i386/pgalloc.h --- linux-2.5.4-pre5/include/asm-i386/pgalloc.h Tue Jan 29 21:41:15 2002 +++ linux/include/asm-i386/pgalloc.h Sun Feb 10 12:27:35 2002 @@ -75,20 +75,26 @@ { unsigned long *ret; + preempt_disable(); if ((ret = pgd_quicklist) != NULL) { pgd_quicklist = (unsigned long *)(*ret); ret[0] = 0; pgtable_cache_size--; - } else + preempt_enable(); + } else { + preempt_enable(); ret = (unsigned long *)get_pgd_slow(); + } return (pgd_t *)ret; } static inline void free_pgd_fast(pgd_t *pgd) { + preempt_disable(); *(unsigned long *)pgd = (unsigned long) pgd_quicklist; pgd_quicklist = (unsigned long *) pgd; pgtable_cache_size++; + preempt_enable(); } static inline void free_pgd_slow(pgd_t *pgd) @@ -119,19 +125,23 @@ { unsigned long *ret; + preempt_disable(); if ((ret = (unsigned long *)pte_quicklist) != NULL) { pte_quicklist = (unsigned long *)(*ret); ret[0] = ret[1]; pgtable_cache_size--; } + preempt_enable(); return (pte_t *)ret; } static inline void pte_free_fast(pte_t *pte) { + preempt_disable(); *(unsigned long *)pte = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pte; pgtable_cache_size++; + preempt_enable(); } static __inline__ void pte_free_slow(pte_t *pte) diff -urN linux-2.5.4-pre5/include/asm-i386/smplock.h linux/include/asm-i386/smplock.h --- linux-2.5.4-pre5/include/asm-i386/smplock.h Tue Jan 29 21:41:25 2002 +++ linux/include/asm-i386/smplock.h Sun Feb 10 12:27:35 2002 @@ -10,7 +10,15 @@ extern spinlock_t kernel_flag; +#ifdef CONFIG_SMP #define kernel_locked() spin_is_locked(&kernel_flag) +#else +#ifdef CONFIG_PREEMPT +#define kernel_locked() preempt_get_count() +#else +#define kernel_locked() 1 +#endif +#endif /* * Release global kernel lock and global interrupt lock @@ -43,6 +51,11 @@ */ static __inline__ void lock_kernel(void) { +#ifdef CONFIG_PREEMPT + if (current->lock_depth == -1) + spin_lock(&kernel_flag); + ++current->lock_depth; +#else #if 1 if (!++current->lock_depth) spin_lock(&kernel_flag); @@ -54,6 +67,7 @@ "\n9:" :"=m" (__dummy_lock(&kernel_flag)), "=m" (current->lock_depth)); +#endif #endif } diff -urN linux-2.5.4-pre5/include/asm-i386/softirq.h linux/include/asm-i386/softirq.h --- linux-2.5.4-pre5/include/asm-i386/softirq.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/softirq.h Sun Feb 10 12:27:35 2002 @@ -5,9 +5,9 @@ #include #define __cpu_bh_enable(cpu) \ - do { barrier(); local_bh_count(cpu)--; } while (0) + do { barrier(); local_bh_count(cpu)--; preempt_enable(); } while (0) #define cpu_bh_disable(cpu) \ - do { local_bh_count(cpu)++; barrier(); } while (0) + do { preempt_disable(); local_bh_count(cpu)++; barrier(); } while (0) #define local_bh_disable() cpu_bh_disable(smp_processor_id()) #define __local_bh_enable() __cpu_bh_enable(smp_processor_id()) @@ -22,7 +22,7 @@ * If you change the offsets in irq_stat then you have to * update this code as well. */ -#define local_bh_enable() \ +#define _local_bh_enable() \ do { \ unsigned int *ptr = &local_bh_count(smp_processor_id()); \ \ @@ -44,5 +44,7 @@ : "r" (ptr), "i" (do_softirq) \ /* no registers clobbered */ ); \ } while (0) + +#define local_bh_enable() do { _local_bh_enable(); preempt_enable(); } while (0) #endif /* __ASM_SOFTIRQ_H */ diff -urN linux-2.5.4-pre5/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h --- linux-2.5.4-pre5/include/asm-i386/spinlock.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/spinlock.h Sun Feb 10 12:27:35 2002 @@ -77,7 +77,7 @@ :"=m" (lock->lock) : : "memory" -static inline void spin_unlock(spinlock_t *lock) +static inline void _raw_spin_unlock(spinlock_t *lock) { #if SPINLOCK_DEBUG if (lock->magic != SPINLOCK_MAGIC) @@ -97,7 +97,7 @@ :"=q" (oldval), "=m" (lock->lock) \ :"0" (oldval) : "memory" -static inline void spin_unlock(spinlock_t *lock) +static inline void _raw_spin_unlock(spinlock_t *lock) { char oldval = 1; #if SPINLOCK_DEBUG @@ -113,7 +113,7 @@ #endif -static inline int spin_trylock(spinlock_t *lock) +static inline int _raw_spin_trylock(spinlock_t *lock) { char oldval; __asm__ __volatile__( @@ -123,7 +123,7 @@ return oldval > 0; } -static inline void spin_lock(spinlock_t *lock) +static inline void _raw_spin_lock(spinlock_t *lock) { #if SPINLOCK_DEBUG __label__ here; @@ -179,7 +179,7 @@ */ /* the spinlock helpers are in arch/i386/kernel/semaphore.c */ -static inline void read_lock(rwlock_t *rw) +static inline void _raw_read_lock(rwlock_t *rw) { #if SPINLOCK_DEBUG if (rw->magic != RWLOCK_MAGIC) @@ -188,7 +188,7 @@ __build_read_lock(rw, "__read_lock_failed"); } -static inline void write_lock(rwlock_t *rw) +static inline void _raw_write_lock(rwlock_t *rw) { #if SPINLOCK_DEBUG if (rw->magic != RWLOCK_MAGIC) @@ -197,10 +197,10 @@ __build_write_lock(rw, "__write_lock_failed"); } -#define read_unlock(rw) asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory") -#define write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory") +#define _raw_read_unlock(rw) asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory") +#define _raw_write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory") -static inline int write_trylock(rwlock_t *lock) +static inline int _raw_write_trylock(rwlock_t *lock) { atomic_t *count = (atomic_t *)lock; if (atomic_sub_and_test(RW_LOCK_BIAS, count)) diff -urN linux-2.5.4-pre5/include/asm-i386/thread_info.h linux/include/asm-i386/thread_info.h --- linux-2.5.4-pre5/include/asm-i386/thread_info.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/thread_info.h Sun Feb 10 12:27:35 2002 @@ -25,6 +25,7 @@ struct exec_domain *exec_domain; /* execution domain */ __u32 flags; /* low level flags */ __u32 cpu; /* current CPU */ + __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ mm_segment_t addr_limit; /* thread address space: 0-0xBFFFFFFF for user-thead @@ -41,7 +42,8 @@ #define TI_EXEC_DOMAIN 0x00000004 #define TI_FLAGS 0x00000008 #define TI_CPU 0x0000000C -#define TI_ADDR_LIMIT 0x00000010 +#define TI_PRE_COUNT 0x00000010 +#define TI_ADDR_LIMIT 0x00000014 #endif diff -urN linux-2.5.4-pre5/include/asm-i386/uaccess.h linux/include/asm-i386/uaccess.h --- linux-2.5.4-pre5/include/asm-i386/uaccess.h Sun Feb 10 12:27:30 2002 +++ linux/include/asm-i386/uaccess.h Sun Feb 10 12:27:35 2002 @@ -5,6 +5,7 @@ * User space memory access functions */ #include +#include #include #include #include diff -urN linux-2.5.4-pre5/include/linux/affs_fs_i.h linux/include/linux/affs_fs_i.h --- linux-2.5.4-pre5/include/linux/affs_fs_i.h Mon Jan 21 15:37:32 2002 +++ linux/include/linux/affs_fs_i.h Sun Feb 10 12:27:35 2002 @@ -2,6 +2,8 @@ #define _AFFS_FS_I #include +#include +#include #define AFFS_CACHE_SIZE PAGE_SIZE //#define AFFS_CACHE_SIZE (4*4) diff -urN linux-2.5.4-pre5/include/linux/ax25.h linux/include/linux/ax25.h --- linux-2.5.4-pre5/include/linux/ax25.h Tue Feb 15 17:17:55 2000 +++ linux/include/linux/ax25.h Sun Feb 10 12:27:35 2002 @@ -6,6 +6,8 @@ #ifndef AX25_KERNEL_H #define AX25_KERNEL_H +#include + #define AX25_MTU 256 #define AX25_MAX_DIGIS 8 diff -urN linux-2.5.4-pre5/include/linux/bfs_fs_i.h linux/include/linux/bfs_fs_i.h --- linux-2.5.4-pre5/include/linux/bfs_fs_i.h Mon Jan 28 13:20:44 2002 +++ linux/include/linux/bfs_fs_i.h Sun Feb 10 12:27:35 2002 @@ -6,6 +6,8 @@ #ifndef _LINUX_BFS_FS_I #define _LINUX_BFS_FS_I +#include + /* * BFS file system in-core inode info */ diff -urN linux-2.5.4-pre5/include/linux/brlock.h linux/include/linux/brlock.h --- linux-2.5.4-pre5/include/linux/brlock.h Tue Jan 29 21:41:10 2002 +++ linux/include/linux/brlock.h Sun Feb 10 12:27:35 2002 @@ -171,11 +171,11 @@ } #else -# define br_read_lock(idx) ((void)(idx)) -# define br_read_unlock(idx) ((void)(idx)) -# define br_write_lock(idx) ((void)(idx)) -# define br_write_unlock(idx) ((void)(idx)) -#endif +# define br_read_lock(idx) ({ (void)(idx); preempt_disable(); }) +# define br_read_unlock(idx) ({ (void)(idx); preempt_enable(); }) +# define br_write_lock(idx) ({ (void)(idx); preempt_disable(); }) +# define br_write_unlock(idx) ({ (void)(idx); preempt_enable(); }) +#endif /* CONFIG_SMP */ /* * Now enumerate all of the possible sw/hw IRQ protected diff -urN linux-2.5.4-pre5/include/linux/capability.h linux/include/linux/capability.h --- linux-2.5.4-pre5/include/linux/capability.h Tue Jan 29 21:41:12 2002 +++ linux/include/linux/capability.h Sun Feb 10 12:27:35 2002 @@ -14,7 +14,6 @@ #define _LINUX_CAPABILITY_H #include -#include /* User-level do most of the mapping between kernel and user capabilities based on the version tag given by the kernel. The diff -urN linux-2.5.4-pre5/include/linux/efs_fs.h linux/include/linux/efs_fs.h --- linux-2.5.4-pre5/include/linux/efs_fs.h Sun Feb 10 12:27:30 2002 +++ linux/include/linux/efs_fs.h Sun Feb 10 12:27:35 2002 @@ -27,6 +27,7 @@ #define EFS_BLOCKSIZE_BITS 9 #define EFS_BLOCKSIZE (1 << EFS_BLOCKSIZE_BITS) +#include #include #include diff -urN linux-2.5.4-pre5/include/linux/err.h linux/include/linux/err.h --- linux-2.5.4-pre5/include/linux/err.h Wed Dec 31 16:00:00 1969 +++ linux/include/linux/err.h Sun Feb 10 12:27:35 2002 @@ -0,0 +1,29 @@ +#ifndef _LINUX_ERR_H +#define _LINUX_ERR_H + +#include + +/* + * Kernel pointers have redundant information, so we can use a + * scheme where we can return either an error code or a dentry + * pointer with the same return value. + * + * This should be a per-architecture thing, to allow different + * error and pointer decisions. + */ +static inline void *ERR_PTR(long error) +{ + return (void *) error; +} + +static inline long PTR_ERR(const void *ptr) +{ + return (long) ptr; +} + +static inline long IS_ERR(const void *ptr) +{ + return (unsigned long)ptr > (unsigned long)-1000L; +} + +#endif /* _LINUX_ERR_H */ diff -urN linux-2.5.4-pre5/include/linux/file.h linux/include/linux/file.h --- linux-2.5.4-pre5/include/linux/file.h Tue Jan 29 21:41:09 2002 +++ linux/include/linux/file.h Sun Feb 10 12:27:35 2002 @@ -8,6 +8,7 @@ #include #include #include +#include /* * The default fd array needs to be at least BITS_PER_LONG, diff -urN linux-2.5.4-pre5/include/linux/fs.h linux/include/linux/fs.h --- linux-2.5.4-pre5/include/linux/fs.h Sun Feb 10 12:27:30 2002 +++ linux/include/linux/fs.h Sun Feb 10 12:27:35 2002 @@ -1257,28 +1257,7 @@ extern int is_subdir(struct dentry *, struct dentry *); extern ino_t find_inode_number(struct dentry *, struct qstr *); -/* - * Kernel pointers have redundant information, so we can use a - * scheme where we can return either an error code or a dentry - * pointer with the same return value. - * - * This should be a per-architecture thing, to allow different - * error and pointer decisions. - */ -static inline void *ERR_PTR(long error) -{ - return (void *) error; -} - -static inline long PTR_ERR(const void *ptr) -{ - return (long) ptr; -} - -static inline long IS_ERR(const void *ptr) -{ - return (unsigned long)ptr > (unsigned long)-1000L; -} +#include /* * The bitmask for a lookup event: diff -urN linux-2.5.4-pre5/include/linux/fs_struct.h linux/include/linux/fs_struct.h --- linux-2.5.4-pre5/include/linux/fs_struct.h Fri Jul 13 15:10:44 2001 +++ linux/include/linux/fs_struct.h Sun Feb 10 12:27:35 2002 @@ -2,6 +2,9 @@ #define _LINUX_FS_STRUCT_H #ifdef __KERNEL__ +#include +#include + struct fs_struct { atomic_t count; rwlock_t lock; diff -urN linux-2.5.4-pre5/include/linux/highmem.h linux/include/linux/highmem.h --- linux-2.5.4-pre5/include/linux/highmem.h Tue Jan 29 21:41:43 2002 +++ linux/include/linux/highmem.h Sun Feb 10 12:27:35 2002 @@ -3,6 +3,7 @@ #include #include +#include #include #ifdef CONFIG_HIGHMEM diff -urN linux-2.5.4-pre5/include/linux/in.h linux/include/linux/in.h --- linux-2.5.4-pre5/include/linux/in.h Tue Jan 29 21:41:09 2002 +++ linux/include/linux/in.h Sun Feb 10 12:27:35 2002 @@ -19,6 +19,7 @@ #define _LINUX_IN_H #include +#include /* Standard well-defined IP protocols. */ enum { diff -urN linux-2.5.4-pre5/include/linux/inet.h linux/include/linux/inet.h --- linux-2.5.4-pre5/include/linux/inet.h Mon Oct 2 14:14:29 2000 +++ linux/include/linux/inet.h Sun Feb 10 12:27:35 2002 @@ -44,6 +44,8 @@ #ifdef __KERNEL__ +#include + extern void inet_proto_init(struct net_proto *pro); extern char *in_ntoa(__u32 in); extern __u32 in_aton(const char *str); diff -urN linux-2.5.4-pre5/include/linux/iso_fs_i.h linux/include/linux/iso_fs_i.h --- linux-2.5.4-pre5/include/linux/iso_fs_i.h Mon Jan 28 13:20:44 2002 +++ linux/include/linux/iso_fs_i.h Sun Feb 10 12:27:35 2002 @@ -1,6 +1,8 @@ #ifndef _ISO_FS_I #define _ISO_FS_I +#include + enum isofs_file_format { isofs_file_normal = 0, isofs_file_sparse = 1, diff -urN linux-2.5.4-pre5/include/linux/lp.h linux/include/linux/lp.h --- linux-2.5.4-pre5/include/linux/lp.h Thu Oct 25 00:07:39 2001 +++ linux/include/linux/lp.h Sun Feb 10 12:27:35 2002 @@ -98,6 +98,9 @@ #ifdef __KERNEL__ +#include +#include + /* Magic numbers for defining port-device mappings */ #define LP_PARPORT_UNSPEC -4 #define LP_PARPORT_AUTO -3 diff -urN linux-2.5.4-pre5/include/linux/mm.h linux/include/linux/mm.h --- linux-2.5.4-pre5/include/linux/mm.h Tue Jan 29 21:41:15 2002 +++ linux/include/linux/mm.h Sun Feb 10 12:27:35 2002 @@ -13,6 +13,7 @@ #include #include #include +#include extern unsigned long max_mapnr; extern unsigned long num_physpages; diff -urN linux-2.5.4-pre5/include/linux/msdos_fs_i.h linux/include/linux/msdos_fs_i.h --- linux-2.5.4-pre5/include/linux/msdos_fs_i.h Mon Jan 28 13:20:44 2002 +++ linux/include/linux/msdos_fs_i.h Sun Feb 10 12:27:35 2002 @@ -1,6 +1,8 @@ #ifndef _MSDOS_FS_I #define _MSDOS_FS_I +#include + /* * MS-DOS file system inode data in memory */ diff -urN linux-2.5.4-pre5/include/linux/namespace.h linux/include/linux/namespace.h --- linux-2.5.4-pre5/include/linux/namespace.h Tue Dec 25 15:39:20 2001 +++ linux/include/linux/namespace.h Sun Feb 10 12:27:35 2002 @@ -9,6 +9,8 @@ struct rw_semaphore sem; }; +void umount_tree(struct vfsmount *mnt); + static inline void put_namespace(struct namespace *namespace) { if (atomic_dec_and_test(&namespace->count)) { diff -urN linux-2.5.4-pre5/include/linux/quotaops.h linux/include/linux/quotaops.h --- linux-2.5.4-pre5/include/linux/quotaops.h Tue Jan 29 21:41:28 2002 +++ linux/include/linux/quotaops.h Sun Feb 10 12:27:35 2002 @@ -13,9 +13,9 @@ #include #include -#if defined(CONFIG_QUOTA) - #include + +#if defined(CONFIG_QUOTA) /* * declaration of quota_function calls in kernel. diff -urN linux-2.5.4-pre5/include/linux/sched.h linux/include/linux/sched.h --- linux-2.5.4-pre5/include/linux/sched.h Sun Feb 10 12:27:30 2002 +++ linux/include/linux/sched.h Sun Feb 10 12:27:35 2002 @@ -6,7 +6,8 @@ extern unsigned long event; #include -#include +#include +#include #include #include #include @@ -91,6 +92,7 @@ #define TASK_UNINTERRUPTIBLE 2 #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 +#define PREEMPT_ACTIVE 0x4000000 #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) @@ -508,14 +510,11 @@ extern unsigned long volatile jiffies; extern unsigned long itimer_ticks; extern unsigned long itimer_next; -extern struct timeval xtime; extern void do_timer(struct pt_regs *); extern unsigned int * prof_buffer; extern unsigned long prof_len; extern unsigned long prof_shift; - -#define CURRENT_TIME (xtime.tv_sec) extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr)); extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr)); diff -urN linux-2.5.4-pre5/include/linux/shmem_fs.h linux/include/linux/shmem_fs.h --- linux-2.5.4-pre5/include/linux/shmem_fs.h Mon Jan 21 15:37:32 2002 +++ linux/include/linux/shmem_fs.h Sun Feb 10 12:27:35 2002 @@ -1,21 +1,11 @@ #ifndef __SHMEM_FS_H #define __SHMEM_FS_H +#include + /* inode in-kernel data */ #define SHMEM_NR_DIRECT 16 - -/* - * A swap entry has to fit into a "unsigned long", as - * the entry is hidden in the "index" field of the - * swapper address space. - * - * We have to move it here, since not every user of fs.h is including - * mm.h, but mm.h is including fs.h via sched .h :-/ - */ -typedef struct { - unsigned long val; -} swp_entry_t; extern atomic_t shmem_nrpages; diff -urN linux-2.5.4-pre5/include/linux/skbuff.h linux/include/linux/skbuff.h --- linux-2.5.4-pre5/include/linux/skbuff.h Tue Jan 29 21:41:44 2002 +++ linux/include/linux/skbuff.h Sun Feb 10 12:27:35 2002 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #define HAVE_ALLOC_SKB /* For the drivers to know */ #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ diff -urN linux-2.5.4-pre5/include/linux/slab.h linux/include/linux/slab.h --- linux-2.5.4-pre5/include/linux/slab.h Tue Jan 29 21:41:12 2002 +++ linux/include/linux/slab.h Sun Feb 10 12:27:35 2002 @@ -62,11 +62,6 @@ extern void kfree(const void *); extern int FASTCALL(kmem_cache_reap(int)); -extern int slabinfo_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data); -struct file; -extern int slabinfo_write_proc(struct file *file, const char *buffer, - unsigned long count, void *data); /* System wide caches */ extern kmem_cache_t *vm_area_cachep; diff -urN linux-2.5.4-pre5/include/linux/smb.h linux/include/linux/smb.h --- linux-2.5.4-pre5/include/linux/smb.h Tue Jan 29 21:41:09 2002 +++ linux/include/linux/smb.h Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #define _LINUX_SMB_H #include +#include enum smb_protocol { SMB_PROTOCOL_NONE, diff -urN linux-2.5.4-pre5/include/linux/smb_fs_i.h linux/include/linux/smb_fs_i.h --- linux-2.5.4-pre5/include/linux/smb_fs_i.h Mon Jan 28 13:20:34 2002 +++ linux/include/linux/smb_fs_i.h Sun Feb 10 12:27:35 2002 @@ -11,6 +11,7 @@ #ifdef __KERNEL__ #include +#include /* * smb fs inode data (in memory only) diff -urN linux-2.5.4-pre5/include/linux/smp.h linux/include/linux/smp.h --- linux-2.5.4-pre5/include/linux/smp.h Tue Jan 29 21:41:12 2002 +++ linux/include/linux/smp.h Sun Feb 10 12:27:35 2002 @@ -81,7 +81,9 @@ #define smp_processor_id() 0 #define hard_smp_processor_id() 0 #define smp_threads_ready 1 +#ifndef CONFIG_PREEMPT #define kernel_lock() +#endif #define cpu_logical_map(cpu) 0 #define cpu_number_map(cpu) 0 #define smp_call_function(func,info,retry,wait) ({ 0; }) diff -urN linux-2.5.4-pre5/include/linux/smp_lock.h linux/include/linux/smp_lock.h --- linux-2.5.4-pre5/include/linux/smp_lock.h Tue Jan 29 21:41:25 2002 +++ linux/include/linux/smp_lock.h Sun Feb 10 12:27:35 2002 @@ -3,7 +3,7 @@ #include -#ifndef CONFIG_SMP +#if !defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT) #define lock_kernel() do { } while(0) #define unlock_kernel() do { } while(0) diff -urN linux-2.5.4-pre5/include/linux/sound.h linux/include/linux/sound.h --- linux-2.5.4-pre5/include/linux/sound.h Sat Aug 12 19:51:52 2000 +++ linux/include/linux/sound.h Sun Feb 10 12:27:35 2002 @@ -3,6 +3,8 @@ * Minor numbers for the sound driver. */ +#include + #define SND_DEV_CTL 0 /* Control port /dev/mixer */ #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM synthesizer and MIDI output) */ diff -urN linux-2.5.4-pre5/include/linux/spinlock.h linux/include/linux/spinlock.h --- linux-2.5.4-pre5/include/linux/spinlock.h Sun Feb 10 12:27:30 2002 +++ linux/include/linux/spinlock.h Sun Feb 10 12:27:35 2002 @@ -2,6 +2,10 @@ #define __LINUX_SPINLOCK_H #include +#include +#include +#include +#include /* * These are the generic versions of the spinlocks and read-write @@ -62,8 +66,10 @@ #if (DEBUG_SPINLOCKS < 1) +#ifndef CONFIG_PREEMPT #define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic) #define ATOMIC_DEC_AND_LOCK +#endif /* * Your basic spinlocks, allowing only a single CPU anywhere @@ -79,11 +85,11 @@ #endif #define spin_lock_init(lock) do { } while(0) -#define spin_lock(lock) (void)(lock) /* Not "unused variable". */ +#define _raw_spin_lock(lock) (void)(lock) /* Not "unused variable". */ #define spin_is_locked(lock) (0) -#define spin_trylock(lock) ({1; }) +#define _raw_spin_trylock(lock) ({1; }) #define spin_unlock_wait(lock) do { } while(0) -#define spin_unlock(lock) do { } while(0) +#define _raw_spin_unlock(lock) do { } while(0) #elif (DEBUG_SPINLOCKS < 2) @@ -142,12 +148,78 @@ #endif #define rwlock_init(lock) do { } while(0) -#define read_lock(lock) (void)(lock) /* Not "unused variable". */ -#define read_unlock(lock) do { } while(0) -#define write_lock(lock) (void)(lock) /* Not "unused variable". */ -#define write_unlock(lock) do { } while(0) +#define _raw_read_lock(lock) (void)(lock) /* Not "unused variable". */ +#define _raw_read_unlock(lock) do { } while(0) +#define _raw_write_lock(lock) (void)(lock) /* Not "unused variable". */ +#define _raw_write_unlock(lock) do { } while(0) #endif /* !SMP */ + +#ifdef CONFIG_PREEMPT + +asmlinkage void preempt_schedule(void); + +#define preempt_get_count() (current_thread_info()->preempt_count) + +#define preempt_disable() \ +do { \ + ++current_thread_info()->preempt_count; \ + barrier(); \ +} while (0) + +#define preempt_enable_no_resched() \ +do { \ + --current_thread_info()->preempt_count; \ + barrier(); \ +} while (0) + +#define preempt_enable() \ +do { \ + --current_thread_info()->preempt_count; \ + barrier(); \ + if (unlikely(!(current_thread_info()->preempt_count) && \ + test_thread_flag(TIF_NEED_RESCHED))) \ + preempt_schedule(); \ +} while (0) + +#define spin_lock(lock) \ +do { \ + preempt_disable(); \ + _raw_spin_lock(lock); \ +} while(0) + +#define spin_trylock(lock) ({preempt_disable(); _raw_spin_trylock(lock) ? \ + 1 : ({preempt_enable(); 0;});}) +#define spin_unlock(lock) \ +do { \ + _raw_spin_unlock(lock); \ + preempt_enable(); \ +} while (0) + +#define read_lock(lock) ({preempt_disable(); _raw_read_lock(lock);}) +#define read_unlock(lock) ({_raw_read_unlock(lock); preempt_enable();}) +#define write_lock(lock) ({preempt_disable(); _raw_write_lock(lock);}) +#define write_unlock(lock) ({_raw_write_unlock(lock); preempt_enable();}) +#define write_trylock(lock) ({preempt_disable();_raw_write_trylock(lock) ? \ + 1 : ({preempt_enable(); 0;});}) + +#else + +#define preempt_get_count() do { } while (0) +#define preempt_disable() do { } while (0) +#define preempt_enable_no_resched() do {} while(0) +#define preempt_enable() do { } while (0) + +#define spin_lock(lock) _raw_spin_lock(lock) +#define spin_trylock(lock) _raw_spin_trylock(lock) +#define spin_unlock(lock) _raw_spin_unlock(lock) + +#define read_lock(lock) _raw_read_lock(lock) +#define read_unlock(lock) _raw_read_unlock(lock) +#define write_lock(lock) _raw_write_lock(lock) +#define write_unlock(lock) _raw_write_unlock(lock) +#define write_trylock(lock) _raw_write_trylock(lock) +#endif /* "lock on reference count zero" */ #ifndef ATOMIC_DEC_AND_LOCK diff -urN linux-2.5.4-pre5/include/linux/sunrpc/svc.h linux/include/linux/sunrpc/svc.h --- linux-2.5.4-pre5/include/linux/sunrpc/svc.h Tue Jan 29 21:42:01 2002 +++ linux/include/linux/sunrpc/svc.h Sun Feb 10 12:27:35 2002 @@ -14,6 +14,7 @@ #include #include #include +#include /* * RPC service. diff -urN linux-2.5.4-pre5/include/linux/sunrpc/xdr.h linux/include/linux/sunrpc/xdr.h --- linux-2.5.4-pre5/include/linux/sunrpc/xdr.h Tue Jan 29 21:42:01 2002 +++ linux/include/linux/sunrpc/xdr.h Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #ifdef __KERNEL__ #include +#include /* * Buffer adjustment diff -urN linux-2.5.4-pre5/include/linux/swap.h linux/include/linux/swap.h --- linux-2.5.4-pre5/include/linux/swap.h Sun Feb 10 12:27:30 2002 +++ linux/include/linux/swap.h Sun Feb 10 12:27:35 2002 @@ -2,6 +2,9 @@ #define _LINUX_SWAP_H #include +#include +#include +#include #include #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ @@ -38,6 +41,14 @@ unsigned int badpages[1]; } info; }; + + /* A swap entry has to fit into a "unsigned long", as + * the entry is hidden in the "index" field of the + * swapper address space. + */ +typedef struct { + unsigned long val; +} swp_entry_t; #ifdef __KERNEL__ diff -urN linux-2.5.4-pre5/include/linux/time.h linux/include/linux/time.h --- linux-2.5.4-pre5/include/linux/time.h Tue Jan 29 21:41:09 2002 +++ linux/include/linux/time.h Sun Feb 10 12:27:35 2002 @@ -82,6 +82,10 @@ )*60 + sec; /* finally seconds */ } +extern struct timeval xtime; + +#define CURRENT_TIME (xtime.tv_sec) + #endif /* __KERNEL__ */ diff -urN linux-2.5.4-pre5/include/linux/timex.h linux/include/linux/timex.h --- linux-2.5.4-pre5/include/linux/timex.h Tue Jan 29 21:41:09 2002 +++ linux/include/linux/timex.h Sun Feb 10 12:27:35 2002 @@ -51,6 +51,7 @@ #ifndef _LINUX_TIMEX_H #define _LINUX_TIMEX_H +#include #include /* diff -urN linux-2.5.4-pre5/include/linux/vmalloc.h linux/include/linux/vmalloc.h --- linux-2.5.4-pre5/include/linux/vmalloc.h Tue Jan 29 21:41:15 2002 +++ linux/include/linux/vmalloc.h Sun Feb 10 12:27:35 2002 @@ -1,7 +1,6 @@ #ifndef __LINUX_VMALLOC_H #define __LINUX_VMALLOC_H -#include #include #include diff -urN linux-2.5.4-pre5/include/net/neighbour.h linux/include/net/neighbour.h --- linux-2.5.4-pre5/include/net/neighbour.h Tue Jan 29 21:41:50 2002 +++ linux/include/net/neighbour.h Sun Feb 10 12:27:35 2002 @@ -46,6 +46,8 @@ #include #include +#include + #define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE) #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY) #define NUD_CONNECTED (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE) diff -urN linux-2.5.4-pre5/include/net/scm.h linux/include/net/scm.h --- linux-2.5.4-pre5/include/net/scm.h Fri Feb 16 16:02:37 2001 +++ linux/include/net/scm.h Sun Feb 10 12:27:35 2002 @@ -1,6 +1,8 @@ #ifndef __LINUX_NET_SCM_H #define __LINUX_NET_SCM_H +#include + /* Well, we should have at least one descriptor open * to accept passed FDs 8) */ diff -urN linux-2.5.4-pre5/include/net/sock.h linux/include/net/sock.h --- linux-2.5.4-pre5/include/net/sock.h Sun Feb 10 12:27:30 2002 +++ linux/include/net/sock.h Sun Feb 10 12:27:35 2002 @@ -106,6 +106,8 @@ #include #include +#include /* just for inode - yeuch.*/ + /* The AF_UNIX specific socket options */ struct unix_opt { diff -urN linux-2.5.4-pre5/kernel/exit.c linux/kernel/exit.c --- linux-2.5.4-pre5/kernel/exit.c Sun Feb 10 12:27:30 2002 +++ linux/kernel/exit.c Sun Feb 10 12:27:35 2002 @@ -18,6 +18,7 @@ #include #endif #include +#include #include #include @@ -390,8 +391,8 @@ /* more a memory barrier than a real lock */ task_lock(tsk); tsk->mm = NULL; - task_unlock(tsk); enter_lazy_tlb(mm, current, smp_processor_id()); + task_unlock(tsk); mmput(mm); } } diff -urN linux-2.5.4-pre5/kernel/fork.c linux/kernel/fork.c --- linux-2.5.4-pre5/kernel/fork.c Sun Feb 10 12:27:30 2002 +++ linux/kernel/fork.c Sun Feb 10 12:27:35 2002 @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -650,6 +652,13 @@ if (p->binfmt && p->binfmt->module) __MOD_INC_USE_COUNT(p->binfmt->module); +#ifdef CONFIG_PREEMPT + /* + * schedule_tail drops this_rq()->lock so we compensate with a count + * of 1. Also, we want to start with kernel preemption disabled. + */ + p->thread_info->preempt_count = 1; +#endif p->did_exec = 0; p->swappable = 0; p->state = TASK_UNINTERRUPTIBLE; diff -urN linux-2.5.4-pre5/kernel/ksyms.c linux/kernel/ksyms.c --- linux-2.5.4-pre5/kernel/ksyms.c Sun Feb 10 12:27:30 2002 +++ linux/kernel/ksyms.c Sun Feb 10 12:27:35 2002 @@ -47,6 +47,7 @@ #include #include #include +#include #include #if defined(CONFIG_PROC_FS) @@ -445,6 +446,9 @@ EXPORT_SYMBOL(interruptible_sleep_on); EXPORT_SYMBOL(interruptible_sleep_on_timeout); EXPORT_SYMBOL(schedule); +#ifdef CONFIG_PREEMPT +EXPORT_SYMBOL(preempt_schedule); +#endif EXPORT_SYMBOL(schedule_timeout); EXPORT_SYMBOL(sys_sched_yield); EXPORT_SYMBOL(set_user_nice); diff -urN linux-2.5.4-pre5/kernel/module.c linux/kernel/module.c --- linux-2.5.4-pre5/kernel/module.c Sun Nov 11 11:23:14 2001 +++ linux/kernel/module.c Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #include #include #include +#include /* * Originally by Anonymous (as far as I know...) @@ -1074,84 +1075,67 @@ /* * Called by the /proc file system to return a current list of modules. */ - -int get_module_list(char *p) +static void *m_start(struct seq_file *m, loff_t *pos) { - size_t left = PAGE_SIZE; - struct module *mod; - char tmpstr[64]; - struct module_ref *ref; - - for (mod = module_list; mod != &kernel_module; mod = mod->next) { - long len; - const char *q; - -#define safe_copy_str(str, len) \ - do { \ - if (left < len) \ - goto fini; \ - memcpy(p, str, len); p += len, left -= len; \ - } while (0) -#define safe_copy_cstr(str) safe_copy_str(str, sizeof(str)-1) - - len = strlen(mod->name); - safe_copy_str(mod->name, len); - - if ((len = 20 - len) > 0) { - if (left < len) - goto fini; - memset(p, ' ', len); - p += len; - left -= len; - } - - len = sprintf(tmpstr, "%8lu", mod->size); - safe_copy_str(tmpstr, len); - - if (mod->flags & MOD_RUNNING) { - len = sprintf(tmpstr, "%4ld", - (mod_member_present(mod, can_unload) - && mod->can_unload - ? -1L : (long)atomic_read(&mod->uc.usecount))); - safe_copy_str(tmpstr, len); - } - - if (mod->flags & MOD_DELETED) - safe_copy_cstr(" (deleted)"); - else if (mod->flags & MOD_RUNNING) { - if (mod->flags & MOD_AUTOCLEAN) - safe_copy_cstr(" (autoclean)"); - if (!(mod->flags & MOD_USED_ONCE)) - safe_copy_cstr(" (unused)"); - } - else if (mod->flags & MOD_INITIALIZING) - safe_copy_cstr(" (initializing)"); - else - safe_copy_cstr(" (uninitialized)"); - - if ((ref = mod->refs) != NULL) { - safe_copy_cstr(" ["); - while (1) { - q = ref->ref->name; - len = strlen(q); - safe_copy_str(q, len); - - if ((ref = ref->next_ref) != NULL) - safe_copy_cstr(" "); - else - break; - } - safe_copy_cstr("]"); - } - safe_copy_cstr("\n"); + struct module *v; + loff_t n = *pos; + lock_kernel(); + for (v = module_list; v && n--; v = v->next) + ; + return v; +} +static void *m_next(struct seq_file *m, void *p, loff_t *pos) +{ + struct module *v = p; + (*pos)++; + return v->next; +} +static void m_stop(struct seq_file *m, void *p) +{ + unlock_kernel(); +} +static int m_show(struct seq_file *m, void *p) +{ + struct module *mod = p; + struct module_ref *ref = mod->refs; -#undef safe_copy_str -#undef safe_copy_cstr - } + if (mod == &kernel_module) + return 0; -fini: - return PAGE_SIZE - left; -} + seq_printf(m, "%-20s%8lu", mod->name, mod->size); + if (mod->flags & MOD_RUNNING) + seq_printf(m, "%4ld", + (mod_member_present(mod, can_unload) + && mod->can_unload + ? -1L : (long)atomic_read(&mod->uc.usecount))); + + if (mod->flags & MOD_DELETED) + seq_puts(m, " (deleted)"); + else if (mod->flags & MOD_RUNNING) { + if (mod->flags & MOD_AUTOCLEAN) + seq_puts(m, " (autoclean)"); + if (!(mod->flags & MOD_USED_ONCE)) + seq_puts(m, " (unused)"); + } else if (mod->flags & MOD_INITIALIZING) + seq_puts(m, " (initializing)"); + else + seq_puts(m, " (uninitialized)"); + if (ref) { + char c; + seq_putc(m, ' '); + for (c = '[' ; ref; c = ' ', ref = ref->next_ref) + seq_printf(m, "%c%s", c, ref->ref->name); + seq_putc(m, ']'); + } + seq_putc(m, '\n'); + return 0; +} +struct seq_operations modules_op = { + start: m_start, + next: m_next, + stop: m_stop, + show: m_show +}; /* * Called by the /proc file system to return a current list of ksyms. diff -urN linux-2.5.4-pre5/kernel/sched.c linux/kernel/sched.c --- linux-2.5.4-pre5/kernel/sched.c Sun Feb 10 12:27:30 2002 +++ linux/kernel/sched.c Sun Feb 10 12:27:35 2002 @@ -18,6 +18,7 @@ #include #include #include +#include #include #define BITMAP_SIZE ((((MAX_PRIO+7)/8)+sizeof(long)-1)/sizeof(long)) @@ -61,10 +62,12 @@ struct runqueue *__rq; repeat_lock_task: + preempt_disable(); __rq = task_rq(p); spin_lock_irqsave(&__rq->lock, *flags); if (unlikely(__rq != task_rq(p))) { spin_unlock_irqrestore(&__rq->lock, *flags); + preempt_enable(); goto repeat_lock_task; } return __rq; @@ -73,6 +76,7 @@ static inline void unlock_task_rq(runqueue_t *rq, unsigned long *flags) { spin_unlock_irqrestore(&rq->lock, *flags); + preempt_enable(); } /* * Adding/removing a task to/from a priority array: @@ -195,6 +199,7 @@ #ifdef CONFIG_SMP int need_resched, nrpolling; + preempt_disable(); /* minimise the chance of sending an interrupt to poll_idle() */ nrpolling = test_tsk_thread_flag(p,TIF_POLLING_NRFLAG); need_resched = test_and_set_tsk_thread_flag(p,TIF_NEED_RESCHED); @@ -202,6 +207,7 @@ if (!need_resched && !nrpolling && (p->thread_info->cpu != smp_processor_id())) smp_send_reschedule(p->thread_info->cpu); + preempt_enable(); #else set_tsk_need_resched(p); #endif @@ -219,6 +225,7 @@ runqueue_t *rq; repeat: + preempt_disable(); rq = task_rq(p); while (unlikely(rq->curr == p)) { cpu_relax(); @@ -227,9 +234,11 @@ rq = lock_task_rq(p, &flags); if (unlikely(rq->curr == p)) { unlock_task_rq(rq, &flags); + preempt_enable(); goto repeat; } unlock_task_rq(rq, &flags); + preempt_enable(); } /* @@ -295,7 +304,10 @@ void wake_up_forked_process(task_t * p) { - runqueue_t *rq = this_rq(); + runqueue_t *rq; + + preempt_disable(); + rq = this_rq(); p->state = TASK_RUNNING; if (!rt_task(p)) { @@ -308,6 +320,7 @@ p->thread_info->cpu = smp_processor_id(); activate_task(p, rq); spin_unlock_irq(&rq->lock); + preempt_enable(); } asmlinkage void schedule_tail(task_t *prev) @@ -635,17 +648,31 @@ */ asmlinkage void schedule(void) { - task_t *prev = current, *next; - runqueue_t *rq = this_rq(); + task_t *prev, *next; + runqueue_t *rq; prio_array_t *array; list_t *queue; int idx; if (unlikely(in_interrupt())) BUG(); + + preempt_disable(); + prev = current; + rq = this_rq(); + release_kernel_lock(prev, smp_processor_id()); spin_lock_irq(&rq->lock); +#ifdef CONFIG_PREEMPT + /* + * if entering from preempt_schedule, off a kernel preemption, + * go straight to picking the next task. + */ + if (unlikely(preempt_get_count() & PREEMPT_ACTIVE)) + goto pick_next_task; +#endif + switch (prev->state) { case TASK_RUNNING: prev->sleep_timestamp = jiffies; @@ -659,7 +686,7 @@ default: deactivate_task(prev, rq); } -#if CONFIG_SMP +#if CONFIG_SMP || CONFIG_PREEMPT pick_next_task: #endif if (unlikely(!rq->nr_running)) { @@ -707,9 +734,25 @@ spin_unlock_irq(&rq->lock); reacquire_kernel_lock(current); + preempt_enable_no_resched(); return; } +#ifdef CONFIG_PREEMPT +/* + * this is is the entry point to schedule() from in-kernel preemption. + */ +asmlinkage void preempt_schedule(void) +{ + do { + current_thread_info()->preempt_count += PREEMPT_ACTIVE; + schedule(); + current_thread_info()->preempt_count -= PREEMPT_ACTIVE; + barrier(); + } while (test_thread_flag(TIF_NEED_RESCHED)); +} +#endif /* CONFIG_PREEMPT */ + /* * The core wakeup function. Non-exclusive wakeups (nr_exclusive == 0) just * wake everything up. If it's an exclusive wakeup (nr_exclusive == small +ve @@ -1105,9 +1148,12 @@ asmlinkage long sys_sched_yield(void) { - runqueue_t *rq = this_rq(); + runqueue_t *rq; prio_array_t *array; + preempt_disable(); + rq = this_rq(); + /* * Decrease the yielding task's priority by one, to avoid * livelocks. This priority loss is temporary, it's recovered @@ -1134,6 +1180,7 @@ __set_bit(current->prio, array->bitmap); } spin_unlock(&rq->lock); + preempt_enable_no_resched(); schedule(); diff -urN linux-2.5.4-pre5/kernel/signal.c linux/kernel/signal.c --- linux-2.5.4-pre5/kernel/signal.c Sun Feb 10 12:27:30 2002 +++ linux/kernel/signal.c Sun Feb 10 12:27:35 2002 @@ -13,6 +13,7 @@ #include #include #include +#include #include diff -urN linux-2.5.4-pre5/kernel/sys.c linux/kernel/sys.c --- linux-2.5.4-pre5/kernel/sys.c Mon Jan 7 12:55:16 2002 +++ linux/kernel/sys.c Sun Feb 10 12:27:35 2002 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/kernel/time.c linux/kernel/time.c --- linux-2.5.4-pre5/kernel/time.c Wed Jan 23 15:28:39 2002 +++ linux/kernel/time.c Sun Feb 10 12:27:35 2002 @@ -24,7 +24,6 @@ * (Even though the technical memorandum forbids it) */ -#include #include #include diff -urN linux-2.5.4-pre5/mm/filemap.c linux/mm/filemap.c --- linux-2.5.4-pre5/mm/filemap.c Tue Jan 15 13:53:51 2002 +++ linux/mm/filemap.c Sun Feb 10 12:27:35 2002 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/mm/mprotect.c linux/mm/mprotect.c --- linux-2.5.4-pre5/mm/mprotect.c Tue Jan 15 10:56:36 2002 +++ linux/mm/mprotect.c Sun Feb 10 12:27:35 2002 @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/mm/mremap.c linux/mm/mremap.c --- linux-2.5.4-pre5/mm/mremap.c Tue Jan 15 10:56:36 2002 +++ linux/mm/mremap.c Sun Feb 10 12:27:35 2002 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff -urN linux-2.5.4-pre5/mm/slab.c linux/mm/slab.c --- linux-2.5.4-pre5/mm/slab.c Sun Feb 10 12:27:30 2002 +++ linux/mm/slab.c Sun Feb 10 12:27:35 2002 @@ -49,7 +49,8 @@ * constructors and destructors are called without any locking. * Several members in kmem_cache_t and slab_t never change, they * are accessed without any locking. - * The per-cpu arrays are never accessed from the wrong cpu, no locking. + * The per-cpu arrays are never accessed from the wrong cpu, no locking, + * and local interrupts are disabled so slab code is preempt-safe. * The non-constant members are protected with a per-cache irq spinlock. * * Further notes from the original documentation: @@ -75,6 +76,7 @@ #include #include #include +#include #include /* @@ -1869,31 +1871,56 @@ } #ifdef CONFIG_PROC_FS -/* /proc/slabinfo - * cache-name num-active-objs total-objs - * obj-size num-active-slabs total-slabs - * num-pages-per-slab - */ -#define FIXUP(t) \ - do { \ - if (len <= off) { \ - off -= len; \ - len = 0; \ - } else { \ - if (len-off > count) \ - goto t; \ - } \ - } while (0) -static int proc_getdata (char*page, char**start, off_t off, int count) +static void *s_start(struct seq_file *m, loff_t *pos) { + loff_t n = *pos; struct list_head *p; - int len = 0; - /* Output format version, so at least we can change it without _too_ - * many complaints. - */ - len += sprintf(page+len, "slabinfo - version: 1.1" + down(&cache_chain_sem); + if (!n) + return (void *)1; + p = &cache_cache.next; + while (--n) { + p = p->next; + if (p == &cache_cache.next) + return NULL; + } + return list_entry(p, kmem_cache_t, next); +} + +static void *s_next(struct seq_file *m, void *p, loff_t *pos) +{ + kmem_cache_t *cachep = p; + ++*pos; + if (p == (void *)1) + return &cache_cache; + cachep = list_entry(cachep->next.next, kmem_cache_t, next); + return cachep == &cache_cache ? NULL : cachep; +} + +static void s_stop(struct seq_file *m, void *p) +{ + up(&cache_chain_sem); +} + +static int s_show(struct seq_file *m, void *p) +{ + kmem_cache_t *cachep = p; + struct list_head *q; + slab_t *slabp; + unsigned long active_objs; + unsigned long num_objs; + unsigned long active_slabs = 0; + unsigned long num_slabs; + const char *name; + + if (p == (void*)1) { + /* + * Output format version, so at least we can change it + * without _too_ many complaints. + */ + seq_puts(m, "slabinfo - version: 1.1" #if STATS " (statistics)" #endif @@ -1901,116 +1928,89 @@ " (SMP)" #endif "\n"); - FIXUP(got_data); - - down(&cache_chain_sem); - p = &cache_cache.next; - do { - kmem_cache_t *cachep; - struct list_head *q; - slab_t *slabp; - unsigned long active_objs; - unsigned long num_objs; - unsigned long active_slabs = 0; - unsigned long num_slabs; - const char *name; - cachep = list_entry(p, kmem_cache_t, next); + return 0; + } - spin_lock_irq(&cachep->spinlock); - active_objs = 0; - num_slabs = 0; - list_for_each(q,&cachep->slabs_full) { - slabp = list_entry(q, slab_t, list); - if (slabp->inuse != cachep->num) - BUG(); - active_objs += cachep->num; - active_slabs++; - } - list_for_each(q,&cachep->slabs_partial) { - slabp = list_entry(q, slab_t, list); - if (slabp->inuse == cachep->num || !slabp->inuse) - BUG(); - active_objs += slabp->inuse; - active_slabs++; - } - list_for_each(q,&cachep->slabs_free) { - slabp = list_entry(q, slab_t, list); - if (slabp->inuse) - BUG(); - num_slabs++; - } - num_slabs+=active_slabs; - num_objs = num_slabs*cachep->num; + spin_lock_irq(&cachep->spinlock); + active_objs = 0; + num_slabs = 0; + list_for_each(q,&cachep->slabs_full) { + slabp = list_entry(q, slab_t, list); + if (slabp->inuse != cachep->num) + BUG(); + active_objs += cachep->num; + active_slabs++; + } + list_for_each(q,&cachep->slabs_partial) { + slabp = list_entry(q, slab_t, list); + if (slabp->inuse == cachep->num || !slabp->inuse) + BUG(); + active_objs += slabp->inuse; + active_slabs++; + } + list_for_each(q,&cachep->slabs_free) { + slabp = list_entry(q, slab_t, list); + if (slabp->inuse) + BUG(); + num_slabs++; + } + num_slabs+=active_slabs; + num_objs = num_slabs*cachep->num; - name = cachep->name; - { - char tmp; - if (__get_user(tmp, name)) - name = "broken"; - } - - len += sprintf(page+len, "%-17s %6lu %6lu %6u %4lu %4lu %4u", - name, active_objs, num_objs, cachep->objsize, - active_slabs, num_slabs, (1<gfporder)); + name = cachep->name; + { + char tmp; + if (__get_user(tmp, name)) + name = "broken"; + } + + seq_printf(m, "%-17s %6lu %6lu %6u %4lu %4lu %4u", + name, active_objs, num_objs, cachep->objsize, + active_slabs, num_slabs, (1<gfporder)); #if STATS - { - unsigned long errors = cachep->errors; - unsigned long high = cachep->high_mark; - unsigned long grown = cachep->grown; - unsigned long reaped = cachep->reaped; - unsigned long allocs = cachep->num_allocations; + { + unsigned long errors = cachep->errors; + unsigned long high = cachep->high_mark; + unsigned long grown = cachep->grown; + unsigned long reaped = cachep->reaped; + unsigned long allocs = cachep->num_allocations; - len += sprintf(page+len, " : %6lu %7lu %5lu %4lu %4lu", - high, allocs, grown, reaped, errors); - } + seq_printf(m, " : %6lu %7lu %5lu %4lu %4lu", + high, allocs, grown, reaped, errors); + } #endif #ifdef CONFIG_SMP - { - unsigned int batchcount = cachep->batchcount; - unsigned int limit; + { + unsigned int batchcount = cachep->batchcount; + unsigned int limit; - if (cc_data(cachep)) - limit = cc_data(cachep)->limit; - else - limit = 0; - len += sprintf(page+len, " : %4u %4u", - limit, batchcount); - } + if (cc_data(cachep)) + limit = cc_data(cachep)->limit; + else + limit = 0; + seq_printf(m, " : %4u %4u", limit, batchcount); + } #endif #if STATS && defined(CONFIG_SMP) - { - unsigned long allochit = atomic_read(&cachep->allochit); - unsigned long allocmiss = atomic_read(&cachep->allocmiss); - unsigned long freehit = atomic_read(&cachep->freehit); - unsigned long freemiss = atomic_read(&cachep->freemiss); - len += sprintf(page+len, " : %6lu %6lu %6lu %6lu", - allochit, allocmiss, freehit, freemiss); - } + { + unsigned long allochit = atomic_read(&cachep->allochit); + unsigned long allocmiss = atomic_read(&cachep->allocmiss); + unsigned long freehit = atomic_read(&cachep->freehit); + unsigned long freemiss = atomic_read(&cachep->freemiss); + seq_printf(m, " : %6lu %6lu %6lu %6lu", + allochit, allocmiss, freehit, freemiss); + } #endif - len += sprintf(page+len,"\n"); - spin_unlock_irq(&cachep->spinlock); - FIXUP(got_data_up); - p = cachep->next.next; - } while (p != &cache_cache.next); -got_data_up: - up(&cache_chain_sem); - -got_data: - *start = page+off; - return len; + spin_unlock_irq(&cachep->spinlock); + seq_putc(m, '\n'); + return 0; } /** - * slabinfo_read_proc - generates /proc/slabinfo - * @page: scratch area, one page long - * @start: pointer to the pointer to the output buffer - * @off: offset within /proc/slabinfo the caller is interested in - * @count: requested len in bytes - * @eof: eof marker - * @data: unused + * slabinfo_op - iterator that generates /proc/slabinfo * - * The contents of the buffer are + * Output layout: * cache-name * num-active-objs * total-objs @@ -2020,28 +2020,24 @@ * num-pages-per-slab * + further values on SMP and with statistics enabled */ -int slabinfo_read_proc (char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = proc_getdata(page, start, off, count); - len -= (*start-page); - if (len <= count) - *eof = 1; - if (len>count) len = count; - if (len<0) len = 0; - return len; -} + +struct seq_operations slabinfo_op = { + start: s_start, + next: s_next, + stop: s_stop, + show: s_show +}; #define MAX_SLABINFO_WRITE 128 /** - * slabinfo_write_proc - SMP tuning for the slab allocator + * slabinfo_write - SMP tuning for the slab allocator * @file: unused * @buffer: user buffer * @count: data len * @data: unused */ -int slabinfo_write_proc (struct file *file, const char *buffer, - unsigned long count, void *data) +ssize_t slabinfo_write(struct file *file, const char *buffer, + size_t count, loff_t *ppos) { #ifdef CONFIG_SMP char kbuf[MAX_SLABINFO_WRITE+1], *tmp; diff -urN linux-2.5.4-pre5/net/socket.c linux/net/socket.c --- linux-2.5.4-pre5/net/socket.c Sun Feb 10 12:27:30 2002 +++ linux/net/socket.c Sun Feb 10 12:27:35 2002 @@ -132,7 +132,7 @@ static struct net_proto_family *net_families[NPROTO]; -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) static atomic_t net_family_lockct = ATOMIC_INIT(0); static spinlock_t net_family_lock = SPIN_LOCK_UNLOCKED; diff -urN linux-2.5.4-pre5/net/sunrpc/svcauth.c linux/net/sunrpc/svcauth.c --- linux-2.5.4-pre5/net/sunrpc/svcauth.c Fri Apr 28 22:50:39 2000 +++ linux/net/sunrpc/svcauth.c Sun Feb 10 12:27:35 2002 @@ -15,6 +15,7 @@ #include #include #include +#include #define RPCDBG_FACILITY RPCDBG_AUTH