diff -Nru a/Makefile b/Makefile --- a/Makefile Sat Apr 19 19:39:07 2003 +++ b/Makefile Mon Apr 21 04:29:56 2003 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 68 -EXTRAVERSION = +EXTRAVERSION = -bk1 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig --- a/arch/alpha/Kconfig Tue Apr 15 12:43:41 2003 +++ b/arch/alpha/Kconfig Sun Apr 20 12:56:50 2003 @@ -291,7 +291,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -514,7 +514,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -688,7 +688,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -710,7 +710,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -862,7 +862,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -912,7 +912,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c --- a/arch/alpha/kernel/core_irongate.c Tue Feb 18 05:29:57 2003 +++ b/arch/alpha/kernel/core_irongate.c Sun Apr 20 09:14:40 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c --- a/arch/alpha/kernel/setup.c Tue Apr 15 10:58:12 2003 +++ b/arch/alpha/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -32,11 +32,7 @@ #include #include #include - -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif - +#include #ifdef CONFIG_MAGIC_SYSRQ #include #include diff -Nru a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c --- a/arch/alpha/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/alpha/mm/init.c Sat Apr 19 23:22:41 2003 @@ -66,19 +66,9 @@ pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - pte_t *pte; - long timeout = 10; - - retry: - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); - else if (--timeout >= 0) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - goto retry; - } - return pte; } diff -Nru a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c --- a/arch/alpha/mm/numa.c Tue Feb 18 05:31:01 2003 +++ b/arch/alpha/mm/numa.c Sun Apr 20 09:14:40 2003 @@ -12,9 +12,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig Tue Apr 15 07:31:47 2003 +++ b/arch/arm/Kconfig Sun Apr 20 12:56:50 2003 @@ -445,7 +445,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -459,7 +459,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -717,7 +717,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -739,7 +739,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -770,7 +770,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -809,7 +809,7 @@ In order to use APM, you will need supporting software. For location and more information, read and the Battery Powered Linux mini-HOWTO, available from - . + . This driver does not spin down disk drives (see the hdparm(8) manpage ("man 8 hdparm") for that), and it doesn't turn off @@ -1063,7 +1063,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c --- a/arch/arm/kernel/setup.c Tue Mar 4 16:48:44 2003 +++ b/arch/arm/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c --- a/arch/arm/mach-clps711x/fortunet.c Sun Nov 17 07:31:08 2002 +++ b/arch/arm/mach-clps711x/fortunet.c Sun Apr 20 09:14:40 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/arm/mm/init.c b/arch/arm/mm/init.c --- a/arch/arm/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/arm/mm/init.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/cris/Kconfig b/arch/cris/Kconfig --- a/arch/cris/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/cris/Kconfig Sun Apr 20 12:56:50 2003 @@ -40,7 +40,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -615,7 +615,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -667,7 +667,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/cris/drivers/Kconfig b/arch/cris/drivers/Kconfig --- a/arch/cris/drivers/Kconfig Sun Feb 9 17:29:49 2003 +++ b/arch/cris/drivers/Kconfig Sun Apr 20 12:56:50 2003 @@ -30,7 +30,7 @@ If your Linux machine will be connected to an Ethernet and you have an Ethernet network interface card (NIC) installed in your computer, say Y here and read the Ethernet-HOWTO, available from - . You will then also have + . You will then also have to say Y to the driver for your particular NIC. Note that the answer to this question won't directly affect the @@ -392,7 +392,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -485,7 +485,7 @@ topics, is contained in . For detailed information about hard drives, consult the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . + . To fine-tune ATA/IDE drive/interface parameters for improved performance, look for the hdparm package at diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig --- a/arch/h8300/Kconfig Thu Apr 17 12:30:45 2003 +++ b/arch/h8300/Kconfig Sun Apr 20 12:56:51 2003 @@ -181,7 +181,7 @@ telephone line with a modem either via UUCP (UUCP is a protocol to forward mail and news between unix hosts over telephone lines; read the UUCP-HOWTO, available from - ) or dialing up a shell + ) or dialing up a shell account or a BBS, even using term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on some Internet connected Unix computer. Read @@ -201,7 +201,7 @@ Make sure to read the NET-3-HOWTO. Eventually, you will have to read Olaf Kirch's excellent and free book "Network Administrator's - Guide", to be found in . If + Guide", to be found in . If unsure, say Y. endmenu diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Fri Apr 4 07:22:18 2003 +++ b/arch/i386/Kconfig Sun Apr 20 12:56:50 2003 @@ -409,7 +409,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -790,7 +790,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -847,7 +847,7 @@ In order to use APM, you will need supporting software. For location and more information, read and the Battery Powered Linux mini-HOWTO, available from - . + . This driver does not spin down disk drives (see the hdparm(8) manpage ("man 8 hdparm") for that), and it doesn't turn off @@ -1000,7 +1000,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -1203,7 +1203,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -1225,7 +1225,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -1341,7 +1341,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1412,7 +1412,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c --- a/arch/i386/kernel/i8259.c Mon Mar 3 13:11:24 2003 +++ b/arch/i386/kernel/i8259.c Sun Apr 20 14:14:28 2003 @@ -325,15 +325,16 @@ * =PC9800NOTE= In NEC PC-9800, we use irq8 instead of irq13! */ -static void math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) +static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) { extern void math_error(void *); #ifndef CONFIG_X86_PC9800 outb(0,0xF0); #endif if (ignore_fpu_irq || !boot_cpu_data.hard_math) - return; + return IRQ_NONE; math_error((void *)regs->eip); + return IRQ_HANDLED; } /* diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Mon Apr 14 16:09:21 2003 +++ b/arch/i386/kernel/io_apic.c Sun Apr 20 16:00:22 2003 @@ -1117,7 +1117,7 @@ if (current_vector == SYSCALL_VECTOR) goto next; - if (current_vector > FIRST_SYSTEM_VECTOR) { + if (current_vector >= FIRST_SYSTEM_VECTOR) { offset = (offset + 1) & 7; current_vector = FIRST_DEVICE_VECTOR + offset; } diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c --- a/arch/i386/kernel/irq.c Thu Mar 20 03:11:45 2003 +++ b/arch/i386/kernel/irq.c Sun Apr 20 14:14:28 2003 @@ -74,7 +74,8 @@ * Special irq handlers. */ -void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } +irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) +{ return IRQ_NONE; } /* * Generic no controller code @@ -205,18 +206,30 @@ int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action) { int status = 1; /* Force the "do bottom halves" bit */ + int retval = 0; if (!(action->flags & SA_INTERRUPT)) local_irq_enable(); do { status |= action->flags; - action->handler(irq, action->dev_id, regs); + retval |= action->handler(irq, action->dev_id, regs).val; action = action->next; } while (action); if (status & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); local_irq_disable(); + if (retval != 1) { + static int count = 100; + while (count) { + count--; + printk(retval + ? "irq event %d: bogus retval mask %x\n" + : "irq %d: nobody cared!n", + irq, + retval); + } + } return status; } @@ -447,7 +460,7 @@ */ int request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Thu Apr 17 12:05:47 2003 +++ b/arch/i386/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -29,9 +29,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c --- a/arch/i386/kernel/time.c Mon Apr 7 16:40:21 2003 +++ b/arch/i386/kernel/time.c Sun Apr 20 14:47:44 2003 @@ -124,15 +124,28 @@ * made, and then undo it! */ tv->tv_usec -= timer->get_offset(); - tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ); + tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ); while (tv->tv_usec < 0) { - tv->tv_usec += 1000000; + tv->tv_usec += USEC_PER_SEC; tv->tv_sec--; } + tv->tv_usec *= NSEC_PER_USEC; + + wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec; + wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec; + + if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) { + wall_to_monotonic.tv_nsec -= NSEC_PER_SEC; + wall_to_monotonic.tv_sec++; + } + if (wall_to_monotonic.tv_nsec < 0) { + wall_to_monotonic.tv_nsec += NSEC_PER_SEC; + wall_to_monotonic.tv_sec--; + } xtime.tv_sec = tv->tv_sec; - xtime.tv_nsec = (tv->tv_usec * 1000); + xtime.tv_nsec = tv->tv_usec; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; @@ -228,46 +241,11 @@ } /* - * Lost tick detection and compensation - */ -static inline void detect_lost_tick(void) -{ - /* read time since last interrupt */ - unsigned long delta = timer->get_offset(); - static unsigned long dbg_print; - - /* check if delta is greater then two ticks */ - if(delta >= 2*(1000000/HZ)){ - - /* - * only print debug info first 5 times - */ - /* - * AKPM: disable this for now; it's nice, but irritating. - */ - if (0 && dbg_print < 5) { - printk(KERN_WARNING "\nWarning! Detected %lu " - "micro-second gap between interrupts.\n", - delta); - printk(KERN_WARNING " Compensating for %lu lost " - "ticks.\n", - delta/(1000000/HZ)-1); - dump_stack(); - dbg_print++; - } - /* calculate number of missed ticks */ - delta = delta/(1000000/HZ)-1; - jiffies += delta; - } - -} - -/* * This is the same as the above, except we _also_ save the current * Time Stamp Counter value at the time of the timer interrupt, so that * we later on can estimate the time of day more exactly. */ -void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { /* * Here we are in the timer irq handler. We just have irqs locally @@ -278,13 +256,12 @@ */ write_seqlock(&xtime_lock); - detect_lost_tick(); timer->mark_offset(); do_timer_interrupt(irq, NULL, regs); write_sequnlock(&xtime_lock); - + return IRQ_HANDLED; } /* not static: needed by APM */ @@ -322,7 +299,9 @@ { xtime.tv_sec = get_cmos_time(); - xtime.tv_nsec = 0; + wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ; + xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); + wall_to_monotonic.tv_nsec = 0; timer = select_timer(); diff -Nru a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c --- a/arch/i386/kernel/timers/timer_cyclone.c Mon Mar 31 08:03:54 2003 +++ b/arch/i386/kernel/timers/timer_cyclone.c Sat Apr 19 23:22:28 2003 @@ -18,6 +18,7 @@ #include extern spinlock_t i8253_lock; +extern unsigned long jiffies; extern unsigned long calibrate_tsc(void); /* Number of usecs that the last interrupt was delayed */ @@ -46,6 +47,8 @@ static void mark_offset_cyclone(void) { + unsigned long lost, delay; + unsigned long delta = last_cyclone_low; int count; unsigned long long this_offset, last_offset; @@ -62,6 +65,15 @@ count |= inb(0x40) << 8; spin_unlock(&i8253_lock); + /* lost tick compensation */ + delta = last_cyclone_low - delta; + delta /=(CYCLONE_TIMER_FREQ/1000000); + delta += delay_at_last_interrupt; + lost = delta/(1000000/HZ); + delay = delta%(1000000/HZ); + if(lost >= 2) + jiffies += lost-1; + /* update the monotonic base value */ this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low; monotonic_base += (this_offset - last_offset) & CYCLONE_TIMER_MASK; @@ -70,6 +82,12 @@ /* calculate delay_at_last_interrupt */ count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; + + /* catch corner case where tick rollover + * occured between cyclone and pit reads + */ + if(abs(delay - delay_at_last_interrupt) > 900) + jiffies++; } static unsigned long get_offset_cyclone(void) diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c --- a/arch/i386/kernel/timers/timer_pit.c Mon Apr 7 16:40:44 2003 +++ b/arch/i386/kernel/timers/timer_pit.c Sat Apr 19 23:22:27 2003 @@ -54,7 +54,7 @@ } -/* This function must be called with interrupts disabled +/* This function must be called with xtime_lock held. * It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs * * However, the pc-audio speaker driver changes the divisor so that @@ -93,7 +93,7 @@ static unsigned long jiffies_p = 0; /* - * cache volatile jiffies temporarily; we have IRQs turned off. + * cache volatile jiffies temporarily; we have xtime_lock. */ unsigned long jiffies_t; @@ -119,8 +119,6 @@ count = LATCH - 1; } - spin_unlock_irqrestore(&i8253_lock, flags); - /* * avoiding timer inconsistencies (they are rare, but they happen)... * there are two kinds of problems that must be avoided here: @@ -130,7 +128,6 @@ * (see c't 95/10 page 335 for Neptun bug.) */ - if( jiffies_t == jiffies_p ) { if( count > count_p ) { /* the nutcase */ @@ -140,6 +137,8 @@ jiffies_p = jiffies_t; count_p = count; + + spin_unlock_irqrestore(&i8253_lock, flags); count = ((LATCH-1) - count) * TICK_SIZE; count = (count + LATCH/2) / LATCH; diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c --- a/arch/i386/kernel/timers/timer_tsc.c Thu Apr 17 12:40:54 2003 +++ b/arch/i386/kernel/timers/timer_tsc.c Sat Apr 19 23:22:28 2003 @@ -21,6 +21,7 @@ int tsc_disable __initdata = 0; extern spinlock_t i8253_lock; +extern unsigned long jiffies; static int use_tsc; /* Number of usecs that the last interrupt was delayed */ @@ -117,6 +118,8 @@ static void mark_offset_tsc(void) { + unsigned long lost,delay; + unsigned long delta = last_tsc_low; int count; int countmp; static int count1 = 0; @@ -161,6 +164,23 @@ } } + /* lost tick compensation */ + delta = last_tsc_low - delta; + { + register unsigned long eax, edx; + eax = delta; + __asm__("mull %2" + :"=a" (eax), "=d" (edx) + :"rm" (fast_gettimeoffset_quotient), + "0" (eax)); + delta = edx; + } + delta += delay_at_last_interrupt; + lost = delta/(1000000/HZ); + delay = delta%(1000000/HZ); + if(lost >= 2) + jiffies += lost-1; + /* update the monotonic base value */ this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; monotonic_base += cycles_2_ns(this_offset - last_offset); @@ -169,6 +189,12 @@ /* calculate delay_at_last_interrupt */ count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; + + /* catch corner case where tick rollover + * occured between tsc and pit reads + */ + if(abs(delay - delay_at_last_interrupt) > 900) + jiffies++; } static void delay_tsc(unsigned long loops) diff -Nru a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c --- a/arch/i386/kernel/vm86.c Thu Apr 3 07:48:45 2003 +++ b/arch/i386/kernel/vm86.c Sun Apr 20 14:14:28 2003 @@ -695,7 +695,8 @@ | (1 << SIGUSR1) | (1 << SIGUSR2) | (1 << SIGIO) | (1 << SIGURG) \ | (1 << SIGUNUSED) ) -static void irq_handler(int intno, void *dev_id, struct pt_regs * regs) { +static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs) +{ int irq_bit; unsigned long flags; @@ -709,6 +710,7 @@ /* else user will poll for IRQs */ out: spin_unlock_irqrestore(&irqbits_lock, flags); + return IRQ_NONE; } static inline void free_vm86_irq(int irqnumber) @@ -742,7 +744,10 @@ bit = irqbits & (1 << irqnumber); irqbits &= ~bit; spin_unlock_irqrestore(&irqbits_lock, flags); - return bit; + if (!bit) + return 0; + enable_irq(irqnumber); + return 1; } diff -Nru a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c --- a/arch/i386/mm/discontig.c Tue Mar 4 23:41:55 2003 +++ b/arch/i386/mm/discontig.c Sun Apr 20 09:14:40 2003 @@ -27,9 +27,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c Mon Feb 24 23:13:11 2003 +++ b/arch/i386/mm/hugetlbpage.c Sat Apr 19 23:22:35 2003 @@ -129,37 +129,45 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, struct page **pages, struct vm_area_struct **vmas, - unsigned long *st, int *length, int i) + unsigned long *position, int *length, int i) { - pte_t *ptep, pte; - unsigned long start = *st; - unsigned long pstart; - int len = *length; - struct page *page; + unsigned long vpfn, vaddr = *position; + int remainder = *length; + + WARN_ON(!is_vm_hugetlb_page(vma)); - do { - pstart = start; - ptep = huge_pte_offset(mm, start); - pte = *ptep; + vpfn = vaddr/PAGE_SIZE; + while (vaddr < vma->vm_end && remainder) { -back1: - page = pte_page(pte); if (pages) { - page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT); + pte_t *pte; + struct page *page; + + pte = huge_pte_offset(mm, vaddr); + + /* hugetlb should be locked, and hence, prefaulted */ + WARN_ON(!pte || pte_none(*pte)); + + page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; + + WARN_ON(!PageCompound(page)); + get_page(page); pages[i] = page; } + if (vmas) vmas[i] = vma; - i++; - len--; - start += PAGE_SIZE; - if (((start & HPAGE_MASK) == pstart) && len && - (start < vma->vm_end)) - goto back1; - } while (len && start < vma->vm_end); - *length = len; - *st = start; + + vaddr += PAGE_SIZE; + ++vpfn; + --remainder; + ++i; + } + + *length = remainder; + *position = vaddr; + return i; } @@ -474,9 +482,7 @@ int is_hugepage_mem_enough(size_t size) { - if (size > (htlbpagemem << HPAGE_SHIFT)) - return 0; - return 1; + return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem; } /* diff -Nru a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c --- a/arch/i386/mm/pgtable.c Thu Mar 6 08:19:03 2003 +++ b/arch/i386/mm/pgtable.c Sat Apr 19 23:22:41 2003 @@ -131,39 +131,23 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - int count = 0; - pte_t *pte; - - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - int count = 0; struct page *pte; - - do { + #if CONFIG_HIGHPTE - pte = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0); #else - pte = alloc_pages(GFP_KERNEL, 0); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); #endif - if (pte) - clear_highpage(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c --- a/arch/i386/pci/irq.c Fri Mar 7 19:36:28 2003 +++ b/arch/i386/pci/irq.c Sun Apr 20 14:14:28 2003 @@ -560,8 +560,9 @@ return NULL; } -static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_NONE; } static int pcibios_lookup_irq(struct pci_dev *dev, int assign) diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Tue Apr 8 12:03:12 2003 +++ b/arch/ia64/Kconfig Sun Apr 20 12:56:50 2003 @@ -280,7 +280,7 @@ page on the WWW at and the Battery Powered Linux mini-HOWTO, available from - . + . Note that, even if you say N here, Linux on the x86 architecture will issue the hlt instruction if nothing is to be done, thereby @@ -425,7 +425,7 @@ See also the , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -497,7 +497,7 @@ systems. Saying Y here will enable your kernel to run ELF binaries. Information about ELF is contained in the ELF HOWTO available from - . + . config BINFMT_MISC tristate "Kernel support for MISC binaries" @@ -535,7 +535,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -684,7 +684,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -762,7 +762,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c Wed Apr 9 11:51:34 2003 +++ b/arch/ia64/ia32/sys_ia32.c Sat Apr 19 23:22:56 2003 @@ -3040,7 +3040,6 @@ #define ca32_svc u.u32_svc #define ca32_client u.u32_client #define ca32_export u.u32_export -#define ca32_authd u.u32_authd #define ca32_debug u.u32_debug }; diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Wed Feb 12 00:11:32 2003 +++ b/arch/ia64/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -41,10 +42,6 @@ #include #include #include - -#ifdef CONFIG_BLK_DEV_RAM -# include -#endif #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE) # error "struct cpuinfo_ia64 too big!" diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig --- a/arch/m68k/Kconfig Thu Feb 27 08:02:04 2003 +++ b/arch/m68k/Kconfig Sun Apr 20 12:56:50 2003 @@ -65,7 +65,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -106,7 +106,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -413,7 +413,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -435,7 +435,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -592,7 +592,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -741,7 +741,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -776,7 +776,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -809,7 +809,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -1084,7 +1084,7 @@ This is the NCR 5380 SCSI controller included on most of the 68030 based Macintoshes. If you have one of these say Y and read the SCSI-HOWTO, available from - . + . config SCSI_MAC_ESP tristate "Macintosh NCR53c9[46] SCSI" @@ -1093,7 +1093,7 @@ This is the NCR 53c9x SCSI controller found on most of the 68040 based Macintoshes. If you have one of these say Y and read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1201,7 +1201,7 @@ Say Y here if you have dumb serial boards other than the four standard COM 1/2/3/4 ports. This may happen if you have an AST FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available - from ), or other custom + from ), or other custom serial port hardware which acts similar to standard serial port hardware. If you only use the standard COM 1/2/3/4 ports, you can say N here to save some memory. You can also say Y if you have an diff -Nru a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c --- a/arch/m68k/kernel/setup.c Fri Jan 3 07:55:43 2003 +++ b/arch/m68k/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -39,10 +40,6 @@ #ifdef CONFIG_SUN3X #include extern void sun_serial_setup(void); -#endif - -#ifdef CONFIG_BLK_DEV_INITRD -#include #endif unsigned long m68k_machtype; diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig --- a/arch/m68knommu/Kconfig Wed Mar 5 15:33:01 2003 +++ b/arch/m68knommu/Kconfig Sun Apr 20 12:56:50 2003 @@ -563,7 +563,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -635,7 +635,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig --- a/arch/mips/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/mips/Kconfig Sun Apr 20 12:56:50 2003 @@ -35,7 +35,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -363,7 +363,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -740,7 +740,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -762,7 +762,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -931,7 +931,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1083,7 +1083,7 @@ Although PS/2 mice are not technically bus mice, they are explained in detail in the Busmouse-HOWTO, available from - . + . When using a PS/2 mouse, you can get problems if you want to use the mouse both on the Linux console and under X. Using the "-R" option @@ -1102,7 +1102,7 @@ MouseSystem or Microsoft mouse (made by Logitech) that plugs into a COM port (rectangular with 9 or 25 pins). These people say N here. If you have something else, read the Busmouse-HOWTO, available from - . This HOWTO contains + . This HOWTO contains information about all non-serial mice, not just bus mice. If you have a laptop, you either have to check the documentation or @@ -1139,7 +1139,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c --- a/arch/mips/gt64120/momenco_ocelot/setup.c Fri May 3 05:28:15 2002 +++ b/arch/mips/gt64120/momenco_ocelot/setup.c Sun Apr 20 09:14:40 2003 @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include "ocelot_pld.h" diff -Nru a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c --- a/arch/mips/kernel/setup.c Tue Feb 25 02:42:13 2003 +++ b/arch/mips/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/mips64/Kconfig b/arch/mips64/Kconfig --- a/arch/mips64/Kconfig Sat Mar 8 21:41:49 2003 +++ b/arch/mips64/Kconfig Sun Apr 20 12:56:50 2003 @@ -113,7 +113,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -145,7 +145,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -350,7 +350,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -392,7 +392,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -520,7 +520,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -594,7 +594,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c --- a/arch/mips64/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/mips64/mm/init.c Sun Apr 20 09:14:40 2003 @@ -21,9 +21,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig --- a/arch/parisc/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/parisc/Kconfig Sun Apr 20 12:56:50 2003 @@ -136,7 +136,7 @@ See also the , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -184,7 +184,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -206,7 +206,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -309,7 +309,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c --- a/arch/parisc/kernel/setup.c Sun Jan 5 03:16:46 2003 +++ b/arch/parisc/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -29,7 +29,7 @@ #include #include -#include /* for initrd_start and initrd_end */ +#include #include #include #include diff -Nru a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c --- a/arch/parisc/kernel/sys_parisc32.c Tue Apr 15 22:48:20 2003 +++ b/arch/parisc/kernel/sys_parisc32.c Sat Apr 19 23:22:56 2003 @@ -1131,7 +1131,7 @@ struct nfsctl_export32 { char ex_client[NFSCLNT_IDMAX+1]; char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; + __kernel_old_dev_t ex_dev; compat_ino_t ex_ino; int ex_flags; __kernel_uid_t ex_anon_uid; diff -Nru a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c --- a/arch/parisc/mm/init.c Sun Mar 2 18:13:32 2003 +++ b/arch/parisc/mm/init.c Sun Apr 20 09:14:40 2003 @@ -15,7 +15,7 @@ #include #include #include /* for hppa_dma_ops and pcxl_dma_ops */ -#include /* for initrd_start and initrd_end */ +#include #include #include diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig --- a/arch/ppc/Kconfig Wed Mar 26 22:00:59 2003 +++ b/arch/ppc/Kconfig Sun Apr 20 12:56:50 2003 @@ -808,7 +808,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -1444,7 +1444,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c --- a/arch/ppc/kernel/setup.c Fri Feb 14 01:58:30 2003 +++ b/arch/ppc/kernel/setup.c Sun Apr 20 09:14:40 2003 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c --- a/arch/ppc/mm/init.c Sat Mar 15 03:34:49 2003 +++ b/arch/ppc/mm/init.c Sun Apr 20 09:14:40 2003 @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include /* for initrd_* */ -#endif +#include #include #include diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c --- a/arch/ppc/mm/pgtable.c Sat Jan 4 00:44:11 2003 +++ b/arch/ppc/mm/pgtable.c Sat Apr 19 23:22:41 2003 @@ -76,15 +76,11 @@ extern void *early_get_page(void); int timeout = 0; - if (mem_init_done) { - while ((pte = (pte_t *) __get_free_page(GFP_KERNEL)) == NULL - && ++timeout < 10) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); - } - } else - pte = (pte_t *) early_get_page(); - if (pte != NULL) + if (mem_init_done) + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + else + pte = (pte_t *)early_get_page(); + if (pte) clear_page(pte); return pte; } @@ -92,20 +88,16 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { struct page *pte; - int timeout = 0; + #ifdef CONFIG_HIGHPTE - int flags = GFP_KERNEL | __GFP_HIGHMEM; + int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT; #else - int flags = GFP_KERNEL; + int flags = GFP_KERNEL | __GFP_REPEAT; #endif - while ((pte = alloc_pages(flags, 0)) == NULL) { - if (++timeout >= 10) - return NULL; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); - } - clear_highpage(pte); + pte = alloc_pages(flags, 0); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/ppc/platforms/4xx/oak_setup.c b/arch/ppc/platforms/4xx/oak_setup.c --- a/arch/ppc/platforms/4xx/oak_setup.c Mon Jan 6 03:43:48 2003 +++ b/arch/ppc/platforms/4xx/oak_setup.c Sun Apr 20 09:14:41 2003 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc/platforms/adir_setup.c b/arch/ppc/platforms/adir_setup.c --- a/arch/ppc/platforms/adir_setup.c Sat Jan 4 03:26:31 2003 +++ b/arch/ppc/platforms/adir_setup.c Sun Apr 20 09:14:40 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c --- a/arch/ppc/platforms/apus_setup.c Sun Sep 15 21:52:01 2002 +++ b/arch/ppc/platforms/apus_setup.c Sun Apr 20 09:14:40 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include /* Needs INITSERIAL call in head.S! */ diff -Nru a/arch/ppc/platforms/ev64260_setup.c b/arch/ppc/platforms/ev64260_setup.c --- a/arch/ppc/platforms/ev64260_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/ev64260_setup.c Sun Apr 20 09:14:40 2003 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c --- a/arch/ppc/platforms/gemini_setup.c Mon Dec 30 04:29:15 2002 +++ b/arch/ppc/platforms/gemini_setup.c Sun Apr 20 09:14:40 2003 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/k2_setup.c b/arch/ppc/platforms/k2_setup.c --- a/arch/ppc/platforms/k2_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/k2_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c --- a/arch/ppc/platforms/lopec_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/lopec_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c --- a/arch/ppc/platforms/mcpn765_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/mcpn765_setup.c Sun Apr 20 09:14:40 2003 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/menf1_setup.c b/arch/ppc/platforms/menf1_setup.c --- a/arch/ppc/platforms/menf1_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/menf1_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/mvme5100_setup.c b/arch/ppc/platforms/mvme5100_setup.c --- a/arch/ppc/platforms/mvme5100_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/mvme5100_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c --- a/arch/ppc/platforms/pal4_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/pal4_setup.c Sun Apr 20 09:14:40 2003 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pcore_setup.c b/arch/ppc/platforms/pcore_setup.c --- a/arch/ppc/platforms/pcore_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/pcore_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c --- a/arch/ppc/platforms/pmac_setup.c Wed Mar 26 22:00:59 2003 +++ b/arch/ppc/platforms/pmac_setup.c Sun Apr 20 09:14:40 2003 @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c --- a/arch/ppc/platforms/powerpmc250.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/powerpmc250.c Sun Apr 20 09:14:40 2003 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/pplus_setup.c b/arch/ppc/platforms/pplus_setup.c --- a/arch/ppc/platforms/pplus_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/pplus_setup.c Sun Apr 20 09:14:40 2003 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c --- a/arch/ppc/platforms/prep_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/prep_setup.c Sun Apr 20 09:14:40 2003 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prpmc750_setup.c b/arch/ppc/platforms/prpmc750_setup.c --- a/arch/ppc/platforms/prpmc750_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/prpmc750_setup.c Sun Apr 20 09:14:40 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/prpmc800_setup.c b/arch/ppc/platforms/prpmc800_setup.c --- a/arch/ppc/platforms/prpmc800_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/prpmc800_setup.c Sun Apr 20 09:14:40 2003 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/sandpoint_setup.c b/arch/ppc/platforms/sandpoint_setup.c --- a/arch/ppc/platforms/sandpoint_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/platforms/sandpoint_setup.c Sun Apr 20 09:14:41 2003 @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/spruce_setup.c b/arch/ppc/platforms/spruce_setup.c --- a/arch/ppc/platforms/spruce_setup.c Thu Mar 27 02:17:35 2003 +++ b/arch/ppc/platforms/spruce_setup.c Sun Apr 20 09:14:41 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/platforms/zx4500_setup.c b/arch/ppc/platforms/zx4500_setup.c --- a/arch/ppc/platforms/zx4500_setup.c Tue Feb 11 15:48:53 2003 +++ b/arch/ppc/platforms/zx4500_setup.c Sun Apr 20 09:14:41 2003 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c --- a/arch/ppc/syslib/m8260_setup.c Sat Mar 22 17:18:48 2003 +++ b/arch/ppc/syslib/m8260_setup.c Sun Apr 20 09:14:41 2003 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c --- a/arch/ppc/syslib/m8xx_setup.c Tue Nov 5 13:53:07 2002 +++ b/arch/ppc/syslib/m8xx_setup.c Sun Apr 20 09:14:41 2003 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c --- a/arch/ppc/syslib/ppc4xx_setup.c Sat Mar 22 16:59:59 2003 +++ b/arch/ppc/syslib/ppc4xx_setup.c Sun Apr 20 09:14:41 2003 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig --- a/arch/ppc64/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/ppc64/Kconfig Sun Apr 20 12:56:50 2003 @@ -195,7 +195,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -387,7 +387,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c --- a/arch/ppc64/kernel/chrp_setup.c Mon Mar 24 16:01:56 2003 +++ b/arch/ppc64/kernel/chrp_setup.c Sun Apr 20 09:14:41 2003 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c --- a/arch/ppc64/kernel/iSeries_setup.c Mon Mar 24 16:01:56 2003 +++ b/arch/ppc64/kernel/iSeries_setup.c Sun Apr 20 09:14:41 2003 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c --- a/arch/ppc64/kernel/setup.c Sun Dec 15 17:35:20 2002 +++ b/arch/ppc64/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c Tue Apr 15 22:48:20 2003 +++ b/arch/ppc64/kernel/sys_ppc32.c Sat Apr 19 23:22:56 2003 @@ -910,7 +910,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig --- a/arch/s390/Kconfig Mon Apr 14 12:11:54 2003 +++ b/arch/s390/Kconfig Sun Apr 20 12:56:51 2003 @@ -60,7 +60,7 @@ See also the , and the SMP-HOWTO available at - . + . Even if you don't know what to do here, say Y. @@ -226,7 +226,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -248,7 +248,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. diff -Nru a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c --- a/arch/s390/kernel/setup.c Mon Apr 14 12:11:56 2003 +++ b/arch/s390/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -29,9 +29,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig --- a/arch/sh/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/sh/Kconfig Sun Apr 20 12:56:51 2003 @@ -483,7 +483,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -608,7 +608,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -630,7 +630,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -748,7 +748,7 @@ ---help--- If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y here, otherwise N. Read the CD-ROM-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -980,7 +980,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -1049,7 +1049,7 @@ Although PS/2 mice are not technically bus mice, they are explained in detail in the Busmouse-HOWTO, available from - . + . When using a PS/2 mouse, you can get problems if you want to use the mouse both on the Linux console and under X. Using the "-R" option @@ -1157,7 +1157,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c --- a/arch/sh/kernel/setup.c Sat Oct 12 07:52:54 2002 +++ b/arch/sh/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -25,9 +25,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig --- a/arch/sparc/Kconfig Sat Mar 8 14:50:37 2003 +++ b/arch/sparc/Kconfig Sun Apr 20 12:56:50 2003 @@ -106,7 +106,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -160,7 +160,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -314,7 +314,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -336,7 +336,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -372,7 +372,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -636,7 +636,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -671,7 +671,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -693,7 +693,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -712,7 +712,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -925,7 +925,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c --- a/arch/sparc/mm/init.c Mon Feb 10 02:46:32 2003 +++ b/arch/sparc/mm/init.c Sun Apr 20 09:14:41 2003 @@ -18,9 +18,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_INITRD -#include -#endif +#include #include #include #include diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c --- a/arch/sparc/mm/sun4c.c Sun Apr 13 22:32:09 2003 +++ b/arch/sparc/mm/sun4c.c Sat Apr 19 23:22:43 2003 @@ -1901,7 +1901,7 @@ if ((pte = sun4c_pte_alloc_one_fast(mm, address)) != NULL) return pte; - pte = (pte_t *)__get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) memset(pte, 0, PAGE_SIZE); return pte; @@ -2194,7 +2194,7 @@ BTFIXUPSET_CALL(pte_alloc_one_kernel, sun4c_pte_alloc_one_kernel, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pte_alloc_one, sun4c_pte_alloc_one, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(free_pmd_fast, sun4c_free_pmd_fast, BTFIXUPCALL_NOP); - BTFIXUPSET_CALL(pmd_alloc_one, sun4c_pmd_alloc_one, BTFIXUPCALL_RETO0); + BTFIXUPSET_CALL(pmd_alloc_one, sun4c_lpmd_alloc_one, BTFIXUPCALL_RETO0); BTFIXUPSET_CALL(free_pgd_fast, sun4c_free_pgd_fast, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(get_pgd_fast, sun4c_get_pgd_fast, BTFIXUPCALL_NORM); diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig --- a/arch/sparc64/Kconfig Wed Mar 26 02:27:26 2003 +++ b/arch/sparc64/Kconfig Sun Apr 20 12:56:50 2003 @@ -114,7 +114,7 @@ See also the , , , and the SMP-HOWTO available at - . + . If you don't know what to do here, say N. @@ -281,7 +281,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -314,7 +314,7 @@ VESA. If you have PCI, say Y, otherwise N. The PCI-HOWTO, available from - , contains valuable + , contains valuable information about which PCI hardware does work under Linux and which doesn't. @@ -426,7 +426,7 @@ want to say Y here. Information about ELF is contained in the ELF HOWTO available from - . + . If you find that after upgrading from Linux kernel 1.2 and saying Y here, you still can't run any ELF binaries (they just crash), then @@ -448,7 +448,7 @@ programs that need an interpreter to run like Java, Python or Emacs-Lisp. It's also useful if you often run DOS executables under the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from - ). Once you have + ). Once you have registered such a binary class with the kernel, you can start one of those programs simply by typing in its name at a shell prompt; Linux will automatically feed it to the correct interpreter. @@ -496,7 +496,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the @@ -804,7 +804,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -839,7 +839,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -861,7 +861,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -880,7 +880,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -1060,7 +1060,7 @@ configuration options. You should read at a minimum before contacting the maintainer with any questions. The SCSI-HOWTO, - available from , can also + available from , can also be of great help. If you want to compile this driver as a module ( = code which can be @@ -1406,7 +1406,7 @@ Please read the file . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1586,7 +1586,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c Tue Apr 15 22:48:21 2003 +++ b/arch/sparc64/kernel/sys_sparc32.c Sat Apr 19 23:22:56 2003 @@ -2133,7 +2133,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c --- a/arch/sparc64/mm/init.c Wed Jan 8 12:37:27 2003 +++ b/arch/sparc64/mm/init.c Sun Apr 20 09:14:41 2003 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c --- a/arch/um/drivers/ubd_kern.c Sat Mar 22 09:04:18 2003 +++ b/arch/um/drivers/ubd_kern.c Sat Apr 19 14:17:05 2003 @@ -106,8 +106,6 @@ __u64 size; struct openflags boot_openflags; struct openflags openflags; - devfs_handle_t real; - devfs_handle_t fake; struct cow cow; }; @@ -127,8 +125,6 @@ .size = -1, \ .boot_openflags = OPEN_FLAGS, \ .openflags = OPEN_FLAGS, \ - .real = NULL, \ - .fake = NULL, \ .cow = DEFAULT_COW, \ } @@ -484,41 +480,30 @@ return(err); } -static int ubd_new_disk(int major, u64 size, char *name, int unit, - struct gendisk **disk_out, devfs_handle_t dir_handle, - devfs_handle_t *handle_out) +static int ubd_new_disk(int major, u64 size, int unit, + struct gendisk **disk_out) + { - char devfs_name[sizeof("ubd/nnnnnn\0")]; struct gendisk *disk; - int minor = unit << UBD_SHIFT; disk = alloc_disk(1 << UBD_SHIFT); - if(disk == NULL) - return(-ENOMEM); + if (!disk) + return -ENOMEM; disk->major = major; - disk->first_minor = minor; + disk->first_minor = unit << UBD_SHIFT; disk->fops = &ubd_blops; set_capacity(disk, size / 512); - /* needs to be ubd -> /dev/ubd/discX/disc */ sprintf(disk->disk_name, "ubd"); - *disk_out = disk; + sprintf(disk->devfs_name, "ubd/disc%d", unit); - /* /dev/ubd/N style names */ - sprintf(devfs_name, "ubd/%d", unit); - *handle_out = devfs_register(NULL, devfs_name, - 0, major, minor, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP | - S_IWGRP, &ubd_blops, NULL); disk->private_data = &ubd_dev[unit]; disk->queue = &ubd_queue; add_disk(disk); - return(0); -} -/* Initialized in an initcall, and unchanged thereafter */ -devfs_handle_t ubd_dir_handle; -devfs_handle_t ubd_fake_dir_handle; + *disk_out = disk; + return 0; +} static int ubd_add(int n) { @@ -538,15 +523,13 @@ if(err) return(err); - err = ubd_new_disk(MAJOR_NR, dev->size, "ubd", n, &ubd_gendisk[n], - ubd_dir_handle, &dev->real); + err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); if(err) return(err); if(fake_major) - ubd_new_disk(fake_major, dev->size, "ubd%d", n, - &fake_gendisk[n], ubd_fake_dir_handle, - &dev->fake); + ubd_new_disk(fake_major, dev->size, n, + &fake_gendisk[n]); /* perhaps this should also be under the "if (fake_major)" above */ /* using the fake_disk->disk_name and also the fakehd_set name */ @@ -645,15 +628,11 @@ del_gendisk(ubd_gendisk[n]); put_disk(ubd_gendisk[n]); ubd_gendisk[n] = NULL; - if(dev->real != NULL) - devfs_unregister(dev->real); if(fake_gendisk[n] != NULL){ del_gendisk(fake_gendisk[n]); put_disk(fake_gendisk[n]); fake_gendisk[n] = NULL; - if(dev->fake != NULL) - devfs_unregister(dev->fake); } *dev = ((struct ubd) DEFAULT_UBD); @@ -682,7 +661,7 @@ { int i; - ubd_dir_handle = devfs_mk_dir("ubd"); + devfs_mk_dir("ubd"); if (register_blkdev(MAJOR_NR, "ubd")) return -1; @@ -693,7 +672,7 @@ char name[sizeof("ubd_nnn\0")]; snprintf(name, sizeof(name), "ubd_%d", fake_major); - ubd_fake_dir_handle = devfs_mk_dir(name); + devfs_mk_dir(name); if (register_blkdev(fake_major, "ubd")) return -1; } diff -Nru a/arch/um/kernel/initrd_kern.c b/arch/um/kernel/initrd_kern.c --- a/arch/um/kernel/initrd_kern.c Mon Oct 14 06:53:49 2002 +++ b/arch/um/kernel/initrd_kern.c Sun Apr 20 09:14:41 2003 @@ -5,7 +5,7 @@ #include "linux/init.h" #include "linux/bootmem.h" -#include "linux/blk.h" +#include "linux/initrd.h" #include "asm/types.h" #include "user_util.h" #include "kern_util.h" diff -Nru a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c --- a/arch/um/kernel/mem.c Thu Mar 6 08:19:07 2003 +++ b/arch/um/kernel/mem.c Sat Apr 19 23:22:41 2003 @@ -810,35 +810,21 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - int count = 0; struct page *pte; - do { - pte = alloc_pages(GFP_KERNEL, 0); - if (pte) - clear_highpage(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); + if (pte) + clear_highpage(pte); return pte; } diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig --- a/arch/v850/Kconfig Thu Apr 3 15:01:04 2003 +++ b/arch/v850/Kconfig Sun Apr 20 12:56:51 2003 @@ -341,7 +341,7 @@ interrupt and DMA channel), because you will be asked for it. You want to read the Sound-HOWTO, available from - . General information about + . General information about the modular sound system is contained in the files . The file contains some slightly diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c --- a/arch/x86_64/ia32/sys_ia32.c Tue Apr 15 22:48:21 2003 +++ b/arch/x86_64/ia32/sys_ia32.c Sat Apr 19 23:22:56 2003 @@ -1708,7 +1708,6 @@ #define ca32_export u.u32_export #define ca32_getfd u.u32_getfd #define ca32_getfs u.u32_getfs -#define ca32_authd u.u32_authd }; union nfsctl_res32 { diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c Fri Mar 28 09:55:32 2003 +++ b/arch/x86_64/kernel/setup.c Sun Apr 20 09:14:41 2003 @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_BLK_DEV_RAM -#include -#endif +#include #include #include #include diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c --- a/drivers/acpi/osl.c Thu Apr 3 05:01:25 2003 +++ b/drivers/acpi/osl.c Sun Apr 20 14:14:28 2003 @@ -234,10 +234,12 @@ return AE_OK; } -static void +static irqreturn_t acpi_irq(int irq, void *dev_id, struct pt_regs *regs) { (*acpi_irq_handler)(acpi_irq_context); + /* FIXME!! We really should check that the irq was really ours! */ + return IRQ_HANDLED; } acpi_status diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c --- a/drivers/block/DAC960.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/DAC960.c Sat Apr 19 23:22:47 2003 @@ -1069,6 +1069,7 @@ if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { CommandMailboxesSize = 0; @@ -1271,6 +1272,7 @@ if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) return DAC960_Failure(Controller, "DMA mask out of range"); + Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; /* This is a temporary dma mapping, used only in the scope of this function */ CommandMailbox = @@ -2386,6 +2388,7 @@ */ RequestQueue = &Controller->RequestQueue; blk_init_queue(RequestQueue, DAC960_RequestFunction, &Controller->queue_lock); + blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); RequestQueue->queuedata = Controller; blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit); diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h --- a/drivers/block/DAC960.h Mon Feb 3 23:46:58 2003 +++ b/drivers/block/DAC960.h Sat Apr 19 23:22:47 2003 @@ -62,11 +62,6 @@ /* Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers - - For now set the V2 mask to only 32 bits. The controller IS capable - of doing 64 bit dma. But I have yet to find out whether this needs to - be explicitely enabled in the controller, or of the controller adapts - automatically. */ #define DAC690_V1_PciDmaMask 0xffffffff @@ -2370,6 +2365,7 @@ unsigned short ControllerScatterGatherLimit; unsigned short DriverScatterGatherLimit; unsigned int ControllerUsageCount; + u64 BounceBufferLimit; unsigned int CombinedStatusBufferLength; unsigned int InitialStatusLength; unsigned int CurrentStatusLength; diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/cciss.c Sat Apr 19 23:22:49 2003 @@ -599,9 +599,12 @@ luninfo.num_opens = drv->usage_count; luninfo.num_parts = 0; /* count partitions 1 to 15 with sizes > 0 */ - for(i=1; i part[i].nr_sects != 0) - luninfo.num_parts++; + for(i=1; i part[i]) + continue; + if (disk->part[i]->nr_sects != 0) + luninfo.num_parts++; + } if (copy_to_user((void *) arg, &luninfo, sizeof(LogvolInfo_struct))) return -EFAULT; diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c --- a/drivers/block/floppy.c Thu Apr 3 14:36:23 2003 +++ b/drivers/block/floppy.c Sun Apr 20 14:50:45 2003 @@ -217,7 +217,7 @@ static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED; static unsigned short virtual_dma_port=0x3f0; -void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs); +irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs); static int set_dor(int fdc, char mask, char data); static void register_devfs_entries (int drive) __init; @@ -1743,7 +1743,7 @@ } /* interrupt handler. Note that this can be called externally on the Sparc */ -void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs) +irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs) { void (*handler)(void) = do_floppy; int do_print; @@ -1764,7 +1764,7 @@ printk("floppy interrupt on bizarre fdc %d\n",fdc); printk("handler=%p\n", handler); is_alive("bizarre fdc"); - return; + return IRQ_NONE; } FDCS->reset = 0; @@ -1797,6 +1797,9 @@ } else FDCS->reset = 1; is_alive("normal interrupt end"); + + /* FIXME! Was it really for us? */ + return IRQ_HANDLED; } static void recalibrate_floppy(void) @@ -2263,10 +2266,9 @@ bad_flp_intr, generic_done }; -static int do_format(kdev_t device, struct format_descr *tmp_format_req) +static int do_format(int drive, struct format_descr *tmp_format_req) { int ret; - int drive=DRIVE(device); LOCK_FDC(drive,1); set_floppy(drive); @@ -2293,7 +2295,7 @@ * ============================= */ -static inline void end_request(struct request *req, int uptodate) +static void floppy_end_request(struct request *req, int uptodate) { if (end_that_request_first(req, uptodate, current_count_sectors)) return; @@ -2334,7 +2336,7 @@ /* unlock chained buffers */ spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 1); + floppy_end_request(req, 1); spin_unlock_irqrestore(q->queue_lock, flags); } else { if (rq_data_dir(req) == WRITE) { @@ -2348,7 +2350,7 @@ DRWE->last_error_generation = DRS->generation; } spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 0); + floppy_end_request(req, 0); spin_unlock_irqrestore(q->queue_lock, flags); } } @@ -3556,7 +3558,7 @@ case FDFMTTRK: if (UDRS->fd_ref != 1) return -EBUSY; - return do_format(device, &inparam.f); + return do_format(drive, &inparam.f); case FDFMTEND: case FDFLUSH: LOCK_FDC(drive,1); @@ -3965,21 +3967,19 @@ static void __init register_devfs_entries (int drive) { - int base_minor, i; + int base_minor = (drive < 4) ? drive : (124 + drive); - base_minor = (drive < 4) ? drive : (124 + drive); - if (UDP->cmos < NUMBER(default_drive_params)) { - i = 0; - do { - char name[16]; - - sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR, - base_minor + (table_sup[UDP->cmos][i] << 2), - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); - } while (table_sup[UDP->cmos][i++]); - } + if (UDP->cmos < NUMBER(default_drive_params)) { + int i = 0; + do { + int minor = base_minor + (table_sup[UDP->cmos][i] << 2); + + devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), + S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, + "floppy/%d%s", + drive, table[table_sup[UDP->cmos][i]]); + } while (table_sup[UDP->cmos][i++]); + } } /* diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c --- a/drivers/block/floppy98.c Thu Apr 3 14:42:27 2003 +++ b/drivers/block/floppy98.c Sun Apr 20 11:05:30 2003 @@ -2318,10 +2318,9 @@ bad_flp_intr, generic_done }; -static int do_format(kdev_t device, struct format_descr *tmp_format_req) +static int do_format(int drive, struct format_descr *tmp_format_req) { int ret; - int drive=DRIVE(device); LOCK_FDC(drive,1); set_floppy(drive); @@ -2348,7 +2347,7 @@ * ============================= */ -static inline void end_request(struct request *req, int uptodate) +static void floppy_end_request(struct request *req, int uptodate) { if (end_that_request_first(req, uptodate, current_count_sectors)) return; @@ -2389,7 +2388,7 @@ /* unlock chained buffers */ spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 1); + floppy_end_request(req, 1); spin_unlock_irqrestore(q->queue_lock, flags); } else { if (rq_data_dir(req) == WRITE) { @@ -2403,7 +2402,7 @@ DRWE->last_error_generation = DRS->generation; } spin_lock_irqsave(q->queue_lock, flags); - end_request(req, 0); + floppy_end_request(req, 0); spin_unlock_irqrestore(q->queue_lock, flags); } } @@ -3635,7 +3634,7 @@ case FDFMTTRK: if (UDRS->fd_ref != 1) return -EBUSY; - return do_format(device, &inparam.f); + return do_format(drive, &inparam.f); case FDFMTEND: case FDFLUSH: LOCK_FDC(drive,1); @@ -4084,21 +4083,19 @@ static void __init register_devfs_entries (int drive) { - int base_minor, i; + int base_minor = (drive < 4) ? drive : (124 + drive); - base_minor = (drive < 4) ? drive : (124 + drive); - if (UDP->cmos < NUMBER(default_drive_params)) { - i = 0; - do { - char name[16]; - - sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR, - base_minor + (table_sup[UDP->cmos][i] << 2), - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); - } while (table_sup[UDP->cmos][i++]); - } + if (UDP->cmos < NUMBER(default_drive_params)) { + int i = 0; + do { + int minor = base_minor + (table_sup[UDP->cmos][i] << 2); + + devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), + S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, + "floppy/%d%s", + drive, table[table_sup[UDP->cmos][i]]); + } while (table_sup[UDP->cmos][i++]); + } } /* diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c Fri Apr 4 17:15:46 2003 +++ b/drivers/block/genhd.c Sat Apr 19 23:22:58 2003 @@ -365,11 +365,13 @@ (unsigned long long)get_capacity(sgp) >> 1, disk_name(sgp, 0, buf)); for (n = 0; n < sgp->minors - 1; n++) { - if (sgp->part[n].nr_sects == 0) + if (!sgp->part[n]) + continue; + if (sgp->part[n]->nr_sects == 0) continue; seq_printf(part, "%4d %4d %10llu %s\n", sgp->major, n + 1 + sgp->first_minor, - (unsigned long long)sgp->part[n].nr_sects >> 1 , + (unsigned long long)sgp->part[n]->nr_sects >> 1 , disk_name(sgp, n + 1, buf)); } @@ -542,6 +544,92 @@ static decl_subsys(block, &ktype_block, &block_hotplug_ops); +/* + * aggregate disk stat collector. Uses the same stats that the sysfs + * entries do, above, but makes them available through one seq_file. + * Watching a few disks may be efficient through sysfs, but watching + * all of them will be more efficient through this interface. + * + * The output looks suspiciously like /proc/partitions with a bunch of + * extra fields. + */ + +/* iterator */ +static void *diskstats_start(struct seq_file *part, loff_t *pos) +{ + loff_t k = *pos; + struct list_head *p; + + down_read(&block_subsys.rwsem); + list_for_each(p, &block_subsys.kset.list) + if (!k--) + return list_entry(p, struct gendisk, kobj.entry); + return NULL; +} + +static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos) +{ + struct list_head *p = ((struct gendisk *)v)->kobj.entry.next; + ++*pos; + return p==&block_subsys.kset.list ? NULL : + list_entry(p, struct gendisk, kobj.entry); +} + +static void diskstats_stop(struct seq_file *part, void *v) +{ + up_read(&block_subsys.rwsem); +} + +static int diskstats_show(struct seq_file *s, void *v) +{ + struct gendisk *gp = v; + char buf[64]; + int n = 0; + + /* + if (&sgp->kobj.entry == block_subsys.kset.list.next) + seq_puts(s, "major minor name" + " rio rmerge rsect ruse wio wmerge " + "wsect wuse running use aveq" + "\n\n"); + */ + + disk_round_stats(gp); + seq_printf(s, "%4d %4d %s %u %u %llu %u %u %u %llu %u %u %u %u\n", + gp->major, n + gp->first_minor, disk_name(gp, n, buf), + disk_stat_read(gp, reads), disk_stat_read(gp, read_merges), + (unsigned long long)disk_stat_read(gp, read_sectors), + jiffies_to_msec(disk_stat_read(gp, read_ticks)), + disk_stat_read(gp, writes), disk_stat_read(gp, write_merges), + (unsigned long long)disk_stat_read(gp, write_sectors), + jiffies_to_msec(disk_stat_read(gp, write_ticks)), + disk_stat_read(gp, in_flight), + jiffies_to_msec(disk_stat_read(gp, io_ticks)), + jiffies_to_msec(disk_stat_read(gp, time_in_queue))); + + /* now show all non-0 size partitions of it */ + for (n = 0; n < gp->minors - 1; n++) { + struct hd_struct *hd = gp->part[n]; + + if (hd && hd->nr_sects) + seq_printf(s, "%4d %4d %s %u %u %u %u\n", + gp->major, n + gp->first_minor + 1, + disk_name(gp, n + 1, buf), + hd->reads, hd->read_sectors, + hd->writes, hd->write_sectors); + } + + return 0; +} + +struct seq_operations diskstats_op = { + start: diskstats_start, + next: diskstats_next, + stop: diskstats_stop, + show: diskstats_show +}; + + struct gendisk *alloc_disk(int minors) { struct gendisk *disk = kmalloc(sizeof(struct gendisk), GFP_KERNEL); @@ -552,7 +640,7 @@ return NULL; } if (minors > 1) { - int size = (minors - 1) * sizeof(struct hd_struct); + int size = (minors - 1) * sizeof(struct hd_struct *); disk->part = kmalloc(size, GFP_KERNEL); if (!disk->part) { kfree(disk); @@ -604,8 +692,8 @@ struct gendisk *disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - p->policy = flag; + struct hd_struct *p = disk->part[part-1]; + if (p) p->policy = flag; } else disk->policy = flag; } @@ -615,7 +703,7 @@ int i; disk->policy = flag; for (i = 0; i < disk->minors - 1; i++) - disk->part[i].policy = flag; + if (disk->part[i]) disk->part[i]->policy = flag; } int bdev_read_only(struct block_device *bdev) @@ -626,8 +714,9 @@ disk = bdev->bd_disk; if (bdev->bd_contains != bdev) { int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); - struct hd_struct *p = &disk->part[part-1]; - return p->policy; + struct hd_struct *p = disk->part[part-1]; + if (p) return p->policy; + return 0; } else return disk->policy; } diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c --- a/drivers/block/ioctl.c Sun Jan 12 06:10:40 2003 +++ b/drivers/block/ioctl.c Sat Apr 19 23:22:49 2003 @@ -41,11 +41,14 @@ return -EINVAL; } /* partition number in use? */ - if (disk->part[part - 1].nr_sects != 0) + if (disk->part[part - 1]) return -EBUSY; /* overlap? */ for (i = 0; i < disk->minors - 1; i++) { - struct hd_struct *s = &disk->part[i]; + struct hd_struct *s = disk->part[i]; + + if (!s) + continue; if (!(start+length <= s->start_sect || start >= s->start_sect + s->nr_sects)) return -EBUSY; @@ -54,7 +57,9 @@ add_partition(disk, part, start, length); return 0; case BLKPG_DEL_PARTITION: - if (disk->part[part - 1].nr_sects == 0) + if (!disk->part[part-1]) + return -ENXIO; + if (disk->part[part - 1]->nr_sects == 0) return -ENXIO; /* partition in use? Incomplete check for now. */ bdevp = bdget(MKDEV(disk->major, disk->first_minor) + part); diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/ll_rw_blk.c Sun Apr 20 14:50:47 2003 @@ -1078,10 +1078,14 @@ * blk_run_queue - run a single device queue * @q The queue to run */ -void __blk_run_queue(request_queue_t *q) +void blk_run_queue(struct request_queue *q) { + unsigned long flags; + + spin_lock_irqsave(q->queue_lock, flags); blk_remove_plug(q); q->request_fn(q); + spin_unlock_irqrestore(q->queue_lock, flags); } /** @@ -1841,7 +1845,7 @@ if (bdev == bdev->bd_contains) return; - p = &disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; + p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; switch (bio->bi_rw) { case READ: p->read_sectors += bio_sectors(bio); @@ -2267,5 +2271,5 @@ EXPORT_SYMBOL(blk_start_queue); EXPORT_SYMBOL(blk_stop_queue); EXPORT_SYMBOL(__blk_stop_queue); -EXPORT_SYMBOL(__blk_run_queue); +EXPORT_SYMBOL(blk_run_queue); EXPORT_SYMBOL(blk_run_queues); diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c --- a/drivers/block/loop.c Fri Apr 18 17:08:13 2003 +++ b/drivers/block/loop.c Sat Apr 19 14:18:27 2003 @@ -1143,7 +1143,6 @@ } for (i = 0; i < max_loop; i++) { - char name[16]; struct loop_device *lo = &loop_dev[i]; struct gendisk *disk = disks[i]; memset(lo, 0, sizeof(*lo)); @@ -1156,14 +1155,10 @@ disk->first_minor = i; disk->fops = &lo_fops; sprintf(disk->disk_name, "loop%d", i); + sprintf(disk->devfs_name, "loop/%d", i); disk->private_data = lo; disk->queue = &lo->lo_queue; add_disk(disk); - sprintf(name, "loop/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, - disk->fops, NULL); } printk(KERN_INFO "loop: loaded (max %d devices)\n", max_loop); return 0; @@ -1184,7 +1179,6 @@ for (i = 0; i < max_loop; i++) { del_gendisk(disks[i]); put_disk(disks[i]); - devfs_remove("loop/%d", i); } devfs_remove("loop"); if (unregister_blkdev(LOOP_MAJOR, "loop")) diff -Nru a/drivers/block/nbd.c b/drivers/block/nbd.c --- a/drivers/block/nbd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/nbd.c Sat Apr 19 14:18:27 2003 @@ -568,7 +568,6 @@ devfs_mk_dir("nbd"); for (i = 0; i < MAX_NBD; i++) { struct gendisk *disk = nbd_dev[i].disk; - char name[16]; nbd_dev[i].refcnt = 0; nbd_dev[i].file = NULL; nbd_dev[i].magic = LO_MAGIC; @@ -585,13 +584,9 @@ disk->private_data = &nbd_dev[i]; disk->queue = &nbd_queue; sprintf(disk->disk_name, "nbd%d", i); + sprintf(disk->devfs_name, "nbd/%d", i); set_capacity(disk, 0x3ffffe); add_disk(disk); - sprintf(name, "nbd/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); } return 0; @@ -607,7 +602,6 @@ for (i = 0; i < MAX_NBD; i++) { del_gendisk(nbd_dev[i].disk); put_disk(nbd_dev[i].disk); - devfs_remove("nbd/%d", i); } devfs_remove("nbd"); blk_cleanup_queue(&nbd_queue); diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c --- a/drivers/block/rd.c Sat Mar 22 07:38:05 2003 +++ b/drivers/block/rd.c Sun Apr 20 09:50:20 2003 @@ -50,9 +50,13 @@ #include #include #include +#include +#include +#include +#include #include /* for invalidate_bdev() */ #include -#include +#include #include #include @@ -370,11 +374,9 @@ } del_gendisk(rd_disks[i]); put_disk(rd_disks[i]); - devfs_remove("rd/%d", i); } #ifdef CONFIG_BLK_DEV_INITRD put_disk(initrd_disk); - devfs_remove("rd/initrd"); #endif devfs_remove("rd"); unregister_blkdev(RAMDISK_MAJOR, "ramdisk" ); @@ -402,7 +404,9 @@ initrd_disk->first_minor = INITRD_MINOR; initrd_disk->fops = &rd_bd_op; sprintf(initrd_disk->disk_name, "initrd"); + sprintf(initrd_disk->devfs_name, "rd/initrd"); #endif + for (i = 0; i < NUM_RAMDISKS; i++) { rd_disks[i] = alloc_disk(1); if (!rd_disks[i]) @@ -420,30 +424,22 @@ for (i = 0; i < NUM_RAMDISKS; i++) { struct gendisk *disk = rd_disks[i]; - char name[16]; + /* rd_size is given in kB */ disk->major = RAMDISK_MAJOR; disk->first_minor = i; disk->fops = &rd_bd_op; disk->queue = &rd_queue; sprintf(disk->disk_name, "ram%d", i); + sprintf(disk->devfs_name, "rd/%d", i); set_capacity(disk, rd_size * 2); - sprintf(name, "rd/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); - } - - for (i = 0; i < NUM_RAMDISKS; i++) add_disk(rd_disks[i]); + } #ifdef CONFIG_BLK_DEV_INITRD /* We ought to separate initrd operations here */ set_capacity(initrd_disk, (initrd_end-initrd_start+511)>>9); add_disk(initrd_disk); - devfs_register(NULL, "rd/initrd", DEVFS_FL_DEFAULT, RAMDISK_MAJOR, - INITRD_MINOR, S_IFBLK | S_IRUSR, &rd_bd_op, NULL); #endif /* rd_size is given in kB */ diff -Nru a/drivers/block/swim3.c b/drivers/block/swim3.c --- a/drivers/block/swim3.c Mon Apr 7 06:36:31 2003 +++ b/drivers/block/swim3.c Sat Apr 19 14:18:27 2003 @@ -971,15 +971,13 @@ .revalidate_disk= floppy_revalidate, }; -static devfs_handle_t floppy_devfs_handle; - int swim3_init(void) { struct device_node *swim; int err = -ENOMEM; int i; - floppy_devfs_handle = devfs_mk_dir("floppy"); + devfs_mk_dir("floppy"); swim = find_devices("floppy"); while (swim && (floppy_count < MAX_FLOPPIES)) @@ -1017,6 +1015,7 @@ disk->private_data = &floppy_states[i]; disk->queue = &swim3_queue; sprintf(disk->disk_name, "fd%d", i); + sprintf(disk->devfs_name, "floppy/%d", i); set_capacity(disk, 2880); add_disk(disk); } @@ -1033,8 +1032,6 @@ { struct device_node *mediabay; struct floppy_state *fs = &floppy_states[floppy_count]; - char floppy_name[16]; - devfs_handle_t floppy_handle; if (swim->n_addrs < 2) { @@ -1095,12 +1092,6 @@ printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count, mediabay ? "in media bay" : ""); - - sprintf(floppy_name, "floppy/%d", floppy_count); - floppy_handle = devfs_register(NULL, floppy_name, - DEVFS_FL_DEFAULT, FLOPPY_MAJOR, floppy_count, - S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, - &floppy_fops, NULL); floppy_count++; diff -Nru a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c --- a/drivers/cdrom/aztcd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/cdrom/aztcd.c Sat Apr 19 14:18:27 2003 @@ -180,7 +180,6 @@ #include #include #include -#include #include @@ -1922,12 +1921,9 @@ azt_disk->first_minor = 0; azt_disk->fops = &azt_fops; sprintf(azt_disk->disk_name, "aztcd"); + sprintf(azt_disk->devfs_name, "aztcd"); azt_disk->queue = &azt_queue; add_disk(azt_disk); - devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT, - azt_disk->major, azt_disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, azt_disk->fops, NULL); - azt_invalidate_buffers(); aztPresent = 1; aztCloseDoor(); @@ -1946,7 +1942,6 @@ static void __exit aztcd_exit(void) { - devfs_remove("aztcd"); del_gendisk(azt_disk); put_disk(azt_disk); if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) { diff -Nru a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c --- a/drivers/cdrom/gscd.c Mon Apr 7 06:36:31 2003 +++ b/drivers/cdrom/gscd.c Sat Apr 19 14:18:27 2003 @@ -63,7 +63,6 @@ #include #include #include -#include #include #include @@ -883,7 +882,6 @@ { CLEAR_TIMER; - devfs_remove("gscd"); del_gendisk(gscd_disk); put_disk(gscd_disk); if ((unregister_blkdev(MAJOR_NR, "gscd") == -EINVAL)) { @@ -958,14 +956,12 @@ gscd_disk->first_minor = 0; gscd_disk->fops = &gscd_fops; sprintf(gscd_disk->disk_name, "gscd"); + sprintf(gscd_disk->devfs_name, "gscd"); if (register_blkdev(MAJOR_NR, "gscd")) { ret = -EIO; goto err_out2; } - - devfs_register(NULL, "gscd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &gscd_fops, NULL); blk_init_queue(&gscd_queue, do_gscd_request, &gscd_lock); diff -Nru a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c --- a/drivers/cdrom/optcd.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/optcd.c Sat Apr 19 14:18:27 2003 @@ -71,7 +71,6 @@ #include #include #include -#include #include #include @@ -2033,6 +2032,8 @@ optcd_disk->first_minor = 0; optcd_disk->fops = &opt_fops; sprintf(optcd_disk->disk_name, "optcd"); + sprintf(optcd_disk->devfs_name, "optcd"); + if (!request_region(optcd_port, 4, "optcd")) { printk(KERN_ERR "optcd: conflict, I/O port 0x%x already used\n", optcd_port); @@ -2065,8 +2066,8 @@ put_disk(optcd_disk); return -EIO; } - devfs_register (NULL, "optcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &opt_fops, NULL); + + blk_init_queue(&opt_queue, do_optcd_request, &optcd_lock); blk_queue_hardsect_size(&opt_queue, 2048); optcd_disk->queue = &opt_queue; @@ -2079,7 +2080,6 @@ static void __exit optcd_exit(void) { - devfs_remove("optcd"); del_gendisk(optcd_disk); put_disk(optcd_disk); if (unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) { diff -Nru a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c --- a/drivers/cdrom/sjcd.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/sjcd.c Sat Apr 19 14:18:27 2003 @@ -70,7 +70,6 @@ #include #include #include -#include #include #include @@ -1692,6 +1691,7 @@ sjcd_disk->first_minor = 0, sjcd_disk->fops = &sjcd_fops, sprintf(sjcd_disk->disk_name, "sjcd"); + sprintf(sjcd_disk->devfs_name, "sjcd"); if (check_region(sjcd_base, 4)) { printk @@ -1778,8 +1778,6 @@ } printk(KERN_INFO "SJCD: Status: port=0x%x.\n", sjcd_base); - devfs_register(NULL, "sjcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0, - S_IFBLK | S_IRUGO | S_IWUGO, &sjcd_fops, NULL); sjcd_disk->queue = &sjcd_queue; add_disk(sjcd_disk); @@ -1798,7 +1796,6 @@ static void __exit sjcd_exit(void) { - devfs_remove("sjcd"); del_gendisk(sjcd_disk); put_disk(sjcd_disk); release_region(sjcd_base, 4); diff -Nru a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c --- a/drivers/cdrom/sonycd535.c Mon Apr 7 06:36:32 2003 +++ b/drivers/cdrom/sonycd535.c Sat Apr 19 14:18:27 2003 @@ -125,7 +125,6 @@ #include #include #include -#include #define REALLY_SLOW_IO #include @@ -1579,6 +1578,7 @@ cdu_disk->first_minor = 0; cdu_disk->fops = &cdu_fops; sprintf(cdu_disk->disk_name, "cdu"); + sprintf(cdu_disk->devfs_name, "cdu535"); if (!request_region(sony535_cd_base_io, 4, CDU535_HANDLE)) { printk(KERN_WARNING"sonycd535: Unable to request region 0x%x\n", @@ -1587,10 +1587,6 @@ } cdu_disk->queue = &sonycd535_queue; add_disk(cdu_disk); - devfs_register (NULL, CDU535_HANDLE, DEVFS_FL_DEFAULT, - cdu_disk->major, cdu_disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, - cdu_disk->fops, NULL); return 0; out7: @@ -1666,7 +1662,6 @@ kfree(sony_buffer); kfree(last_sony_subcode); kfree(sony_toc); - devfs_remove(CDU535_HANDLE); del_gendisk(cdu_disk); put_disk(cdu_disk); blk_cleanup_queue(&sonycd535_queue); diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig --- a/drivers/char/Kconfig Tue Mar 18 08:57:58 2003 +++ b/drivers/char/Kconfig Sun Apr 20 12:56:51 2003 @@ -487,7 +487,7 @@ box (as opposed to using a serial printer; if the connector at the printer has 9 or 25 holes ["female"], then it's serial), say Y. Also read the Printing-HOWTO, available from - . + . It is possible to share one parallel port among several devices (e.g. printer and ZIP drive) and it is safe to compile the diff -Nru a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h --- a/drivers/char/drm/drmP.h Wed Apr 9 21:45:21 2003 +++ b/drivers/char/drm/drmP.h Sun Apr 20 14:14:28 2003 @@ -837,7 +837,7 @@ unsigned int cmd, unsigned long arg ); extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern void DRM(dma_service)( int irq, void *device, +extern irqreturn_t DRM(dma_service)( int irq, void *device, struct pt_regs *regs ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); diff -Nru a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c --- a/drivers/char/drm/i830_dma.c Wed Apr 9 21:45:21 2003 +++ b/drivers/char/drm/i830_dma.c Sun Apr 20 14:12:17 2003 @@ -52,14 +52,6 @@ #define up_write up #endif -#ifndef LockPage -#define LockPage(page) set_bit(PG_locked, &(page)->flags) -#endif -#ifndef UnlockPage -#define UnlockPage(page) unlock_page(page) -#endif - - static inline void i830_print_status_page(drm_device_t *dev) { drm_device_dma_t *dma = dev->dma; @@ -176,10 +168,10 @@ buf->bus_address); dev_priv->mmap_buffer = NULL; filp->f_op = old_fops; - if ((unsigned long)buf_priv->virtual > -1024UL) { + if (IS_ERR(buf_priv->virtual)) { /* Real error */ DRM_ERROR("mmap error\n"); - retcode = (signed int)buf_priv->virtual; + retcode = PTR_ERR(buf_priv->virtual); buf_priv->virtual = 0; } up_write( ¤t->mm->mmap_sem ); @@ -454,7 +446,7 @@ memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE); DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page); - I830_WRITE(0x02080, virt_to_bus((void *)dev_priv->hw_status_page)); + I830_WRITE(0x02080, dev_priv->dma_status_page); DRM_DEBUG("Enabled hardware status page\n"); /* Now we need to init our freelist */ diff -Nru a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c --- a/drivers/char/drm/radeon_irq.c Sat Mar 29 22:34:33 2003 +++ b/drivers/char/drm/radeon_irq.c Sun Apr 20 14:14:28 2003 @@ -54,7 +54,7 @@ * tied to dma at all, this is just a hangover from dri prehistory. */ -void DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_radeon_private_t *dev_priv = @@ -67,7 +67,7 @@ stat = RADEON_READ(RADEON_GEN_INT_STATUS) & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT); if (!stat) - return; + return IRQ_NONE; /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) { @@ -83,6 +83,7 @@ /* Acknowledge interrupts we handle */ RADEON_WRITE(RADEON_GEN_INT_STATUS, stat); + return IRQ_HANDLED; } static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv) diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c --- a/drivers/char/ipmi/ipmi_devintf.c Thu Apr 17 12:39:33 2003 +++ b/drivers/char/ipmi/ipmi_devintf.c Fri Apr 18 11:01:14 2003 @@ -437,10 +437,7 @@ static int ipmi_major = 0; MODULE_PARM(ipmi_major, "i"); -static devfs_handle_t devfs_handle; - #define MAX_DEVICES 10 -static devfs_handle_t handles[MAX_DEVICES]; static void ipmi_new_smi(int if_num) { @@ -451,10 +448,9 @@ snprintf(name, sizeof(name), "ipmidev/%d", if_num); - handles[if_num] = devfs_register(NULL, name, DEVFS_FL_NONE, - ipmi_major, if_num, - S_IFCHR | S_IRUSR | S_IWUSR, - &ipmi_fops, NULL); + devfs_register(NULL, name, 0, ipmi_major, if_num, + S_IFCHR | S_IRUSR | S_IWUSR, + &ipmi_fops, NULL); } static void ipmi_smi_gone(int if_num) @@ -462,7 +458,7 @@ if (if_num > MAX_DEVICES) return; - devfs_unregister(handles[if_num]); + devfs_remove("ipmidev/%d", if_num); } static struct ipmi_smi_watcher smi_watcher = @@ -488,7 +484,7 @@ ipmi_major = rv; } - devfs_handle = devfs_mk_dir(DEVICE_NAME); + devfs_mk_dir(DEVICE_NAME); rv = ipmi_smi_watcher_register(&smi_watcher); if (rv) { @@ -507,7 +503,7 @@ static __exit void cleanup_ipmi(void) { ipmi_smi_watcher_unregister(&smi_watcher); - devfs_unregister(devfs_handle); + devfs_remove(DEVICE_NAME); unregister_chrdev(ipmi_major, DEVICE_NAME); } module_exit(cleanup_ipmi); diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c Wed Feb 12 01:49:20 2003 +++ b/drivers/char/keyboard.c Sat Apr 19 23:22:30 2003 @@ -601,7 +601,7 @@ return; if ((kbd->kbdmode == VC_RAW || kbd->kbdmode == VC_MEDIUMRAW) && - value != K_SAK) + value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ fn_handler[value](vc, regs); } diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c --- a/drivers/char/misc.c Fri Apr 18 08:56:44 2003 +++ b/drivers/char/misc.c Sat Apr 19 02:56:45 2003 @@ -167,7 +167,6 @@ int misc_register(struct miscdevice * misc) { struct miscdevice *c; - char buf[256]; if (misc->next || misc->prev) return -EBUSY; @@ -197,14 +196,21 @@ misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); - /* yuck, yet another stupid special-casing. We should rather - add ->devfs_name to avoid this mess. */ - snprintf(buf, sizeof(buf), strchr(misc->name, '/') ? - "%s" : "misc/%s", misc->name); - misc->devfs_handle = devfs_register(NULL, buf, 0, - MISC_MAJOR, misc->minor, - S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP, - misc->fops, NULL); + /* + * please use it if you want to do fancy things with your + * name... + */ + if (misc->devfs_name[0] == '\0') { + /* yuck, yet another stupid special-casing. + whos actually using this? Please switch over + to ->devfs_name ASAP */ + snprintf(misc->devfs_name, sizeof(misc->devfs_name), + strchr(misc->name, '/') ? + "%s" : "misc/%s", misc->name); + } + + devfs_register(NULL, misc->devfs_name, 0, MISC_MAJOR, misc->minor, + S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->fops, NULL); /* * Add it to the front, so that later devices can "override" @@ -238,7 +244,7 @@ misc->next->prev = misc->prev; misc->next = NULL; misc->prev = NULL; - devfs_unregister (misc->devfs_handle); + devfs_remove(misc->devfs_name); if (i < DYNAMIC_MINORS && i>0) { misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); } diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig --- a/drivers/ide/Kconfig Sun Mar 23 08:45:07 2003 +++ b/drivers/ide/Kconfig Sun Apr 20 12:56:52 2003 @@ -22,7 +22,7 @@ topics, is contained in . For detailed information about hard drives, consult the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . + . To fine-tune ATA/IDE drive/interface parameters for improved performance, look for the hdparm package at @@ -1017,7 +1017,7 @@ If you are unsure, then just choose the Enhanced IDE/MFM/RLL driver instead of this one. For more detailed information, read the Disk-HOWTO, available from - . + . config IDEDMA_AUTO bool diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c --- a/drivers/ide/ide-cd.c Fri Apr 18 08:58:55 2003 +++ b/drivers/ide/ide-cd.c Sat Apr 19 14:18:27 2003 @@ -3366,7 +3366,8 @@ DRIVER(drive)->busy++; g->minors = 1; g->minor_shift = 0; - strcpy(g->devfs_name, drive->devfs_name); + snprintf(g->devfs_name, sizeof(g->devfs_name), + "%s/cd", drive->devfs_name); g->driverfs_dev = &drive->gendev; g->flags = GENHD_FL_CD; if (ide_cdrom_setup(drive)) { diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c --- a/drivers/ide/ide-io.c Fri Apr 18 08:58:55 2003 +++ b/drivers/ide/ide-io.c Sun Apr 20 14:14:28 2003 @@ -1112,7 +1112,7 @@ * on the hwgroup and the process begins again. */ -void ide_intr (int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id; @@ -1126,7 +1126,7 @@ if (!ide_ack_intr(hwif)) { spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_NONE; } if ((handler = hwgroup->handler) == NULL || @@ -1165,7 +1165,7 @@ #endif /* CONFIG_BLK_DEV_IDEPCI */ } spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } drive = hwgroup->drive; if (!drive) { @@ -1176,7 +1176,7 @@ * [Note - this can occur if the drive is hot unplugged] */ spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } if (!drive_is_ready(drive)) { /* @@ -1187,7 +1187,7 @@ * enough advance overhead that the latter isn't a problem. */ spin_unlock_irqrestore(&ide_lock, flags); - return; + return IRQ_HANDLED; } if (!hwgroup->busy) { hwgroup->busy = 1; /* paranoia */ @@ -1222,6 +1222,7 @@ } } spin_unlock_irqrestore(&ide_lock, flags); + return IRQ_HANDLED; } EXPORT_SYMBOL(ide_intr); diff -Nru a/drivers/ide/legacy/hd98.c b/drivers/ide/legacy/hd98.c --- a/drivers/ide/legacy/hd98.c Mon Apr 7 06:36:32 2003 +++ b/drivers/ide/legacy/hd98.c Sun Apr 20 11:08:34 2003 @@ -655,11 +655,8 @@ unsigned int cmd, unsigned long arg) { struct hd_geometry *loc = (struct hd_geometry *) arg; - int dev; + int dev = DEVICE_NR(inode->i_rdev); - if ((!inode) || kdev_none(inode->i_rdev)) - return -EINVAL; - dev = DEVICE_NR(inode->i_rdev); if (dev >= NR_HD) return -EINVAL; switch (cmd) { diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c --- a/drivers/input/evdev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/evdev.c Sat Apr 19 02:34:45 2003 @@ -27,7 +27,6 @@ char name[16]; struct input_handle handle; wait_queue_head_t wait; - devfs_handle_t devfs; struct list_head list; }; @@ -76,6 +75,13 @@ return input_flush_device(&list->evdev->handle, file); } +static void evdev_free(struct evdev *evdev) +{ + devfs_remove("input/event%d", evdev->minor); + evdev_table[evdev->minor] = NULL; + kfree(evdev); +} + static int evdev_release(struct inode * inode, struct file * file) { struct evdev_list *list = file->private_data; @@ -84,17 +90,13 @@ list_del(&list->node); if (!--list->evdev->open) { - if (list->evdev->exist) { + if (list->evdev->exist) input_close_device(&list->evdev->handle); - } else { - input_unregister_minor(list->evdev->devfs); - evdev_table[list->evdev->minor] = NULL; - kfree(list->evdev); - } + else + evdev_free(list->evdev); } kfree(list); - return 0; } @@ -397,7 +399,7 @@ sprintf(evdev->name, "event%d", minor); evdev_table[minor] = evdev; - evdev->devfs = input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE); + input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE); return &evdev->handle; } @@ -411,11 +413,8 @@ if (evdev->open) { input_close_device(handle); wake_up_interruptible(&evdev->wait); - } else { - input_unregister_minor(evdev->devfs); - evdev_table[evdev->minor] = NULL; - kfree(evdev); - } + } else + evdev_free(evdev); } static struct input_device_id evdev_ids[] = { diff -Nru a/drivers/input/input.c b/drivers/input/input.c --- a/drivers/input/input.c Mon Apr 14 04:16:02 2003 +++ b/drivers/input/input.c Sat Apr 19 03:09:24 2003 @@ -32,7 +32,6 @@ EXPORT_SYMBOL(input_register_handler); EXPORT_SYMBOL(input_unregister_handler); EXPORT_SYMBOL(input_register_minor); -EXPORT_SYMBOL(input_unregister_minor); EXPORT_SYMBOL(input_open_device); EXPORT_SYMBOL(input_close_device); EXPORT_SYMBOL(input_accept_process); @@ -47,7 +46,6 @@ static LIST_HEAD(input_handler_list); static struct input_handler *input_table[8]; -static devfs_handle_t input_devfs_handle; #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_bus_input_dir; @@ -542,20 +540,13 @@ .open = input_open_file, }; -devfs_handle_t input_register_minor(char *name, int minor, int minor_base) +void input_register_minor(char *name, int minor, int minor_base) { char devfs_name[16]; - sprintf(devfs_name, name, minor); - - return devfs_register(NULL, devfs_name, 0, - INPUT_MAJOR, minor + minor_base, - S_IFCHR|S_IRUGO|S_IWUSR, - &input_fops, NULL); -} -void input_unregister_minor(devfs_handle_t handle) -{ - devfs_unregister(handle); + sprintf(devfs_name, name, minor); + devfs_register(NULL, devfs_name, 0, INPUT_MAJOR, minor_base + minor, + S_IFCHR|S_IRUGO|S_IWUSR, &input_fops, NULL); } #ifdef CONFIG_PROC_FS @@ -699,8 +690,7 @@ return -EBUSY; } - input_devfs_handle = devfs_mk_dir("input"); - + devfs_mk_dir("input"); return 0; } @@ -711,7 +701,7 @@ remove_proc_entry("handlers", proc_bus_input_dir); remove_proc_entry("input", proc_bus); #endif - devfs_unregister(input_devfs_handle); + devfs_remove("input"); if (unregister_chrdev(INPUT_MAJOR, "input")) printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR); devclass_unregister(&input_devclass); diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c --- a/drivers/input/joydev.c Wed Feb 12 02:02:06 2003 +++ b/drivers/input/joydev.c Sat Apr 19 03:09:50 2003 @@ -45,7 +45,6 @@ char name[16]; struct input_handle handle; wait_queue_head_t wait; - devfs_handle_t devfs; struct list_head list; struct js_corr corr[ABS_MAX]; struct JS_DATA_SAVE_TYPE glue; @@ -141,6 +140,13 @@ return retval < 0 ? retval : 0; } +static void joydev_free(struct joydev *joydev) +{ + devfs_remove("js%d", joydev->minor); + joydev_table[joydev->minor] = NULL; + kfree(joydev); +} + static int joydev_release(struct inode * inode, struct file * file) { struct joydev_list *list = file->private_data; @@ -150,17 +156,13 @@ list_del(&list->node); if (!--list->joydev->open) { - if (list->joydev->exist) { + if (list->joydev->exist) input_close_device(&list->joydev->handle); - } else { - input_unregister_minor(list->joydev->devfs); - joydev_table[list->joydev->minor] = NULL; - kfree(list->joydev); - } + else + joydev_free(list->joydev); } kfree(list); - return 0; } @@ -442,7 +444,7 @@ } joydev_table[minor] = joydev; - joydev->devfs = input_register_minor("js%d", minor, JOYDEV_MINOR_BASE); + input_register_minor("js%d", minor, JOYDEV_MINOR_BASE); return &joydev->handle; } @@ -453,13 +455,10 @@ joydev->exist = 0; - if (joydev->open) { + if (joydev->open) input_close_device(handle); - } else { - input_unregister_minor(joydev->devfs); - joydev_table[joydev->minor] = NULL; - kfree(joydev); - } + else + joydev_free(joydev); } static struct input_device_id joydev_ids[] = { diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c --- a/drivers/input/mousedev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/mousedev.c Sat Apr 19 02:45:50 2003 @@ -46,7 +46,6 @@ wait_queue_head_t wait; struct list_head list; struct input_handle handle; - devfs_handle_t devfs; }; struct mousedev_list { @@ -171,45 +170,52 @@ return retval < 0 ? retval : 0; } +static void mousedev_free(struct mousedev *mousedev) +{ + devfs_remove("input/mouse%d", mousedev->minor); + mousedev_table[mousedev->minor] = NULL; + kfree(mousedev); +} + +static int mixdev_release(void) +{ + struct input_handle *handle; + + list_for_each_entry(handle, &mousedev_handler.h_list, h_node) { + struct mousedev *mousedev = handle->private; + + if (!mousedev->open) { + if (mousedev->exist) + input_close_device(&mousedev->handle); + else + mousedev_free(mousedev); + } + } + + return 0; +} + static int mousedev_release(struct inode * inode, struct file * file) { struct mousedev_list *list = file->private_data; - struct input_handle *handle; - struct mousedev *mousedev; mousedev_fasync(-1, file, 0); list_del(&list->node); if (!--list->mousedev->open) { - if (list->mousedev->minor == MOUSEDEV_MIX) { - list_for_each_entry(handle, &mousedev_handler.h_list, h_node) { - mousedev = handle->private; - if (!mousedev->open) { - if (mousedev->exist) { - input_close_device(&mousedev->handle); - } else { - input_unregister_minor(mousedev->devfs); - mousedev_table[mousedev->minor] = NULL; - kfree(mousedev); - } - } - } - } else { - if (!mousedev_mix.open) { - if (list->mousedev->exist) { - input_close_device(&list->mousedev->handle); - } else { - input_unregister_minor(list->mousedev->devfs); - mousedev_table[list->mousedev->minor] = NULL; - kfree(list->mousedev); - } - } + if (list->mousedev->minor == MOUSEDEV_MIX) + return mixdev_release(); + + if (!mousedev_mix.open) { + if (list->mousedev->exist) + input_close_device(&list->mousedev->handle); + else + mousedev_free(list->mousedev); } } kfree(list); - return 0; } @@ -425,7 +431,7 @@ input_open_device(&mousedev->handle); mousedev_table[minor] = mousedev; - mousedev->devfs = input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE); + input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE); return &mousedev->handle; } @@ -441,9 +447,7 @@ } else { if (mousedev_mix.open) input_close_device(handle); - input_unregister_minor(mousedev->devfs); - mousedev_table[mousedev->minor] = NULL; - kfree(mousedev); + mousedev_free(mousedev); } } @@ -507,7 +511,7 @@ mousedev_table[MOUSEDEV_MIX] = &mousedev_mix; mousedev_mix.exist = 1; mousedev_mix.minor = MOUSEDEV_MIX; - mousedev_mix.devfs = input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); + input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX if (!(mousedev_mix.misc = !misc_register(&psaux_mouse))) @@ -525,7 +529,7 @@ if (mousedev_mix.misc) misc_deregister(&psaux_mouse); #endif - input_unregister_minor(mousedev_mix.devfs); + devfs_remove("input/mice"); input_unregister_handler(&mousedev_handler); interface_unregister(&mousedev_intf); } diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c --- a/drivers/input/serio/i8042.c Thu Apr 17 12:33:06 2003 +++ b/drivers/input/serio/i8042.c Sun Apr 20 14:14:28 2003 @@ -74,7 +74,7 @@ 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110 }; -static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to @@ -332,7 +332,7 @@ * to the upper layers. */ -static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; unsigned char str, data; @@ -415,6 +415,8 @@ serio_interrupt(&i8042_kbd_port, data, dfl, regs); } + /* FIXME - was it really ours? */ + return IRQ_HANDLED; } /* diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c --- a/drivers/input/tsdev.c Sat Mar 22 09:03:17 2003 +++ b/drivers/input/tsdev.c Sat Apr 19 02:48:08 2003 @@ -57,7 +57,6 @@ wait_queue_head_t wait; struct list_head list; struct input_handle handle; - devfs_handle_t devfs; }; /* From Compaq's Touch Screen Specification version 0.2 (draft) */ @@ -115,6 +114,13 @@ return 0; } +static void tsdev_free(struct tsdev *tsdev) +{ + devfs_remove("input/ts%d", tsdev->minor); + tsdev_table[tsdev->minor] = NULL; + kfree(tsdev); +} + static int tsdev_release(struct inode *inode, struct file *file) { struct tsdev_list *list = file->private_data; @@ -123,13 +129,10 @@ list_del(&list->node); if (!--list->tsdev->open) { - if (list->tsdev->exist) { + if (list->tsdev->exist) input_close_device(&list->tsdev->handle); - } else { - input_unregister_minor(list->tsdev->devfs); - tsdev_table[list->tsdev->minor] = NULL; - kfree(list->tsdev); - } + else + tsdev_free(list->tsdev); } kfree(list); return 0; @@ -325,8 +328,7 @@ tsdev->handle.private = tsdev; tsdev_table[minor] = tsdev; - tsdev->devfs = - input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE); + input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE); return &tsdev->handle; @@ -341,11 +343,8 @@ if (tsdev->open) { input_close_device(handle); wake_up_interruptible(&tsdev->wait); - } else { - input_unregister_minor(tsdev->devfs); - tsdev_table[tsdev->minor] = NULL; - kfree(tsdev); - } + } else + tsdev_free(tsdev); } static struct input_device_id tsdev_ids[] = { diff -Nru a/drivers/md/Kconfig b/drivers/md/Kconfig --- a/drivers/md/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/md/Kconfig Sun Apr 20 12:56:52 2003 @@ -25,7 +25,7 @@ More information about Software RAID on Linux is contained in the Software RAID mini-HOWTO, available from - . There you will also learn + . There you will also learn where to get the supporting user space utilities raidtools. If unsure, say N. @@ -57,7 +57,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to compile this as a module ( = code which can be @@ -81,7 +81,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to use such a RAID-1 set, say Y. This code is also @@ -106,7 +106,7 @@ Information about Software RAID on Linux is contained in the Software-RAID mini-HOWTO, available from - . There you will also + . There you will also learn where to get the supporting user space utilities raidtools. If you want to use such a RAID-4/RAID-5 set, say Y. This code is diff -Nru a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c --- a/drivers/md/dm-ioctl.c Sat Apr 5 23:55:25 2003 +++ b/drivers/md/dm-ioctl.c Sat Apr 19 14:26:30 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -174,16 +175,10 @@ static int register_with_devfs(struct hash_cell *hc) { struct gendisk *disk = dm_disk(hc->md); - char *name = kmalloc(DM_NAME_LEN + strlen(DM_DIR) + 1, GFP_KERNEL); - if (!name) { - return -ENOMEM; - } - sprintf(name, DM_DIR "/%s", hc->name); - devfs_register(NULL, name, 0, disk->major, disk->first_minor, + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, - &dm_blk_dops, NULL); - kfree(name); + DM_DIR "/%s", hc->name); return 0; } diff -Nru a/drivers/md/dm.c b/drivers/md/dm.c --- a/drivers/md/dm.c Sat Mar 8 14:50:22 2003 +++ b/drivers/md/dm.c Sat Apr 19 23:22:55 2003 @@ -15,7 +15,7 @@ #include static const char *_name = DM_NAME; -#define MAX_DEVICES (1 << KDEV_MINOR_BITS) +#define MAX_DEVICES 1024 static int major = 0; static int _major = 0; diff -Nru a/drivers/md/md.c b/drivers/md/md.c --- a/drivers/md/md.c Thu Apr 3 17:21:40 2003 +++ b/drivers/md/md.c Sat Apr 19 14:26:30 2003 @@ -3486,11 +3486,11 @@ devfs_mk_dir("md"); blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, md_probe, NULL, NULL); + for (minor=0; minor < MAX_MD_DEVS; ++minor) { - char name[16]; - sprintf(name, "md/%d", minor); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, MAJOR_NR, minor, - S_IFBLK | S_IRUSR | S_IWUSR, &md_fops, NULL); + devfs_mk_bdev(MKDEV(MAJOR_NR, minor), + S_IFBLK|S_IRUSR|S_IWUSR, + "md/%d", minor); } register_reboot_notifier(&md_notifier); diff -Nru a/drivers/md/raid1.c b/drivers/md/raid1.c --- a/drivers/md/raid1.c Sat Apr 12 23:14:24 2003 +++ b/drivers/md/raid1.c Sun Apr 20 09:24:36 2003 @@ -258,7 +258,7 @@ r1_bio->sector + (r1_bio->master_bio->bi_size >> 9); } -static int end_request(struct bio *bio, unsigned int bytes_done, int error) +static int raid1_end_request(struct bio *bio, unsigned int bytes_done, int error) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); @@ -496,7 +496,7 @@ read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; read_bio->bi_bdev = mirror->rdev->bdev; - read_bio->bi_end_io = end_request; + read_bio->bi_end_io = raid1_end_request; read_bio->bi_rw = r1_bio->cmd; read_bio->bi_private = r1_bio; @@ -531,7 +531,7 @@ mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; mbio->bi_bdev = conf->mirrors[i].rdev->bdev; - mbio->bi_end_io = end_request; + mbio->bi_end_io = raid1_end_request; mbio->bi_rw = r1_bio->cmd; mbio->bi_private = r1_bio; @@ -551,11 +551,11 @@ /* * We have to be a bit careful about the semaphore above, thats * why we start the requests separately. Since generic_make_request() - * can sleep, this is the safer solution. Imagine, end_request + * can sleep, this is the safer solution. Imagine, raid1_end_request * decreasing the semaphore before we could have set it up ... * We could play tricks with the semaphore (presetting it and * correcting at the end if sum_bios is not 'n' but we have to - * do end_request by hand if all requests finish until we had a + * do raid1_end_request by hand if all requests finish until we had a * chance to set up the semaphore correctly ... lots of races). */ diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c --- a/drivers/media/dvb/dvb-core/dvbdev.c Thu Apr 17 09:17:57 2003 +++ b/drivers/media/dvb/dvb-core/dvbdev.c Sat Apr 19 01:48:24 2003 @@ -45,7 +45,6 @@ static int dvbdev_debug = 0; #define dprintk if (dvbdev_debug) printk -static devfs_handle_t dvb_devfs_handle; static LIST_HEAD(dvb_adapter_list); static DECLARE_MUTEX(dvbdev_register_lock); @@ -221,10 +220,8 @@ list_add_tail (&dvbdev->list_head, &adap->device_list); sprintf(name, "dvb/adapter%d%s%d", adap->num, dnames[type], id); - dvbdev->devfs_handle = devfs_register(NULL, name, 0, DVB_MAJOR, - nums2minor(adap->num, type, id), - S_IFCHR | S_IRUSR | S_IWUSR, - dvbdev->fops, dvbdev); + devfs_register(NULL, name, 0, DVB_MAJOR, nums2minor(adap->num, type, id), + S_IFCHR | S_IRUSR | S_IWUSR, dvbdev->fops, dvbdev); dprintk("DVB: register adapter%d/%s @ minor: %i (0x%02x)\n", adap->num, name, nums2minor(adap->num, type, id), @@ -236,12 +233,12 @@ void dvb_unregister_device(struct dvb_device *dvbdev) { - if (!dvbdev) - return; - - devfs_unregister(dvbdev->devfs_handle); - list_del (&dvbdev->list_head); - kfree (dvbdev); + if (dvbdev) { + devfs_remove("dvb/adapter%d%s%d", dvbdev->adapter->num, + dnames[dvbdev->type], dvbdev->id); + list_del(&dvbdev->list_head); + kfree(dvbdev); + } } @@ -289,11 +286,12 @@ INIT_LIST_HEAD (&adap->device_list); /* fixme: is this correct? */ + /* No */ try_module_get(THIS_MODULE); printk ("DVB: registering new adapter (%s).\n", name); - adap->devfs_handle = devfs_mk_dir("dvb/adapter%d", num); + devfs_mk_dir("dvb/adapter%d", num); adap->num = num; adap->name = name; @@ -307,13 +305,14 @@ int dvb_unregister_adapter(struct dvb_adapter *adap) { - devfs_unregister (adap->devfs_handle); if (down_interruptible (&dvbdev_register_lock)) return -ERESTARTSYS; + devfs_remove("dvb/adapter%d", adap->num); list_del (&adap->list_head); up (&dvbdev_register_lock); kfree (adap); /* fixme: is this correct? */ + /* No. */ module_put(THIS_MODULE); return 0; } @@ -322,7 +321,7 @@ static int __init init_dvbdev(void) { - dvb_devfs_handle = devfs_mk_dir ("dvb"); + devfs_mk_dir("dvb"); #ifndef CONFIG_DVB_DEVFS_ONLY if(register_chrdev(DVB_MAJOR,"DVB", &dvb_device_fops)) { printk("video_dev: unable to get major %d\n", DVB_MAJOR); @@ -339,7 +338,7 @@ #ifndef CONFIG_DVB_DEVFS_ONLY unregister_chrdev(DVB_MAJOR, "DVB"); #endif - devfs_unregister(dvb_devfs_handle); + devfs_remove("dvb"); } module_init(init_dvbdev); diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h --- a/drivers/media/dvb/dvb-core/dvbdev.h Mon Apr 7 13:17:58 2003 +++ b/drivers/media/dvb/dvb-core/dvbdev.h Fri Apr 18 11:10:40 2003 @@ -45,7 +45,6 @@ struct dvb_adapter { int num; - devfs_handle_t devfs_handle; struct list_head list_head; struct list_head device_list; const char *name; @@ -55,7 +54,6 @@ struct dvb_device { struct list_head list_head; struct file_operations *fops; - devfs_handle_t devfs_handle; struct dvb_adapter *adapter; int type; u32 id; diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c --- a/drivers/media/video/videodev.c Thu Dec 5 18:56:38 2002 +++ b/drivers/media/video/videodev.c Sat Apr 19 03:13:38 2003 @@ -375,7 +375,6 @@ int base; int end; char *name_base; - char name[16]; switch(type) { @@ -426,19 +425,19 @@ vfd->minor=i; up(&videodev_lock); - sprintf (name, "v4l/%s%d", name_base, i - base); - vfd->devfs_handle = - devfs_register (NULL, name, DEVFS_FL_DEFAULT, - VIDEO_MAJOR, vfd->minor, - S_IFCHR | S_IRUSR | S_IWUSR, - &video_fops, - NULL); + sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); + devfs_register(NULL, vfd->devfs_name, 0, VIDEO_MAJOR, vfd->minor, + S_IFCHR | S_IRUSR | S_IWUSR, &video_fops, NULL); init_MUTEX(&vfd->lock); #ifdef CONFIG_VIDEO_PROC_FS - sprintf (name, "%s%d", name_base, i - base); - videodev_proc_create_dev (vfd, name); +{ + char name[16]; + sprintf(name, "%s%d", name_base, i - base); + videodev_proc_create_dev(vfd, name); +} #endif + return 0; } @@ -460,7 +459,7 @@ videodev_proc_destroy_dev (vfd); #endif - devfs_unregister (vfd->devfs_handle); + devfs_remove(vfd->devfs_name); video_device[vfd->minor]=NULL; up(&videodev_lock); } diff -Nru a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c --- a/drivers/mtd/mtdblock.c Tue Apr 8 12:33:09 2003 +++ b/drivers/mtd/mtdblock.c Sat Apr 19 14:18:27 2003 @@ -528,25 +528,20 @@ if (!mtd || mtd->type == MTD_ABSENT) return; -#ifdef CONFIG_DEVFS_FS - sprintf(name, DEVICE_NAME"/%d", mtd->index); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - MTD_BLOCK_MAJOR, mtd->index, - S_IFBLK | S_IRUGO | S_IWUGO, - &mtd_fops, NULL); -#endif - disk = alloc_disk(1); if (disk) { disk->major = MAJOR_NR; disk->first_minor = mtd->index; disk->fops = &mtd_fops; + sprintf(disk->disk_name, "mtdblock%d", mtd->index); + sprintf(disk->devfs_name, "mtdblock/%d", mtd->index); mtddisk[mtd->index] = disk; set_capacity(disk, mtd->size / 512); disk->private_data = &mtdblks[mtd->index]; disk->queue = &mtd_queue; + add_disk(disk); } } @@ -555,8 +550,6 @@ { if (!mtd || mtd->type == MTD_ABSENT) return; - - devfs_remove(DEVICE_NAME"/%d", mtd->index); if (mtddisk[mtd->index]) { del_gendisk(mtddisk[mtd->index]); diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Sun Mar 30 01:45:41 2003 +++ b/drivers/net/Kconfig Sun Apr 20 12:56:51 2003 @@ -12,7 +12,7 @@ telephone line with a modem either via UUCP (UUCP is a protocol to forward mail and news between unix hosts over telephone lines; read the UUCP-HOWTO, available from - ) or dialing up a shell + ) or dialing up a shell account or a BBS, even using term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on some Internet connected Unix computer. Read @@ -32,7 +32,7 @@ Make sure to read the NET-3-HOWTO. Eventually, you will have to read Olaf Kirch's excellent and free book "Network Administrator's - Guide", to be found in . If + Guide", to be found in . If unsure, say Y. if NETDEVICES @@ -51,7 +51,7 @@ thing often comes in handy, the default is Y. It won't enlarge your kernel either. What a deal. Read about it in the Network Administrator's Guide, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -98,7 +98,7 @@ Say Y if you want this and read . You may also want to read section 6.2 of the NET-3-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -206,7 +206,7 @@ If your Linux machine will be connected to an Ethernet and you have an Ethernet network interface card (NIC) installed in your computer, say Y here and read the Ethernet-HOWTO, available from - . You will then also have + . You will then also have to say Y to the driver for your particular NIC. Note that the answer to this question won't directly affect the @@ -357,7 +357,7 @@ If you want to include a driver to support Nubus or LC-PDS Ethernet cards using an NS8390 chipset or its equivalent, say Y and read the Ethernet-HOWTO, available from - . + . config MAC89x0 tristate "Macintosh CS89x0 based ethernet cards" @@ -366,7 +366,7 @@ Support for CS89x0 chipset based Ethernet cards. If you have a Nubus or LC-PDS network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -382,7 +382,7 @@ the onboard Ethernet in many Quadras as well as some LC-PDS, a few Nubus and all known Comm Slot Ethernet cards. If you have one of these say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -397,7 +397,7 @@ Support for the onboard AMD 79C940 MACE Ethernet controller used in the 660AV and 840AV Macintosh. If you have one of these Macintoshes say Y and read the Ethernet-HOWTO, available from - . + . config MVME147_NET tristate "MVME147 (Lance) Ethernet support" @@ -516,7 +516,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . config STNIC tristate "National DP83902AV support" @@ -595,7 +595,7 @@ help If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -608,7 +608,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Also, consider buying a + . Also, consider buying a new card, since the 3c501 is slow, broken, and obsolete: you will have problems. Some people suggest to ping ("man ping") a nearby machine every minute ("man cron") when using this card. @@ -625,7 +625,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -640,7 +640,7 @@ Information about this network (Ethernet) card can be found in . If you have a card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -654,7 +654,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -668,7 +668,7 @@ ---help--- If you have a network (Ethernet) card belonging to the 3Com EtherLinkIII series, say Y and read the Ethernet-HOWTO, available - from . + from . If your card is not working you may need to use the DOS setup disk to disable Plug & Play mode, and to select the default @@ -686,7 +686,7 @@ help If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet network card, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -700,7 +700,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -714,7 +714,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -736,7 +736,7 @@ "Hurricane" (3c555/3cSOHO) PCI If you have such a card, say Y and read the Ethernet-HOWTO, - available from . More + available from . More specific information is in and in the comments at the beginning of . @@ -758,7 +758,7 @@ If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -772,7 +772,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Some LinkSys cards are + . Some LinkSys cards are of this type. If you want to compile this driver as a module ( = code which can be @@ -786,7 +786,7 @@ help If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from - . + . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -799,7 +799,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -813,7 +813,7 @@ help If you have a network (Ethernet) card of this type and are running an MCA based system (PS/2), say Y and read the Ethernet-HOWTO, - available from . + available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -827,7 +827,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . Important: There have been many reports that, with some motherboards mixing an SMC Ultra and an Adaptec AHA154x SCSI card (or compatible, @@ -848,7 +848,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -865,7 +865,7 @@ another SMC9192/9194 based chipset. Say Y if you want it compiled into the kernel, and read the file and the Ethernet-HOWTO, - available from . + available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -879,7 +879,7 @@ help If you have a network (Ethernet) card belonging to this class, such as the NI5010, NI5210 or NI6210, say Y and read the Ethernet-HOWTO, - available from . + available from . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -892,7 +892,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Note that this is still + . Note that this is still experimental code. This driver is also available as a module ( = code which can be @@ -907,7 +907,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -921,7 +921,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -937,7 +937,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -952,7 +952,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - as well as + as well as . If you want to compile this as a module ( = code which can be @@ -968,7 +968,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -984,7 +984,7 @@ bus system (that's the way the cards talks to the other components of your computer) is ISA (as opposed to EISA, VLB or PCI), say Y. Make sure you know the name of your card. Read the Ethernet-HOWTO, - available from . + available from . If unsure, say Y. @@ -999,7 +999,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1015,7 +1015,7 @@ cards. If this is for you, say Y and read in the kernel source as well as the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1029,7 +1029,7 @@ ---help--- If you have an EtherExpress16 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . Note that the Intel + . Note that the Intel EtherExpress16 card used to be regarded as a very poor choice because the driver was very unreliable. We now have a new driver that should do better. @@ -1048,7 +1048,7 @@ driver supports intel i82595{FX,TX} based boards. Note however that the EtherExpress PRO/100 Ethernet card has its own separate driver. Please read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1062,7 +1062,7 @@ ---help--- If you have a Fujitsu FMV-181/182/183/184 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . If you use an FMV-183 or FMV-184 and it is not working, you may need to disable Plug & Play mode of the card. @@ -1079,7 +1079,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1093,7 +1093,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1115,7 +1115,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1129,7 +1129,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Many Ethernet cards + . Many Ethernet cards without a specific driver are compatible with NE2000. If you have a PCI NE2000 card however, say N here and Y to "PCI @@ -1152,7 +1152,7 @@ (Ethernet) card, and this is the Linux driver for it. Note that the IBM Thinkpad 300 is compatible with the Z-Note and is also supported by this driver. Read the Ethernet-HOWTO, available from - . + . config SEEQ8005 tristate "SEEQ8005 support (EXPERIMENTAL)" @@ -1160,7 +1160,7 @@ help This is a driver for the SEEQ 8005 network (Ethernet) card. If this is for you, read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1174,7 +1174,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . config NET_CBUS bool "NEC PC-9800 C-bus cards" @@ -1248,7 +1248,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1278,7 +1278,7 @@ help This is another class of network cards which attach directly to the bus. If you have one of those, say Y and read the Ethernet-HOWTO, - available from . + available from . Note that the answer to this question doesn't directly affect the kernel: saying N will just cause the configurator to skip all @@ -1292,7 +1292,7 @@ help If you have a PCnet32 or PCnetPCI based network (Ethernet) card, answer Y here and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1306,7 +1306,7 @@ help If you have an AMD 8111-based PCI lance ethernet card, answer Y here and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1346,7 +1346,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1360,7 +1360,7 @@ help If you have a network (Ethernet) controller of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1374,7 +1374,7 @@ help If you have a network (Ethernet) controller of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1389,7 +1389,7 @@ Support for CS89x0 chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - as well as + as well as . If you want to compile this as a module ( = code which can be @@ -1406,7 +1406,7 @@ PCI/EISA Ethernet switch cards. These include the SE-4 and the SE-6 models. If you have a network card of this type, say Y and read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . This driver is also available as a module ( = code which can be @@ -1421,7 +1421,7 @@ help If you have an Intel EtherExpress PRO/100 PCI network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1523,7 +1523,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1557,7 +1557,7 @@ with ISA NE2000 cards (they have their own driver, "NE2000/NE1000 support" below). If you have a PCI NE2000 network (Ethernet) card, say Y and read the Ethernet-HOWTO, available from - . + . This driver also works for the following NE2000 clone cards: RealTek RTL-8029 Winbond 89C940 Compex RL2000 KTI ET32P2 @@ -1576,7 +1576,7 @@ ---help--- If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . Note that this driver + . Note that this driver will NOT WORK for NE3200 cards as they are completely different. This driver is also available as a module ( = code which can be @@ -1591,7 +1591,7 @@ help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1606,7 +1606,7 @@ This is a driver for the Fast Ethernet PCI network cards based on the RTL8139C+ chips. If you have one of those, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1621,7 +1621,7 @@ the RTL8139 chips. If you have one of those, say Y and read as well as the Ethernet-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -1675,7 +1675,7 @@ the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in SiS 630 and SiS 540 chipsets. If you have one of those, say Y and read the Ethernet-HOWTO, available at - . Please read + . Please read and comments at the beginning of for more information. @@ -1721,7 +1721,7 @@ If you have a PCI Ethernet network card based on the ThunderLAN chip which is supported by this driver, say Y and read the Ethernet-HOWTO, available from - . + . Devices currently supported by this driver are Compaq Netelligent, Compaq NetFlex and Olicom cards. Please read the file @@ -1777,7 +1777,7 @@ Cute little network (Ethernet) devices which attach to the parallel port ("pocket adapters"), commonly used with laptops. If you have one of those, say Y and read the Ethernet-HOWTO, available from - . + . If you want to plug a network (or some other) card into the PCMCIA (or PC-card) slot of your laptop instead (PCMCIA is the standard for @@ -1799,7 +1799,7 @@ ---help--- This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, - available from , if you + available from , if you want to use this. If you intend to use this driver, you should have said N to the "Parallel printer support", because the two drivers don't like each other. @@ -1816,7 +1816,7 @@ This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, available from - , if you want to use + , if you want to use this. It is possible to have several devices share a single parallel port and it is safe to compile the corresponding drivers into the kernel. @@ -1834,7 +1834,7 @@ This is a network (Ethernet) device which attaches to your parallel port. Read as well as the Ethernet-HOWTO, available from - , if you want to use + , if you want to use this. It is possible to have several devices share a single parallel port and it is safe to compile the corresponding drivers into the kernel. @@ -2010,7 +2010,7 @@ help If you have a Gigabit Ethernet card of this type, say Y and read the Ethernet-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -2201,7 +2201,7 @@ If you want to use PLIP, say Y and read the PLIP mini-HOWTO as well as the NET-3-HOWTO, both available from - . Note that the PLIP + . Note that the PLIP protocol has been changed and this PLIP driver won't work together with the PLIP support in Linux versions 1.0.x. This option enlarges your kernel by about 8 KB. @@ -2225,7 +2225,7 @@ To use PPP, you need an additional program called pppd as described in the PPP-HOWTO, available at - . Make sure that you have + . Make sure that you have the version of pppd recommended in . The PPP option enlarges your kernel by about 16 KB. @@ -2377,7 +2377,7 @@ allows you to use SLIP over a regular dial up shell connection. If you plan to use SLiRP, make sure to say Y to CSLIP, below. The NET-3-HOWTO, available from - , explains how to + , explains how to configure SLIP. Note that you don't need this option if you just want to run term (term is a program which gives you almost full Internet connectivity if you have a regular dial up shell account on @@ -2403,7 +2403,7 @@ ) which allows you to use SLIP over a regular dial up shell connection, you definitely want to say Y here. The NET-3-HOWTO, available from - , explains how to configure + , explains how to configure CSLIP. This won't enlarge your kernel. config SLIP_SMART diff -Nru a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig --- a/drivers/net/arcnet/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/arcnet/Kconfig Sun Apr 20 12:56:51 2003 @@ -18,7 +18,7 @@ support" below. You might also want to have a look at the Ethernet-HOWTO, available - from (even though ARCnet + from (even though ARCnet is not really Ethernet). This driver is also available as a module ( = code which can be diff -Nru a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c --- a/drivers/net/e100/e100_main.c Mon Apr 7 00:03:41 2003 +++ b/drivers/net/e100/e100_main.c Sun Apr 20 14:14:29 2003 @@ -190,7 +190,7 @@ static int e100_set_mac(struct net_device *, void *); struct net_device_stats *e100_get_stats(struct net_device *); -static void e100intr(int, void *, struct pt_regs *); +static irqreturn_t e100intr(int, void *, struct pt_regs *); static void e100_print_brd_conf(struct e100_private *); static void e100_set_multi(struct net_device *); void e100_set_speed_duplex(struct e100_private *); @@ -1837,7 +1837,7 @@ * the RX & TX queues & starts the RU if it has stopped due * to no resources. */ -void +irqreturn_t e100intr(int irq, void *dev_inst, struct pt_regs *regs) { struct net_device *dev; @@ -1850,7 +1850,7 @@ intr_status = readw(&bdp->scb->scb_status); /* If not my interrupt, just return */ if (!(intr_status & SCB_STATUS_ACK_MASK) || (intr_status == 0xffff)) { - return; + return IRQ_NONE; } /* disable and ack intr */ @@ -1859,7 +1859,7 @@ /* the device is closed, don't continue or else bad things may happen. */ if (!netif_running(dev)) { e100_set_intr_mask(bdp); - return; + return IRQ_NONE; } /* SWI intr (triggered by watchdog) is signal to allocate new skb buffers */ @@ -1877,6 +1877,7 @@ e100_tx_srv(bdp); e100_set_intr_mask(bdp); + return IRQ_HANDLED; } /** diff -Nru a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig --- a/drivers/net/hamradio/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/hamradio/Kconfig Sun Apr 20 12:56:51 2003 @@ -60,7 +60,7 @@ Currently, this driver supports Ottawa PI/PI2, Paccomm/Gracilis PackeTwin, and S5SCC/DMA boards. They are detected automatically. If you have one of these cards, say Y here and read the AX25-HOWTO, - available from . + available from . This driver can operate multiple boards simultaneously. If you compile it as a module (by saying M instead of Y), it will be called @@ -88,7 +88,7 @@ in order to communicate with other computers. If you want to use this, read and the AX25-HOWTO, available from - . Also make sure to say Y + . Also make sure to say Y to "Amateur Radio AX.25 Level 2" support. If you want to compile this as a module ( = code which can be diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c --- a/drivers/net/pcmcia/3c574_cs.c Mon Apr 7 11:33:22 2003 +++ b/drivers/net/pcmcia/3c574_cs.c Sat Apr 19 23:19:00 2003 @@ -940,11 +940,9 @@ outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD); } - dev_kfree_skb (skb); pop_tx_status(dev); - - spin_unlock(&lp->window_lock); - + spin_unlock_irqrestore(&lp->window_lock, flags); + dev_kfree_skb(skb); return 0; } diff -Nru a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig --- a/drivers/net/pcmcia/Kconfig Tue Feb 25 18:56:15 2003 +++ b/drivers/net/pcmcia/Kconfig Sun Apr 20 12:56:51 2003 @@ -17,7 +17,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . If unsure, say N. diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c --- a/drivers/net/pcmcia/pcnet_cs.c Wed Mar 19 02:23:25 2003 +++ b/drivers/net/pcmcia/pcnet_cs.c Sun Apr 20 14:14:29 2003 @@ -117,7 +117,7 @@ static int pcnet_close(struct net_device *dev); static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int do_ioctl_light(struct net_device *dev, struct ifreq *rq, int cmd); -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs); static void ei_watchdog(u_long arg); static void pcnet_reset_8390(struct net_device *dev); static int set_config(struct net_device *dev, struct ifmap *map); @@ -1121,11 +1121,13 @@ /*====================================================================*/ -static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs) { pcnet_dev_t *info = dev_id; info->stale = 0; ei_interrupt(irq, dev_id, regs); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } static void ei_watchdog(u_long arg) diff -Nru a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig --- a/drivers/net/tokenring/Kconfig Mon Feb 24 10:24:37 2003 +++ b/drivers/net/tokenring/Kconfig Sun Apr 20 12:56:51 2003 @@ -16,7 +16,7 @@ connected to such a Token Ring network and want to use your Token Ring card under Linux, say Y here and to the driver for your particular card below and read the Token-Ring mini-HOWTO, available - from . Most people can + from . Most people can say N here. config IBMTR @@ -25,7 +25,7 @@ ---help--- This is support for all IBM Token Ring cards that don't use DMA. If you have such a beast, say Y and read the Token-Ring mini-HOWTO, - available from . + available from . Warning: this driver will almost definitely fail if more than one active Token Ring card is present. @@ -44,7 +44,7 @@ Wake On Lan, and PCI 100/16/4 adapters. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -62,7 +62,7 @@ This is support for IBM Lanstreamer PCI Token Ring Cards. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a modules ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -78,7 +78,7 @@ should use the tms380 driver instead. If you have such an adapter, say Y and read the Token-Ring - mini-HOWTO, available from . + mini-HOWTO, available from . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -104,7 +104,7 @@ If you have such an adapter and would like to use it, say Y and read the Token-Ring mini-HOWTO, available from - . + . Also read the file or check . @@ -194,7 +194,7 @@ If you have such an adapter and would like to use it, say Y or M and read the Token-Ring mini-HOWTO, available from - and the file + and the file . This driver is also available as a module ( = code which can be diff -Nru a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig --- a/drivers/net/tulip/Kconfig Sun Feb 9 17:29:49 2003 +++ b/drivers/net/tulip/Kconfig Sun Apr 20 12:56:51 2003 @@ -21,7 +21,7 @@ (smc9332dst), you can also try the driver for "Generic DECchip" cards, above. However, most people with a network card of this type will say Y here.) Do read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . @@ -42,7 +42,7 @@ (smc9332dst), you can also try the driver for "Generic DECchip" cards, above. However, most people with a network card of this type will say Y here.) Do read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . @@ -80,7 +80,7 @@ These include the DE425, DE434, DE435, DE450 and DE500 models. If you have a network card of this type, say Y and read the Ethernet-HOWTO, available from - . More specific + . More specific information is contained in . diff -Nru a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c --- a/drivers/net/tulip/dmfe.c Fri Mar 28 21:04:10 2003 +++ b/drivers/net/tulip/dmfe.c Sat Apr 19 23:22:21 2003 @@ -668,12 +668,12 @@ if ( db->tx_queue_cnt < TX_FREE_DESC_CNT ) netif_wake_queue(dev); - /* free this SKB */ - dev_kfree_skb(skb); - /* Restore CR7 to enable interrupt */ spin_unlock_irqrestore(&db->lock, flags); outl(db->cr7_data, dev->base_addr + DCR7); + + /* free this SKB */ + dev_kfree_skb(skb); return 0; } diff -Nru a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig --- a/drivers/net/wireless/Kconfig Tue Feb 25 18:56:15 2003 +++ b/drivers/net/wireless/Kconfig Sun Apr 20 12:56:51 2003 @@ -88,7 +88,7 @@ If you want to use an ISA WaveLAN card under Linux, say Y and read the Ethernet-HOWTO, available from - . Some more specific + . Some more specific information is contained in and in the source code . @@ -240,7 +240,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . You will also very likely also need the Wireless Tools in order to configure your card and that /etc/pcmcia/wireless.opts works: @@ -266,7 +266,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, - available from . + available from . # yes, this works even when no drivers are selected config NET_WIRELESS diff -Nru a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c --- a/drivers/parport/parport_pc.c Sun Mar 23 14:28:44 2003 +++ b/drivers/parport/parport_pc.c Sun Apr 20 14:14:29 2003 @@ -262,9 +262,11 @@ * of these are in parport_pc.h. */ -static void parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { parport_generic_irq(irq, (struct parport *) dev_id, regs); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } void parport_pc_write_data(struct parport *p, unsigned char d) diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c --- a/drivers/pci/bus.c Mon Mar 3 13:26:41 2003 +++ b/drivers/pci/bus.c Sat Apr 19 23:22:31 2003 @@ -75,7 +75,8 @@ * Add newly discovered PCI devices (which are on the bus->devices * list) to the global PCI device list, add the sysfs and procfs * entries. Where a bridge is found, add the discovered bus to - * the parents list of child buses, and recurse. + * the parents list of child buses, and recurse (breadth-first + * to be compatible with 2.4) * * Call hotplug for each new devices. */ @@ -97,6 +98,12 @@ pci_proc_attach_device(dev); #endif pci_create_sysfs_dev_files(dev); + + } + + list_for_each_entry(dev, &bus->devices, bus_list) { + + BUG_ON(list_empty(&dev->global_list)); /* * If there is an unattached subordinate bus, attach diff -Nru a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig --- a/drivers/pcmcia/Kconfig Sun Mar 30 00:13:46 2003 +++ b/drivers/pcmcia/Kconfig Sun Apr 20 12:56:51 2003 @@ -21,7 +21,7 @@ To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). Please also read the PCMCIA-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). diff -Nru a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c --- a/drivers/pcmcia/rsrc_mgr.c Wed Mar 26 08:49:33 2003 +++ b/drivers/pcmcia/rsrc_mgr.c Sun Apr 20 14:14:29 2003 @@ -599,7 +599,7 @@ #ifdef CONFIG_PCMCIA_PROBE -static void fake_irq(int i, void *d, struct pt_regs *r) { } +static irqreturn_t fake_irq(int i, void *d, struct pt_regs *r) { return IRQ_NONE; } static inline int check_irq(int irq) { if (request_irq(irq, fake_irq, 0, "bogus", NULL) != 0) diff -Nru a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c --- a/drivers/pcmcia/yenta.c Mon Mar 17 07:43:04 2003 +++ b/drivers/pcmcia/yenta.c Sun Apr 20 14:14:29 2003 @@ -429,7 +429,7 @@ socket->handler(socket->info, events); } -static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned int events; pci_socket_t *socket = (pci_socket_t *) dev_id; @@ -440,7 +440,9 @@ socket->events |= events; spin_unlock(&socket->event_lock); schedule_work(&socket->tq_task); + return IRQ_HANDLED; } + return IRQ_NONE; } static void yenta_interrupt_wrapper(unsigned long data) diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c --- a/drivers/pnp/resource.c Thu Mar 6 13:50:22 2003 +++ b/drivers/pnp/resource.c Sun Apr 20 14:14:29 2003 @@ -420,8 +420,9 @@ return NULL; } -static void pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs) { + return IRQ_NONE; } int pnp_check_irq(struct pnp_dev * dev, int idx) diff -Nru a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c --- a/drivers/s390/block/dasd.c Fri Apr 18 08:58:55 2003 +++ b/drivers/s390/block/dasd.c Sat Apr 19 14:17:47 2003 @@ -141,38 +141,15 @@ static inline int dasd_state_new_to_known(struct dasd_device *device) { - umode_t devfs_perm; - kdev_t kdev; - char buf[20]; - - kdev = dasd_get_kdev(device); - if (kdev_none(kdev)) - return -ENODEV; - /* * As long as the device is not in state DASD_STATE_NEW we want to * keep the reference count > 0. */ dasd_get_device(device); -#ifdef CONFIG_DEVFS_FS - /* Add a proc directory and the dasd device entry to devfs. */ sprintf(device->gdp->devfs_name, "dasd/%04x", _ccw_device_get_device_number(device->cdev)); -#endif - if (device->ro_flag) - devfs_perm = S_IFBLK | S_IRUSR; - else - devfs_perm = S_IFBLK | S_IRUSR | S_IWUSR; - - snprintf(buf, sizeof(buf), "dasd/%04x/device", - _ccw_device_get_device_number(device->cdev)); - device->devfs_entry = devfs_register(NULL, buf, 0, - major(kdev), - minor(kdev) << DASD_PARTN_BITS, - devfs_perm, - &dasd_device_operations, NULL); device->state = DASD_STATE_KNOWN; return 0; } @@ -183,10 +160,6 @@ static inline void dasd_state_known_to_new(struct dasd_device * device) { - /* Remove device entry and devfs directory. */ - devfs_unregister(device->devfs_entry); - devfs_unregister(device->gdp->de); - /* Forget the discipline information. */ device->discipline = NULL; device->state = DASD_STATE_NEW; diff -Nru a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c --- a/drivers/s390/block/dasd_devmap.c Mon Apr 14 12:11:53 2003 +++ b/drivers/s390/block/dasd_devmap.c Sun Apr 20 06:55:08 2003 @@ -406,27 +406,6 @@ } /* - * Return kdev for a dasd device. - */ -kdev_t -dasd_get_kdev(struct dasd_device *device) -{ - struct dasd_devmap *devmap; - int major, minor; - int devno; - - devno = _ccw_device_get_device_number(device->cdev); - devmap = dasd_devmap_from_devno(devno); - if (devmap == NULL) - return NODEV; - major = dasd_gendisk_index_major(devmap->devindex); - if (major < 0) - return NODEV; - minor = devmap->devindex % DASD_PER_MAJOR; - return mk_kdev(major, minor); -} - -/* * Create a dasd device structure for cdev. */ struct dasd_device * diff -Nru a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h --- a/drivers/s390/block/dasd_int.h Mon Apr 14 12:11:54 2003 +++ b/drivers/s390/block/dasd_int.h Sun Apr 20 06:54:52 2003 @@ -264,7 +264,6 @@ struct dasd_device { /* Block device stuff. */ struct gendisk *gdp; - devfs_handle_t devfs_entry; request_queue_t *request_queue; spinlock_t request_queue_lock; unsigned long blocks; /* size of volume in blocks */ @@ -471,7 +470,6 @@ struct dasd_device *dasd_create_device(struct ccw_device *); void dasd_delete_device(struct dasd_device *); -kdev_t dasd_get_kdev(struct dasd_device *); struct dasd_device *dasd_device_from_devindex(int); int dasd_parse(void); diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c --- a/drivers/s390/block/xpram.c Sat Mar 22 07:38:05 2003 +++ b/drivers/s390/block/xpram.c Sat Apr 19 14:18:27 2003 @@ -449,7 +449,6 @@ offset = 0; for (i = 0; i < xpram_devs; i++) { struct gendisk *disk = xpram_disks[i]; - char name[16]; xpram_devices[i].size = xpram_sizes[i] / 4; xpram_devices[i].offset = offset; @@ -460,13 +459,9 @@ disk->private_data = &xpram_devices[i]; disk->queue = &xpram_queue; sprintf(disk->disk_name, "slram%d", i); + sprintf(disk->disk_name, "slram/%d", i); set_capacity(disk, xpram_sizes[i] << 1); add_disk(disk); - sprintf(name, "slram/%d", i); - devfs_register(NULL, name, DEVFS_FL_DEFAULT, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); } return 0; @@ -485,7 +480,6 @@ for (i = 0; i < xpram_devs; i++) { del_gendisk(xpram_disks[i]); put_disk(xpram_disks[i]); - devfs_remove("slram/%d", i); } unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME); devfs_remove("slram"); diff -Nru a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c --- a/drivers/s390/char/tubfs.c Mon Mar 31 15:55:36 2003 +++ b/drivers/s390/char/tubfs.c Fri Apr 18 11:14:59 2003 @@ -34,10 +34,6 @@ }; #ifdef CONFIG_DEVFS_FS -static devfs_handle_t fs3270_devfs_dir; -static devfs_handle_t fs3270_devfs_tub; -extern struct file_operations tty_fops; - void fs3270_devfs_register(tub_t *tubp) { char name[16]; @@ -48,7 +44,7 @@ S_IFCHR | S_IRUSR | S_IWUSR, &fs3270_fops, NULL); sprintf(name, "tty%.4x", tubp->devno); tty_register_devfs_name(&tty3270_driver, 0, tubp->minor, - fs3270_devfs_dir, name); + NULL, name); } void fs3270_devfs_unregister(tub_t *tubp) @@ -72,13 +68,11 @@ IBM_FS3270_MAJOR, rc); return -1; } -#ifdef CONFIG_DEVFS_FS - fs3270_devfs_dir = devfs_mk_dir("3270"); - fs3270_devfs_tub = devfs_register(NULL, "3270/tub", 0, + devfs_mk_dir("3270"); + devfs_register(NULL, "3270/tub", 0, IBM_FS3270_MAJOR, 0, S_IFCHR | S_IRUGO | S_IWUGO, &fs3270_fops, NULL); -#endif fs3270_major = IBM_FS3270_MAJOR; return 0; } @@ -90,10 +84,8 @@ fs3270_fini(void) { if (fs3270_major != -1) { -#ifdef CONFIG_DEVFS_FS - devfs_unregister(fs3270_devfs_tub); - devfs_unregister(fs3270_devfs_dir); -#endif + devfs_remove("3270"); + devfs_remove("3270/tub"); unregister_chrdev(fs3270_major, "fs3270"); fs3270_major = -1; } diff -Nru a/drivers/s390/char/tubio.h b/drivers/s390/char/tubio.h --- a/drivers/s390/char/tubio.h Mon Mar 31 15:55:36 2003 +++ b/drivers/s390/char/tubio.h Fri Apr 18 11:49:07 2003 @@ -338,7 +338,6 @@ extern enum tubwhat tty3270_proc_what; extern struct tty_driver tty3270_driver; #ifdef CONFIG_DEVFS_FS -extern devfs_handle_t fs3270_devfs_dir; extern void fs3270_devfs_register(tub_t *); extern void fs3270_devfs_unregister(tub_t *); #endif diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig --- a/drivers/scsi/Kconfig Tue Mar 4 22:34:46 2003 +++ b/drivers/scsi/Kconfig Sun Apr 20 12:56:51 2003 @@ -8,7 +8,7 @@ If you want to use a SCSI hard disk or the SCSI or parallel port version of the IOMEGA ZIP drive under Linux, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from - . This is NOT for SCSI + . This is NOT for SCSI CD-ROMs. This driver is also available as a module ( = code which can be @@ -26,7 +26,7 @@ ---help--- If you want to use a SCSI tape drive under Linux, say Y and read the SCSI-HOWTO, available from - , and + , and in the kernel source. This is NOT for SCSI CD-ROMs. @@ -48,7 +48,7 @@ tape drives (ADR-x0) that supports the standard SCSI-2 commands for tapes (QIC-157) and can be driven by the standard driver st. For more information, you may have a look at the SCSI-HOWTO - and + and in the kernel source. More info on the OnStream driver may be found on @@ -67,7 +67,7 @@ ---help--- If you want to use a SCSI CD-ROM under Linux, say Y and read the SCSI-HOWTO and the CD-ROM-HOWTO at - . Also make sure to say Y + . Also make sure to say Y or M to "ISO 9660 CD-ROM file system support" later. This driver is also available as a module ( = code which can be @@ -238,7 +238,7 @@ must be manually specified in this case. It is explained in section 3.3 of the SCSI-HOWTO, available from - . You might also want to + . You might also want to read the file . This driver is also available as a module ( = code which can be @@ -252,7 +252,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.4 of the SCSI-HOWTO, available from - . Note that Trantor was + . Note that Trantor was purchased by Adaptec, and some former Trantor products are being sold under the Adaptec name. If it doesn't work out of the box, you may have to change some settings in . @@ -268,7 +268,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.5 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -316,7 +316,7 @@ configuration options. You should read at a minimum before contacting the maintainer with any questions. The SCSI-HOWTO, - available from , can also + available from , can also be of great help. If you want to compile this driver as a module ( = code which can be @@ -377,7 +377,7 @@ This is support for the AM53/79C974 SCSI host adapters. Please read for details. Also, the SCSI-HOWTO, available from - , is for you. + , is for you. Note that there is another driver for AM53C974 based adapters: "Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support", above. You @@ -406,7 +406,7 @@ ---help--- This is support for BusLogic MultiMaster and FlashPoint SCSI Host Adapters. Consult the SCSI-HOWTO, available from - , and the files + , and the files and for more information. If this driver does not work correctly without modification, please contact @@ -451,7 +451,7 @@ help This is support for DTC 3180/3280 SCSI Host Adapters. Please read the SCSI-HOWTO, available from - , and the file + , and the file . This driver is also available as a module ( = code which can be @@ -470,7 +470,7 @@ You want to read the start of and the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -518,7 +518,7 @@ host adapters could also use this driver but are discouraged from doing so, since this driver only supports hard disks and lacks numerous features. You might want to have a look at the SCSI-HOWTO, - available from . + available from . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -534,7 +534,7 @@ other adapters based on the Future Domain chipsets (Quantum ISA-200S, ISA-250MG; Adaptec AHA-2920A; and at least one IBM board). It is explained in section 3.7 of the SCSI-HOWTO, available from - . + . NOTE: Newer Adaptec AHA-2920C boards use the Adaptec AIC-7850 chip and should use the aic7xxx driver ("Adaptec AIC7xxx chipset SCSI @@ -589,7 +589,7 @@ generic 5380 support. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -605,7 +605,7 @@ This is a driver for the old NCR 53c80 series of SCSI controllers on boards using memory mapped I/O. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -719,7 +719,7 @@ help This is support for the Initio 91XXU(W) SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -732,7 +732,7 @@ help This is support for the Initio INI-A100U2W SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -758,7 +758,7 @@ For more information about this driver and how to use it you should read the file . You should also read the SCSI-HOWTO, which is available from - . If you use this driver, + . If you use this driver, you will still be able to use the parallel port for other tasks, such as a printer; it is safe to compile both drivers into the kernel. @@ -787,7 +787,7 @@ For more information about this driver and how to use it you should read the file . You should also read the SCSI-HOWTO, which is available from - . If you use this driver, + . If you use this driver, you will still be able to use the parallel port for other tasks, such as a printer; it is safe to compile both drivers into the kernel. @@ -833,7 +833,7 @@ This is support for the NCR53c406a SCSI host adapter. For user configurable parameters, check out in the kernel source. Also read the SCSI-HOWTO, available from - . + . If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -883,7 +883,7 @@ This is a driver for the 53c7 and 8xx NCR family of SCSI controllers, not to be confused with the NCR 5380 controllers. It is explained in section 3.8 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . Please read for the available boot time @@ -1220,7 +1220,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.10 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -1235,7 +1235,7 @@ help This is support for the PCI2000I EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called pci2000 ( = code which can be inserted in and removed from the running kernel @@ -1248,7 +1248,7 @@ help This is support for the PCI2220i EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called pci2220i ( = code which can be inserted in and removed from the running kernel @@ -1261,7 +1261,7 @@ help This is support for the PSI240i EIDE interface card which acts as a SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . This driver is also available as a module called psi240i ( = code which can be inserted in and removed from the running kernel @@ -1283,7 +1283,7 @@ Information about this driver is contained in . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1303,7 +1303,7 @@ Please read the file . You should also read the SCSI-HOWTO, available from - . + . This driver is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1346,7 +1346,7 @@ ---help--- These are 8-bit SCSI controllers; the ST-01 is also supported by this driver. It is explained in section 3.9 of the SCSI-HOWTO, - available from . If it + available from . If it doesn't work out of the box, you may have to change some settings in . @@ -1433,7 +1433,7 @@ ---help--- This is support for a SCSI host adapter. It is explained in section 3.11 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . Note that Trantor was purchased by Adaptec, and some former Trantor products are being sold under the @@ -1453,7 +1453,7 @@ information about this hardware. If the driver doesn't work out of the box, you may have to change some settings in . Read the SCSI-HOWTO, available from - . Note that there is also + . Note that there is also another driver for the same hardware: "UltraStor SCSI support", below. You should say Y to both only if you want 24F support as well. @@ -1502,7 +1502,7 @@ This is support for the UltraStor 14F, 24F and 34F SCSI-2 host adapter family. This driver is explained in section 3.12 of the SCSI-HOWTO, available from - . If it doesn't work out + . If it doesn't work out of the box, you may have to change some settings in . @@ -1520,7 +1520,7 @@ help This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus SCSI host adapter. Please read the SCSI-HOWTO, available from - . + . If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c Wed Apr 9 07:55:37 2003 +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c Sun Apr 20 14:14:29 2003 @@ -3863,7 +3863,7 @@ /* * SCSI controller interrupt handler. */ -void +irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs) { struct ahc_softc *ahc; @@ -3883,6 +3883,8 @@ ahc_schedule_completeq(ahc, acmd); } ahc_unlock(ahc, &flags); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } void diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h Tue Mar 25 16:32:23 2003 +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h Sun Apr 20 14:14:29 2003 @@ -1224,7 +1224,7 @@ int ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, char channel, int lun, u_int tag, role_t role, uint32_t status); -void ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs); +irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs); void ahc_platform_flushwork(struct ahc_softc *ahc); int ahc_softc_comp(struct ahc_softc *, struct ahc_softc *); void ahc_done(struct ahc_softc*, struct scb*); diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Wed Feb 12 14:02:45 2003 +++ b/drivers/scsi/qla1280.c Sun Apr 20 14:14:29 2003 @@ -1736,11 +1736,12 @@ * qla1280_intr_handler * Handles the H/W interrupt **************************************************************************/ -void +irqreturn_t qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) { struct scsi_qla_host *ha; struct device_reg *reg; + int handled = 0; u16 data; ENTER_INTR ("qla1280_intr_handler"); @@ -1757,6 +1758,7 @@ /* Check for pending interrupts. */ if (data & RISC_INT) { qla1280_isr(ha, &ha->done_q_first, &ha->done_q_last); + handled = 1; } else { /* spurious interrupts can happen legally */ dprintk(1, "scsi(%ld): Spurious interrupt - ignoring\n", @@ -1772,6 +1774,7 @@ WRT_REG_WORD(®->ictrl, (ISP_EN_INT | ISP_EN_RISC)); LEAVE_INTR("qla1280_intr_handler"); + return IRQ_RETVAL(handled); } /************************************************************************** diff -Nru a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h --- a/drivers/scsi/qla1280.h Tue Dec 10 12:28:34 2002 +++ b/drivers/scsi/qla1280.h Sun Apr 20 14:14:29 2003 @@ -1316,7 +1316,7 @@ int qla1280_biosparam(struct scsi_device *, struct block_device *, sector_t, int[]); static int qla1280_slave_configure(Scsi_Device *); -void qla1280_intr_handler(int, void *, struct pt_regs *); +irqreturn_t qla1280_intr_handler(int, void *, struct pt_regs *); void qla1280_setup(char *s, int *dummy); /* diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c --- a/drivers/scsi/scsi_error.c Mon Mar 24 04:15:10 2003 +++ b/drivers/scsi/scsi_error.c Sun Apr 20 09:19:56 2003 @@ -1401,7 +1401,6 @@ static void scsi_restart_operations(struct Scsi_Host *shost) { struct scsi_device *sdev; - unsigned long flags; /* * If the door was locked, we need to insert a door lock request @@ -1430,11 +1429,8 @@ * now that error recovery is done, we will need to ensure that these * requests are started. */ - list_for_each_entry(sdev, &shost->my_devices, siblings) { - spin_lock_irqsave(sdev->request_queue->queue_lock, flags); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); - } + list_for_each_entry(sdev, &shost->my_devices, siblings) + blk_run_queue(sdev->request_queue); } /** diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c Mon Apr 14 16:09:21 2003 +++ b/drivers/scsi/scsi_lib.c Sun Apr 20 09:19:56 2003 @@ -328,7 +328,7 @@ /* * Called for single_lun devices on IO completion. Clear starget_sdev_user, - * and call __blk_run_queue for all the scsi_devices on the target - + * and call blk_run_queue for all the scsi_devices on the target - * including current_sdev first. * * Called with *no* scsi locks held. @@ -336,7 +336,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev) { struct scsi_device *sdev; - unsigned long flags, flags2; + unsigned long flags; spin_lock_irqsave(current_sdev->host->host_lock, flags); WARN_ON(!current_sdev->sdev_target->starget_sdev_user); @@ -344,14 +344,12 @@ spin_unlock_irqrestore(current_sdev->host->host_lock, flags); /* - * Call __blk_run_queue for all LUNs on the target, starting with + * Call blk_run_queue for all LUNs on the target, starting with * current_sdev. We race with others (to set starget_sdev_user), * but in most cases, we will be first. Ideally, each LU on the * target would get some limited time or requests on the target. */ - spin_lock_irqsave(current_sdev->request_queue->queue_lock, flags2); - __blk_run_queue(current_sdev->request_queue); - spin_unlock_irqrestore(current_sdev->request_queue->queue_lock, flags2); + blk_run_queue(current_sdev->request_queue); spin_lock_irqsave(current_sdev->host->host_lock, flags); if (current_sdev->sdev_target->starget_sdev_user) { @@ -366,11 +364,8 @@ spin_unlock_irqrestore(current_sdev->host->host_lock, flags); list_for_each_entry(sdev, ¤t_sdev->same_target_siblings, - same_target_siblings) { - spin_lock_irqsave(sdev->request_queue->queue_lock, flags2); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags2); - } + same_target_siblings) + blk_run_queue(sdev->request_queue); } /* @@ -452,7 +447,7 @@ (shost->host_busy >= shost->can_queue))) { /* * As long as shost is accepting commands and we have - * starved queues, call __blk_run_queue. scsi_request_fn + * starved queues, call blk_run_queue. scsi_request_fn * drops the queue_lock and can add us back to the * starved_list. * @@ -465,9 +460,7 @@ list_del_init(&sdev->starved_entry); spin_unlock_irqrestore(shost->host_lock, flags); - spin_lock_irqsave(sdev->request_queue->queue_lock, flags); - __blk_run_queue(sdev->request_queue); - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); + blk_run_queue(sdev->request_queue); spin_lock_irqsave(shost->host_lock, flags); if (unlikely(!list_empty(&sdev->starved_entry))) @@ -480,9 +473,7 @@ } spin_unlock_irqrestore(shost->host_lock, flags); - spin_lock_irqsave(q->queue_lock, flags); - __blk_run_queue(q); - spin_unlock_irqrestore(q->queue_lock, flags); + blk_run_queue(q); } /* diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c --- a/drivers/scsi/scsi_scan.c Fri Apr 18 08:58:55 2003 +++ b/drivers/scsi/scsi_scan.c Sat Apr 19 14:18:27 2003 @@ -1733,7 +1733,6 @@ if (sdev->attached) return -EINVAL; - devfs_remove(sdev->devfs_name); scsi_device_unregister(sdev); scsi_free_sdev(sdev); diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c --- a/drivers/scsi/sr.c Fri Apr 18 08:58:55 2003 +++ b/drivers/scsi/sr.c Sat Apr 19 14:18:27 2003 @@ -569,7 +569,8 @@ get_capabilities(cd); sr_vendor_init(cd); - strcpy(disk->devfs_name, sdev->devfs_name); + snprintf(disk->devfs_name, sizeof(disk->devfs_name), + "%s/cd", sdev->devfs_name); disk->driverfs_dev = &sdev->sdev_driverfs_dev; register_cdrom(&cd->cdi); set_capacity(disk, cd->capacity); diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c --- a/drivers/serial/8250.c Sat Mar 15 17:15:06 2003 +++ b/drivers/serial/8250.c Sun Apr 20 14:14:29 2003 @@ -984,7 +984,7 @@ * This means we need to loop through all ports. checking that they * don't have an interrupt pending. */ -static void serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct irq_info *i = dev_id; struct list_head *l, *end = NULL; @@ -1024,6 +1024,8 @@ spin_unlock(&i->lock); DEBUG_INTR("end.\n"); + /* FIXME! Was it really ours? */ + return IRQ_HANDLED; } /* diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig --- a/drivers/serial/Kconfig Tue Mar 18 09:05:10 2003 +++ b/drivers/serial/Kconfig Sun Apr 20 12:56:51 2003 @@ -97,7 +97,7 @@ Say Y here if you have dumb serial boards other than the four standard COM 1/2/3/4 ports. This may happen if you have an AST FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available - from ), or other custom + from ), or other custom serial port hardware which acts similar to standard serial port hardware. If you only use the standard COM 1/2/3/4 ports, you can say N here to save some memory. You can also say Y if you have an diff -Nru a/drivers/serial/core.c b/drivers/serial/core.c --- a/drivers/serial/core.c Wed Apr 16 15:35:04 2003 +++ b/drivers/serial/core.c Sat Apr 19 23:22:29 2003 @@ -782,8 +782,12 @@ /* * Claim and map the new regions */ - if (port->type != PORT_UNKNOWN) + if (port->type != PORT_UNKNOWN) { retval = port->ops->request_port(port); + } else { + /* Always success - Jean II */ + retval = 0; + } /* * If we fail to request resources for the diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c --- a/drivers/usb/class/usblp.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/class/usblp.c Sat Apr 19 02:08:38 2003 @@ -130,7 +130,6 @@ struct usblp { struct usb_device *dev; /* USB device */ - devfs_handle_t devfs; /* devfs device */ struct semaphore sem; /* locks this struct, especially "dev" */ char *writebuf; /* write transfer_buffer */ char *readbuf; /* read transfer_buffer */ @@ -163,7 +162,6 @@ dbg("usblp=0x%p", usblp); dbg("dev=0x%p", usblp->dev); - dbg("devfs=0x%p", usblp->devfs); dbg("buf=0x%p", usblp->buf); dbg("readcount=%d", usblp->readcount); dbg("ifnum=%d", usblp->ifnum); @@ -382,7 +380,7 @@ static void usblp_cleanup (struct usblp *usblp) { - devfs_unregister (usblp->devfs); + devfs_remove ("usb/lp%d", usblp->minor); usb_deregister_dev (1, usblp->minor); info("usblp%d: removed", usblp->minor); @@ -908,8 +906,7 @@ /* If we have devfs, create with perms=660. */ sprintf(name, "usb/lp%d", usblp->minor); - usblp->devfs = devfs_register(NULL, name, - DEVFS_FL_DEFAULT, USB_MAJOR, + devfs_register(NULL, name, 0, USB_MAJOR, usblp->minor, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, &usblp_fops, NULL); diff -Nru a/drivers/usb/core/file.c b/drivers/usb/core/file.c --- a/drivers/usb/core/file.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/core/file.c Fri Apr 18 11:15:45 2003 @@ -28,8 +28,6 @@ #endif #include -static devfs_handle_t usb_devfs_handle; /* /dev/usb dir. */ - #define MAX_USB_MINORS 256 static struct file_operations *usb_minors[MAX_USB_MINORS]; static spinlock_t minor_lock = SPIN_LOCK_UNLOCKED; @@ -75,14 +73,13 @@ return -EBUSY; } - usb_devfs_handle = devfs_mk_dir("usb"); - + devfs_mk_dir("usb"); return 0; } void usb_major_cleanup(void) { - devfs_unregister(usb_devfs_handle); + devfs_remove("usb"); unregister_chrdev(USB_MAJOR, "usb"); } diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c Mon Apr 14 14:01:44 2003 +++ b/drivers/usb/core/hcd.c Sun Apr 20 14:14:29 2003 @@ -1436,17 +1436,18 @@ * to handle interrupts. The PCI glue layer does so automatically; only * bus glue for non-PCI system busses will need to use this. */ -void usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r) +irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r) { struct usb_hcd *hcd = __hcd; int start = hcd->state; if (unlikely (hcd->state == USB_STATE_HALT)) /* irq sharing? */ - return; + return IRQ_NONE; hcd->driver->irq (hcd, r); if (hcd->state != start && hcd->state == USB_STATE_HALT) usb_hc_died (hcd); + return IRQ_HANDLED; } EXPORT_SYMBOL (usb_hcd_irq); diff -Nru a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h --- a/drivers/usb/core/hcd.h Mon Apr 14 13:59:07 2003 +++ b/drivers/usb/core/hcd.h Sun Apr 20 14:14:29 2003 @@ -239,7 +239,7 @@ /* generic bus glue, needed for host controllers that don't use PCI */ extern struct usb_operations usb_hcd_operations; -extern void usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r); +extern irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r); extern void usb_hc_died (struct usb_hcd *hcd); /* -------------------------------------------------------------------------- */ diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c --- a/drivers/usb/image/scanner.c Sat Apr 12 04:48:13 2003 +++ b/drivers/usb/image/scanner.c Fri Apr 18 11:54:05 2003 @@ -397,6 +397,7 @@ */ +#include #include /* @@ -843,7 +844,7 @@ kfree(scn->obuf); dbg("%s: De-allocating minor:%d", __FUNCTION__, scn->scn_minor); - devfs_unregister(scn->devfs); + devfs_remove("usb/scanner%d", scn->scn_minor - SCN_BASE_MNR); usb_deregister_dev(1, scn->scn_minor); usb_free_urb(scn->scn_irq); usb_put_dev(scn->scn_dev); @@ -1105,13 +1106,11 @@ sprintf(name, "usb/scanner%d", scn->scn_minor - SCN_BASE_MNR); - scn->devfs = devfs_register(NULL, name, + devfs_register(NULL, name, DEVFS_FL_DEFAULT, USB_MAJOR, scn->scn_minor, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, &usb_scanner_fops, NULL); - if (scn->devfs == NULL) - dbg("scanner%d: device node registration failed", scn_minor); info ("USB scanner device (0x%04x/0x%04x) now attached to %s", dev->descriptor.idVendor, dev->descriptor.idProduct, name); diff -Nru a/drivers/usb/image/scanner.h b/drivers/usb/image/scanner.h --- a/drivers/usb/image/scanner.h Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/image/scanner.h Fri Apr 18 11:53:22 2003 @@ -40,7 +40,6 @@ #include #include #include -#include // #define DEBUG @@ -336,7 +335,6 @@ struct scn_usb_data { struct usb_device *scn_dev; - devfs_handle_t devfs; /* devfs device */ struct urb *scn_irq; unsigned int ifnum; /* Interface number of the USB device */ int scn_minor; /* Scanner minor - used in disconnect() */ diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c --- a/drivers/usb/input/hiddev.c Sat Mar 22 09:04:18 2003 +++ b/drivers/usb/input/hiddev.c Fri Apr 18 11:17:15 2003 @@ -50,7 +50,6 @@ int open; int minor; wait_queue_head_t wait; - devfs_handle_t devfs; struct hid_device *hid; struct hiddev_list *list; }; @@ -66,7 +65,6 @@ }; static struct hiddev *hiddev_table[HIDDEV_MINORS]; -static devfs_handle_t hiddev_devfs_handle; /* forward reference to make our lives easier */ extern struct usb_driver hiddev_driver; @@ -229,7 +227,7 @@ */ static void hiddev_cleanup(struct hiddev *hiddev) { - devfs_unregister(hiddev->devfs); + devfs_remove("usb/hid/hiddev%d", hiddev->minor); usb_deregister_dev(1, hiddev->minor); hiddev_table[hiddev->minor] = NULL; kfree(hiddev); @@ -716,8 +714,8 @@ hiddev->exist = 1; sprintf(devfs_name, "usb/hid/hiddev%d", minor); - hiddev->devfs = devfs_register(NULL, devfs_name, - DEVFS_FL_DEFAULT, USB_MAJOR, minor + HIDDEV_MINOR_BASE, + devfs_register(NULL, devfs_name, 0, + USB_MAJOR, minor + HIDDEV_MINOR_BASE, S_IFCHR | S_IRUGO | S_IWUSR, &hiddev_fops, NULL); hid->minor = minor; hid->hiddev = hiddev; @@ -774,7 +772,7 @@ int __init hiddev_init(void) { - hiddev_devfs_handle = devfs_mk_dir("usb/hid"); + devfs_mk_dir("usb/hid"); usb_register(&hiddev_driver); return 0; } diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c --- a/drivers/usb/misc/auerswald.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/auerswald.c Fri Apr 18 11:50:24 2003 @@ -242,7 +242,6 @@ struct semaphore mutex; /* protection in user context */ char name[20]; /* name of the /dev/usb entry */ unsigned int dtindex; /* index in the device table */ - devfs_handle_t devfs; /* devfs device node */ struct usb_device * usbdev; /* USB device handle */ int open_count; /* count the number of open character channels */ char dev_desc[AUSI_DLEN];/* for storing a textual description */ @@ -1972,7 +1971,7 @@ up (&dev_table_mutex); /* initialize the devfs node for this device and register it */ - cp->devfs = devfs_register(NULL, cp->name, 0, USB_MAJOR, + devfs_register(NULL, cp->name, 0, USB_MAJOR, AUER_MINOR_BASE + dtindex, S_IFCHR | S_IRUGO | S_IWUGO, &auerswald_fops, NULL); @@ -2092,7 +2091,7 @@ /* remove our devfs node */ /* Nobody can see this device any more */ - devfs_unregister (cp->devfs); + devfs_remove(cp->name); /* give back our USB minor number */ usb_deregister_dev (1, cp->dtindex); diff -Nru a/drivers/usb/misc/brlvger.c b/drivers/usb/misc/brlvger.c --- a/drivers/usb/misc/brlvger.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/brlvger.c Fri Apr 18 11:52:06 2003 @@ -156,7 +156,6 @@ struct usb_device *dev; /* USB device handle */ struct usb_endpoint_descriptor *in_interrupt; struct urb *intr_urb; - devfs_handle_t devfs; int subminor; /* which minor dev #? */ @@ -374,16 +373,11 @@ dbg("Display length: %d", priv->plength); sprintf(devfs_name, "usb/brlvger%d", priv->subminor); - priv->devfs = devfs_register(NULL, devfs_name, + devfs_register(NULL, devfs_name, DEVFS_FL_DEFAULT, USB_MAJOR, BRLVGER_MINOR+priv->subminor, S_IFCHR |S_IRUSR|S_IWUSR |S_IRGRP|S_IWGRP, &brlvger_fops, NULL); - if (!priv->devfs) { -#ifdef CONFIG_DEVFS_FS - err("devfs node registration failed"); -#endif - } display_table[i] = priv; @@ -420,7 +414,7 @@ if(priv){ info("Display %d disconnecting", priv->subminor); - devfs_unregister(priv->devfs); + devfs_remove("usb/brlvger%d", priv->subminor); usb_deregister_dev(1, priv->subminor); down(&disconnect_sem); diff -Nru a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c --- a/drivers/usb/misc/rio500.c Sat Mar 22 09:02:37 2003 +++ b/drivers/usb/misc/rio500.c Fri Apr 18 11:51:05 2003 @@ -65,7 +65,6 @@ struct rio_usb_data { struct usb_device *rio_dev; /* init: probe_rio */ - devfs_handle_t devfs; /* devfs device */ unsigned int ifnum; /* Interface number of the USB device */ int isopen; /* nz if open */ int present; /* Device is present on the bus */ @@ -476,13 +475,11 @@ } dbg("probe_rio: ibuf address:%p", rio->ibuf); - rio->devfs = devfs_register(NULL, "usb/rio500", + devfs_register(NULL, "usb/rio500", DEVFS_FL_DEFAULT, USB_MAJOR, RIO_MINOR, S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, &usb_rio_fops, NULL); - if (rio->devfs == NULL) - dbg("probe_rio: device node registration failed"); init_MUTEX(&(rio->lock)); @@ -496,7 +493,7 @@ usb_set_intfdata (intf, NULL); if (rio) { - devfs_unregister(rio->devfs); + devfs_remove("usb/rio500"); usb_deregister_dev(1, rio->minor); down(&(rio->lock)); diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c --- a/drivers/usb/usb-skeleton.c Mon Mar 24 13:03:56 2003 +++ b/drivers/usb/usb-skeleton.c Fri Apr 18 11:49:59 2003 @@ -98,7 +98,6 @@ struct usb_skel { struct usb_device * udev; /* save off the usb device pointer */ struct usb_interface * interface; /* the interface for this device */ - devfs_handle_t devfs; /* devfs device node */ unsigned char minor; /* the starting minor number for this device */ unsigned char num_ports; /* the number of ports this device has */ char num_interrupt_in; /* number of interrupt in endpoints we have */ @@ -610,7 +609,7 @@ /* initialize the devfs node for this device and register it */ sprintf(name, "usb/skel%d", dev->minor); - dev->devfs = devfs_register(NULL, name, + devfs = devfs_register(NULL, name, DEVFS_FL_DEFAULT, USB_MAJOR, dev->minor, S_IFCHR | S_IRUSR | S_IWUSR | @@ -674,7 +673,7 @@ minor = dev->minor; /* remove our devfs node */ - devfs_unregister (dev->devfs); + devfs_remove("usb/skel%d", dev->minor); /* give back our dynamic minor */ usb_deregister_dev (1, minor); diff -Nru a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c --- a/drivers/video/aty/mach64_gx.c Sun Feb 9 15:55:58 2003 +++ b/drivers/video/aty/mach64_gx.c Sat Apr 19 23:22:36 2003 @@ -119,7 +119,7 @@ } static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { /* * FIXME: use real calculations instead of using fixed values from the old @@ -338,7 +338,7 @@ */ static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 MHz100; /* in 0.01 MHz */ u32 program_bits; @@ -494,7 +494,7 @@ */ static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; @@ -610,7 +610,7 @@ */ static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u32 vclk_per, u8 bpp, union aty_pll *pll) { u32 tempA, tempB, fOut, longMHz100, diff, preDiff; @@ -734,7 +734,7 @@ */ static int aty_var_to_pll_408(const struct fb_info *info, u32 vclk_per, - u32 bpp, u32 width, union aty_pll *pll) + u8 bpp, union aty_pll *pll) { u32 mhz100; /* in 0.01 MHz */ u32 program_bits; diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c --- a/drivers/video/fbmem.c Sat Apr 12 17:33:14 2003 +++ b/drivers/video/fbmem.c Sun Apr 20 02:39:53 2003 @@ -25,6 +25,7 @@ #include #include #include +#include #include #ifdef CONFIG_KMOD #include @@ -655,7 +656,7 @@ } /* Return if no suitable logo was found */ - fb_logo.logo = find_logo(info->var.bits_per_pixel); + fb_logo.logo = fb_find_logo(info->var.bits_per_pixel); if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) { fb_logo.logo = NULL; diff -Nru a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c --- a/drivers/video/logo/logo.c Thu Apr 10 07:16:31 2003 +++ b/drivers/video/logo/logo.c Sun Apr 20 02:43:30 2003 @@ -33,7 +33,7 @@ extern const struct linux_logo logo_superh_clut224; -const struct linux_logo * __init find_logo(int depth) +const struct linux_logo *fb_find_logo(int depth) { const struct linux_logo *logo = 0; diff -Nru a/fs/Kconfig b/fs/Kconfig --- a/fs/Kconfig Fri Mar 21 10:23:06 2003 +++ b/fs/Kconfig Sun Apr 20 12:56:52 2003 @@ -26,7 +26,7 @@ by about 44 KB. The Ext2fs-Undeletion mini-HOWTO, available from - , gives information about + , gives information about how to retrieve deleted files on ext2fs file systems. To change the behavior of ext2 file systems, you can use the tune2fs @@ -386,7 +386,7 @@ in order to use quota support (you can download sources from ). For further details, read the Quota mini-HOWTO, available from - . Probably the quota + . Probably the quota support is only useful for multi user systems. If unsure, say N. config QFMT_V1 @@ -469,7 +469,7 @@ driver. If you have a CD-ROM drive and want to do more with it than just listen to audio CDs and watch its LEDs, say Y (and read and the CD-ROM-HOWTO, - available from ), thereby + available from ), thereby enlarging your kernel by about 27 KB; otherwise say N. If you want to compile this as a module ( = code which can be @@ -576,7 +576,7 @@ they are compressed; to access compressed MSDOS partitions under Linux, you can either use the DOS emulator DOSEMU, described in the DOSEMU-HOWTO, available from - , or try dmsdosfs in + , or try dmsdosfs in . If you intend to use dosemu with a non-compressed MSDOS partition, say Y here) and MSDOS floppies. This means that file access becomes @@ -1233,7 +1233,7 @@ programs nfsd and mountd (but does not need to have NFS file system support enabled in its kernel). NFS is explained in the Network Administrator's Guide, available from - , on its man page: "man + , on its man page: "man nfs", and in the NFS-HOWTO. A superior but less widely used alternative to NFS is provided by @@ -1298,7 +1298,7 @@ as well. Please read the NFS-HOWTO, available from - . + . The NFS server is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -1398,7 +1398,7 @@ works only if the Windows machines use TCP/IP as the underlying transport protocol, and not NetBEUI. For details, read and the SMB-HOWTO, - available from . + available from . Note: if you just want your box to act as an SMB *server* and make files and printing services available to Windows clients (which need @@ -1475,7 +1475,7 @@ to mount NetWare file server volumes and to access them just like any other Unix directory. For details, please read the file in the kernel source and - the IPX-HOWTO from . + the IPX-HOWTO from . You do not have to say Y here if you want your Linux box to act as a file *server* for Novell NetWare clients. diff -Nru a/fs/aio.c b/fs/aio.c --- a/fs/aio.c Sat Mar 22 09:10:34 2003 +++ b/fs/aio.c Sat Apr 19 23:22:38 2003 @@ -148,7 +148,7 @@ dprintk("mmap address: 0x%08lx\n", info->mmap_base); info->nr_pages = get_user_pages(current, ctx->mm, - info->mmap_base, info->mmap_size, + info->mmap_base, nr_pages, 1, 0, info->ring_pages, NULL); up_write(&ctx->mm->mmap_sem); diff -Nru a/fs/block_dev.c b/fs/block_dev.c --- a/fs/block_dev.c Mon Mar 24 10:17:16 2003 +++ b/fs/block_dev.c Sat Apr 19 23:22:49 2003 @@ -559,10 +559,10 @@ bdev->bd_contains = whole; down(&whole->bd_sem); whole->bd_part_count++; - p = disk->part + part - 1; + p = disk->part[part - 1]; bdev->bd_inode->i_data.backing_dev_info = whole->bd_inode->i_data.backing_dev_info; - if (!(disk->flags & GENHD_FL_UP) || !p->nr_sects) { + if (!(disk->flags & GENHD_FL_UP) || !p || !p->nr_sects) { whole->bd_part_count--; up(&whole->bd_sem); ret = -ENXIO; diff -Nru a/fs/buffer.c b/fs/buffer.c --- a/fs/buffer.c Sat Apr 12 16:21:06 2003 +++ b/fs/buffer.c Sat Apr 19 23:22:40 2003 @@ -776,6 +776,85 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); /* + * Add a page to the dirty page list. + * + * It is a sad fact of life that this function is called from several places + * deeply under spinlocking. It may not sleep. + * + * If the page has buffers, the uptodate buffers are set dirty, to preserve + * dirty-state coherency between the page and the buffers. It the page does + * not have buffers then when they are later attached they will all be set + * dirty. + * + * The buffers are dirtied before the page is dirtied. There's a small race + * window in which a writepage caller may see the page cleanness but not the + * buffer dirtiness. That's fine. If this code were to set the page dirty + * before the buffers, a concurrent writepage caller could clear the page dirty + * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean + * page on the dirty page list. + * + * There is also a small window where the page is dirty, and not on dirty_pages. + * Also a possibility that by the time the page is added to dirty_pages, it has + * been set clean. The page lists are somewhat approximate in this regard. + * It's better to have clean pages accidentally attached to dirty_pages than to + * leave dirty pages attached to clean_pages. + * + * We use private_lock to lock against try_to_free_buffers while using the + * page's buffer list. Also use this to protect against clean buffers being + * added to the page after it was set dirty. + * + * FIXME: may need to call ->reservepage here as well. That's rather up to the + * address_space though. + * + * For now, we treat swapper_space specially. It doesn't use the normal + * block a_ops. + */ +int __set_page_dirty_buffers(struct page *page) +{ + struct address_space * const mapping = page->mapping; + int ret = 0; + + if (mapping == NULL) { + SetPageDirty(page); + goto out; + } + + if (!PageUptodate(page)) + buffer_error(); + + spin_lock(&mapping->private_lock); + if (page_has_buffers(page)) { + struct buffer_head *head = page_buffers(page); + struct buffer_head *bh = head; + + do { + if (buffer_uptodate(bh)) + set_buffer_dirty(bh); + else + buffer_error(); + bh = bh->b_this_page; + } while (bh != head); + } + spin_unlock(&mapping->private_lock); + + if (!TestSetPageDirty(page)) { + spin_lock(&mapping->page_lock); + if (page->mapping) { /* Race with truncate? */ + if (!mapping->backing_dev_info->memory_backed) + inc_page_state(nr_dirty); + list_del(&page->list); + list_add(&page->list, &mapping->dirty_pages); + } + spin_unlock(&mapping->page_lock); + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + } + +out: + return ret; +} +EXPORT_SYMBOL(__set_page_dirty_buffers); + +/* * Write out and wait upon a list of buffers. * * We have conflicting pressures: we want to make sure that all @@ -916,7 +995,7 @@ head = NULL; offset = PAGE_SIZE; while ((offset -= size) >= 0) { - bh = alloc_buffer_head(); + bh = alloc_buffer_head(GFP_NOFS); if (!bh) goto no_grow; @@ -2267,7 +2346,7 @@ if (buffer_uptodate(&map_bh)) continue; /* reiserfs does this */ if (block_start < from || block_end > to) { - struct buffer_head *bh = alloc_buffer_head(); + struct buffer_head *bh = alloc_buffer_head(GFP_NOFS); if (!bh) { ret = -ENOMEM; @@ -2826,9 +2905,9 @@ buffer_heads_over_limit = (tot > max_buffer_heads); } -struct buffer_head *alloc_buffer_head(void) +struct buffer_head *alloc_buffer_head(int gfp_flags) { - struct buffer_head *ret = kmem_cache_alloc(bh_cachep, GFP_NOFS); + struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); if (ret) { preempt_disable(); __get_cpu_var(bh_accounting).nr++; diff -Nru a/fs/dcache.c b/fs/dcache.c --- a/fs/dcache.c Wed Apr 9 11:44:15 2003 +++ b/fs/dcache.c Sat Apr 19 23:22:23 2003 @@ -155,12 +155,11 @@ if (d_unhashed(dentry)) goto kill_it; if (list_empty(&dentry->d_lru)) { - dentry->d_vfs_flags &= ~DCACHE_REFERENCED; + dentry->d_vfs_flags |= DCACHE_REFERENCED; list_add(&dentry->d_lru, &dentry_unused); dentry_stat.nr_unused++; } spin_unlock(&dentry->d_lock); - dentry->d_vfs_flags |= DCACHE_REFERENCED; spin_unlock(&dcache_lock); return; @@ -250,7 +249,6 @@ static inline struct dentry * __dget_locked(struct dentry *dentry) { atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; if (atomic_read(&dentry->d_count) == 1) { dentry_stat.nr_unused--; list_del_init(&dentry->d_lru); @@ -379,17 +377,16 @@ dentry = list_entry(tmp, struct dentry, d_lru); spin_lock(&dentry->d_lock); + /* leave inuse dentries */ + if (atomic_read(&dentry->d_count)) { + spin_unlock(&dentry->d_lock); + continue; + } /* If the dentry was recently referenced, don't free it. */ if (dentry->d_vfs_flags & DCACHE_REFERENCED) { dentry->d_vfs_flags &= ~DCACHE_REFERENCED; - - /* don't add non zero d_count dentries - * back to d_lru list - */ - if (!atomic_read(&dentry->d_count)) { - list_add(&dentry->d_lru, &dentry_unused); - dentry_stat.nr_unused++; - } + list_add(&dentry->d_lru, &dentry_unused); + dentry_stat.nr_unused++; spin_unlock(&dentry->d_lock); continue; } @@ -538,13 +535,18 @@ struct list_head *tmp = next; struct dentry *dentry = list_entry(tmp, struct dentry, d_child); next = tmp->next; - list_del_init(&dentry->d_lru); - /* don't add non zero d_count dentries - * back to d_lru list + if (!list_empty(&dentry->d_lru)) { + dentry_stat.nr_unused--; + list_del_init(&dentry->d_lru); + } + /* + * move only zero ref count dentries to the end + * of the unused list for prune_dcache */ if (!atomic_read(&dentry->d_count)) { list_add(&dentry->d_lru, dentry_unused.prev); + dentry_stat.nr_unused++; found++; } /* @@ -609,13 +611,18 @@ spin_lock(&dcache_lock); hlist_for_each(lp, head) { struct dentry *this = hlist_entry(lp, struct dentry, d_hash); - list_del(&this->d_lru); + if (!list_empty(&this->d_lru)) { + dentry_stat.nr_unused--; + list_del(&this->d_lru); + } - /* don't add non zero d_count dentries - * back to d_lru list + /* + * move only zero ref count dentries to the end + * of the unused list for prune_dcache */ if (!atomic_read(&this->d_count)) { list_add_tail(&this->d_lru, &dentry_unused); + dentry_stat.nr_unused++; found++; } } @@ -1017,7 +1024,6 @@ if (likely(move_count == dentry->d_move_count)) { if (!d_unhashed(dentry)) { atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; found = dentry; } } diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c --- a/fs/devfs/base.c Fri Apr 18 08:59:17 2003 +++ b/fs/devfs/base.c Sat Apr 19 14:26:30 2003 @@ -763,7 +763,6 @@ struct bdev_type { - struct block_device_operations *ops; dev_t dev; }; @@ -1442,7 +1441,6 @@ * this to whatever you like, and change it once the file is opened (the next * file opened will not see this change). * - * Returns a handle which may later be used in a call to devfs_unregister(). * On failure %NULL is returned. */ @@ -1457,6 +1455,8 @@ /* we don't accept any flags anymore. prototype will change soon. */ WARN_ON(flags); + WARN_ON(dir); + WARN_ON(!S_ISCHR(mode)); if (name == NULL) { @@ -1491,7 +1491,6 @@ } else if (S_ISBLK (mode)) { de->u.bdev.dev = dev; de->u.cdev.autogen = devnum != 0; - de->u.bdev.ops = ops; } else { PRINTK ("(%s): illegal mode: %x\n", name, mode); devfs_put (de); @@ -1517,6 +1516,52 @@ } /* End Function devfs_register */ +int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) +{ + struct devfs_entry *dir = NULL, *de; + char buf[64]; + va_list args; + int error, n; + + if (!S_ISBLK(mode)) { + printk(KERN_WARNING "%s: invalide mode (%u) for %s\n", + __FUNCTION__, mode, buf); + return -EINVAL; + } + + va_start(args, fmt); + n = vsnprintf(buf, 64, fmt, args); + if (n >= 64 || !buf[0]) { + printk(KERN_WARNING "%s: invalid format string\n", + __FUNCTION__); + return -EINVAL; + } + + de = _devfs_prepare_leaf(&dir, buf, mode); + if (!de) { + printk(KERN_WARNING "%s: could not prepare leaf for %s\n", + __FUNCTION__, buf); + return -ENOMEM; /* could be more accurate... */ + } + + de->u.bdev.dev = dev; + + error = _devfs_append_entry(dir, de, NULL); + if (error) { + printk(KERN_WARNING "%s: could not append to parent for %s\n", + __FUNCTION__, buf); + goto out; + } + + devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED); + out: + devfs_put(dir); + return error; +} + +EXPORT_SYMBOL(devfs_mk_bdev); + + /** * _devfs_unhook - Unhook a device entry from its parents list * @de: The entry to unhook. @@ -1578,24 +1623,6 @@ } } /* End Function _devfs_unregister */ - -/** - * devfs_unregister - Unregister a device entry. - * @de: A handle previously created by devfs_register() or returned from - * devfs_get_handle(). If this is %NULL the routine does nothing. - */ - -void devfs_unregister (devfs_handle_t de) -{ - VERIFY_ENTRY (de); - if ( (de == NULL) || (de->parent == NULL) ) return; - DPRINTK (DEBUG_UNREGISTER, "(%s): de: %p refcount: %d\n", - de->name, de, atomic_read (&de->refcount) ); - write_lock (&de->parent->u.dir.lock); - _devfs_unregister (de->parent, de); - devfs_put (de); -} /* End Function devfs_unregister */ - static int devfs_do_symlink (devfs_handle_t dir, const char *name, const char *link, devfs_handle_t *handle) { @@ -1678,7 +1705,6 @@ * Use of this function is optional. The devfs_register() function * will automatically create intermediate directories as needed. This function * is provided for efficiency reasons, as it provides a handle to a directory. - * Returns a handle which may later be used in a call to devfs_unregister(). * On failure %NULL is returned. */ @@ -1730,7 +1756,10 @@ n = vsnprintf(buf, 64, fmt, args); if (n < 64 && buf[0]) { devfs_handle_t de = _devfs_find_entry(NULL, buf, 0); - devfs_unregister(de); + + write_lock(&de->parent->u.dir.lock); + _devfs_unregister(de->parent, de); + devfs_put(de); devfs_put(de); } } @@ -1863,7 +1892,6 @@ EXPORT_SYMBOL(devfs_put); EXPORT_SYMBOL(devfs_register); -EXPORT_SYMBOL(devfs_unregister); EXPORT_SYMBOL(devfs_mk_symlink); EXPORT_SYMBOL(devfs_mk_dir); EXPORT_SYMBOL(devfs_remove); diff -Nru a/fs/devfs/util.c b/fs/devfs/util.c --- a/fs/devfs/util.c Fri Apr 18 08:58:55 2003 +++ b/fs/devfs/util.c Sat Apr 19 14:26:30 2003 @@ -74,8 +74,6 @@ #include #include "internal.h" -#define PRINTK(format, args...) \ - {printk (KERN_ERR "%s" format, __FUNCTION__ , ## args);} int devfs_register_tape(const char *name) { @@ -255,162 +253,4 @@ } } up(&device_list_mutex); -} - -struct unique_numspace -{ - spinlock_t init_lock; - unsigned char sem_initialised; - unsigned int num_free; /* Num free in bits */ - unsigned int length; /* Array length in bytes */ - unsigned long *bits; - struct semaphore semaphore; -}; - -#define UNIQUE_NUMBERSPACE_INITIALISER {SPIN_LOCK_UNLOCKED, 0, 0, 0, NULL} - - -/** - * devfs_alloc_unique_number - Allocate a unique (positive) number. - * @space: The number space to allocate from. - * - * Returns the allocated unique number, else a negative error code. - * This routine is thread safe and may block. - */ - -int devfs_alloc_unique_number (struct unique_numspace *space) -{ - int number; - unsigned int length; - - /* Get around stupid lack of semaphore initialiser */ - spin_lock (&space->init_lock); - if (!space->sem_initialised) - { - sema_init (&space->semaphore, 1); - space->sem_initialised = 1; - } - spin_unlock (&space->init_lock); - down (&space->semaphore); - if (space->num_free < 1) - { - void *bits; - - if (space->length < 16) length = 16; - else length = space->length << 1; - if ( ( bits = vmalloc (length) ) == NULL ) - { - up (&space->semaphore); - return -ENOMEM; - } - if (space->bits != NULL) - { - memcpy (bits, space->bits, space->length); - vfree (space->bits); - } - space->num_free = (length - space->length) << 3; - space->bits = bits; - memset (bits + space->length, 0, length - space->length); - space->length = length; - } - number = find_first_zero_bit (space->bits, space->length << 3); - --space->num_free; - __set_bit (number, space->bits); - up (&space->semaphore); - return number; -} /* End Function devfs_alloc_unique_number */ -EXPORT_SYMBOL(devfs_alloc_unique_number); - - -/** - * devfs_dealloc_unique_number - Deallocate a unique (positive) number. - * @space: The number space to deallocate from. - * @number: The number to deallocate. - * - * This routine is thread safe and may block. - */ - -void devfs_dealloc_unique_number (struct unique_numspace *space, int number) -{ - int was_set; - - if (number < 0) return; - down (&space->semaphore); - was_set = __test_and_clear_bit (number, space->bits); - if (was_set) ++space->num_free; - up (&space->semaphore); - if (!was_set) PRINTK ("(): number %d was already free\n", number); -} /* End Function devfs_dealloc_unique_number */ -EXPORT_SYMBOL(devfs_dealloc_unique_number); - -static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER; -static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER; - -void devfs_create_partitions(struct gendisk *disk) -{ - char dirname[64], diskname[64], symlink[16]; - - if (!disk->devfs_name) - sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name, - disk->first_minor >> disk->minor_shift); - - devfs_mk_dir(disk->devfs_name); - disk->number = devfs_alloc_unique_number(&disc_numspace); - - sprintf(diskname, "%s/disc", disk->devfs_name); - devfs_register(NULL, diskname, 0, - disk->major, disk->first_minor, - S_IFBLK | S_IRUSR | S_IWUSR, - disk->fops, NULL); - - sprintf(symlink, "discs/disc%d", disk->number); - sprintf(dirname, "../%s", disk->devfs_name); - devfs_mk_symlink(symlink, dirname); - -} - -void devfs_create_cdrom(struct gendisk *disk) -{ - char dirname[64], cdname[64], symlink[16]; - - if (!disk->devfs_name) - strcat(disk->devfs_name, disk->disk_name); - - devfs_mk_dir(disk->devfs_name); - disk->number = devfs_alloc_unique_number(&cdrom_numspace); - - sprintf(cdname, "%s/cd", disk->devfs_name); - devfs_register(NULL, cdname, 0, - disk->major, disk->first_minor, - S_IFBLK | S_IRUGO | S_IWUGO, - disk->fops, NULL); - - sprintf(symlink, "cdroms/cdrom%d", disk->number); - sprintf(dirname, "../%s", disk->devfs_name); - devfs_mk_symlink(symlink, dirname); -} - -void devfs_register_partition(struct gendisk *dev, int part) -{ - char devname[64]; - - sprintf(devname, "%s/part%d", dev->devfs_name, part); - devfs_register(NULL, devname, 0, - dev->major, dev->first_minor + part, - S_IFBLK | S_IRUSR | S_IWUSR, - dev->fops, NULL); -} - -void devfs_remove_partitions(struct gendisk *disk) -{ - devfs_remove("discs/disc%d", disk->number); - devfs_remove(disk->devfs_name); - devfs_dealloc_unique_number(&disc_numspace, disk->number); -} - -void devfs_remove_cdrom(struct gendisk *disk) -{ - devfs_remove("cdroms/cdrom%d", disk->number); - devfs_remove(disk->devfs_name); - devfs_dealloc_unique_number(&cdrom_numspace, disk->number); } diff -Nru a/fs/dquot.c b/fs/dquot.c --- a/fs/dquot.c Sat Apr 12 00:30:08 2003 +++ b/fs/dquot.c Sat Apr 19 23:22:37 2003 @@ -345,50 +345,6 @@ return 0; } -static struct super_block *get_super_to_sync(int type) -{ - struct list_head *head; - int cnt, dirty; - -restart: - spin_lock(&sb_lock); - list_for_each(head, &super_blocks) { - struct super_block *sb = list_entry(head, struct super_block, s_list); - - for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++) - if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt) - && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt])) - dirty = 1; - if (!dirty) - continue; - sb->s_count++; - spin_unlock(&sb_lock); - down_read(&sb->s_umount); - if (!sb->s_root) { - drop_super(sb); - goto restart; - } - return sb; - } - spin_unlock(&sb_lock); - return NULL; -} - -void sync_dquots(struct super_block *sb, int type) -{ - if (sb) { - if (sb->s_qcop->quota_sync) - sb->s_qcop->quota_sync(sb, type); - } - else { - while ((sb = get_super_to_sync(type))) { - if (sb->s_qcop->quota_sync) - sb->s_qcop->quota_sync(sb, type); - drop_super(sb); - } - } -} - /* Free unused dquots from cache */ static void prune_dqcache(int count) { diff -Nru a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c --- a/fs/exportfs/expfs.c Wed Apr 2 22:51:32 2003 +++ b/fs/exportfs/expfs.c Sat Apr 19 23:22:23 2003 @@ -91,7 +91,6 @@ if (dentry != result && acceptable(context, dentry)) { dput(result); - dentry->d_vfs_flags |= DCACHE_REFERENCED; return dentry; } spin_lock(&dcache_lock); @@ -271,7 +270,6 @@ if (dentry != result && acceptable(context, dentry)) { dput(result); - dentry->d_vfs_flags |= DCACHE_REFERENCED; return dentry; } spin_lock(&dcache_lock); @@ -434,7 +432,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/fat/inode.c b/fs/fat/inode.c --- a/fs/fat/inode.c Wed Apr 2 22:51:32 2003 +++ b/fs/fat/inode.c Sat Apr 19 23:22:23 2003 @@ -608,7 +608,6 @@ return ERR_PTR(-ENOMEM); } result->d_op = sb->s_root->d_op; - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/jbd/journal.c b/fs/jbd/journal.c --- a/fs/jbd/journal.c Wed Apr 2 22:51:44 2003 +++ b/fs/jbd/journal.c Sat Apr 19 23:22:40 2003 @@ -457,14 +457,8 @@ /* * Right, time to make up the new buffer_head. */ - do { - new_bh = alloc_buffer_head(); - if (!new_bh) { - printk (KERN_NOTICE "%s: ENOMEM at alloc_buffer_head, " - "trying again.\n", __FUNCTION__); - yield(); - } - } while (!new_bh); + new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); + /* keep subsequent assertions sane */ new_bh->b_state = 0; init_buffer(new_bh, NULL, NULL); @@ -1613,28 +1607,7 @@ */ void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry) { - void *p; - static unsigned long last_warning; - - while (1) { - p = kmalloc(size, flags); - if (p) - return p; - if (!retry) - return NULL; - /* Log every retry for debugging. Also log them to the - * syslog, but do rate-limiting on the non-debugging - * messages. */ - jbd_debug(1, "ENOMEM in %s, retrying.\n", where); - - if (time_after(jiffies, last_warning + 5*HZ)) { - printk(KERN_NOTICE - "ENOMEM in %s, retrying.\n", where); - last_warning = jiffies; - } - - yield(); - } + return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0)); } /* diff -Nru a/fs/partitions/Makefile b/fs/partitions/Makefile --- a/fs/partitions/Makefile Thu Mar 6 15:43:48 2003 +++ b/fs/partitions/Makefile Sat Apr 19 14:18:27 2003 @@ -4,6 +4,7 @@ obj-y := check.o +obj-$(CONFIG_DEVFS_FS) += devfs.o obj-$(CONFIG_ACORN_PARTITION) += acorn.o obj-$(CONFIG_AMIGA_PARTITION) += amiga.o obj-$(CONFIG_ATARI_PARTITION) += atari.o diff -Nru a/fs/partitions/check.c b/fs/partitions/check.c --- a/fs/partitions/check.c Fri Apr 18 08:58:55 2003 +++ b/fs/partitions/check.c Sun Apr 20 14:52:10 2003 @@ -19,8 +19,10 @@ #include #include #include +#include #include "check.h" +#include "devfs.h" #include "acorn.h" #include "amiga.h" @@ -94,25 +96,24 @@ char *disk_name(struct gendisk *hd, int part, char *buf) { - if (!part) { #ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) - sprintf(buf, "%s/%s", hd->devfs_name, - (hd->flags & GENHD_FL_CD) ? "cd" : "disc"); - else -#endif - sprintf(buf, "%s", hd->disk_name); - } else { -#ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) + if (hd->devfs_name[0] != '\0') { + if (part) sprintf(buf, "%s/part%d", hd->devfs_name, part); + else if (hd->minors != 1) + sprintf(buf, "%s/disc", hd->devfs_name); else -#endif - if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) - sprintf(buf, "%sp%d", hd->disk_name, part); - else - sprintf(buf, "%s%d", hd->disk_name, part); + sprintf(buf, "%s", hd->devfs_name); + return buf; } +#endif + + if (!part) + sprintf(buf, "%s", hd->disk_name); + else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) + sprintf(buf, "%sp%d", hd->disk_name, part); + else + sprintf(buf, "%s%d", hd->disk_name, part); return buf; } @@ -128,7 +129,7 @@ return NULL; #ifdef CONFIG_DEVFS_FS - if (hd->devfs_name) { + if (hd->devfs_name[0] != '\0') { printk(KERN_INFO " /dev/%s:", hd->devfs_name); sprintf(state->name, "p"); } @@ -182,7 +183,7 @@ static ssize_t part_dev_read(struct hd_struct * p, char *page) { struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj); - int part = p - disk->part + 1; + int part = p->partno; dev_t base = MKDEV(disk->major, disk->first_minor); return sprintf(page, "%04x\n", (unsigned)(base + part)); } @@ -234,7 +235,9 @@ void delete_partition(struct gendisk *disk, int part) { - struct hd_struct *p = disk->part + part - 1; + struct hd_struct *p = disk->part[part-1]; + if (!p) + return; if (!p->nr_sects) return; p->start_sect = 0; @@ -242,15 +245,28 @@ p->reads = p->writes = p->read_sectors = p->write_sectors = 0; devfs_remove("%s/part%d", disk->devfs_name, part); kobject_unregister(&p->kobj); + disk->part[part-1] = NULL; + kfree(p); } void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len) { - struct hd_struct *p = disk->part + part - 1; + struct hd_struct *p; + p = kmalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return; + + memset(p, 0, sizeof(*p)); p->start_sect = start; p->nr_sects = len; - devfs_register_partition(disk, part); + p->partno = part; + disk->part[part-1] = p; + + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor + part), + S_IFBLK|S_IRUSR|S_IWUSR, + "%s/part%d", disk->devfs_name, part); + snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part); p->kobj.parent = &disk->kobj; p->kobj.ktype = &ktype_part; @@ -284,12 +300,12 @@ return; disk_sysfs_symlinks(disk); - if (disk->flags & GENHD_FL_CD) - devfs_create_cdrom(disk); - /* No minors to use for partitions */ - if (disk->minors == 1) + if (disk->minors == 1) { + if (disk->devfs_name[0] != '\0') + devfs_add_disk(disk); return; + } /* No such device (e.g., media were just removed) */ if (!get_capacity(disk)) @@ -299,7 +315,7 @@ if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0) return; state = check_partition(disk, bdev); - devfs_create_partitions(disk); + devfs_add_partitioned(disk); if (state) { for (j = 1; j < state->limit; j++) { sector_t size = state->parts[j].size; @@ -392,10 +408,9 @@ unlink_gendisk(disk); disk_stat_set_all(disk, 0); disk->stamp = disk->stamp_idle = 0; - if (disk->flags & GENHD_FL_CD) - devfs_remove_cdrom(disk); - else - devfs_remove_partitions(disk); + + devfs_remove_disk(disk); + if (disk->driverfs_dev) { sysfs_remove_link(&disk->kobj, "device"); sysfs_remove_link(&disk->driverfs_dev->kobj, "block"); diff -Nru a/fs/partitions/check.h b/fs/partitions/check.h --- a/fs/partitions/check.h Tue Oct 8 11:36:39 2002 +++ b/fs/partitions/check.h Sat Apr 19 23:22:17 2003 @@ -29,3 +29,8 @@ } extern int warn_no_part; + +extern void parse_bsd(struct parsed_partitions *state, + struct block_device *bdev, u32 offset, u32 size, + int origin, char *flavour, int max_partitions); + diff -Nru a/fs/partitions/devfs.c b/fs/partitions/devfs.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/fs/partitions/devfs.c Sat Apr 19 17:57:36 2003 @@ -0,0 +1,134 @@ +/* + * This tries to keep block devices away from devfs as much as possible. + */ +#include +#include +#include +#include +#include +#include + + +struct unique_numspace { + u32 num_free; /* Num free in bits */ + u32 length; /* Array length in bytes */ + unsigned long *bits; + struct semaphore mutex; +}; + +static DECLARE_MUTEX(numspace_mutex); + +static int expand_numspace(struct unique_numspace *s) +{ + u32 length; + void *bits; + + if (s->length < 16) + length = 16; + else + length = s->length << 1; + + bits = vmalloc(length); + if (!bits) + return -ENOMEM; + if (s->bits) { + memcpy(bits, s->bits, s->length); + vfree(s->bits); + } + + s->num_free = (length - s->length) << 3; + s->bits = bits; + memset(bits + s->length, 0, length - s->length); + s->length = length; + + return 0; +} + +static int alloc_unique_number(struct unique_numspace *s) +{ + int rval = 0; + + down(&numspace_mutex); + if (s->num_free < 1) + rval = expand_numspace(s); + if (!rval) { + rval = find_first_zero_bit(s->bits, s->length << 3); + --s->num_free; + __set_bit(rval, s->bits); + } + up(&numspace_mutex); + + return rval; +} + +static void dealloc_unique_number(struct unique_numspace *s, int number) +{ + int old_val; + + if (number >= 0) { + down(&numspace_mutex); + old_val = __test_and_clear_bit(number, s->bits); + if (old_val) + ++s->num_free; + up(&numspace_mutex); + } +} + +static struct unique_numspace disc_numspace; +static struct unique_numspace cdrom_numspace; + +void devfs_add_partitioned(struct gendisk *disk) +{ + char dirname[64], symlink[16]; + + if (disk->devfs_name[0] != '\0') + sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name, + disk->first_minor >> disk->minor_shift); + + devfs_mk_dir(disk->devfs_name); + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), + S_IFBLK|S_IRUSR|S_IWUSR, + "%s/disc", disk->devfs_name); + + disk->number = alloc_unique_number(&disc_numspace); + + sprintf(symlink, "discs/disc%d", disk->number); + sprintf(dirname, "../%s", disk->devfs_name); + devfs_mk_symlink(symlink, dirname); + +} + +void devfs_add_disk(struct gendisk *disk) +{ + devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), + (disk->flags & GENHD_FL_CD) ? + S_IFBLK|S_IRUGO|S_IWUGO : + S_IFBLK|S_IRUSR|S_IWUSR, + "%s", disk->devfs_name); + + if (disk->flags & GENHD_FL_CD) { + char dirname[64], symlink[16]; + + disk->number = alloc_unique_number(&cdrom_numspace); + + sprintf(symlink, "cdroms/cdrom%d", disk->number); + sprintf(dirname, "../%s", disk->devfs_name); + devfs_mk_symlink(symlink, dirname); + } +} + +void devfs_remove_disk(struct gendisk *disk) +{ + if (disk->minors != 1) { + devfs_remove("discs/disc%d", disk->number); + dealloc_unique_number(&disc_numspace, disk->number); + devfs_remove("%s/disc", disk->devfs_name); + } + if (disk->flags & GENHD_FL_CD) { + devfs_remove("cdroms/cdrom%d", disk->number); + dealloc_unique_number(&cdrom_numspace, disk->number); + } + devfs_remove(disk->devfs_name); +} + + diff -Nru a/fs/partitions/devfs.h b/fs/partitions/devfs.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/fs/partitions/devfs.h Sat Apr 19 13:56:14 2003 @@ -0,0 +1,10 @@ + +#ifdef CONFIG_DEVFS_FS +void devfs_add_disk(struct gendisk *dev); +void devfs_add_partitioned(struct gendisk *dev); +void devfs_remove_disk(struct gendisk *dev); +#else +# define devfs_add_disk(disk) do { } while (0) +# define devfs_add_partitioned(disk) do { } while (0) +# define devfs_remove_disk(disk) do { } while (0) +#endif diff -Nru a/fs/partitions/msdos.c b/fs/partitions/msdos.c --- a/fs/partitions/msdos.c Thu Feb 13 10:15:06 2003 +++ b/fs/partitions/msdos.c Sat Apr 19 23:22:17 2003 @@ -214,12 +214,12 @@ #endif } -#ifdef CONFIG_BSD_DISKLABEL +#if defined(CONFIG_BSD_DISKLABEL) || defined(CONFIG_NEC98_PARTITION) /* * Create devices for BSD partitions listed in a disklabel, under a * dos-like partition. See parse_extended() for more information. */ -static void +void parse_bsd(struct parsed_partitions *state, struct block_device *bdev, u32 offset, u32 size, int origin, char *flavour, int max_partitions) diff -Nru a/fs/partitions/nec98.c b/fs/partitions/nec98.c --- a/fs/partitions/nec98.c Thu Mar 6 15:43:48 2003 +++ b/fs/partitions/nec98.c Sat Apr 19 23:22:17 2003 @@ -66,13 +66,6 @@ return valid; } -#ifdef CONFIG_BSD_DISKLABEL -extern void parse_bsd(struct parsed_partitions *state, - struct block_device *bdev, - u32 offset, u32 size, int origin, char *flavour, - int max_partitions); -#endif - int nec98_partition(struct parsed_partitions *state, struct block_device *bdev) { unsigned int nr; diff -Nru a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c --- a/fs/proc/proc_misc.c Tue Apr 8 07:50:00 2003 +++ b/fs/proc/proc_misc.c Sat Apr 19 23:22:58 2003 @@ -333,6 +333,18 @@ .release = seq_release, }; +extern struct seq_operations diskstats_op; +static int diskstats_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &diskstats_op); +} +static struct file_operations proc_diskstats_operations = { + open: diskstats_open, + read: seq_read, + llseek: seq_lseek, + release: seq_release, +}; + #ifdef CONFIG_MODULES extern struct seq_operations modules_op; static int modules_open(struct inode *inode, struct file *file) @@ -644,6 +656,7 @@ create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); + create_seq_entry("diskstats", 0, &proc_diskstats_operations); #ifdef CONFIG_MODULES create_seq_entry("modules", 0, &proc_modules_operations); #endif diff -Nru a/fs/quota.c b/fs/quota.c --- a/fs/quota.c Sat Mar 22 12:36:49 2003 +++ b/fs/quota.c Sat Apr 19 23:22:37 2003 @@ -19,8 +19,10 @@ { if (type >= MAXQUOTAS) return -EINVAL; + if (!sb && cmd != Q_SYNC) + return -ENODEV; /* Is operation supported? */ - if (!sb->s_qcop) + if (sb && !sb->s_qcop) return -ENOSYS; switch (cmd) { @@ -51,7 +53,7 @@ return -ENOSYS; break; case Q_SYNC: - if (!sb->s_qcop->quota_sync) + if (sb && !sb->s_qcop->quota_sync) return -ENOSYS; break; case Q_XQUOTAON: @@ -102,6 +104,50 @@ return security_quotactl (cmd, type, id, sb); } +static struct super_block *get_super_to_sync(int type) +{ + struct list_head *head; + int cnt, dirty; + +restart: + spin_lock(&sb_lock); + list_for_each(head, &super_blocks) { + struct super_block *sb = list_entry(head, struct super_block, s_list); + + for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++) + if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt) + && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt])) + dirty = 1; + if (!dirty) + continue; + sb->s_count++; + spin_unlock(&sb_lock); + down_read(&sb->s_umount); + if (!sb->s_root) { + drop_super(sb); + goto restart; + } + return sb; + } + spin_unlock(&sb_lock); + return NULL; +} + +void sync_dquots(struct super_block *sb, int type) +{ + if (sb) { + if (sb->s_qcop->quota_sync) + sb->s_qcop->quota_sync(sb, type); + } + else { + while ((sb = get_super_to_sync(type))) { + if (sb->s_qcop->quota_sync) + sb->s_qcop->quota_sync(sb, type); + drop_super(sb); + } + } +} + /* Copy parameters and call proper function */ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, caddr_t addr) { @@ -167,7 +213,8 @@ return sb->s_qcop->set_dqblk(sb, type, id, &idq); } case Q_SYNC: - return sb->s_qcop->quota_sync(sb, type); + sync_dquots(sb, type); + return 0; case Q_XQUOTAON: case Q_XQUOTAOFF: @@ -222,27 +269,30 @@ struct super_block *sb = NULL; struct block_device *bdev; char *tmp; - int ret = -ENODEV; + int ret; cmds = cmd >> SUBCMDSHIFT; type = cmd & SUBCMDMASK; - tmp = getname(special); - if (IS_ERR(tmp)) - return PTR_ERR(tmp); - bdev = lookup_bdev(tmp); - putname(tmp); - if (IS_ERR(bdev)) - return PTR_ERR(bdev); - sb = get_super(bdev); - bdput(bdev); + if (cmds != Q_SYNC || special) { + tmp = getname(special); + if (IS_ERR(tmp)) + return PTR_ERR(tmp); + bdev = lookup_bdev(tmp); + putname(tmp); + if (IS_ERR(bdev)) + return PTR_ERR(bdev); + sb = get_super(bdev); + bdput(bdev); + if (!sb) + return -ENODEV; + } - if (sb) { - ret = check_quotactl_valid(sb, type, cmds, id); - if (ret >= 0) - ret = do_quotactl(sb, type, cmds, id, addr); + ret = check_quotactl_valid(sb, type, cmds, id); + if (ret >= 0) + ret = do_quotactl(sb, type, cmds, id, addr); + if (sb) drop_super(sb); - } return ret; } diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c --- a/fs/reiserfs/inode.c Wed Apr 2 22:51:32 2003 +++ b/fs/reiserfs/inode.c Sat Apr 19 23:22:23 2003 @@ -1260,7 +1260,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/smbfs/proc.c b/fs/smbfs/proc.c --- a/fs/smbfs/proc.c Wed Apr 2 22:51:32 2003 +++ b/fs/smbfs/proc.c Sat Apr 19 23:22:56 2003 @@ -2085,7 +2085,6 @@ void smb_decode_unix_basic(struct smb_fattr *fattr, char *p) { /* FIXME: verify nls support. all is sent as utf8? */ - __u64 devmajor, devminor; fattr->f_unix = 1; fattr->f_mode = 0; @@ -2112,9 +2111,10 @@ fattr->f_mode |= smb_filetype_to_mode(WVAL(p, 56)); if (S_ISBLK(fattr->f_mode) || S_ISCHR(fattr->f_mode)) { - devmajor = LVAL(p, 60); - devminor = LVAL(p, 68); - fattr->f_rdev = ((devmajor & 0xFF) << 8) | (devminor & 0xFF); + __u64 major = LVAL(p, 60); + __u64 minor = LVAL(p, 68); + + fattr->f_rdev = MKDEV(major & 0xffffffff, minor & 0xffffffff); } fattr->f_mode |= LVAL(p, 84); } @@ -3008,7 +3008,7 @@ */ int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, - int major, int minor) + unsigned int major, unsigned int minor) { struct smb_sb_info *server = server_from_dentry(d); u64 nttime; diff -Nru a/fs/smbfs/proto.h b/fs/smbfs/proto.h --- a/fs/smbfs/proto.h Tue Dec 31 17:21:17 2002 +++ b/fs/smbfs/proto.h Sat Apr 19 23:22:56 2003 @@ -27,7 +27,7 @@ extern void smb_decode_unix_basic(struct smb_fattr *fattr, char *p); extern int smb_proc_getattr(struct dentry *dir, struct smb_fattr *fattr); extern int smb_proc_setattr(struct dentry *dir, struct smb_fattr *fattr); -extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, int major, int minor); +extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, unsigned int major, unsigned int minor); extern int smb_proc_settime(struct dentry *dentry, struct smb_fattr *fattr); extern int smb_proc_dskattr(struct super_block *sb, struct statfs *attr); extern int smb_proc_read_link(struct smb_sb_info *server, struct dentry *d, char *buffer, int len); diff -Nru a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c --- a/fs/xfs/linux/xfs_super.c Mon Apr 7 12:05:43 2003 +++ b/fs/xfs/linux/xfs_super.c Sat Apr 19 23:22:23 2003 @@ -741,7 +741,6 @@ iput(inode); return ERR_PTR(-ENOMEM); } - result->d_vfs_flags |= DCACHE_REFERENCED; return result; } diff -Nru a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c --- a/fs/xfs/pagebuf/page_buf.c Wed Mar 26 10:29:29 2003 +++ b/fs/xfs/pagebuf/page_buf.c Sat Apr 19 23:22:50 2003 @@ -554,7 +554,8 @@ } else if (flags & PBF_MAPPED) { if (as_list_len > 64) purge_addresses(); - pb->pb_addr = vmap(pb->pb_pages, page_count); + pb->pb_addr = vmap(pb->pb_pages, page_count, + VM_MAP, PAGE_KERNEL); if (pb->pb_addr == NULL) return -ENOMEM; pb->pb_addr += pb->pb_offset; diff -Nru a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h --- a/include/asm-alpha/pgalloc.h Mon Dec 30 07:03:59 2002 +++ b/include/asm-alpha/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -40,7 +40,7 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL); + pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (ret) clear_page(ret); return ret; diff -Nru a/include/asm-arm/proc-armv/pgalloc.h b/include/asm-arm/proc-armv/pgalloc.h --- a/include/asm-arm/proc-armv/pgalloc.h Sun Nov 17 11:16:37 2002 +++ b/include/asm-arm/proc-armv/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -27,17 +27,9 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *)__get_free_page(GFP_KERNEL); - if (!pte) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); - + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) { clear_page(pte); clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); @@ -51,16 +43,8 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) { struct page *pte; - int count = 0; - - do { - pte = alloc_pages(GFP_KERNEL, 0); - if (!pte) { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (pte) { void *page = page_address(pte); clear_page(page); diff -Nru a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h --- a/include/asm-cris/pgalloc.h Tue Feb 5 07:24:38 2002 +++ b/include/asm-cris/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -62,7 +62,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-i386/arch_hooks.h b/include/asm-i386/arch_hooks.h --- a/include/asm-i386/arch_hooks.h Sun Mar 10 19:00:12 2002 +++ b/include/asm-i386/arch_hooks.h Sun Apr 20 14:14:29 2003 @@ -1,6 +1,8 @@ #ifndef _ASM_ARCH_HOOKS_H #define _ASM_ARCH_HOOKS_H +#include + /* * linux/include/asm/arch_hooks.h * @@ -12,7 +14,7 @@ extern void init_ISA_irqs(void); extern void apic_intr_init(void); extern void smp_intr_init(void); -extern void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* these are the defined hooks */ extern void intr_init_hook(void); diff -Nru a/include/asm-i386/div64.h b/include/asm-i386/div64.h --- a/include/asm-i386/div64.h Tue Feb 5 09:39:44 2002 +++ b/include/asm-i386/div64.h Sat Apr 19 23:22:26 2003 @@ -14,4 +14,22 @@ __mod; \ }) +/* + * (long)X = ((long long)divs) / (long)div + * (long)rem = ((long long)divs) % (long)div + * + * Warning, this will do an exception if X overflows. + */ +#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c) + +extern inline long +div_ll_X_l_rem(long long divs, long div, long *rem) +{ + long dum2; + __asm__("divl %2":"=a"(dum2), "=d"(*rem) + : "rm"(div), "A"(divs)); + + return dum2; + +} #endif diff -Nru a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h --- a/include/asm-i386/floppy.h Mon Mar 31 15:55:40 2003 +++ b/include/asm-i386/floppy.h Sun Apr 20 14:14:29 2003 @@ -51,7 +51,7 @@ static int virtual_dma_mode; static int doing_pdma; -static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) { register unsigned char st; @@ -63,10 +63,8 @@ static int bytes=0; static int dma_wait=0; #endif - if(!doing_pdma) { - floppy_interrupt(irq, dev_id, regs); - return; - } + if (!doing_pdma) + return floppy_interrupt(irq, dev_id, regs); #ifdef TRACE_FLPY_INT if(!calls) @@ -130,7 +128,7 @@ calls++; #endif if(st == 0x20) - return; + return IRQ_HANDLED; if(!(st & 0x20)) { virtual_dma_residue += virtual_dma_count; virtual_dma_count=0; @@ -143,12 +141,13 @@ #endif doing_pdma = 0; floppy_interrupt(irq, dev_id, regs); - return; + return IRQ_HANDLED; } #ifdef TRACE_FLPY_INT if(!virtual_dma_count) dma_wait++; #endif + return IRQ_HANDLED; } static void fd_disable_dma(void) diff -Nru a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h --- a/include/asm-ia64/pgalloc.h Tue Aug 27 13:04:10 2002 +++ b/include/asm-ia64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -93,7 +93,7 @@ static inline pmd_t* pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); + pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pmd != NULL)) clear_page(pmd); @@ -125,7 +125,7 @@ static inline struct page * pte_alloc_one (struct mm_struct *mm, unsigned long addr) { - struct page *pte = alloc_pages(GFP_KERNEL, 0); + struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (likely(pte != NULL)) clear_page(page_address(pte)); @@ -135,7 +135,7 @@ static inline pte_t * pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pte != NULL)) clear_page(pte); diff -Nru a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h --- a/include/asm-m68k/motorola_pgalloc.h Wed Jan 8 12:37:27 2003 +++ b/include/asm-m68k/motorola_pgalloc.h Sat Apr 19 23:22:41 2003 @@ -11,7 +11,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) { clear_page(pte); __flush_page_to_ram(pte); @@ -30,7 +30,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_pages(GFP_KERNEL, 0); + struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); pte_t *pte; if(!page) diff -Nru a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h --- a/include/asm-m68k/sun3_pgalloc.h Wed Jan 8 12:37:27 2003 +++ b/include/asm-m68k/sun3_pgalloc.h Sat Apr 19 23:22:43 2003 @@ -18,7 +18,7 @@ extern const char bad_pmd_string[]; -#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) +#define lpmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) static inline void pte_free_kernel(pte_t * pte) @@ -39,7 +39,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - unsigned long page = __get_free_page(GFP_KERNEL); + unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT); if (!page) return NULL; @@ -51,7 +51,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_pages(GFP_KERNEL, 0); + struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); if (page == NULL) return NULL; diff -Nru a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h --- a/include/asm-mips/pgalloc.h Tue Feb 5 07:24:35 2002 +++ b/include/asm-mips/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -132,7 +132,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h --- a/include/asm-mips64/pgalloc.h Tue Feb 5 07:24:35 2002 +++ b/include/asm-mips64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -93,7 +93,7 @@ { pte_t *pte; - pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; @@ -141,7 +141,7 @@ { pmd_t *pmd; - pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, 1); + pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, 1); if (pmd) pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); return pmd; diff -Nru a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h --- a/include/asm-parisc/pgalloc.h Mon Jul 22 02:42:24 2002 +++ b/include/asm-parisc/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -35,7 +35,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { - pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); + pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pmd) clear_page(pmd); return pmd; @@ -73,7 +73,7 @@ static inline struct page * pte_alloc_one(struct mm_struct *mm, unsigned long address) { - struct page *page = alloc_page(GFP_KERNEL); + struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT); if (likely(page != NULL)) clear_page(page_address(page)); return page; @@ -82,7 +82,7 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (likely(pte != NULL)) clear_page(pte); return pte; diff -Nru a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h --- a/include/asm-ppc64/pgalloc.h Fri Sep 13 03:36:28 2002 +++ b/include/asm-ppc64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -31,19 +31,11 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long addr) { - int count = 0; pmd_t *pmd; - do { - pmd = (pmd_t *)__get_free_page(GFP_KERNEL); - if (pmd) - clear_page(pmd); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pmd && (count++ < 10)); - + pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pmd) + clear_page(pmd); return pmd; } @@ -62,19 +54,11 @@ static inline pte_t * pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { - int count = 0; pte_t *pte; - do { - pte = (pte_t *)__get_free_page(GFP_KERNEL); - if (pte) - clear_page(pte); - else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); - + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte) + clear_page(pte); return pte; } diff -Nru a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h --- a/include/asm-s390/pgalloc.h Mon Apr 14 12:11:58 2003 +++ b/include/asm-s390/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -120,20 +120,13 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr) { pte_t *pte; - int count; int i; - count = 0; - do { - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pte != NULL) { - for (i=0; i < PTRS_PER_PTE; i++) - pte_clear(pte+i); - } else { - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); - } - } while (!pte && (count++ < 10)); + pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); + if (pte != NULL) { + for (i=0; i < PTRS_PER_PTE; i++) + pte_clear(pte+i); + } return pte; } diff -Nru a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h --- a/include/asm-sh/pgalloc.h Fri May 3 04:27:09 2002 +++ b/include/asm-sh/pgalloc.h Sat Apr 19 23:22:41 2003 @@ -35,7 +35,7 @@ static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL); + pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pte) clear_page(pte); return pte; diff -Nru a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h --- a/include/asm-sparc64/pgalloc.h Mon Aug 26 17:10:23 2002 +++ b/include/asm-sparc64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -159,7 +159,7 @@ pmd = pmd_alloc_one_fast(mm, address); if (!pmd) { - pmd = (pmd_t *)__get_free_page(GFP_KERNEL); + pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); if (pmd) memset(pmd, 0, PAGE_SIZE); } diff -Nru a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h --- a/include/asm-x86_64/pgalloc.h Tue Jan 28 08:48:34 2003 +++ b/include/asm-x86_64/pgalloc.h Sat Apr 19 23:22:43 2003 @@ -31,12 +31,12 @@ static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) { - return (pmd_t *) get_zeroed_page(GFP_KERNEL); + return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline pgd_t *pgd_alloc (struct mm_struct *mm) { - return (pgd_t *)get_zeroed_page(GFP_KERNEL); + return (pgd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline void pgd_free (pgd_t *pgd) @@ -48,12 +48,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) { - return (pte_t *) get_zeroed_page(GFP_KERNEL); + return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); } static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) { - void *p = (void *)get_zeroed_page(GFP_KERNEL); + void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); if (!p) return NULL; return virt_to_page(p); diff -Nru a/include/linux/blk.h b/include/linux/blk.h --- a/include/linux/blk.h Mon Oct 28 11:57:56 2002 +++ b/include/linux/blk.h Sun Apr 20 09:15:03 2003 @@ -12,24 +12,6 @@ extern void add_disk_randomness(struct gendisk *disk); extern void rand_initialize_disk(struct gendisk *disk); -#ifdef CONFIG_BLK_DEV_RAM - -extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ -extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ -extern int rd_image_start; /* starting block # of image */ - -#ifdef CONFIG_BLK_DEV_INITRD - -#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ - -extern unsigned long initrd_start,initrd_end; -extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */ -void initrd_init(void); - -#endif /* CONFIG_BLK_DEV_INITRD */ - -#endif - /* * end_request() and friends. Must be called with the request queue spinlock * acquired. All functions called within end_request() _must_be_ atomic. diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h --- a/include/linux/blkdev.h Mon Apr 7 06:36:32 2003 +++ b/include/linux/blkdev.h Sun Apr 20 09:20:10 2003 @@ -341,7 +341,7 @@ extern void blk_start_queue(request_queue_t *q); extern void blk_stop_queue(request_queue_t *q); extern void __blk_stop_queue(request_queue_t *q); -extern void __blk_run_queue(request_queue_t *q); +extern void blk_run_queue(request_queue_t *q); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) { diff -Nru a/include/linux/buffer_head.h b/include/linux/buffer_head.h --- a/include/linux/buffer_head.h Thu Mar 27 21:15:06 2003 +++ b/include/linux/buffer_head.h Sat Apr 19 23:22:40 2003 @@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); void __bforget(struct buffer_head *); struct buffer_head *__bread(struct block_device *, sector_t block, int size); -struct buffer_head *alloc_buffer_head(void); +struct buffer_head *alloc_buffer_head(int gfp_flags); void free_buffer_head(struct buffer_head * bh); void FASTCALL(unlock_buffer(struct buffer_head *bh)); void ll_rw_block(int, int, struct buffer_head * bh[]); diff -Nru a/include/linux/dcache.h b/include/linux/dcache.h --- a/include/linux/dcache.h Wed Apr 2 22:51:32 2003 +++ b/include/linux/dcache.h Sat Apr 19 23:22:23 2003 @@ -270,7 +270,6 @@ if (!atomic_read(&dentry->d_count)) BUG(); atomic_inc(&dentry->d_count); - dentry->d_vfs_flags |= DCACHE_REFERENCED; } return dentry; } diff -Nru a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h --- a/include/linux/devfs_fs_kernel.h Fri Apr 18 08:59:17 2003 +++ b/include/linux/devfs_fs_kernel.h Sat Apr 19 14:18:27 2003 @@ -25,7 +25,8 @@ unsigned int flags, unsigned int major, unsigned int minor, umode_t mode, void *ops, void *info); -extern void devfs_unregister (devfs_handle_t de); +extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) + __attribute__((format (printf, 3, 4))); extern int devfs_mk_symlink (const char *name, const char *link); extern devfs_handle_t devfs_mk_dir(const char *fmt, ...) __attribute__((format (printf, 1, 2))); @@ -33,10 +34,6 @@ __attribute__((format (printf, 1, 2))); extern int devfs_register_tape(const char *name); extern void devfs_unregister_tape(int num); -extern void devfs_create_partitions(struct gendisk *dev); -extern void devfs_create_cdrom(struct gendisk *dev); -extern void devfs_remove_partitions(struct gendisk *dev); -extern void devfs_remove_cdrom(struct gendisk *dev); extern void devfs_register_partition(struct gendisk *dev, int part); extern void mount_devfs_fs(void); #else /* CONFIG_DEVFS_FS */ @@ -50,9 +47,9 @@ { return NULL; } -static inline void devfs_unregister (devfs_handle_t de) +static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) { - return; + return 0; } static inline int devfs_mk_symlink (const char *name, const char *link) { @@ -70,18 +67,6 @@ return -1; } static inline void devfs_unregister_tape(int num) -{ -} -static inline void devfs_create_partitions(struct gendisk *dev) -{ -} -static inline void devfs_create_cdrom(struct gendisk *dev) -{ -} -static inline void devfs_remove_partitions(struct gendisk *dev) -{ -} -static inline void devfs_remove_cdrom(struct gendisk *dev) { } static inline void devfs_register_partition(struct gendisk *dev, int part) diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h --- a/include/linux/genhd.h Fri Apr 18 08:58:55 2003 +++ b/include/linux/genhd.h Sat Apr 19 23:22:49 2003 @@ -64,7 +64,7 @@ sector_t nr_sects; struct kobject kobj; unsigned reads, read_sectors, writes, write_sectors; - int policy; + int policy, partno; }; #define GENHD_FL_REMOVABLE 1 @@ -89,7 +89,7 @@ int minor_shift; /* number of times minor is shifted to get real minor */ char disk_name[16]; /* name of major driver */ - struct hd_struct *part; /* [indexed by minor] */ + struct hd_struct **part; /* [indexed by minor] */ struct block_device_operations *fops; struct request_queue *queue; void *private_data; diff -Nru a/include/linux/gfp.h b/include/linux/gfp.h --- a/include/linux/gfp.h Sun Mar 2 18:14:26 2003 +++ b/include/linux/gfp.h Sat Apr 19 23:22:40 2003 @@ -11,13 +11,26 @@ #define __GFP_DMA 0x01 #define __GFP_HIGHMEM 0x02 -/* Action modifiers - doesn't change the zoning */ +/* + * Action modifiers - doesn't change the zoning + * + * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt + * _might_ fail. This depends upon the particular VM implementation. + * + * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller + * cannot handle allocation failures. + * + * __GFP_NORETRY: The VM implementation must not retry indefinitely. + */ #define __GFP_WAIT 0x10 /* Can wait and reschedule? */ #define __GFP_HIGH 0x20 /* Should access emergency pools? */ #define __GFP_IO 0x40 /* Can start physical IO? */ #define __GFP_FS 0x80 /* Can call down to low-level FS? */ #define __GFP_COLD 0x100 /* Cache-cold page required */ #define __GFP_NOWARN 0x200 /* Suppress page allocation failure warning */ +#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */ +#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */ +#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) diff -Nru a/include/linux/ide.h b/include/linux/ide.h --- a/include/linux/ide.h Fri Apr 18 08:58:55 2003 +++ b/include/linux/ide.h Sun Apr 20 14:14:29 2003 @@ -1568,7 +1568,7 @@ extern int ide_spin_wait_hwgroup(ide_drive_t *); extern void ide_timer_expiry(unsigned long); -extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs); +extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs); extern void do_ide_request(request_queue_t *); extern void ide_init_subdrivers(void); diff -Nru a/include/linux/initrd.h b/include/linux/initrd.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/initrd.h Sun Apr 20 13:15:58 2003 @@ -0,0 +1,16 @@ + +#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ + +/* 1 = load ramdisk, 0 = don't load */ +extern int rd_doload; + +/* 1 = prompt for ramdisk, 0 = don't prompt */ +extern int rd_prompt; + +/* starting block # of image */ +extern int rd_image_start; + +/* 1 if it is not an error if initrd_start < memory_start */ +extern int initrd_below_start_ok; + +extern unsigned long initrd_start, initrd_end; diff -Nru a/include/linux/input.h b/include/linux/input.h --- a/include/linux/input.h Wed Feb 12 01:41:01 2003 +++ b/include/linux/input.h Sat Apr 19 02:49:04 2003 @@ -895,8 +895,8 @@ int input_accept_process(struct input_handle *handle, struct file *file); int input_flush_device(struct input_handle* handle, struct file* file); -devfs_handle_t input_register_minor(char *name, int minor, int minor_base); -void input_unregister_minor(devfs_handle_t handle); +/* will go away once devfs_register gets sanitized */ +void input_register_minor(char *name, int minor, int minor_base); void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); diff -Nru a/include/linux/interrupt.h b/include/linux/interrupt.h --- a/include/linux/interrupt.h Mon Apr 14 12:11:44 2003 +++ b/include/linux/interrupt.h Sun Apr 20 14:14:29 2003 @@ -11,8 +11,30 @@ #include #include +/* + * For 2.4.x compatibility, 2.4.x can use + * + * typedef void irqreturn_t; + * #define IRQ_NONE + * #define IRQ_HANDLED + * #define IRQ_RETVAL(x) + * + * To mix old-style and new-style irq handler returns. + * + * IRQ_NONE means we didn't handle it. + * IRQ_HANDLED means that we did have a valid interrupt and handled it. + * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) + */ +typedef struct irqreturn { + unsigned int val; +} irqreturn_t; + +#define IRQ_NONE ((struct irqreturn) { 0 }) +#define IRQ_HANDLED ((struct irqreturn) { 1 }) +#define IRQ_RETVAL(x) ((struct irqreturn) { (x) != 0 }) + struct irqaction { - void (*handler)(int, void *, struct pt_regs *); + irqreturn_t (*handler)(int, void *, struct pt_regs *); unsigned long flags; unsigned long mask; const char *name; @@ -20,8 +42,9 @@ struct irqaction *next; }; +extern irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs); extern int request_irq(unsigned int, - void (*handler)(int, void *, struct pt_regs *), + irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long, const char *, void *); extern void free_irq(unsigned int, void *); diff -Nru a/include/linux/irq.h b/include/linux/irq.h --- a/include/linux/irq.h Mon May 27 05:07:35 2002 +++ b/include/linux/irq.h Sun Apr 20 14:14:29 2003 @@ -72,7 +72,6 @@ extern int setup_irq(unsigned int , struct irqaction * ); extern hw_irq_controller no_irq_type; /* needed in every arch ? */ -extern void no_action(int cpl, void *dev_id, struct pt_regs *regs); #endif diff -Nru a/include/linux/linux_logo.h b/include/linux/linux_logo.h --- a/include/linux/linux_logo.h Tue Mar 25 17:25:37 2003 +++ b/include/linux/linux_logo.h Sun Apr 20 02:43:12 2003 @@ -32,6 +32,6 @@ const unsigned char *data; }; -extern const struct linux_logo * __init find_logo(int depth); +extern const struct linux_logo *fb_find_logo(int depth); #endif /* _LINUX_LINUX_LOGO_H */ diff -Nru a/include/linux/miscdevice.h b/include/linux/miscdevice.h --- a/include/linux/miscdevice.h Tue Jan 14 09:53:18 2003 +++ b/include/linux/miscdevice.h Sat Apr 19 02:57:03 2003 @@ -44,7 +44,7 @@ const char *name; struct file_operations *fops; struct miscdevice * next, * prev; - devfs_handle_t devfs_handle; + char devfs_name[64]; }; extern int misc_register(struct miscdevice * misc); diff -Nru a/include/linux/mm.h b/include/linux/mm.h --- a/include/linux/mm.h Sat Apr 12 16:21:11 2003 +++ b/include/linux/mm.h Sat Apr 19 23:22:50 2003 @@ -594,28 +594,10 @@ extern unsigned int nr_used_zone_pages(void); -#ifdef CONFIG_MMU extern struct page * vmalloc_to_page(void *addr); extern struct page * follow_page(struct mm_struct *mm, unsigned long address, int write); extern int remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long to, unsigned long size, pgprot_t prot); -#else -static inline struct page * vmalloc_to_page(void *addr) -{ - return NULL; -} -static inline struct page * follow_page(struct mm_struct *mm, - unsigned long address, int write) -{ - return NULL; -} -static inline int remap_page_range(struct vm_area_struct *vma, - unsigned long from, unsigned long to, - unsigned long size, pgprot_t prot) -{ - return -EPERM; -} -#endif /* CONFIG_MMU */ #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff -Nru a/include/linux/net.h b/include/linux/net.h --- a/include/linux/net.h Sun Apr 6 06:03:54 2003 +++ b/include/linux/net.h Sat Apr 19 16:21:17 2003 @@ -127,14 +127,17 @@ int offset, size_t size, int flags); }; +struct module; + struct net_proto_family { - int family; - int (*create)(struct socket *sock, int protocol); + int family; + int (*create)(struct socket *sock, int protocol); /* These are counters for the number of different methods of each we support */ - short authentication; - short encryption; - short encrypt_net; + short authentication; + short encryption; + short encrypt_net; + struct module *owner; }; struct iovec; diff -Nru a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h --- a/include/linux/nfsd/syscall.h Wed Apr 16 14:09:42 2003 +++ b/include/linux/nfsd/syscall.h Sat Apr 19 23:22:56 2003 @@ -59,7 +59,7 @@ struct nfsctl_export { char ex_client[NFSCLNT_IDMAX+1]; char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; + __kernel_old_dev_t ex_dev; __kernel_ino_t ex_ino; int ex_flags; __kernel_uid_t ex_anon_uid; @@ -104,7 +104,6 @@ #define ca_export u.u_export #define ca_getfd u.u_getfd #define ca_getfs u.u_getfs -#define ca_authd u.u_authd }; union nfsctl_res { diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Wed Apr 16 15:34:52 2003 +++ b/include/linux/sched.h Sat Apr 19 23:22:46 2003 @@ -465,6 +465,7 @@ #define PF_FROZEN 0x00010000 /* frozen for system suspend */ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ #define PF_KSWAPD 0x00040000 /* I am kswapd */ +#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ #if CONFIG_SMP extern void set_cpus_allowed(task_t *p, unsigned long new_mask); diff -Nru a/include/linux/slab.h b/include/linux/slab.h --- a/include/linux/slab.h Sat Mar 8 14:50:35 2003 +++ b/include/linux/slab.h Sat Apr 19 23:22:40 2003 @@ -22,7 +22,7 @@ #define SLAB_KERNEL GFP_KERNEL #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN) +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY) #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). diff -Nru a/include/linux/time.h b/include/linux/time.h --- a/include/linux/time.h Tue Apr 8 09:16:49 2003 +++ b/include/linux/time.h Sat Apr 19 23:22:26 2003 @@ -26,6 +26,16 @@ #include #include +#include +#include +#ifndef div_long_long_rem + +#define div_long_long_rem(dividend,divisor,remainder) ({ \ + u64 result = dividend; \ + *remainder = do_div(result,divisor); \ + result; }) + +#endif /* * Have the 32 bit jiffies value wrap 5 minutes after boot @@ -59,25 +69,52 @@ #ifndef NSEC_PER_USEC #define NSEC_PER_USEC (1000L) #endif +/* + * We want to do realistic conversions of time so we need to use the same + * values the update wall clock code uses as the jiffie size. This value + * is: TICK_NSEC(TICK_USEC) (both of which are defined in timex.h). This + * is a constant and is in nanoseconds. We will used scaled math and + * with a scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and + * NSEC_JIFFIE_SC. Note that these defines contain nothing but + * constants and so are computed at compile time. SHIFT_HZ (computed in + * timex.h) adjusts the scaling for different HZ values. + */ +#define SEC_JIFFIE_SC (30 - SHIFT_HZ) +#define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 30) +#define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 20) +#define SEC_CONVERSION ((unsigned long)(((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) /\ + (u64)TICK_NSEC(TICK_USEC))) +#define NSEC_CONVERSION ((unsigned long)(((u64)1 << NSEC_JIFFIE_SC) / \ + (u64)TICK_NSEC(TICK_USEC))) +#define USEC_CONVERSION \ + ((unsigned long)(((u64)NSEC_PER_USEC << USEC_JIFFIE_SC)/ \ + (u64)TICK_NSEC(TICK_USEC))) +#define MAX_SEC_IN_JIFFIES \ + (u32)((u64)((u64)MAX_JIFFY_OFFSET * TICK_NSEC(TICK_USEC)) / NSEC_PER_SEC) static __inline__ unsigned long timespec_to_jiffies(struct timespec *value) { unsigned long sec = value->tv_sec; - long nsec = value->tv_nsec; + long nsec = value->tv_nsec + TICK_NSEC(TICK_USEC) - 1; - if (sec >= (MAX_JIFFY_OFFSET / HZ)) + if (sec >= MAX_SEC_IN_JIFFIES) return MAX_JIFFY_OFFSET; - nsec += 1000000000L / HZ - 1; - nsec /= 1000000000L / HZ; - return HZ * sec + nsec; + return (((u64)sec * SEC_CONVERSION) + + (((u64)nsec * NSEC_CONVERSION) >> + (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; + } static __inline__ void jiffies_to_timespec(unsigned long jiffies, struct timespec *value) { - value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ); - value->tv_sec = jiffies / HZ; + /* + * Convert jiffies to nanoseconds and seperate with + * one divide. + */ + u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); + value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_nsec); } /* Same for "timeval" */ @@ -85,20 +122,25 @@ timeval_to_jiffies(struct timeval *value) { unsigned long sec = value->tv_sec; - long usec = value->tv_usec; + long usec = value->tv_usec + USEC_PER_SEC / HZ - 1; - if (sec >= (MAX_JIFFY_OFFSET / HZ)) + if (sec >= MAX_SEC_IN_JIFFIES) return MAX_JIFFY_OFFSET; - usec += 1000000L / HZ - 1; - usec /= 1000000L / HZ; - return HZ * sec + usec; + return (((u64)sec * SEC_CONVERSION) + + (((u64)usec * USEC_CONVERSION) >> + (USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; } static __inline__ void jiffies_to_timeval(unsigned long jiffies, struct timeval *value) { - value->tv_usec = (jiffies % HZ) * (1000000L / HZ); - value->tv_sec = jiffies / HZ; + /* + * Convert jiffies to nanoseconds and seperate with + * one divide. + */ + u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); + value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); + value->tv_usec /= NSEC_PER_USEC; } static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) @@ -140,6 +182,7 @@ } extern struct timespec xtime; +extern struct timespec wall_to_monotonic; extern seqlock_t xtime_lock; static inline unsigned long get_seconds(void) @@ -200,6 +243,9 @@ #define CLOCK_MONOTONIC_HR 5 #define MAX_CLOCKS 6 +#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC | \ + CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR) +#define CLOCKS_MONO (CLOCK_MONOTONIC & CLOCK_MONOTONIC_HR) /* * The various flags for setting POSIX.1b interval timers. diff -Nru a/include/linux/timex.h b/include/linux/timex.h --- a/include/linux/timex.h Sun Sep 8 11:24:21 2002 +++ b/include/linux/timex.h Sat Apr 19 23:22:26 2003 @@ -51,7 +51,6 @@ #ifndef _LINUX_TIMEX_H #define _LINUX_TIMEX_H -#include #include /* @@ -177,6 +176,7 @@ /* a value TUSEC for TICK_USEC (can be set bij adjtimex) */ #define TICK_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8)) +#include /* * syscall interface - used (mainly by NTP daemon) * to discipline kernel clock oscillator diff -Nru a/include/linux/videodev.h b/include/linux/videodev.h --- a/include/linux/videodev.h Wed Dec 11 16:02:48 2002 +++ b/include/linux/videodev.h Sat Apr 19 03:11:22 2003 @@ -39,7 +39,7 @@ /* for videodev.c intenal usage -- don't touch */ int users; struct semaphore lock; - devfs_handle_t devfs_handle; + char devfs_name[64]; /* devfs */ }; #define VIDEO_MAJOR 81 diff -Nru a/include/linux/vmalloc.h b/include/linux/vmalloc.h --- a/include/linux/vmalloc.h Thu Nov 7 23:47:15 2002 +++ b/include/linux/vmalloc.h Sat Apr 19 23:22:50 2003 @@ -27,7 +27,8 @@ extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot); extern void vfree(void *addr); -extern void *vmap(struct page **pages, unsigned int count); +extern void *vmap(struct page **pages, unsigned int count, + unsigned long flags, pgprot_t prot); extern void vunmap(void *addr); /* diff -Nru a/include/net/pkt_cls.h b/include/net/pkt_cls.h --- a/include/net/pkt_cls.h Tue Feb 5 09:39:48 2002 +++ b/include/net/pkt_cls.h Sun Apr 20 00:25:21 2003 @@ -39,6 +39,8 @@ int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); }; +struct module; + struct tcf_proto_ops { struct tcf_proto_ops *next; @@ -56,6 +58,8 @@ /* rtnetlink specific */ int (*dump)(struct tcf_proto*, unsigned long, struct sk_buff *skb, struct tcmsg*); + + struct module *owner; }; /* Main classifier routine: scans classifier chain attached diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h --- a/include/net/pkt_sched.h Thu May 23 09:59:37 2002 +++ b/include/net/pkt_sched.h Sun Apr 20 00:57:16 2003 @@ -49,6 +49,8 @@ int (*dump)(struct Qdisc *, unsigned long, struct sk_buff *skb, struct tcmsg*); }; +struct module; + struct Qdisc_ops { struct Qdisc_ops *next; @@ -67,6 +69,8 @@ int (*change)(struct Qdisc *, struct rtattr *arg); int (*dump)(struct Qdisc *, struct sk_buff *); + + struct module *owner; }; extern rwlock_t qdisc_tree_lock; diff -Nru a/include/sound/mpu401.h b/include/sound/mpu401.h --- a/include/sound/mpu401.h Thu Mar 20 08:41:11 2003 +++ b/include/sound/mpu401.h Sun Apr 20 14:14:29 2003 @@ -102,7 +102,7 @@ */ -void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); int snd_mpu401_uart_new(snd_card_t * card, int device, diff -Nru a/init/Kconfig b/init/Kconfig --- a/init/Kconfig Mon Mar 10 22:34:13 2003 +++ b/init/Kconfig Sun Apr 20 12:56:52 2003 @@ -56,12 +56,12 @@ and some programs won't run unless you say Y here. In particular, if you want to run the DOS emulator dosemu under Linux (read the DOSEMU-HOWTO, available from - ), you'll need to say Y + ), you'll need to say Y here. You can find documentation about IPC with "info ipc" and also in section 6.4 of the Linux Programmer's Guide, available from - . + . config BSD_PROCESS_ACCT bool "BSD Process Accounting" diff -Nru a/init/do_mounts_rd.c b/init/do_mounts_rd.c --- a/init/do_mounts_rd.c Thu Mar 6 16:27:25 2003 +++ b/init/do_mounts_rd.c Sun Apr 20 09:14:41 2003 @@ -4,6 +4,7 @@ #include #include #include +#include #include "do_mounts.h" diff -Nru a/init/main.c b/init/main.c --- a/init/main.c Fri Apr 4 09:01:32 2003 +++ b/init/main.c Sun Apr 20 09:14:41 2003 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff -Nru a/ipc/shm.c b/ipc/shm.c --- a/ipc/shm.c Wed Dec 18 05:36:54 2002 +++ b/ipc/shm.c Sat Apr 19 23:22:48 2003 @@ -361,27 +361,35 @@ } } -static void shm_get_stat (unsigned long *rss, unsigned long *swp) +static void shm_get_stat(unsigned long *rss, unsigned long *swp) { - struct shmem_inode_info *info; int i; *rss = 0; *swp = 0; - for(i = 0; i <= shm_ids.max_id; i++) { - struct shmid_kernel* shp; - struct inode * inode; + for (i = 0; i <= shm_ids.max_id; i++) { + struct shmid_kernel *shp; + struct inode *inode; shp = shm_get(i); - if(shp == NULL) + if(!shp) continue; + inode = shp->shm_file->f_dentry->d_inode; - info = SHMEM_I(inode); - spin_lock (&info->lock); - *rss += inode->i_mapping->nrpages; - *swp += info->swapped; - spin_unlock (&info->lock); + + if (is_file_hugepages(shp->shm_file)) { + struct address_space *mapping = inode->i_mapping; + spin_lock(&mapping->page_lock); + *rss += (HPAGE_SIZE/PAGE_SIZE)*mapping->nrpages; + spin_unlock(&mapping->page_lock); + } else { + struct shmem_inode_info *info = SHMEM_I(inode); + spin_lock(&info->lock); + *rss += inode->i_mapping->nrpages; + *swp += info->swapped; + spin_unlock(&info->lock); + } } } @@ -737,21 +745,66 @@ * detach and kill segment if marked destroyed. * The work is done in shm_close. */ -asmlinkage long sys_shmdt (char *shmaddr) +asmlinkage long sys_shmdt(char *shmaddr) { struct mm_struct *mm = current->mm; - struct vm_area_struct *shmd, *shmdnext; + struct vm_area_struct *vma, *next; + unsigned long addr = (unsigned long)shmaddr; + loff_t size = 0; int retval = -EINVAL; down_write(&mm->mmap_sem); - for (shmd = mm->mmap; shmd; shmd = shmdnext) { - shmdnext = shmd->vm_next; - if ((shmd->vm_ops == &shm_vm_ops || (shmd->vm_flags & VM_HUGETLB)) - && shmd->vm_start - (shmd->vm_pgoff << PAGE_SHIFT) == (ulong) shmaddr) { - do_munmap(mm, shmd->vm_start, shmd->vm_end - shmd->vm_start); + + /* + * If it had been mremap()'d, the starting address would not + * match the usual checks anyway. So assume all vma's are + * above the starting address given. + */ + vma = find_vma(mm, addr); + + while (vma) { + next = vma->vm_next; + + /* + * Check if the starting address would match, i.e. it's + * a fragment created by mprotect() and/or munmap(), or it + * otherwise it starts at this address with no hassles. + */ + if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) && + (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { + + + size = vma->vm_file->f_dentry->d_inode->i_size; + do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); + /* + * We discovered the size of the shm segment, so + * break out of here and fall through to the next + * loop that uses the size information to stop + * searching for matching vma's. + */ retval = 0; + vma = next; + break; } + vma = next; + } + + /* + * We need look no further than the maximum address a fragment + * could possibly have landed at. Also cast things to loff_t to + * prevent overflows and make comparisions vs. equal-width types. + */ + while (vma && (loff_t)(vma->vm_end - addr) <= size) { + next = vma->vm_next; + + /* finding a matching vma now does not alter retval */ + if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) && + (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) + + do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); + vma = next; } + up_write(&mm->mmap_sem); return retval; } diff -Nru a/kernel/posix-timers.c b/kernel/posix-timers.c --- a/kernel/posix-timers.c Tue Apr 15 16:11:01 2003 +++ b/kernel/posix-timers.c Sat Apr 19 23:22:26 2003 @@ -33,7 +33,12 @@ result; }) #endif +#define CLOCK_REALTIME_RES TICK_NSEC(TICK_USEC) // In nano seconds. +static inline u64 mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2) +{ + return (u64)mpy1 * mpy2; +} /* * Management arrays for POSIX timers. Timers are kept in slab memory * Timer ids are allocated by an external routine that keeps track of the @@ -48,7 +53,7 @@ * The idr_get_new *may* call slab for more memory so it must not be * called under a spin lock. Likewise idr_remore may release memory * (but it may be ok to do this under a lock...). - * idr_find is just a memory look up and is quite fast. A zero return + * idr_find is just a memory look up and is quite fast. A -1 return * indicates that the requested id does not exist. */ @@ -82,6 +87,7 @@ * For some reason mips/mips64 define the SIGEV constants plus 128. * Here we define a mask to get rid of the common bits. The * optimizer should make this costless to all but mips. + * Note that no common bits (the non-mips case) will give 0xffffffff. */ #define MIPS_SIGEV ~(SIGEV_NONE & \ SIGEV_SIGNAL & \ @@ -93,7 +99,7 @@ * The timer ID is turned into a timer address by idr_find(). * Verifying a valid ID consists of: * - * a) checking that idr_find() returns other than zero. + * a) checking that idr_find() returns other than -1. * b) checking that the timer id matches the one in the timer itself. * c) that the timer owner is in the callers thread group. */ @@ -162,6 +168,8 @@ void register_posix_clock(int clock_id, struct k_clock *new_clock); static int do_posix_gettime(struct k_clock *clock, struct timespec *tp); +static u64 do_posix_clock_monotonic_gettime_parts( + struct timespec *tp, struct timespec *mo); int do_posix_clock_monotonic_gettime(struct timespec *tp); int do_posix_clock_monotonic_settime(struct timespec *tp); static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); @@ -172,8 +180,8 @@ */ static __init int init_posix_timers(void) { - struct k_clock clock_realtime = {.res = NSEC_PER_SEC / HZ }; - struct k_clock clock_monotonic = {.res = NSEC_PER_SEC / HZ, + struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES }; + struct k_clock clock_monotonic = {.res = CLOCK_REALTIME_RES, .clock_get = do_posix_clock_monotonic_gettime, .clock_set = do_posix_clock_monotonic_settime }; @@ -192,7 +200,7 @@ static void tstojiffie(struct timespec *tp, int res, u64 *jiff) { - unsigned long sec = tp->tv_sec; + long sec = tp->tv_sec; long nsec = tp->tv_nsec + res - 1; if (nsec > NSEC_PER_SEC) { @@ -201,35 +209,14 @@ } /* - * A note on jiffy overflow: It is possible for the system to - * have been up long enough for the jiffies quanity to overflow. - * In order for correct timer evaluations we require that the - * specified time be somewhere between now and now + (max - * unsigned int/2). Times beyond this will be truncated back to - * this value. This is done in the absolute adjustment code, - * below. Here it is enough to just discard the high order - * bits. - */ - *jiff = (u64)sec * HZ; - /* - * Do the res thing. (Don't forget the add in the declaration of nsec) - */ - nsec -= nsec % res; - /* - * Split to jiffie and sub jiffie - */ - *jiff += nsec / (NSEC_PER_SEC / HZ); -} - -static void tstotimer(struct itimerspec *time, struct k_itimer *timer) -{ - u64 result; - int res = posix_clocks[timer->it_clock].res; - - tstojiffie(&time->it_value, res, &result); - timer->it_timer.expires = (unsigned long)result; - tstojiffie(&time->it_interval, res, &result); - timer->it_incr = (unsigned long)result; + * The scaling constants are defined in + * The difference between there and here is that we do the + * res rounding and compute a 64-bit result (well so does that + * but it then throws away the high bits). + */ + *jiff = (mpy_l_X_l_ll(sec, SEC_CONVERSION) + + (mpy_l_X_l_ll(nsec, NSEC_CONVERSION) >> + (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; } static void schedule_next_timer(struct k_itimer *timr) @@ -690,57 +677,81 @@ * If it is relative time, we need to add the current (CLOCK_MONOTONIC) * time to it to get the proper time for the timer. */ -static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, int abs) +static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, + int abs, u64 *exp) { struct timespec now; - struct timespec oc; - do_posix_clock_monotonic_gettime(&now); - - if (!abs || (posix_clocks[CLOCK_MONOTONIC].clock_get != - clock->clock_get)) { - if (abs) - do_posix_gettime(clock, &oc); - else - oc.tv_nsec = oc.tv_sec = 0; - - tp->tv_sec += now.tv_sec - oc.tv_sec; - tp->tv_nsec += now.tv_nsec - oc.tv_nsec; + struct timespec oc = *tp; + struct timespec wall_to_mono; + u64 jiffies_64_f; + int rtn =0; + if (abs) { + /* + * The mask pick up the 4 basic clocks + */ + if (!(clock - &posix_clocks[0]) & ~CLOCKS_MASK) { + jiffies_64_f = do_posix_clock_monotonic_gettime_parts( + &now, &wall_to_mono); + /* + * If we are doing a MONOTONIC clock + */ + if((clock - &posix_clocks[0]) & CLOCKS_MONO){ + now.tv_sec += wall_to_mono.tv_sec; + now.tv_nsec += wall_to_mono.tv_nsec; + } + } else { + /* + * Not one of the basic clocks + */ + do_posix_gettime(clock, &now); + jiffies_64_f = get_jiffies_64(); + } + /* + * Take away now to get delta + */ + oc.tv_sec -= now.tv_sec; + oc.tv_nsec -= now.tv_nsec; /* * Normalize... */ - if ((tp->tv_nsec - NSEC_PER_SEC) >= 0) { - tp->tv_nsec -= NSEC_PER_SEC; - tp->tv_sec++; + while ((oc.tv_nsec - NSEC_PER_SEC) >= 0) { + oc.tv_nsec -= NSEC_PER_SEC; + oc.tv_sec++; } - if ((tp->tv_nsec) < 0) { - tp->tv_nsec += NSEC_PER_SEC; - tp->tv_sec--; + while ((oc.tv_nsec) < 0) { + oc.tv_nsec += NSEC_PER_SEC; + oc.tv_sec--; } + }else{ + jiffies_64_f = get_jiffies_64(); } /* - * Check if the requested time is prior to now (if so set now) or - * is more than the timer code can handle (if so we error out). - * The (unsigned) catches the case of prior to "now" with the same - * test. Only on failure do we sort out what happened, and then - * we use the (unsigned) to error out negative seconds. + * Check if the requested time is prior to now (if so set now) + */ + if (oc.tv_sec < 0) + oc.tv_sec = oc.tv_nsec = 0; + tstojiffie(&oc, clock->res, exp); + + /* + * Check if the requested time is more than the timer code + * can handle (if so we error out but return the value too). */ - if ((unsigned) (tp->tv_sec - now.tv_sec) > (MAX_JIFFY_OFFSET / HZ)) { - if ((unsigned) tp->tv_sec < now.tv_sec) { - tp->tv_sec = now.tv_sec; - tp->tv_nsec = now.tv_nsec; - } else + if (*exp > ((u64)MAX_JIFFY_OFFSET)) /* * This is a considered response, not exactly in * line with the standard (in fact it is silent on - * possible overflows). We assume such a large + * possible overflows). We assume such a large * value is ALMOST always a programming error and * try not to compound it by setting a really dumb * value. */ - return -EINVAL; - } - return 0; + rtn = -EINVAL; + /* + * return the actual jiffies expire time, full 64 bits + */ + *exp += jiffies_64_f; + return rtn; } /* Set a POSIX.1b interval timer. */ @@ -750,6 +761,7 @@ struct itimerspec *new_setting, struct itimerspec *old_setting) { struct k_clock *clock = &posix_clocks[timr->it_clock]; + u64 expire_64; if (old_setting) do_timer_gettime(timr, old_setting); @@ -788,14 +800,15 @@ return 0; } - if ((flags & TIMER_ABSTIME) && - (clock->clock_get != do_posix_clock_monotonic_gettime)) - // FIXME: what is this? - ; if (adjust_abs_time(clock, - &new_setting->it_value, flags & TIMER_ABSTIME)) + &new_setting->it_value, flags & TIMER_ABSTIME, + &expire_64)) { return -EINVAL; - tstotimer(new_setting, timr); + } + timr->it_timer.expires = (unsigned long)expire_64; + tstojiffie(&new_setting->it_interval, clock->res, &expire_64); + timr->it_incr = (unsigned long)expire_64; + /* * For some reason the timer does not fire immediately if expires is @@ -964,30 +977,46 @@ * Note also that the while loop assures that the sub_jiff_offset * will be less than a jiffie, thus no need to normalize the result. * Well, not really, if called with ints off :( - * - * HELP, this code should make an attempt at resolution beyond the - * jiffie. Trouble is this is "arch" dependent... */ -int do_posix_clock_monotonic_gettime(struct timespec *tp) +static u64 do_posix_clock_monotonic_gettime_parts( + struct timespec *tp, struct timespec *mo) { - long sub_sec; - u64 jiffies_64_f; - -#if (BITS_PER_LONG > 32) - jiffies_64_f = jiffies_64; -#else + u64 jiff; + struct timeval tpv; unsigned int seq; do { seq = read_seqbegin(&xtime_lock); - jiffies_64_f = jiffies_64; + do_gettimeofday(&tpv); + *mo = wall_to_monotonic; + jiff = jiffies_64; - } while (read_seqretry(&xtime_lock, seq)); -#endif - tp->tv_sec = div_long_long_rem(jiffies_64_f, HZ, &sub_sec); - tp->tv_nsec = sub_sec * (NSEC_PER_SEC / HZ); + } while(read_seqretry(&xtime_lock, seq)); + + /* + * Love to get this before it is converted to usec. + * It would save a div AND a mpy. + */ + tp->tv_sec = tpv.tv_sec; + tp->tv_nsec = tpv.tv_usec * NSEC_PER_USEC; + return jiff; +} + +int do_posix_clock_monotonic_gettime(struct timespec *tp) +{ + struct timespec wall_to_mono; + + do_posix_clock_monotonic_gettime_parts(tp, &wall_to_mono); + + tp->tv_sec += wall_to_mono.tv_sec; + tp->tv_nsec += wall_to_mono.tv_nsec; + + if ((tp->tv_nsec - NSEC_PER_SEC) > 0) { + tp->tv_nsec -= NSEC_PER_SEC; + tp->tv_sec++; + } return 0; } @@ -1138,7 +1167,7 @@ struct timespec t; struct timer_list new_timer; DECLARE_WAITQUEUE(abs_wqueue, current); - u64 rq_time = 0; + u64 rq_time = (u64)0; s64 left; int abs; struct restart_block *restart_block = @@ -1163,7 +1192,7 @@ if (!rq_time) return -EINTR; left = rq_time - get_jiffies_64(); - if (left <= 0LL) + if (left <= (s64)0) return 0; /* Already passed */ } @@ -1174,14 +1203,14 @@ do { t = *tsave; if (abs || !rq_time) { - adjust_abs_time(&posix_clocks[which_clock], &t, abs); - tstojiffie(&t, posix_clocks[which_clock].res, &rq_time); + adjust_abs_time(&posix_clocks[which_clock], &t, abs, + &rq_time); } left = rq_time - get_jiffies_64(); - if (left >= MAX_JIFFY_OFFSET) - left = MAX_JIFFY_OFFSET; - if (left < 0) + if (left >= (s64)MAX_JIFFY_OFFSET) + left = (s64)MAX_JIFFY_OFFSET; + if (left < (s64)0) break; new_timer.expires = jiffies + left; @@ -1192,13 +1221,12 @@ del_timer_sync(&new_timer); left = rq_time - get_jiffies_64(); - } while (left > 0 && !test_thread_flag(TIF_SIGPENDING)); + } while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING)); if (abs_wqueue.task_list.next) finish_wait(&nanosleep_abs_wqueue, &abs_wqueue); - if (left > 0) { - unsigned long rmd; + if (left > (s64)0) { /* * Always restart abs calls from scratch to pick up any @@ -1207,9 +1235,10 @@ if (abs) return -ERESTARTNOHAND; - tsave->tv_sec = div_long_long_rem(left, HZ, &rmd); - tsave->tv_nsec = rmd * (NSEC_PER_SEC / HZ); - + left *= TICK_NSEC(TICK_USEC); + tsave->tv_sec = div_long_long_rem(left, + NSEC_PER_SEC, + &tsave->tv_nsec); restart_block->fn = clock_nanosleep_restart; restart_block->arg0 = which_clock; restart_block->arg1 = (unsigned long)tsave; diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c Wed Apr 9 01:55:28 2003 +++ b/kernel/sched.c Sat Apr 19 23:22:31 2003 @@ -1091,7 +1091,7 @@ #define IDLE_REBALANCE_TICK (HZ/1000 ?: 1) #define BUSY_REBALANCE_TICK (HZ/5 ?: 1) #define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5) -#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 100) +#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2) #ifdef CONFIG_NUMA static void balance_node(runqueue_t *this_rq, int idle, int this_cpu) diff -Nru a/kernel/timer.c b/kernel/timer.c --- a/kernel/timer.c Fri Apr 11 15:29:11 2003 +++ b/kernel/timer.c Sat Apr 19 23:22:24 2003 @@ -441,8 +441,16 @@ unsigned long tick_usec = TICK_USEC; /* ACTHZ period (usec) */ unsigned long tick_nsec = TICK_NSEC(TICK_USEC); /* USER_HZ period (nsec) */ -/* The current time */ +/* + * The current time + * wall_to_monotonic is what we need to add to xtime (or xtime corrected + * for sub jiffie times) to get to monotonic time. Monotonic is pegged at zero + * at zero at system boot time, so wall_to_monotonic will be negative, + * however, we will ALWAYS keep the tv_nsec part positive so we can use + * the usual normalization. + */ struct timespec xtime __attribute__ ((aligned (16))); +struct timespec wall_to_monotonic __attribute__ ((aligned (16))); /* Don't completely fail for HZ > 500. */ int tickadj = 500/HZ ? : 1; /* microsecs */ @@ -508,6 +516,7 @@ case TIME_INS: if (xtime.tv_sec % 86400 == 0) { xtime.tv_sec--; + wall_to_monotonic.tv_sec++; time_state = TIME_OOP; clock_was_set(); printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); @@ -517,6 +526,7 @@ case TIME_DEL: if ((xtime.tv_sec + 1) % 86400 == 0) { xtime.tv_sec++; + wall_to_monotonic.tv_sec--; time_state = TIME_WAIT; clock_was_set(); printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n"); diff -Nru a/mm/filemap.c b/mm/filemap.c --- a/mm/filemap.c Sat Apr 12 16:21:01 2003 +++ b/mm/filemap.c Sat Apr 19 23:22:33 2003 @@ -31,12 +31,11 @@ * This is needed for the following functions: * - try_to_release_page * - block_invalidatepage - * - page_has_buffers * - generic_osync_inode * - * FIXME: remove all knowledge of the buffer layer from this file + * FIXME: remove all knowledge of the buffer layer from the core VM */ -#include +#include /* for generic_osync_inode */ #include #include diff -Nru a/mm/oom_kill.c b/mm/oom_kill.c --- a/mm/oom_kill.c Thu Mar 20 10:43:25 2003 +++ b/mm/oom_kill.c Sat Apr 19 23:22:46 2003 @@ -129,6 +129,8 @@ chosen = p; maxpoints = points; } + if (p->flags & PF_SWAPOFF) + return p; } while_each_thread(g, p); return chosen; diff -Nru a/mm/page-writeback.c b/mm/page-writeback.c --- a/mm/page-writeback.c Mon Apr 14 19:46:02 2003 +++ b/mm/page-writeback.c Sat Apr 19 23:22:32 2003 @@ -462,88 +462,6 @@ EXPORT_SYMBOL(write_one_page); /* - * Add a page to the dirty page list. - * - * It is a sad fact of life that this function is called from several places - * deeply under spinlocking. It may not sleep. - * - * If the page has buffers, the uptodate buffers are set dirty, to preserve - * dirty-state coherency between the page and the buffers. It the page does - * not have buffers then when they are later attached they will all be set - * dirty. - * - * The buffers are dirtied before the page is dirtied. There's a small race - * window in which a writepage caller may see the page cleanness but not the - * buffer dirtiness. That's fine. If this code were to set the page dirty - * before the buffers, a concurrent writepage caller could clear the page dirty - * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean - * page on the dirty page list. - * - * There is also a small window where the page is dirty, and not on dirty_pages. - * Also a possibility that by the time the page is added to dirty_pages, it has - * been set clean. The page lists are somewhat approximate in this regard. - * It's better to have clean pages accidentally attached to dirty_pages than to - * leave dirty pages attached to clean_pages. - * - * We use private_lock to lock against try_to_free_buffers while using the - * page's buffer list. Also use this to protect against clean buffers being - * added to the page after it was set dirty. - * - * FIXME: may need to call ->reservepage here as well. That's rather up to the - * address_space though. - * - * For now, we treat swapper_space specially. It doesn't use the normal - * block a_ops. - * - * FIXME: this should move over to fs/buffer.c - buffer_heads have no business in mm/ - */ -#include -int __set_page_dirty_buffers(struct page *page) -{ - struct address_space * const mapping = page->mapping; - int ret = 0; - - if (mapping == NULL) { - SetPageDirty(page); - goto out; - } - - if (!PageUptodate(page)) - buffer_error(); - - spin_lock(&mapping->private_lock); - if (page_has_buffers(page)) { - struct buffer_head *head = page_buffers(page); - struct buffer_head *bh = head; - - do { - if (buffer_uptodate(bh)) - set_buffer_dirty(bh); - else - buffer_error(); - bh = bh->b_this_page; - } while (bh != head); - } - spin_unlock(&mapping->private_lock); - - if (!TestSetPageDirty(page)) { - spin_lock(&mapping->page_lock); - if (page->mapping) { /* Race with truncate? */ - if (!mapping->backing_dev_info->memory_backed) - inc_page_state(nr_dirty); - list_del(&page->list); - list_add(&page->list, &mapping->dirty_pages); - } - spin_unlock(&mapping->page_lock); - __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); - } - -out: - return ret; -} -EXPORT_SYMBOL(__set_page_dirty_buffers); - -/* * For address_spaces which do not use buffers. Just set the page's dirty bit * and move it to the dirty_pages list. Also perform space reservation if * required. diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c --- a/mm/page_alloc.c Mon Apr 14 19:46:02 2003 +++ b/mm/page_alloc.c Sat Apr 19 23:22:40 2003 @@ -536,6 +536,7 @@ struct page *page; int i; int cold; + int do_retry; if (wait) might_sleep(); @@ -626,10 +627,21 @@ } /* - * Don't let big-order allocations loop. Yield for kswapd, try again. + * Don't let big-order allocations loop unless the caller explicitly + * requests that. Wait for some write requests to complete then retry. + * + * In this implementation, __GFP_REPEAT means __GFP_NOFAIL, but that + * may not be true in other implementations. */ - if (order <= 3) { - yield(); + do_retry = 0; + if (!(gfp_mask & __GFP_NORETRY)) { + if ((order <= 3) || (gfp_mask & __GFP_REPEAT)) + do_retry = 1; + if (gfp_mask & __GFP_NOFAIL) + do_retry = 1; + } + if (do_retry) { + blk_congestion_wait(WRITE, HZ/50); goto rebalance; } diff -Nru a/mm/swap.c b/mm/swap.c --- a/mm/swap.c Tue Mar 18 01:44:12 2003 +++ b/mm/swap.c Sat Apr 19 23:22:33 2003 @@ -21,7 +21,7 @@ #include #include #include -#include +#include /* for try_to_release_page() */ #include /* How many pages do we try to swap or page in/out together? */ diff -Nru a/mm/swap_state.c b/mm/swap_state.c --- a/mm/swap_state.c Tue Apr 8 03:16:30 2003 +++ b/mm/swap_state.c Sat Apr 19 23:22:33 2003 @@ -13,7 +13,6 @@ #include #include #include -#include /* block_sync_page() */ #include @@ -187,7 +186,7 @@ BUG_ON(!PageLocked(page)); BUG_ON(PageWriteback(page)); - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); entry.val = page->index; @@ -236,7 +235,7 @@ BUG_ON(!PageLocked(page)); BUG_ON(PageWriteback(page)); - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); entry.val = page->index; diff -Nru a/mm/swapfile.c b/mm/swapfile.c --- a/mm/swapfile.c Sat Apr 12 16:21:01 2003 +++ b/mm/swapfile.c Sat Apr 19 23:22:46 2003 @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -300,7 +300,7 @@ struct swap_info_struct * p; swp_entry_t entry; - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); BUG_ON(!PageLocked(page)); if (!PageSwapCache(page)) @@ -355,7 +355,7 @@ if (page) { int one_user; - BUG_ON(page_has_buffers(page)); + BUG_ON(PagePrivate(page)); page_cache_get(page); one_user = (page_count(page) == 2); /* Only cache user (+us), or swap space full? Free it! */ @@ -590,6 +590,11 @@ * to swapoff for a while, then reappear - but that is rare. */ while ((i = find_next_to_unuse(si, i))) { + if (signal_pending(current)) { + retval = -EINTR; + break; + } + /* * Get a page for the entry, using the existing swap * cache page if there is one. Otherwise, get a clean @@ -759,8 +764,7 @@ /* * Make sure that we aren't completely killing - * interactive performance. Interruptible check on - * signal_pending() would be nice, but changes the spec? + * interactive performance. */ cond_resched(); } @@ -1029,12 +1033,18 @@ } prev = type; } - err = -EINVAL; if (type < 0) { + err = -EINVAL; + swap_list_unlock(); + goto out_dput; + } + if (vm_enough_memory(p->pages)) + vm_unacct_memory(p->pages); + else { + err = -ENOMEM; swap_list_unlock(); goto out_dput; } - if (prev < 0) { swap_list.head = p->next; } else { @@ -1048,7 +1058,9 @@ total_swap_pages -= p->pages; p->flags &= ~SWP_WRITEOK; swap_list_unlock(); + current->flags |= PF_SWAPOFF; err = try_to_unuse(type); + current->flags &= ~PF_SWAPOFF; if (err) { /* re-insert swap space back into swap_list */ swap_list_lock(); diff -Nru a/mm/vmalloc.c b/mm/vmalloc.c --- a/mm/vmalloc.c Thu Oct 31 07:28:17 2002 +++ b/mm/vmalloc.c Sat Apr 19 23:22:50 2003 @@ -308,7 +308,7 @@ * * @addr: memory base address * - * Free the virtually continguos memory area starting at @addr, as + * Free the virtually contiguous memory area starting at @addr, as * obtained from vmalloc(), vmalloc_32() or __vmalloc(). * * May not be called in interrupt context. @@ -324,7 +324,7 @@ * * @addr: memory base address * - * Free the virtually continguos memory area starting at @addr, + * Free the virtually contiguous memory area starting at @addr, * which was created from the page array passed to vmap(). * * May not be called in interrupt context. @@ -336,25 +336,28 @@ } /** - * vmap - map an array of pages into virtually continguos space + * vmap - map an array of pages into virtually contiguous space * * @pages: array of page pointers * @count: number of pages to map + * @flags: vm_area->flags + * @prot: page protection for the mapping * - * Maps @count pages from @pages into continguos kernel virtual + * Maps @count pages from @pages into contiguous kernel virtual * space. */ -void *vmap(struct page **pages, unsigned int count) +void *vmap(struct page **pages, unsigned int count, + unsigned long flags, pgprot_t prot) { struct vm_struct *area; if (count > num_physpages) return NULL; - area = get_vm_area((count << PAGE_SHIFT), VM_MAP); + area = get_vm_area((count << PAGE_SHIFT), flags); if (!area) return NULL; - if (map_vm_area(area, PAGE_KERNEL, &pages)) { + if (map_vm_area(area, prot, &pages)) { vunmap(area->addr); return NULL; } @@ -363,14 +366,14 @@ } /** - * __vmalloc - allocate virtually continguos memory + * __vmalloc - allocate virtually contiguous memory * * @size: allocation size * @gfp_mask: flags for the page level allocator * @prot: protection mask for the allocated pages * * Allocate enough pages to cover @size from the page level - * allocator with @gfp_mask flags. Map them into continguos + * allocator with @gfp_mask flags. Map them into contiguous * kernel virtual space, using a pagetable protection of @prot. */ void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot) @@ -418,12 +421,12 @@ } /** - * vmalloc - allocate virtually continguos memory + * vmalloc - allocate virtually contiguous memory * * @size: allocation size * * Allocate enough pages to cover @size from the page level - * allocator and map them into continguos kernel virtual space. + * allocator and map them into contiguous kernel virtual space. * * For tight cotrol over page level allocator and protection flags * use __vmalloc() instead. @@ -434,12 +437,12 @@ } /** - * vmalloc_32 - allocate virtually continguos memory (32bit addressable) + * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) * * @size: allocation size * * Allocate enough 32bit PA addressable pages to cover @size from the - * page level allocator and map them into continguos kernel virtual space. + * page level allocator and map them into contiguous kernel virtual space. */ void *vmalloc_32(unsigned long size) { diff -Nru a/mm/vmscan.c b/mm/vmscan.c --- a/mm/vmscan.c Tue Apr 8 03:16:30 2003 +++ b/mm/vmscan.c Sat Apr 19 23:22:51 2003 @@ -22,7 +22,8 @@ #include #include #include -#include /* for try_to_release_page() */ +#include /* for try_to_release_page(), + buffer_heads_over_limit */ #include #include #include @@ -134,11 +135,9 @@ * If the vm encounted mapped pages on the LRU it increase the pressure on * slab to avoid swapping. * - * FIXME: do not do for zone highmem - * * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits. */ -static int shrink_slab(long scanned, unsigned int gfp_mask) +static int shrink_slab(long scanned, unsigned int gfp_mask) { struct shrinker *shrinker; long pages; @@ -804,8 +803,7 @@ * excessive rotation of the inactive list, which is _supposed_ to be an LRU, * yes? */ -int -try_to_free_pages(struct zone *classzone, +int try_to_free_pages(struct zone *classzone, unsigned int gfp_mask, unsigned int order) { int priority; @@ -835,9 +833,10 @@ /* Take a nap, wait for some writeback to complete */ blk_congestion_wait(WRITE, HZ/10); - shrink_slab(total_scanned, gfp_mask); + if (classzone - classzone->zone_pgdat->node_zones < ZONE_HIGHMEM) + shrink_slab(total_scanned, gfp_mask); } - if (gfp_mask & __GFP_FS) + if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) out_of_memory(); return 0; } @@ -895,7 +894,8 @@ max_scan = SWAP_CLUSTER_MAX; to_free -= shrink_zone(zone, max_scan, GFP_KERNEL, to_reclaim, &nr_mapped, ps, priority); - shrink_slab(max_scan + nr_mapped, GFP_KERNEL); + if (i < ZONE_HIGHMEM) + shrink_slab(max_scan + nr_mapped, GFP_KERNEL); if (zone->all_unreclaimable) continue; if (zone->pages_scanned > zone->present_pages * 2) diff -Nru a/net/Kconfig b/net/Kconfig --- a/net/Kconfig Fri Apr 4 10:01:38 2003 +++ b/net/Kconfig Sun Apr 20 12:56:51 2003 @@ -18,7 +18,7 @@ For a general introduction to Linux networking, it is highly recommended to read the NET-HOWTO, available from - . + . menu "Networking options" depends on NET @@ -162,7 +162,7 @@ For an excellent introduction to Linux networking, please read the NET-3-HOWTO, available from - . + . This option is also necessary if you want to use the full power of term (term is a program which gives you almost full Internet @@ -294,7 +294,7 @@ Novell client ncpfs (available from ) or from within the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, - available from ). In order + available from ). In order to do the former, you'll also have to say Y to "NCP file system support", below. @@ -307,7 +307,7 @@ or mars_nwe from . For more information, read the IPX-HOWTO available from - . + . General information about how to connect Linux, Windows machines and Macs is on the WWW at . @@ -339,7 +339,7 @@ General information about how to connect Linux, Windows machines and Macs is on the WWW at . The NET-3-HOWTO, available from - , contains valuable + , contains valuable information as well. This driver is also available as a module ( = code which can be diff -Nru a/net/ax25/Kconfig b/net/ax25/Kconfig --- a/net/ax25/Kconfig Sun Feb 9 17:29:49 2003 +++ b/net/ax25/Kconfig Sun Apr 20 12:56:51 2003 @@ -13,7 +13,7 @@ help If you want to connect your Linux box to an amateur radio, answer Y here. You want to read and - the AX25-HOWTO, available from . + the AX25-HOWTO, available from . Note that the answer to this question won't directly affect the kernel: saying N will just cause the configurator to skip all @@ -42,7 +42,7 @@ Information about where to get supporting software for Linux amateur radio as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You might also want to + . You might also want to check out the file in the kernel source. More information about digital amateur radio in general is on the WWW at @@ -76,7 +76,7 @@ A comprehensive listing of all the software for Linux amateur radio users as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You also might want to + . You also might want to check out the file . More information about digital amateur radio in general is on the WWW at . @@ -97,7 +97,7 @@ A comprehensive listing of all the software for Linux amateur radio users as well as information about how to configure an AX.25 port is contained in the AX25-HOWTO, available from - . You also might want to + . You also might want to check out the file . More information about digital amateur radio in general is on the WWW at . diff -Nru a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c --- a/net/ipv6/xfrm6_input.c Mon Apr 14 11:25:51 2003 +++ b/net/ipv6/xfrm6_input.c Sat Apr 19 20:41:29 2003 @@ -136,7 +136,7 @@ unsigned char *tmp_hdr = NULL; int hdr_len = 0; u16 nh_offset = 0; - u8 nexthdr = 0; + int nexthdr = 0; nh_offset = ((unsigned char*)&skb->nh.ipv6h->nexthdr) - skb->nh.raw; hdr_len = sizeof(struct ipv6hdr); diff -Nru a/net/ipx/Kconfig b/net/ipx/Kconfig --- a/net/ipx/Kconfig Tue Oct 29 17:16:55 2002 +++ b/net/ipx/Kconfig Sun Apr 20 12:56:51 2003 @@ -12,7 +12,7 @@ same address). The way this is done is to create a virtual internal "network" inside your box and to assign an IPX address to this network. Say Y here if you want to do this; read the IPX-HOWTO at - for details. + for details. The full internal IPX network enables you to allocate sockets on different virtual nodes of the internal network. This is done by diff -Nru a/net/irda/Kconfig b/net/irda/Kconfig --- a/net/irda/Kconfig Sun Feb 9 17:29:49 2003 +++ b/net/irda/Kconfig Sun Apr 20 12:56:51 2003 @@ -16,7 +16,7 @@ some user-space utilities like irattach. For more information, see the file . You also want to read the IR-HOWTO, available at - . + . If you want to exchange bits of data (vCal, vCard) with a PDA, you will need to install some OBEX application, such as OpenObex : diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_api.c Sun Apr 20 00:25:22 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -223,8 +224,9 @@ tp->q = q; tp->classify = tp_ops->classify; tp->classid = parent; - err = tp_ops->init(tp); - if (err) { + err = -EBUSY; + if (!try_module_get(tp_ops->owner) || + (err = tp_ops->init(tp)) != 0) { kfree(tp); goto errout; } @@ -248,6 +250,7 @@ write_unlock(&qdisc_tree_lock); tp->ops->destroy(tp); + module_put(tp->ops->owner); kfree(tp); err = 0; goto errout; diff -Nru a/net/sched/cls_fw.c b/net/sched/cls_fw.c --- a/net/sched/cls_fw.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_fw.c Sun Apr 20 00:25:22 2003 @@ -117,7 +117,6 @@ static int fw_init(struct tcf_proto *tp) { - MOD_INC_USE_COUNT; return 0; } @@ -127,10 +126,8 @@ struct fw_filter *f; int h; - if (head == NULL) { - MOD_DEC_USE_COUNT; + if (head == NULL) return; - } for (h=0; h<256; h++) { while ((f=head->ht[h]) != NULL) { @@ -146,7 +143,6 @@ } } kfree(head); - MOD_DEC_USE_COUNT; } static int fw_delete(struct tcf_proto *tp, unsigned long arg) @@ -351,18 +347,18 @@ } struct tcf_proto_ops cls_fw_ops = { - NULL, - "fw", - fw_classify, - fw_init, - fw_destroy, - - fw_get, - fw_put, - fw_change, - fw_delete, - fw_walk, - fw_dump + .next = NULL, + .kind = "fw", + .classify = fw_classify, + .init = fw_init, + .destroy = fw_destroy, + .get = fw_get, + .put = fw_put, + .change = fw_change, + .delete = fw_delete, + .walk = fw_walk, + .dump = fw_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_route.c b/net/sched/cls_route.c --- a/net/sched/cls_route.c Fri Oct 11 16:07:31 2002 +++ b/net/sched/cls_route.c Sun Apr 20 00:25:22 2003 @@ -272,7 +272,6 @@ static int route4_init(struct tcf_proto *tp) { - MOD_INC_USE_COUNT; return 0; } @@ -281,10 +280,8 @@ struct route4_head *head = xchg(&tp->root, NULL); int h1, h2; - if (head == NULL) { - MOD_DEC_USE_COUNT; + if (head == NULL) return; - } for (h1=0; h1<=256; h1++) { struct route4_bucket *b; @@ -309,7 +306,6 @@ } } kfree(head); - MOD_DEC_USE_COUNT; } static int route4_delete(struct tcf_proto *tp, unsigned long arg) @@ -607,18 +603,18 @@ } struct tcf_proto_ops cls_route4_ops = { - NULL, - "route", - route4_classify, - route4_init, - route4_destroy, - - route4_get, - route4_put, - route4_change, - route4_delete, - route4_walk, - route4_dump + .next = NULL, + .kind = "route", + .classify = route4_classify, + .init = route4_init, + .destroy = route4_destroy, + .get = route4_get, + .put = route4_put, + .change = route4_change, + .delete = route4_delete, + .walk = route4_walk, + .dump = route4_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h --- a/net/sched/cls_rsvp.h Mon Apr 14 15:42:04 2003 +++ b/net/sched/cls_rsvp.h Sun Apr 20 00:25:22 2003 @@ -242,14 +242,12 @@ { struct rsvp_head *data; - MOD_INC_USE_COUNT; data = kmalloc(sizeof(struct rsvp_head), GFP_KERNEL); if (data) { memset(data, 0, sizeof(struct rsvp_head)); tp->root = data; return 0; } - MOD_DEC_USE_COUNT; return -ENOBUFS; } @@ -289,7 +287,6 @@ } } kfree(data); - MOD_DEC_USE_COUNT; } static int rsvp_delete(struct tcf_proto *tp, unsigned long arg) @@ -668,18 +665,18 @@ } struct tcf_proto_ops RSVP_OPS = { - NULL, - RSVP_ID, - rsvp_classify, - rsvp_init, - rsvp_destroy, - - rsvp_get, - rsvp_put, - rsvp_change, - rsvp_delete, - rsvp_walk, - rsvp_dump + .next = NULL, + .kind = RSVP_ID, + .classify = rsvp_classify, + .init = rsvp_init, + .destroy = rsvp_destroy, + .get = rsvp_get, + .put = rsvp_put, + .change = rsvp_change, + .delete = rsvp_delete, + .walk = rsvp_walk, + .dump = rsvp_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c --- a/net/sched/cls_tcindex.c Tue Feb 5 07:24:36 2002 +++ b/net/sched/cls_tcindex.c Sun Apr 20 00:25:22 2003 @@ -144,12 +144,10 @@ struct tcindex_data *p; DPRINTK("tcindex_init(tp %p)\n",tp); - MOD_INC_USE_COUNT; p = kmalloc(sizeof(struct tcindex_data),GFP_KERNEL); - if (!p) { - MOD_DEC_USE_COUNT; + if (!p) return -ENOMEM; - } + tp->root = p; p->perfect = NULL; p->h = NULL; @@ -417,7 +415,6 @@ kfree(p->h); kfree(p); tp->root = NULL; - MOD_DEC_USE_COUNT; } @@ -480,18 +477,18 @@ } struct tcf_proto_ops cls_tcindex_ops = { - NULL, - "tcindex", - tcindex_classify, - tcindex_init, - tcindex_destroy, - - tcindex_get, - tcindex_put, - tcindex_change, - tcindex_delete, - tcindex_walk, - tcindex_dump + .next = NULL, + .kind = "tcindex", + .classify = tcindex_classify, + .init = tcindex_init, + .destroy = tcindex_destroy, + .get = tcindex_get, + .put = tcindex_put, + .change = tcindex_change, + .delete = tcindex_delete, + .walk = tcindex_walk, + .dump = tcindex_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c --- a/net/sched/cls_u32.c Mon Apr 14 15:42:04 2003 +++ b/net/sched/cls_u32.c Sun Apr 20 00:25:22 2003 @@ -257,17 +257,14 @@ struct tc_u_hnode *root_ht; struct tc_u_common *tp_c; - MOD_INC_USE_COUNT; - for (tp_c = u32_list; tp_c; tp_c = tp_c->next) if (tp_c->q == tp->q) break; root_ht = kmalloc(sizeof(*root_ht), GFP_KERNEL); - if (root_ht == NULL) { - MOD_DEC_USE_COUNT; + if (root_ht == NULL) return -ENOBUFS; - } + memset(root_ht, 0, sizeof(*root_ht)); root_ht->divisor = 0; root_ht->refcnt++; @@ -277,7 +274,6 @@ tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL); if (tp_c == NULL) { kfree(root_ht); - MOD_DEC_USE_COUNT; return -ENOBUFS; } memset(tp_c, 0, sizeof(*tp_c)); @@ -402,7 +398,6 @@ kfree(tp_c); } - MOD_DEC_USE_COUNT; tp->data = NULL; } @@ -690,18 +685,18 @@ } struct tcf_proto_ops cls_u32_ops = { - NULL, - "u32", - u32_classify, - u32_init, - u32_destroy, - - u32_get, - u32_put, - u32_change, - u32_delete, - u32_walk, - u32_dump + .next = NULL, + .kind = "u32", + .classify = u32_classify, + .init = u32_init, + .destroy = u32_destroy, + .get = u32_get, + .put = u32_put, + .change = u32_change, + .delete = u32_delete, + .walk = u32_walk, + .dump = u32_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c Wed Nov 6 17:27:58 2002 +++ b/net/sched/sch_api.c Sun Apr 20 00:57:16 2003 @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -447,6 +448,10 @@ else sch->handle = handle; + err = -EBUSY; + if (!try_module_get(ops->owner)) + goto err_out; + if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) { write_lock(&qdisc_tree_lock); sch->next = dev->qdisc_list; @@ -458,6 +463,7 @@ #endif return sch; } + module_put(ops->owner); err_out: *errp = err; diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c --- a/net/sched/sch_atm.c Thu Mar 20 00:45:11 2003 +++ b/net/sched/sch_atm.c Sun Apr 20 00:57:16 2003 @@ -575,7 +575,6 @@ p->link.ref = 1; p->link.next = NULL; tasklet_init(&p->task,sch_atm_dequeue,(unsigned long) sch); - MOD_INC_USE_COUNT; return 0; } @@ -612,7 +611,6 @@ } } tasklet_kill(&p->task); - MOD_DEC_USE_COUNT; } @@ -663,41 +661,35 @@ return 0; } -static struct Qdisc_class_ops atm_class_ops = -{ - .graft = atm_tc_graft, - .leaf = atm_tc_leaf, - .get = atm_tc_get, - .put = atm_tc_put, - .change = atm_tc_change, - .delete = atm_tc_delete, - .walk = atm_tc_walk, - - .tcf_chain = atm_tc_find_tcf, - .bind_tcf = atm_tc_bind_filter, - .unbind_tcf = atm_tc_put, - - .dump = atm_tc_dump_class, +static struct Qdisc_class_ops atm_class_ops = { + .graft = atm_tc_graft, + .leaf = atm_tc_leaf, + .get = atm_tc_get, + .put = atm_tc_put, + .change = atm_tc_change, + .delete = atm_tc_delete, + .walk = atm_tc_walk, + .tcf_chain = atm_tc_find_tcf, + .bind_tcf = atm_tc_bind_filter, + .unbind_tcf = atm_tc_put, + .dump = atm_tc_dump_class, }; -struct Qdisc_ops atm_qdisc_ops = -{ - .next = NULL, - .cl_ops = &atm_class_ops, - .id = "atm", - .priv_size = sizeof(struct atm_qdisc_data), - - .enqueue = atm_tc_enqueue, - .dequeue = atm_tc_dequeue, - .requeue = atm_tc_requeue, - .drop = atm_tc_drop, - - .init = atm_tc_init, - .reset = atm_tc_reset, - .destroy = atm_tc_destroy, - .change = NULL, - - .dump = atm_tc_dump +struct Qdisc_ops atm_qdisc_ops = { + .next = NULL, + .cl_ops = &atm_class_ops, + .id = "atm", + .priv_size = sizeof(struct atm_qdisc_data), + .enqueue = atm_tc_enqueue, + .dequeue = atm_tc_dequeue, + .requeue = atm_tc_requeue, + .drop = atm_tc_drop, + .init = atm_tc_init, + .reset = atm_tc_reset, + .destroy = atm_tc_destroy, + .change = NULL, + .dump = atm_tc_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c Sat Feb 15 13:11:57 2003 +++ b/net/sched/sch_cbq.c Sun Apr 20 00:57:16 2003 @@ -1411,11 +1411,8 @@ r = RTA_DATA(tb[TCA_CBQ_RATE-1]); - MOD_INC_USE_COUNT; - if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL) { - MOD_DEC_USE_COUNT; + if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL) return -EINVAL; - } q->link.refcnt = 1; q->link.sibling = &q->link; @@ -1749,7 +1746,6 @@ } qdisc_put_rtab(q->link.R_tab); - MOD_DEC_USE_COUNT; } static void cbq_put(struct Qdisc *sch, unsigned long arg) @@ -2064,41 +2060,35 @@ } } -static struct Qdisc_class_ops cbq_class_ops = -{ - .graft = cbq_graft, - .leaf = cbq_leaf, - .get = cbq_get, - .put = cbq_put, - .change = cbq_change_class, - .delete = cbq_delete, - .walk = cbq_walk, - - .tcf_chain = cbq_find_tcf, - .bind_tcf = cbq_bind_filter, - .unbind_tcf = cbq_unbind_filter, - - .dump = cbq_dump_class, +static struct Qdisc_class_ops cbq_class_ops = { + .graft = cbq_graft, + .leaf = cbq_leaf, + .get = cbq_get, + .put = cbq_put, + .change = cbq_change_class, + .delete = cbq_delete, + .walk = cbq_walk, + .tcf_chain = cbq_find_tcf, + .bind_tcf = cbq_bind_filter, + .unbind_tcf = cbq_unbind_filter, + .dump = cbq_dump_class, }; -struct Qdisc_ops cbq_qdisc_ops = -{ - .next = NULL, - .cl_ops = &cbq_class_ops, - .id = "cbq", - .priv_size = sizeof(struct cbq_sched_data), - - .enqueue = cbq_enqueue, - .dequeue = cbq_dequeue, - .requeue = cbq_requeue, - .drop = cbq_drop, - - .init = cbq_init, - .reset = cbq_reset, - .destroy = cbq_destroy, - .change = NULL, - - .dump = cbq_dump, +struct Qdisc_ops cbq_qdisc_ops = { + .next = NULL, + .cl_ops = &cbq_class_ops, + .id = "cbq", + .priv_size = sizeof(struct cbq_sched_data), + .enqueue = cbq_enqueue, + .dequeue = cbq_dequeue, + .requeue = cbq_requeue, + .drop = cbq_drop, + .init = cbq_init, + .reset = cbq_reset, + .destroy = cbq_destroy, + .change = NULL, + .dump = cbq_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_csz.c b/net/sched/sch_csz.c --- a/net/sched/sch_csz.c Thu Apr 10 22:56:20 2003 +++ b/net/sched/sch_csz.c Sun Apr 20 00:57:16 2003 @@ -756,8 +756,6 @@ q->filter_list = tp->next; tp->ops->destroy(tp); } - - MOD_DEC_USE_COUNT; } static int csz_init(struct Qdisc *sch, struct rtattr *opt) @@ -799,7 +797,6 @@ q->wd_timer.data = (unsigned long)sch; q->wd_timer.function = csz_watchdog; #endif - MOD_INC_USE_COUNT; return 0; } @@ -1018,42 +1015,35 @@ return &q->filter_list; } -struct Qdisc_class_ops csz_class_ops = -{ - .graft = csz_graft, - .leaf = csz_leaf, - - .get = csz_get, - .put = csz_put, - .change = csz_change, - .delete = csz_delete, - .walk = csz_walk, - - .tcf_chain = csz_find_tcf, - .bind_tcf = csz_bind, - .unbind_tcf = csz_put, - - .dump = csz_dump_class, +struct Qdisc_class_ops csz_class_ops = { + .graft = csz_graft, + .leaf = csz_leaf, + .get = csz_get, + .put = csz_put, + .change = csz_change, + .delete = csz_delete, + .walk = csz_walk, + .tcf_chain = csz_find_tcf, + .bind_tcf = csz_bind, + .unbind_tcf = csz_put, + .dump = csz_dump_class, }; -struct Qdisc_ops csz_qdisc_ops = -{ - .next = NULL, - .cl_ops = &csz_class_ops, - .id = "csz", - .priv_size = sizeof(struct csz_sched_data), - - .enqueue = csz_enqueue, - .dequeue = csz_dequeue, - .requeue = NULL, - .drop = NULL, - - .init = csz_init, - .reset = csz_reset, - .destroy = csz_destroy, - .change = NULL, - - .dump = csz_dump, +struct Qdisc_ops csz_qdisc_ops = { + .next = NULL, + .cl_ops = &csz_class_ops, + .id = "csz", + .priv_size = sizeof(struct csz_sched_data), + .enqueue = csz_enqueue, + .dequeue = csz_dequeue, + .requeue = NULL, + .drop = NULL, + .init = csz_init, + .reset = csz_reset, + .destroy = csz_destroy, + .change = NULL, + .dump = csz_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c --- a/net/sched/sch_dsmark.c Wed Apr 9 22:08:17 2003 +++ b/net/sched/sch_dsmark.c Sun Apr 20 00:57:16 2003 @@ -353,7 +353,6 @@ if (!(p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops))) p->q = &noop_qdisc; DPRINTK("dsmark_init: qdisc %p\n",&p->q); - MOD_INC_USE_COUNT; return 0; } @@ -382,7 +381,6 @@ qdisc_destroy(p->q); p->q = &noop_qdisc; kfree(p->mask); - MOD_DEC_USE_COUNT; } @@ -433,41 +431,35 @@ return -1; } -static struct Qdisc_class_ops dsmark_class_ops = -{ - .graft = dsmark_graft, - .leaf = dsmark_leaf, - .get = dsmark_get, - .put = dsmark_put, - .change = dsmark_change, - .delete = dsmark_delete, - .walk = dsmark_walk, - - .tcf_chain = dsmark_find_tcf, - .bind_tcf = dsmark_bind_filter, - .unbind_tcf = dsmark_put, - - .dump = dsmark_dump_class, +static struct Qdisc_class_ops dsmark_class_ops = { + .graft = dsmark_graft, + .leaf = dsmark_leaf, + .get = dsmark_get, + .put = dsmark_put, + .change = dsmark_change, + .delete = dsmark_delete, + .walk = dsmark_walk, + .tcf_chain = dsmark_find_tcf, + .bind_tcf = dsmark_bind_filter, + .unbind_tcf = dsmark_put, + .dump = dsmark_dump_class, }; -struct Qdisc_ops dsmark_qdisc_ops = -{ - .next = NULL, - .cl_ops = &dsmark_class_ops, - .id = "dsmark", - .priv_size = sizeof(struct dsmark_qdisc_data), - - .enqueue = dsmark_enqueue, - .dequeue = dsmark_dequeue, - .requeue = dsmark_requeue, - .drop = dsmark_drop, - - .init = dsmark_init, - .reset = dsmark_reset, - .destroy = dsmark_destroy, - .change = NULL, - - .dump = dsmark_dump +struct Qdisc_ops dsmark_qdisc_ops = { + .next = NULL, + .cl_ops = &dsmark_class_ops, + .id = "dsmark", + .priv_size = sizeof(struct dsmark_qdisc_data), + .enqueue = dsmark_enqueue, + .dequeue = dsmark_dequeue, + .requeue = dsmark_requeue, + .drop = dsmark_drop, + .init = dsmark_init, + .reset = dsmark_reset, + .destroy = dsmark_destroy, + .change = NULL, + .dump = dsmark_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c --- a/net/sched/sch_fifo.c Mon Oct 7 07:44:51 2002 +++ b/net/sched/sch_fifo.c Sun Apr 20 00:57:16 2003 @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -168,42 +169,36 @@ return -1; } -struct Qdisc_ops pfifo_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "pfifo", - .priv_size = sizeof(struct fifo_sched_data), - - .enqueue = pfifo_enqueue, - .dequeue = pfifo_dequeue, - .requeue = pfifo_requeue, - .drop = fifo_drop, - - .init = fifo_init, - .reset = fifo_reset, - .destroy = NULL, - .change = fifo_init, - - .dump = fifo_dump, +struct Qdisc_ops pfifo_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "pfifo", + .priv_size = sizeof(struct fifo_sched_data), + .enqueue = pfifo_enqueue, + .dequeue = pfifo_dequeue, + .requeue = pfifo_requeue, + .drop = fifo_drop, + .init = fifo_init, + .reset = fifo_reset, + .destroy = NULL, + .change = fifo_init, + .dump = fifo_dump, + .owner = THIS_MODULE, }; -struct Qdisc_ops bfifo_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "bfifo", - .priv_size = sizeof(struct fifo_sched_data), - - .enqueue = bfifo_enqueue, - .dequeue = bfifo_dequeue, - .requeue = bfifo_requeue, - .drop = fifo_drop, - - .init = fifo_init, - .reset = fifo_reset, - .destroy = NULL, - .change = fifo_init, - - .dump = fifo_dump, +struct Qdisc_ops bfifo_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "bfifo", + .priv_size = sizeof(struct fifo_sched_data), + .enqueue = bfifo_enqueue, + .dequeue = bfifo_dequeue, + .requeue = bfifo_requeue, + .drop = fifo_drop, + .init = fifo_init, + .reset = fifo_reset, + .destroy = NULL, + .change = fifo_init, + .dump = fifo_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c Mon Oct 7 07:44:51 2002 +++ b/net/sched/sch_generic.c Sun Apr 20 00:57:16 2003 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -222,45 +223,40 @@ return NET_XMIT_CN; } -struct Qdisc_ops noop_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "noop", - .priv_size = 0, - - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .requeue = noop_requeue, +struct Qdisc_ops noop_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "noop", + .priv_size = 0, + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .requeue = noop_requeue, + .owner = THIS_MODULE, }; -struct Qdisc noop_qdisc = -{ - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .flags = TCQ_F_BUILTIN, - .ops = &noop_qdisc_ops, +struct Qdisc noop_qdisc = { + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .flags = TCQ_F_BUILTIN, + .ops = &noop_qdisc_ops, }; - -struct Qdisc_ops noqueue_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "noqueue", - .priv_size = 0, - - .enqueue = noop_enqueue, - .dequeue = noop_dequeue, - .requeue = noop_requeue, +struct Qdisc_ops noqueue_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "noqueue", + .priv_size = 0, + .enqueue = noop_enqueue, + .dequeue = noop_dequeue, + .requeue = noop_requeue, + .owner = THIS_MODULE, }; -struct Qdisc noqueue_qdisc = -{ - .enqueue = NULL, - .dequeue = noop_dequeue, - .flags = TCQ_F_BUILTIN, - .ops = &noqueue_qdisc_ops, +struct Qdisc noqueue_qdisc = { + .enqueue = NULL, + .dequeue = noop_dequeue, + .flags = TCQ_F_BUILTIN, + .ops = &noqueue_qdisc_ops, }; @@ -343,19 +339,17 @@ return 0; } -static struct Qdisc_ops pfifo_fast_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "pfifo_fast", - .priv_size = 3 * sizeof(struct sk_buff_head), - - .enqueue = pfifo_fast_enqueue, - .dequeue = pfifo_fast_dequeue, - .requeue = pfifo_fast_requeue, - - .init = pfifo_fast_init, - .reset = pfifo_fast_reset, +static struct Qdisc_ops pfifo_fast_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "pfifo_fast", + .priv_size = 3 * sizeof(struct sk_buff_head), + .enqueue = pfifo_fast_enqueue, + .dequeue = pfifo_fast_dequeue, + .requeue = pfifo_fast_requeue, + .init = pfifo_fast_init, + .reset = pfifo_fast_reset, + .owner = THIS_MODULE, }; struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops) @@ -422,6 +416,7 @@ ops->reset(qdisc); if (ops->destroy) ops->destroy(qdisc); + module_put(ops->owner); if (!(qdisc->flags&TCQ_F_BUILTIN)) kfree(qdisc); } diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c --- a/net/sched/sch_gred.c Tue Feb 25 11:05:27 2003 +++ b/net/sched/sch_gred.c Sun Apr 20 00:57:16 2003 @@ -348,7 +348,6 @@ table->grio=sopt->grio; table->initd=0; /* probably need to clear all the table DP entries as well */ - MOD_INC_USE_COUNT; return 0; } @@ -490,7 +489,6 @@ table->def=sopt->def_DP; table->grio=sopt->grio; table->initd=0; - MOD_INC_USE_COUNT; return 0; } @@ -602,27 +600,23 @@ if (table->tab[i]) kfree(table->tab[i]); } - MOD_DEC_USE_COUNT; } -struct Qdisc_ops gred_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "gred", - .priv_size = sizeof(struct gred_sched), - - .enqueue = gred_enqueue, - .dequeue = gred_dequeue, - .requeue = gred_requeue, - .drop = gred_drop, - - .init = gred_init, - .reset = gred_reset, - .destroy = gred_destroy, - .change = gred_change, - - .dump = gred_dump, +struct Qdisc_ops gred_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "gred", + .priv_size = sizeof(struct gred_sched), + .enqueue = gred_enqueue, + .dequeue = gred_dequeue, + .requeue = gred_requeue, + .drop = gred_drop, + .init = gred_init, + .reset = gred_reset, + .destroy = gred_destroy, + .change = gred_change, + .dump = gred_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c --- a/net/sched/sch_htb.c Fri Apr 11 00:08:40 2003 +++ b/net/sched/sch_htb.c Sun Apr 20 00:57:16 2003 @@ -1167,7 +1167,6 @@ q->rate2quantum = 1; q->defcls = gopt->defcls; - MOD_INC_USE_COUNT; return 0; } @@ -1352,7 +1351,6 @@ htb_destroy_filters(&q->filter_list); __skb_queue_purge(&q->direct_queue); - MOD_DEC_USE_COUNT; } static int htb_delete(struct Qdisc *sch, unsigned long arg) @@ -1588,41 +1586,35 @@ } } -static struct Qdisc_class_ops htb_class_ops = -{ - htb_graft, - htb_leaf, - htb_get, - htb_put, - htb_change_class, - htb_delete, - htb_walk, - - htb_find_tcf, - htb_bind_filter, - htb_unbind_filter, - - htb_dump_class, +static struct Qdisc_class_ops htb_class_ops = { + .graft = htb_graft, + .leaf = htb_leaf, + .get = htb_get, + .put = htb_put, + .change = htb_change_class, + .delete = htb_delete, + .walk = htb_walk, + .tcf_chain = htb_find_tcf, + .bind_tcf = htb_bind_filter, + .unbind_tcf = htb_unbind_filter, + .dump = htb_dump_class, }; -struct Qdisc_ops htb_qdisc_ops = -{ - NULL, - &htb_class_ops, - "htb", - sizeof(struct htb_sched), - - htb_enqueue, - htb_dequeue, - htb_requeue, - htb_drop, - - htb_init, - htb_reset, - htb_destroy, - NULL /* htb_change */, - - htb_dump, +struct Qdisc_ops htb_qdisc_ops = { + .next = NULL, + .cl_ops = &htb_class_ops, + .id = "htb", + .priv_size = sizeof(struct htb_sched), + .enqueue = htb_enqueue, + .dequeue = htb_dequeue, + .requeue = htb_requeue, + .drop = htb_drop, + .init = htb_init, + .reset = htb_reset, + .destroy = htb_destroy, + .change = NULL /* htb_change */, + .dump = htb_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c --- a/net/sched/sch_ingress.c Wed Apr 9 22:08:17 2003 +++ b/net/sched/sch_ingress.c Sun Apr 20 00:57:16 2003 @@ -262,7 +262,6 @@ memset(p, 0, sizeof(*p)); p->filter_list = NULL; p->q = &noop_qdisc; - MOD_INC_USE_COUNT; return 0; error: return -EINVAL; @@ -308,9 +307,6 @@ /* for future use */ qdisc_destroy(p->q); #endif - - MOD_DEC_USE_COUNT; - } @@ -329,41 +325,35 @@ return -1; } -static struct Qdisc_class_ops ingress_class_ops = -{ - .graft = ingress_graft, - .leaf = ingress_leaf, - .get = ingress_get, - .put = ingress_put, - .change = ingress_change, - .delete = NULL, - .walk = ingress_walk, - - .tcf_chain = ingress_find_tcf, - .bind_tcf = ingress_bind_filter, - .unbind_tcf = ingress_put, - - .dump = NULL, +static struct Qdisc_class_ops ingress_class_ops = { + .graft = ingress_graft, + .leaf = ingress_leaf, + .get = ingress_get, + .put = ingress_put, + .change = ingress_change, + .delete = NULL, + .walk = ingress_walk, + .tcf_chain = ingress_find_tcf, + .bind_tcf = ingress_bind_filter, + .unbind_tcf = ingress_put, + .dump = NULL, }; -struct Qdisc_ops ingress_qdisc_ops = -{ - .next = NULL, - .cl_ops = &ingress_class_ops, - .id = "ingress", - .priv_size = sizeof(struct ingress_qdisc_data), - - .enqueue = ingress_enqueue, - .dequeue = ingress_dequeue, - .requeue = ingress_requeue, - .drop = ingress_drop, - - .init = ingress_init, - .reset = ingress_reset, - .destroy = ingress_destroy, - .change = NULL, - - .dump = ingress_dump, +struct Qdisc_ops ingress_qdisc_ops = { + .next = NULL, + .cl_ops = &ingress_class_ops, + .id = "ingress", + .priv_size = sizeof(struct ingress_qdisc_data), + .enqueue = ingress_enqueue, + .dequeue = ingress_dequeue, + .requeue = ingress_requeue, + .drop = ingress_drop, + .init = ingress_init, + .reset = ingress_reset, + .destroy = ingress_destroy, + .change = NULL, + .dump = ingress_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c --- a/net/sched/sch_prio.c Thu Apr 10 22:56:20 2003 +++ b/net/sched/sch_prio.c Sun Apr 20 00:57:16 2003 @@ -169,7 +169,6 @@ qdisc_destroy(q->queues[prio]); q->queues[prio] = &noop_qdisc; } - MOD_DEC_USE_COUNT; } static int prio_tune(struct Qdisc *sch, struct rtattr *opt) @@ -233,7 +232,6 @@ if ((err= prio_tune(sch, opt)) != 0) return err; } - MOD_INC_USE_COUNT; return 0; } @@ -369,42 +367,35 @@ return &q->filter_list; } -static struct Qdisc_class_ops prio_class_ops = -{ - .graft = prio_graft, - .leaf = prio_leaf, - - .get = prio_get, - .put = prio_put, - .change = prio_change, - .delete = prio_delete, - .walk = prio_walk, - - .tcf_chain = prio_find_tcf, - .bind_tcf = prio_bind, - .unbind_tcf = prio_put, - - .dump = prio_dump_class, +static struct Qdisc_class_ops prio_class_ops = { + .graft = prio_graft, + .leaf = prio_leaf, + .get = prio_get, + .put = prio_put, + .change = prio_change, + .delete = prio_delete, + .walk = prio_walk, + .tcf_chain = prio_find_tcf, + .bind_tcf = prio_bind, + .unbind_tcf = prio_put, + .dump = prio_dump_class, }; -struct Qdisc_ops prio_qdisc_ops = -{ - .next = NULL, - .cl_ops = &prio_class_ops, - .id = "prio", - .priv_size = sizeof(struct prio_sched_data), - - .enqueue = prio_enqueue, - .dequeue = prio_dequeue, - .requeue = prio_requeue, - .drop = prio_drop, - - .init = prio_init, - .reset = prio_reset, - .destroy = prio_destroy, - .change = prio_tune, - - .dump = prio_dump, +struct Qdisc_ops prio_qdisc_ops = { + .next = NULL, + .cl_ops = &prio_class_ops, + .id = "prio", + .priv_size = sizeof(struct prio_sched_data), + .enqueue = prio_enqueue, + .dequeue = prio_dequeue, + .requeue = prio_requeue, + .drop = prio_drop, + .init = prio_init, + .reset = prio_reset, + .destroy = prio_destroy, + .change = prio_tune, + .dump = prio_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c --- a/net/sched/sch_red.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_red.c Sun Apr 20 00:57:16 2003 @@ -407,14 +407,7 @@ static int red_init(struct Qdisc* sch, struct rtattr *opt) { - int err; - - MOD_INC_USE_COUNT; - - if ((err = red_change(sch, opt)) != 0) { - MOD_DEC_USE_COUNT; - } - return err; + return red_change(sch, opt); } @@ -458,27 +451,23 @@ static void red_destroy(struct Qdisc *sch) { - MOD_DEC_USE_COUNT; } -struct Qdisc_ops red_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "red", - .priv_size = sizeof(struct red_sched_data), - - .enqueue = red_enqueue, - .dequeue = red_dequeue, - .requeue = red_requeue, - .drop = red_drop, - - .init = red_init, - .reset = red_reset, - .destroy = red_destroy, - .change = red_change, - - .dump = red_dump, +struct Qdisc_ops red_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "red", + .priv_size = sizeof(struct red_sched_data), + .enqueue = red_enqueue, + .dequeue = red_dequeue, + .requeue = red_requeue, + .drop = red_drop, + .init = red_init, + .reset = red_reset, + .destroy = red_destroy, + .change = red_change, + .dump = red_dump, + .owner = THIS_MODULE, }; diff -Nru a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c --- a/net/sched/sch_sfq.c Sat Apr 12 15:42:42 2003 +++ b/net/sched/sch_sfq.c Sun Apr 20 00:57:16 2003 @@ -431,7 +431,6 @@ } for (i=0; idata; del_timer(&q->perturb_timer); - MOD_DEC_USE_COUNT; } static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) @@ -464,24 +462,21 @@ return -1; } -struct Qdisc_ops sfq_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "sfq", - .priv_size = sizeof(struct sfq_sched_data), - - .enqueue = sfq_enqueue, - .dequeue = sfq_dequeue, - .requeue = sfq_requeue, - .drop = sfq_drop, - - .init = sfq_init, - .reset = sfq_reset, - .destroy = sfq_destroy, - .change = NULL, - - .dump = sfq_dump, +struct Qdisc_ops sfq_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "sfq", + .priv_size = sizeof(struct sfq_sched_data), + .enqueue = sfq_enqueue, + .dequeue = sfq_dequeue, + .requeue = sfq_requeue, + .drop = sfq_drop, + .init = sfq_init, + .reset = sfq_reset, + .destroy = sfq_destroy, + .change = NULL, + .dump = sfq_dump, + .owner = THIS_MODULE, }; #ifdef MODULE diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_tbf.c Sun Apr 20 00:57:16 2003 @@ -330,23 +330,17 @@ static int tbf_init(struct Qdisc* sch, struct rtattr *opt) { - int err; struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data; if (opt == NULL) return -EINVAL; - MOD_INC_USE_COUNT; - PSCHED_GET_TIME(q->t_c); init_timer(&q->wd_timer); q->wd_timer.function = tbf_watchdog; q->wd_timer.data = (unsigned long)sch; - if ((err = tbf_change(sch, opt)) != 0) { - MOD_DEC_USE_COUNT; - } - return err; + return tbf_change(sch, opt); } static void tbf_destroy(struct Qdisc *sch) @@ -359,8 +353,6 @@ qdisc_put_rtab(q->P_tab); if (q->R_tab) qdisc_put_rtab(q->R_tab); - - MOD_DEC_USE_COUNT; } static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb) @@ -391,24 +383,20 @@ return -1; } -struct Qdisc_ops tbf_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "tbf", - .priv_size = sizeof(struct tbf_sched_data), - - .enqueue = tbf_enqueue, - .dequeue = tbf_dequeue, - .requeue = tbf_requeue, - .drop = tbf_drop, - - .init = tbf_init, - .reset = tbf_reset, - .destroy = tbf_destroy, - .change = tbf_change, - - .dump = tbf_dump, +struct Qdisc_ops tbf_qdisc_ops = { + .next = NULL, + .cl_ops = NULL, + .id = "tbf", + .priv_size = sizeof(struct tbf_sched_data), + .enqueue = tbf_enqueue, + .dequeue = tbf_dequeue, + .requeue = tbf_requeue, + .drop = tbf_drop, + .init = tbf_init, + .reset = tbf_reset, + .destroy = tbf_destroy, + .change = tbf_change, + .dump = tbf_dump, }; diff -Nru a/net/sched/sch_teql.c b/net/sched/sch_teql.c --- a/net/sched/sch_teql.c Mon Oct 7 07:44:52 2002 +++ b/net/sched/sch_teql.c Sun Apr 20 00:57:16 2003 @@ -177,8 +177,6 @@ } while ((prev = q) != master->slaves); } - - MOD_DEC_USE_COUNT; } static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt) @@ -222,8 +220,6 @@ m->dev.mtu = dev->mtu; m->dev.flags = (m->dev.flags&~FMASK)|(dev->flags&FMASK); } - - MOD_INC_USE_COUNT; return 0; } @@ -386,14 +382,12 @@ m->dev.mtu = mtu; m->dev.flags = (m->dev.flags&~FMASK) | flags; netif_start_queue(&m->dev); - MOD_INC_USE_COUNT; return 0; } static int teql_master_close(struct net_device *dev) { netif_stop_queue(dev); - MOD_DEC_USE_COUNT; return 0; } @@ -440,20 +434,19 @@ static struct teql_master the_master = { { - .next = NULL, - .cl_ops = NULL, - .id = "", - .priv_size = sizeof(struct teql_sched_data), - - .enqueue = teql_enqueue, - .dequeue = teql_dequeue, - .requeue = teql_requeue, - .drop = NULL, - - .init = teql_qdisc_init, - .reset = teql_reset, - .destroy = teql_destroy, - .dump = NULL, + .next = NULL, + .cl_ops = NULL, + .id = "", + .priv_size = sizeof(struct teql_sched_data), + .enqueue = teql_enqueue, + .dequeue = teql_dequeue, + .requeue = teql_requeue, + .drop = NULL, + .init = teql_qdisc_init, + .reset = teql_reset, + .destroy = teql_destroy, + .dump = NULL, + .owner = THIS_MODULE, },}; @@ -474,6 +467,7 @@ memcpy(the_master.qops.id, the_master.dev.name, IFNAMSIZ); the_master.dev.init = teql_master_init; + SET_MODULE_OWNER(&the_master.dev); err = register_netdevice(&the_master.dev); if (err == 0) { err = register_qdisc(&the_master.qops); diff -Nru a/net/socket.c b/net/socket.c --- a/net/socket.c Fri Apr 18 10:39:05 2003 +++ b/net/socket.c Sat Apr 19 16:21:17 2003 @@ -506,8 +506,13 @@ void sock_release(struct socket *sock) { - if (sock->ops) + if (sock->ops) { + const int family = sock->ops->family; + sock->ops->release(sock); + sock->ops = NULL; + module_put(net_families[family]->owner); + } if (sock->fasync_list) printk(KERN_ERR "sock_release: fasync list not empty!\n"); @@ -1058,11 +1063,12 @@ sock->type = type; + i = -EBUSY; + if (!try_module_get(net_families[family]->owner)) + goto out_release; + if ((i = net_families[family]->create(sock, protocol)) < 0) - { - sock_release(sock); - goto out; - } + goto out_release; *res = sock; security_socket_post_create(sock, family, type, protocol); @@ -1070,6 +1076,9 @@ out: net_family_read_unlock(); return i; +out_release: + sock_release(sock); + goto out; } asmlinkage long sys_socket(int family, int type, int protocol) diff -Nru a/sound/core/sgbuf.c b/sound/core/sgbuf.c --- a/sound/core/sgbuf.c Thu Apr 10 03:28:11 2003 +++ b/sound/core/sgbuf.c Sat Apr 19 23:22:50 2003 @@ -85,7 +85,7 @@ } sgbuf->size = size; - dmab->area = vmap(sgbuf->page_table, sgbuf->pages); + dmab->area = vmap(sgbuf->page_table, sgbuf->pages, VM_MAP, PAGE_KERNEL); if (! dmab->area) goto _failed; return dmab->area; diff -Nru a/sound/core/sound.c b/sound/core/sound.c --- a/sound/core/sound.c Thu Apr 10 03:28:11 2003 +++ b/sound/core/sound.c Fri Apr 18 11:18:17 2003 @@ -68,10 +68,6 @@ static DECLARE_MUTEX(sound_mutex); -#ifdef CONFIG_DEVFS_FS -static devfs_handle_t devfs_handle = NULL; -#endif - #ifdef CONFIG_KMOD /** @@ -343,15 +339,7 @@ if ((err = snd_oss_init_module()) < 0) return err; #endif -#ifdef CONFIG_DEVFS_FS -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) - devfs_handle = devfs_mk_dir(NULL, "snd", 3, NULL); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,67) - devfs_handle = devfs_mk_dir(NULL, "snd", NULL); -#else - devfs_handle = devfs_mk_dir("snd"); -#endif -#endif + devfs_mk_dir("snd"); if (register_chrdev(major, "alsa", &snd_fops)) { snd_printk(KERN_ERR "unable to register native major device number %d\n", major); return -EIO; @@ -404,9 +392,7 @@ #endif if (unregister_chrdev(major, "alsa") != 0) snd_printk(KERN_ERR "unable to unregister major device number %d\n", major); -#ifdef CONFIG_DEVFS_FS - devfs_unregister(devfs_handle); -#endif + devfs_remove("snd"); } module_init(alsa_sound_init) diff -Nru a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c --- a/sound/drivers/mpu401/mpu401_uart.c Thu Mar 20 08:41:13 2003 +++ b/sound/drivers/mpu401/mpu401_uart.c Sun Apr 20 14:14:29 2003 @@ -90,7 +90,7 @@ #endif } -static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) +static irqreturn_t _snd_mpu401_uart_interrupt(mpu401_t *mpu) { if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { if (! test_and_set_bit(MPU401_MODE_BIT_RX_LOOP, &mpu->mode)) { @@ -108,6 +108,9 @@ snd_mpu401_uart_output_write(mpu); spin_unlock(&mpu->output_lock); } + + /* FIXME! This should really check whether the irq was for us */ + return IRQ_HANDLED; } /** @@ -118,13 +121,13 @@ * * Processes the interrupt for MPU401-UART i/o. */ -void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) { mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return); if (mpu == NULL) - return; - _snd_mpu401_uart_interrupt(mpu); + return IRQ_NONE; + return _snd_mpu401_uart_interrupt(mpu); } /* diff -Nru a/sound/oss/Kconfig b/sound/oss/Kconfig --- a/sound/oss/Kconfig Mon Mar 3 13:09:18 2003 +++ b/sound/oss/Kconfig Sun Apr 20 12:56:52 2003 @@ -872,7 +872,7 @@ Say Y here if you have a Sound Blaster SB32, AWE32-PnP, SB AWE64 or similar sound card. See , and the Soundblaster-AWE - mini-HOWTO, available from + mini-HOWTO, available from for more info. config SOUND_WAVEFRONT diff -Nru a/sound/pci/ens1370.c b/sound/pci/ens1370.c --- a/sound/pci/ens1370.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/ens1370.c Sun Apr 20 14:45:01 2003 @@ -412,7 +412,7 @@ #endif }; -static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs); static struct pci_device_id snd_audiopci_ids[] __devinitdata = { #ifdef CHIP1370 @@ -2231,17 +2231,17 @@ * Interrupt handler */ -static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return); unsigned int status, sctrl; if (ensoniq == NULL) - return; + return IRQ_NONE; status = inl(ES_REG(ensoniq, STATUS)); if (!(status & ES_INTR)) - return; + return IRQ_NONE; spin_lock(&ensoniq->reg_lock); sctrl = ensoniq->sctrl; @@ -2263,6 +2263,7 @@ snd_pcm_period_elapsed(ensoniq->capture_substream); if ((status & ES_DAC1) && ensoniq->playback1_substream) snd_pcm_period_elapsed(ensoniq->playback1_substream); + return IRQ_HANDLED; } static int __devinit snd_audiopci_probe(struct pci_dev *pci, diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c --- a/sound/pci/intel8x0.c Thu Apr 10 03:28:13 2003 +++ b/sound/pci/intel8x0.c Sun Apr 20 14:14:29 2003 @@ -716,7 +716,7 @@ iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI); } -static void snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) { intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return); ichdev_t *ichdev; @@ -727,7 +727,7 @@ status = igetdword(chip, chip->int_sta_reg); if ((status & chip->int_sta_mask) == 0) { spin_unlock(&chip->reg_lock); - return; + return IRQ_NONE; } /* ack first */ iputdword(chip, chip->int_sta_reg, status & ~chip->int_sta_mask); @@ -738,6 +738,7 @@ if (status & ichdev->int_sta_mask) snd_intel8x0_update(chip, ichdev); } + return IRQ_HANDLED; } /* diff -Nru a/sound/sound_core.c b/sound/sound_core.c --- a/sound/sound_core.c Sat Mar 22 07:38:05 2003 +++ b/sound/sound_core.c Fri Apr 18 11:59:04 2003 @@ -54,7 +54,7 @@ int unit_minor; struct file_operations *unit_fops; struct sound_unit *next; - devfs_handle_t de; + char name[32]; }; #ifdef CONFIG_SOUND_MSNDCLAS @@ -151,30 +151,29 @@ static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode) { + struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL); int r; - struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL); - char name_buf[32]; - if(s==NULL) + if (!s) return -ENOMEM; spin_lock(&sound_loader_lock); - r=__sound_insert_unit(s,list,fops,index,low,top); + r = __sound_insert_unit(s, list, fops, index, low, top); spin_unlock(&sound_loader_lock); - if(r<0) - { - kfree(s); - return r; - } - - if (r < SOUND_STEP) - sprintf (name_buf, "sound/%s", name); + if (r < 0) + goto fail; + else if (r < SOUND_STEP) + sprintf(s->name, "sound/%s", name); else - sprintf (name_buf, "sound/%s%d", name, r / SOUND_STEP); - s->de = devfs_register (NULL, name_buf, - DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor, - S_IFCHR | mode, fops, NULL); + sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP); + + devfs_register(NULL, s->name, 0, SOUND_MAJOR, s->unit_minor, + S_IFCHR | mode, fops, NULL); + return r; + + fail: + kfree(s); return r; } @@ -192,7 +191,7 @@ p = __sound_remove_unit(list, unit); spin_unlock(&sound_loader_lock); if (p) { - devfs_unregister (p->de); + devfs_remove(p->name); kfree(p); } }