diff options
author | Tony Luck <tony.luck@intel.com> | 2005-08-22 17:31:36 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-08-22 17:31:36 -0400 |
commit | 729c80c6ffd7633210a09d4b55fdfab3c8d1866b (patch) | |
tree | a8fe47dfa3da91b9902e61c55a811d3a66614fc8 | |
parent | 4eaefb39528b3a78fb6a784162200b198d3e16ee (diff) | |
parent | f6fdd7d9c273bb2a20ab467cb57067494f932fa3 (diff) |
Auto-update from upstream
76 files changed, 714 insertions, 530 deletions
@@ -2423,8 +2423,7 @@ S: Toronto, Ontario | |||
2423 | S: Canada | 2423 | S: Canada |
2424 | 2424 | ||
2425 | N: Zwane Mwaikambo | 2425 | N: Zwane Mwaikambo |
2426 | E: zwane@linuxpower.ca | 2426 | E: zwane@arm.linux.org.uk |
2427 | W: http://function.linuxpower.ca | ||
2428 | D: Various driver hacking | 2427 | D: Various driver hacking |
2429 | D: Lowlevel x86 kernel hacking | 2428 | D: Lowlevel x86 kernel hacking |
2430 | D: General debugging | 2429 | D: General debugging |
diff --git a/MAINTAINERS b/MAINTAINERS index 33122b1519ca..564a03e61a0c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1739,7 +1739,7 @@ S: Maintained | |||
1739 | 1739 | ||
1740 | OPL3-SA2, SA3, and SAx DRIVER | 1740 | OPL3-SA2, SA3, and SAx DRIVER |
1741 | P: Zwane Mwaikambo | 1741 | P: Zwane Mwaikambo |
1742 | M: zwane@commfireservices.com | 1742 | M: zwane@arm.linux.org.uk |
1743 | L: linux-sound@vger.kernel.org | 1743 | L: linux-sound@vger.kernel.org |
1744 | S: Maintained | 1744 | S: Maintained |
1745 | 1745 | ||
@@ -1995,7 +1995,7 @@ S: Maintained | |||
1995 | 1995 | ||
1996 | SC1200 WDT DRIVER | 1996 | SC1200 WDT DRIVER |
1997 | P: Zwane Mwaikambo | 1997 | P: Zwane Mwaikambo |
1998 | M: zwane@commfireservices.com | 1998 | M: zwane@arm.linux.org.uk |
1999 | S: Maintained | 1999 | S: Maintained |
2000 | 2000 | ||
2001 | SCHEDULER | 2001 | SCHEDULER |
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index bd1dbf3bd223..a22a866de8f9 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -726,15 +726,11 @@ __setup("apic=", apic_set_verbosity); | |||
726 | static int __init detect_init_APIC (void) | 726 | static int __init detect_init_APIC (void) |
727 | { | 727 | { |
728 | u32 h, l, features; | 728 | u32 h, l, features; |
729 | extern void get_cpu_vendor(struct cpuinfo_x86*); | ||
730 | 729 | ||
731 | /* Disabled by kernel option? */ | 730 | /* Disabled by kernel option? */ |
732 | if (enable_local_apic < 0) | 731 | if (enable_local_apic < 0) |
733 | return -1; | 732 | return -1; |
734 | 733 | ||
735 | /* Workaround for us being called before identify_cpu(). */ | ||
736 | get_cpu_vendor(&boot_cpu_data); | ||
737 | |||
738 | switch (boot_cpu_data.x86_vendor) { | 734 | switch (boot_cpu_data.x86_vendor) { |
739 | case X86_VENDOR_AMD: | 735 | case X86_VENDOR_AMD: |
740 | if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) || | 736 | if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) || |
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index da6c46d667cb..8c242bb1ef45 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -195,7 +195,7 @@ static void disable_lapic_nmi_watchdog(void) | |||
195 | wrmsr(MSR_P6_EVNTSEL0, 0, 0); | 195 | wrmsr(MSR_P6_EVNTSEL0, 0, 0); |
196 | break; | 196 | break; |
197 | case 15: | 197 | case 15: |
198 | if (boot_cpu_data.x86_model > 0x3) | 198 | if (boot_cpu_data.x86_model > 0x4) |
199 | break; | 199 | break; |
200 | 200 | ||
201 | wrmsr(MSR_P4_IQ_CCCR0, 0, 0); | 201 | wrmsr(MSR_P4_IQ_CCCR0, 0, 0); |
@@ -432,7 +432,7 @@ void setup_apic_nmi_watchdog (void) | |||
432 | setup_p6_watchdog(); | 432 | setup_p6_watchdog(); |
433 | break; | 433 | break; |
434 | case 15: | 434 | case 15: |
435 | if (boot_cpu_data.x86_model > 0x3) | 435 | if (boot_cpu_data.x86_model > 0x4) |
436 | return; | 436 | return; |
437 | 437 | ||
438 | if (!setup_p4_watchdog()) | 438 | if (!setup_p4_watchdog()) |
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c index 5015ab99afd2..f15e64285f96 100644 --- a/arch/ppc/syslib/ppc4xx_dma.c +++ b/arch/ppc/syslib/ppc4xx_dma.c | |||
@@ -620,6 +620,7 @@ ppc4xx_clr_dma_status(unsigned int dmanr) | |||
620 | return DMA_STATUS_GOOD; | 620 | return DMA_STATUS_GOOD; |
621 | } | 621 | } |
622 | 622 | ||
623 | #ifdef CONFIG_PPC4xx_EDMA | ||
623 | /* | 624 | /* |
624 | * Enables the burst on the channel (BTEN bit in the control/count register) | 625 | * Enables the burst on the channel (BTEN bit in the control/count register) |
625 | * Note: | 626 | * Note: |
@@ -685,6 +686,11 @@ ppc4xx_set_burst_size(unsigned int dmanr, unsigned int bsize) | |||
685 | return DMA_STATUS_GOOD; | 686 | return DMA_STATUS_GOOD; |
686 | } | 687 | } |
687 | 688 | ||
689 | EXPORT_SYMBOL(ppc4xx_enable_burst); | ||
690 | EXPORT_SYMBOL(ppc4xx_disable_burst); | ||
691 | EXPORT_SYMBOL(ppc4xx_set_burst_size); | ||
692 | #endif /* CONFIG_PPC4xx_EDMA */ | ||
693 | |||
688 | EXPORT_SYMBOL(ppc4xx_init_dma_channel); | 694 | EXPORT_SYMBOL(ppc4xx_init_dma_channel); |
689 | EXPORT_SYMBOL(ppc4xx_get_channel_config); | 695 | EXPORT_SYMBOL(ppc4xx_get_channel_config); |
690 | EXPORT_SYMBOL(ppc4xx_set_channel_priority); | 696 | EXPORT_SYMBOL(ppc4xx_set_channel_priority); |
@@ -703,6 +709,4 @@ EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt); | |||
703 | EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); | 709 | EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); |
704 | EXPORT_SYMBOL(ppc4xx_get_dma_status); | 710 | EXPORT_SYMBOL(ppc4xx_get_dma_status); |
705 | EXPORT_SYMBOL(ppc4xx_clr_dma_status); | 711 | EXPORT_SYMBOL(ppc4xx_clr_dma_status); |
706 | EXPORT_SYMBOL(ppc4xx_enable_burst); | 712 | |
707 | EXPORT_SYMBOL(ppc4xx_disable_burst); | ||
708 | EXPORT_SYMBOL(ppc4xx_set_burst_size); | ||
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index 6615e4838ee4..fb6368159dd0 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S | |||
@@ -1145,5 +1145,10 @@ ENTRY(sys_call_table) | |||
1145 | .long sys_add_key /* 285 */ | 1145 | .long sys_add_key /* 285 */ |
1146 | .long sys_request_key | 1146 | .long sys_request_key |
1147 | .long sys_keyctl | 1147 | .long sys_keyctl |
1148 | .long sys_ioprio_set | ||
1149 | .long sys_ioprio_get | ||
1150 | .long sys_inotify_init /* 290 */ | ||
1151 | .long sys_inotify_add_watch | ||
1152 | .long sys_inotify_rm_watch | ||
1148 | 1153 | ||
1149 | /* End of entry.S */ | 1154 | /* End of entry.S */ |
diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S index 6aabc63e4518..a3d037805f1c 100644 --- a/arch/sh64/kernel/syscalls.S +++ b/arch/sh64/kernel/syscalls.S | |||
@@ -342,4 +342,9 @@ sys_call_table: | |||
342 | .long sys_add_key | 342 | .long sys_add_key |
343 | .long sys_request_key | 343 | .long sys_request_key |
344 | .long sys_keyctl /* 315 */ | 344 | .long sys_keyctl /* 315 */ |
345 | .long sys_ioprio_set | ||
346 | .long sys_ioprio_get | ||
347 | .long sys_inotify_init | ||
348 | .long sys_inotify_add_watch | ||
349 | .long sys_inotify_rm_watch /* 320 */ | ||
345 | 350 | ||
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 1bd430d0ca06..8faa8dc4de43 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -98,8 +98,9 @@ extern void ___rw_write_enter(void); | |||
98 | * The module references will be fixed up by module_frob_arch_sections. | 98 | * The module references will be fixed up by module_frob_arch_sections. |
99 | */ | 99 | */ |
100 | #define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ | 100 | #define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ |
101 | extern __ret __x(__arg1, __arg2) \ | 101 | extern __ret __x(__arg1, __arg2); \ |
102 | __attribute__((weak, alias("." # __x))); | 102 | asm(".weak " #__x);\ |
103 | asm(#__x "=." #__x); | ||
103 | 104 | ||
104 | DOT_ALIAS2(int, div, int, int) | 105 | DOT_ALIAS2(int, div, int, int) |
105 | DOT_ALIAS2(int, mul, int, int) | 106 | DOT_ALIAS2(int, mul, int, int) |
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 093281bdf85f..6f00ab8b9d23 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile | |||
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror | |||
8 | extra-y := head.o init_task.o vmlinux.lds | 8 | extra-y := head.o init_task.o vmlinux.lds |
9 | 9 | ||
10 | obj-y := process.o setup.o cpu.o idprom.o \ | 10 | obj-y := process.o setup.o cpu.o idprom.o \ |
11 | traps.o devices.o auxio.o \ | 11 | traps.o devices.o auxio.o una_asm.o \ |
12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ | 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ |
13 | unaligned.o central.o pci.o starfire.o semaphore.o \ | 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ |
14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o | 14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 100b0107c4be..0c9e54b2f0c8 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2127,6 +2127,9 @@ void __init trap_init(void) | |||
2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || | 2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || |
2128 | TI_NEW_CHILD != offsetof(struct thread_info, new_child) || | 2128 | TI_NEW_CHILD != offsetof(struct thread_info, new_child) || |
2129 | TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || | 2129 | TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || |
2130 | TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || | ||
2131 | TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || | ||
2132 | TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || | ||
2130 | TI_FPREGS != offsetof(struct thread_info, fpregs) || | 2133 | TI_FPREGS != offsetof(struct thread_info, fpregs) || |
2131 | (TI_FPREGS & (64 - 1))) | 2134 | (TI_FPREGS & (64 - 1))) |
2132 | thread_info_offsets_are_bolixed_dave(); | 2135 | thread_info_offsets_are_bolixed_dave(); |
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S new file mode 100644 index 000000000000..cbb40585253c --- /dev/null +++ b/arch/sparc64/kernel/una_asm.S | |||
@@ -0,0 +1,153 @@ | |||
1 | /* una_asm.S: Kernel unaligned trap assembler helpers. | ||
2 | * | ||
3 | * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net) | ||
4 | * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
5 | */ | ||
6 | |||
7 | .text | ||
8 | |||
9 | kernel_unaligned_trap_fault: | ||
10 | call kernel_mna_trap_fault | ||
11 | nop | ||
12 | retl | ||
13 | nop | ||
14 | .size kern_unaligned_trap_fault, .-kern_unaligned_trap_fault | ||
15 | |||
16 | .globl __do_int_store | ||
17 | __do_int_store: | ||
18 | rd %asi, %o4 | ||
19 | wr %o3, 0, %asi | ||
20 | ldx [%o2], %g3 | ||
21 | cmp %o1, 2 | ||
22 | be,pn %icc, 2f | ||
23 | cmp %o1, 4 | ||
24 | be,pt %icc, 1f | ||
25 | srlx %g3, 24, %g2 | ||
26 | srlx %g3, 56, %g1 | ||
27 | srlx %g3, 48, %g7 | ||
28 | 4: stba %g1, [%o0] %asi | ||
29 | srlx %g3, 40, %g1 | ||
30 | 5: stba %g7, [%o0 + 1] %asi | ||
31 | srlx %g3, 32, %g7 | ||
32 | 6: stba %g1, [%o0 + 2] %asi | ||
33 | 7: stba %g7, [%o0 + 3] %asi | ||
34 | srlx %g3, 16, %g1 | ||
35 | 8: stba %g2, [%o0 + 4] %asi | ||
36 | srlx %g3, 8, %g7 | ||
37 | 9: stba %g1, [%o0 + 5] %asi | ||
38 | 10: stba %g7, [%o0 + 6] %asi | ||
39 | ba,pt %xcc, 0f | ||
40 | 11: stba %g3, [%o0 + 7] %asi | ||
41 | 1: srl %g3, 16, %g7 | ||
42 | 12: stba %g2, [%o0] %asi | ||
43 | srl %g3, 8, %g2 | ||
44 | 13: stba %g7, [%o0 + 1] %asi | ||
45 | 14: stba %g2, [%o0 + 2] %asi | ||
46 | ba,pt %xcc, 0f | ||
47 | 15: stba %g3, [%o0 + 3] %asi | ||
48 | 2: srl %g3, 8, %g2 | ||
49 | 16: stba %g2, [%o0] %asi | ||
50 | 17: stba %g3, [%o0 + 1] %asi | ||
51 | 0: | ||
52 | wr %o4, 0x0, %asi | ||
53 | retl | ||
54 | nop | ||
55 | .size __do_int_store, .-__do_int_store | ||
56 | |||
57 | .section __ex_table | ||
58 | .word 4b, kernel_unaligned_trap_fault | ||
59 | .word 5b, kernel_unaligned_trap_fault | ||
60 | .word 6b, kernel_unaligned_trap_fault | ||
61 | .word 7b, kernel_unaligned_trap_fault | ||
62 | .word 8b, kernel_unaligned_trap_fault | ||
63 | .word 9b, kernel_unaligned_trap_fault | ||
64 | .word 10b, kernel_unaligned_trap_fault | ||
65 | .word 11b, kernel_unaligned_trap_fault | ||
66 | .word 12b, kernel_unaligned_trap_fault | ||
67 | .word 13b, kernel_unaligned_trap_fault | ||
68 | .word 14b, kernel_unaligned_trap_fault | ||
69 | .word 15b, kernel_unaligned_trap_fault | ||
70 | .word 16b, kernel_unaligned_trap_fault | ||
71 | .word 17b, kernel_unaligned_trap_fault | ||
72 | .previous | ||
73 | |||
74 | .globl do_int_load | ||
75 | do_int_load: | ||
76 | rd %asi, %o5 | ||
77 | wr %o4, 0, %asi | ||
78 | cmp %o1, 8 | ||
79 | bge,pn %icc, 9f | ||
80 | cmp %o1, 4 | ||
81 | be,pt %icc, 6f | ||
82 | 4: lduba [%o2] %asi, %g2 | ||
83 | 5: lduba [%o2 + 1] %asi, %g3 | ||
84 | sll %g2, 8, %g2 | ||
85 | brz,pt %o3, 3f | ||
86 | add %g2, %g3, %g2 | ||
87 | sllx %g2, 48, %g2 | ||
88 | srax %g2, 48, %g2 | ||
89 | 3: ba,pt %xcc, 0f | ||
90 | stx %g2, [%o0] | ||
91 | 6: lduba [%o2 + 1] %asi, %g3 | ||
92 | sll %g2, 24, %g2 | ||
93 | 7: lduba [%o2 + 2] %asi, %g7 | ||
94 | sll %g3, 16, %g3 | ||
95 | 8: lduba [%o2 + 3] %asi, %g1 | ||
96 | sll %g7, 8, %g7 | ||
97 | or %g2, %g3, %g2 | ||
98 | or %g7, %g1, %g7 | ||
99 | or %g2, %g7, %g2 | ||
100 | brnz,a,pt %o3, 3f | ||
101 | sra %g2, 0, %g2 | ||
102 | 3: ba,pt %xcc, 0f | ||
103 | stx %g2, [%o0] | ||
104 | 9: lduba [%o2] %asi, %g2 | ||
105 | 10: lduba [%o2 + 1] %asi, %g3 | ||
106 | sllx %g2, 56, %g2 | ||
107 | 11: lduba [%o2 + 2] %asi, %g7 | ||
108 | sllx %g3, 48, %g3 | ||
109 | 12: lduba [%o2 + 3] %asi, %g1 | ||
110 | sllx %g7, 40, %g7 | ||
111 | sllx %g1, 32, %g1 | ||
112 | or %g2, %g3, %g2 | ||
113 | or %g7, %g1, %g7 | ||
114 | 13: lduba [%o2 + 4] %asi, %g3 | ||
115 | or %g2, %g7, %g7 | ||
116 | 14: lduba [%o2 + 5] %asi, %g1 | ||
117 | sllx %g3, 24, %g3 | ||
118 | 15: lduba [%o2 + 6] %asi, %g2 | ||
119 | sllx %g1, 16, %g1 | ||
120 | or %g7, %g3, %g7 | ||
121 | 16: lduba [%o2 + 7] %asi, %g3 | ||
122 | sllx %g2, 8, %g2 | ||
123 | or %g7, %g1, %g7 | ||
124 | or %g2, %g3, %g2 | ||
125 | or %g7, %g2, %g7 | ||
126 | cmp %o1, 8 | ||
127 | be,a,pt %icc, 0f | ||
128 | stx %g7, [%o0] | ||
129 | srlx %g7, 32, %g2 | ||
130 | sra %g7, 0, %g7 | ||
131 | stx %g2, [%o0] | ||
132 | stx %g7, [%o0 + 8] | ||
133 | 0: | ||
134 | wr %o5, 0x0, %asi | ||
135 | retl | ||
136 | nop | ||
137 | .size __do_int_load, .-__do_int_load | ||
138 | |||
139 | .section __ex_table | ||
140 | .word 4b, kernel_unaligned_trap_fault | ||
141 | .word 5b, kernel_unaligned_trap_fault | ||
142 | .word 6b, kernel_unaligned_trap_fault | ||
143 | .word 7b, kernel_unaligned_trap_fault | ||
144 | .word 8b, kernel_unaligned_trap_fault | ||
145 | .word 9b, kernel_unaligned_trap_fault | ||
146 | .word 10b, kernel_unaligned_trap_fault | ||
147 | .word 11b, kernel_unaligned_trap_fault | ||
148 | .word 12b, kernel_unaligned_trap_fault | ||
149 | .word 13b, kernel_unaligned_trap_fault | ||
150 | .word 14b, kernel_unaligned_trap_fault | ||
151 | .word 15b, kernel_unaligned_trap_fault | ||
152 | .word 16b, kernel_unaligned_trap_fault | ||
153 | .previous | ||
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 4372bf32ecf6..11c3e88732e4 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c | |||
@@ -180,169 +180,28 @@ static void __attribute_used__ unaligned_panic(char *str, struct pt_regs *regs) | |||
180 | die_if_kernel(str, regs); | 180 | die_if_kernel(str, regs); |
181 | } | 181 | } |
182 | 182 | ||
183 | #define do_integer_load(dest_reg, size, saddr, is_signed, asi, errh) ({ \ | 183 | extern void do_int_load(unsigned long *dest_reg, int size, |
184 | __asm__ __volatile__ ( \ | 184 | unsigned long *saddr, int is_signed, int asi); |
185 | "wr %4, 0, %%asi\n\t" \ | ||
186 | "cmp %1, 8\n\t" \ | ||
187 | "bge,pn %%icc, 9f\n\t" \ | ||
188 | " cmp %1, 4\n\t" \ | ||
189 | "be,pt %%icc, 6f\n" \ | ||
190 | "4:\t" " lduba [%2] %%asi, %%l1\n" \ | ||
191 | "5:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
192 | "sll %%l1, 8, %%l1\n\t" \ | ||
193 | "brz,pt %3, 3f\n\t" \ | ||
194 | " add %%l1, %%l2, %%l1\n\t" \ | ||
195 | "sllx %%l1, 48, %%l1\n\t" \ | ||
196 | "srax %%l1, 48, %%l1\n" \ | ||
197 | "3:\t" "ba,pt %%xcc, 0f\n\t" \ | ||
198 | " stx %%l1, [%0]\n" \ | ||
199 | "6:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
200 | "sll %%l1, 24, %%l1\n" \ | ||
201 | "7:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \ | ||
202 | "sll %%l2, 16, %%l2\n" \ | ||
203 | "8:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \ | ||
204 | "sll %%g7, 8, %%g7\n\t" \ | ||
205 | "or %%l1, %%l2, %%l1\n\t" \ | ||
206 | "or %%g7, %%g1, %%g7\n\t" \ | ||
207 | "or %%l1, %%g7, %%l1\n\t" \ | ||
208 | "brnz,a,pt %3, 3f\n\t" \ | ||
209 | " sra %%l1, 0, %%l1\n" \ | ||
210 | "3:\t" "ba,pt %%xcc, 0f\n\t" \ | ||
211 | " stx %%l1, [%0]\n" \ | ||
212 | "9:\t" "lduba [%2] %%asi, %%l1\n" \ | ||
213 | "10:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
214 | "sllx %%l1, 56, %%l1\n" \ | ||
215 | "11:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \ | ||
216 | "sllx %%l2, 48, %%l2\n" \ | ||
217 | "12:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \ | ||
218 | "sllx %%g7, 40, %%g7\n\t" \ | ||
219 | "sllx %%g1, 32, %%g1\n\t" \ | ||
220 | "or %%l1, %%l2, %%l1\n\t" \ | ||
221 | "or %%g7, %%g1, %%g7\n" \ | ||
222 | "13:\t" "lduba [%2 + 4] %%asi, %%l2\n\t" \ | ||
223 | "or %%l1, %%g7, %%g7\n" \ | ||
224 | "14:\t" "lduba [%2 + 5] %%asi, %%g1\n\t" \ | ||
225 | "sllx %%l2, 24, %%l2\n" \ | ||
226 | "15:\t" "lduba [%2 + 6] %%asi, %%l1\n\t" \ | ||
227 | "sllx %%g1, 16, %%g1\n\t" \ | ||
228 | "or %%g7, %%l2, %%g7\n" \ | ||
229 | "16:\t" "lduba [%2 + 7] %%asi, %%l2\n\t" \ | ||
230 | "sllx %%l1, 8, %%l1\n\t" \ | ||
231 | "or %%g7, %%g1, %%g7\n\t" \ | ||
232 | "or %%l1, %%l2, %%l1\n\t" \ | ||
233 | "or %%g7, %%l1, %%g7\n\t" \ | ||
234 | "cmp %1, 8\n\t" \ | ||
235 | "be,a,pt %%icc, 0f\n\t" \ | ||
236 | " stx %%g7, [%0]\n\t" \ | ||
237 | "srlx %%g7, 32, %%l1\n\t" \ | ||
238 | "sra %%g7, 0, %%g7\n\t" \ | ||
239 | "stx %%l1, [%0]\n\t" \ | ||
240 | "stx %%g7, [%0 + 8]\n" \ | ||
241 | "0:\n\t" \ | ||
242 | "wr %%g0, %5, %%asi\n\n\t" \ | ||
243 | ".section __ex_table\n\t" \ | ||
244 | ".word 4b, " #errh "\n\t" \ | ||
245 | ".word 5b, " #errh "\n\t" \ | ||
246 | ".word 6b, " #errh "\n\t" \ | ||
247 | ".word 7b, " #errh "\n\t" \ | ||
248 | ".word 8b, " #errh "\n\t" \ | ||
249 | ".word 9b, " #errh "\n\t" \ | ||
250 | ".word 10b, " #errh "\n\t" \ | ||
251 | ".word 11b, " #errh "\n\t" \ | ||
252 | ".word 12b, " #errh "\n\t" \ | ||
253 | ".word 13b, " #errh "\n\t" \ | ||
254 | ".word 14b, " #errh "\n\t" \ | ||
255 | ".word 15b, " #errh "\n\t" \ | ||
256 | ".word 16b, " #errh "\n\n\t" \ | ||
257 | ".previous\n\t" \ | ||
258 | : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed), \ | ||
259 | "r" (asi), "i" (ASI_AIUS) \ | ||
260 | : "l1", "l2", "g7", "g1", "cc"); \ | ||
261 | }) | ||
262 | 185 | ||
263 | #define store_common(dst_addr, size, src_val, asi, errh) ({ \ | 186 | extern void __do_int_store(unsigned long *dst_addr, int size, |
264 | __asm__ __volatile__ ( \ | 187 | unsigned long *src_val, int asi); |
265 | "wr %3, 0, %%asi\n\t" \ | 188 | |
266 | "ldx [%2], %%l1\n" \ | 189 | static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr, |
267 | "cmp %1, 2\n\t" \ | 190 | struct pt_regs *regs, int asi) |
268 | "be,pn %%icc, 2f\n\t" \ | 191 | { |
269 | " cmp %1, 4\n\t" \ | 192 | unsigned long zero = 0; |
270 | "be,pt %%icc, 1f\n\t" \ | 193 | unsigned long *src_val = &zero; |
271 | " srlx %%l1, 24, %%l2\n\t" \ | 194 | |
272 | "srlx %%l1, 56, %%g1\n\t" \ | 195 | if (size == 16) { |
273 | "srlx %%l1, 48, %%g7\n" \ | 196 | size = 8; |
274 | "4:\t" "stba %%g1, [%0] %%asi\n\t" \ | 197 | zero = (((long)(reg_num ? |
275 | "srlx %%l1, 40, %%g1\n" \ | 198 | (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | |
276 | "5:\t" "stba %%g7, [%0 + 1] %%asi\n\t" \ | 199 | (unsigned)fetch_reg(reg_num + 1, regs); |
277 | "srlx %%l1, 32, %%g7\n" \ | 200 | } else if (reg_num) { |
278 | "6:\t" "stba %%g1, [%0 + 2] %%asi\n" \ | 201 | src_val = fetch_reg_addr(reg_num, regs); |
279 | "7:\t" "stba %%g7, [%0 + 3] %%asi\n\t" \ | 202 | } |
280 | "srlx %%l1, 16, %%g1\n" \ | 203 | __do_int_store(dst_addr, size, src_val, asi); |
281 | "8:\t" "stba %%l2, [%0 + 4] %%asi\n\t" \ | 204 | } |
282 | "srlx %%l1, 8, %%g7\n" \ | ||
283 | "9:\t" "stba %%g1, [%0 + 5] %%asi\n" \ | ||
284 | "10:\t" "stba %%g7, [%0 + 6] %%asi\n\t" \ | ||
285 | "ba,pt %%xcc, 0f\n" \ | ||
286 | "11:\t" " stba %%l1, [%0 + 7] %%asi\n" \ | ||
287 | "1:\t" "srl %%l1, 16, %%g7\n" \ | ||
288 | "12:\t" "stba %%l2, [%0] %%asi\n\t" \ | ||
289 | "srl %%l1, 8, %%l2\n" \ | ||
290 | "13:\t" "stba %%g7, [%0 + 1] %%asi\n" \ | ||
291 | "14:\t" "stba %%l2, [%0 + 2] %%asi\n\t" \ | ||
292 | "ba,pt %%xcc, 0f\n" \ | ||
293 | "15:\t" " stba %%l1, [%0 + 3] %%asi\n" \ | ||
294 | "2:\t" "srl %%l1, 8, %%l2\n" \ | ||
295 | "16:\t" "stba %%l2, [%0] %%asi\n" \ | ||
296 | "17:\t" "stba %%l1, [%0 + 1] %%asi\n" \ | ||
297 | "0:\n\t" \ | ||
298 | "wr %%g0, %4, %%asi\n\n\t" \ | ||
299 | ".section __ex_table\n\t" \ | ||
300 | ".word 4b, " #errh "\n\t" \ | ||
301 | ".word 5b, " #errh "\n\t" \ | ||
302 | ".word 6b, " #errh "\n\t" \ | ||
303 | ".word 7b, " #errh "\n\t" \ | ||
304 | ".word 8b, " #errh "\n\t" \ | ||
305 | ".word 9b, " #errh "\n\t" \ | ||
306 | ".word 10b, " #errh "\n\t" \ | ||
307 | ".word 11b, " #errh "\n\t" \ | ||
308 | ".word 12b, " #errh "\n\t" \ | ||
309 | ".word 13b, " #errh "\n\t" \ | ||
310 | ".word 14b, " #errh "\n\t" \ | ||
311 | ".word 15b, " #errh "\n\t" \ | ||
312 | ".word 16b, " #errh "\n\t" \ | ||
313 | ".word 17b, " #errh "\n\n\t" \ | ||
314 | ".previous\n\t" \ | ||
315 | : : "r" (dst_addr), "r" (size), "r" (src_val), "r" (asi), "i" (ASI_AIUS)\ | ||
316 | : "l1", "l2", "g7", "g1", "cc"); \ | ||
317 | }) | ||
318 | |||
319 | #define do_integer_store(reg_num, size, dst_addr, regs, asi, errh) ({ \ | ||
320 | unsigned long zero = 0; \ | ||
321 | unsigned long *src_val = &zero; \ | ||
322 | \ | ||
323 | if (size == 16) { \ | ||
324 | size = 8; \ | ||
325 | zero = (((long)(reg_num ? \ | ||
326 | (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | \ | ||
327 | (unsigned)fetch_reg(reg_num + 1, regs); \ | ||
328 | } else if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \ | ||
329 | store_common(dst_addr, size, src_val, asi, errh); \ | ||
330 | }) | ||
331 | |||
332 | extern void smp_capture(void); | ||
333 | extern void smp_release(void); | ||
334 | |||
335 | #define do_atomic(srcdest_reg, mem, errh) ({ \ | ||
336 | unsigned long flags, tmp; \ | ||
337 | \ | ||
338 | smp_capture(); \ | ||
339 | local_irq_save(flags); \ | ||
340 | tmp = *srcdest_reg; \ | ||
341 | do_integer_load(srcdest_reg, 4, mem, 0, errh); \ | ||
342 | store_common(mem, 4, &tmp, errh); \ | ||
343 | local_irq_restore(flags); \ | ||
344 | smp_release(); \ | ||
345 | }) | ||
346 | 205 | ||
347 | static inline void advance(struct pt_regs *regs) | 206 | static inline void advance(struct pt_regs *regs) |
348 | { | 207 | { |
@@ -364,24 +223,29 @@ static inline int ok_for_kernel(unsigned int insn) | |||
364 | return !floating_point_load_or_store_p(insn); | 223 | return !floating_point_load_or_store_p(insn); |
365 | } | 224 | } |
366 | 225 | ||
367 | void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault"); | 226 | void kernel_mna_trap_fault(void) |
368 | |||
369 | void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) | ||
370 | { | 227 | { |
371 | unsigned long g2 = regs->u_regs [UREG_G2]; | 228 | struct pt_regs *regs = current_thread_info()->kern_una_regs; |
229 | unsigned int insn = current_thread_info()->kern_una_insn; | ||
230 | unsigned long g2 = regs->u_regs[UREG_G2]; | ||
372 | unsigned long fixup = search_extables_range(regs->tpc, &g2); | 231 | unsigned long fixup = search_extables_range(regs->tpc, &g2); |
373 | 232 | ||
374 | if (!fixup) { | 233 | if (!fixup) { |
375 | unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); | 234 | unsigned long address; |
235 | |||
236 | address = compute_effective_address(regs, insn, | ||
237 | ((insn >> 25) & 0x1f)); | ||
376 | if (address < PAGE_SIZE) { | 238 | if (address < PAGE_SIZE) { |
377 | printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); | 239 | printk(KERN_ALERT "Unable to handle kernel NULL " |
240 | "pointer dereference in mna handler"); | ||
378 | } else | 241 | } else |
379 | printk(KERN_ALERT "Unable to handle kernel paging request in mna handler"); | 242 | printk(KERN_ALERT "Unable to handle kernel paging " |
243 | "request in mna handler"); | ||
380 | printk(KERN_ALERT " at virtual address %016lx\n",address); | 244 | printk(KERN_ALERT " at virtual address %016lx\n",address); |
381 | printk(KERN_ALERT "current->{mm,active_mm}->context = %016lx\n", | 245 | printk(KERN_ALERT "current->{active_,}mm->context = %016lx\n", |
382 | (current->mm ? CTX_HWBITS(current->mm->context) : | 246 | (current->mm ? CTX_HWBITS(current->mm->context) : |
383 | CTX_HWBITS(current->active_mm->context))); | 247 | CTX_HWBITS(current->active_mm->context))); |
384 | printk(KERN_ALERT "current->{mm,active_mm}->pgd = %016lx\n", | 248 | printk(KERN_ALERT "current->{active_,}mm->pgd = %016lx\n", |
385 | (current->mm ? (unsigned long) current->mm->pgd : | 249 | (current->mm ? (unsigned long) current->mm->pgd : |
386 | (unsigned long) current->active_mm->pgd)); | 250 | (unsigned long) current->active_mm->pgd)); |
387 | die_if_kernel("Oops", regs); | 251 | die_if_kernel("Oops", regs); |
@@ -400,48 +264,41 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u | |||
400 | enum direction dir = decode_direction(insn); | 264 | enum direction dir = decode_direction(insn); |
401 | int size = decode_access_size(insn); | 265 | int size = decode_access_size(insn); |
402 | 266 | ||
267 | current_thread_info()->kern_una_regs = regs; | ||
268 | current_thread_info()->kern_una_insn = insn; | ||
269 | |||
403 | if (!ok_for_kernel(insn) || dir == both) { | 270 | if (!ok_for_kernel(insn) || dir == both) { |
404 | printk("Unsupported unaligned load/store trap for kernel at <%016lx>.\n", | 271 | printk("Unsupported unaligned load/store trap for kernel " |
405 | regs->tpc); | 272 | "at <%016lx>.\n", regs->tpc); |
406 | unaligned_panic("Kernel does fpu/atomic unaligned load/store.", regs); | 273 | unaligned_panic("Kernel does fpu/atomic " |
407 | 274 | "unaligned load/store.", regs); | |
408 | __asm__ __volatile__ ("\n" | 275 | |
409 | "kernel_unaligned_trap_fault:\n\t" | 276 | kernel_mna_trap_fault(); |
410 | "mov %0, %%o0\n\t" | ||
411 | "call kernel_mna_trap_fault\n\t" | ||
412 | " mov %1, %%o1\n\t" | ||
413 | : | ||
414 | : "r" (regs), "r" (insn) | ||
415 | : "o0", "o1", "o2", "o3", "o4", "o5", "o7", | ||
416 | "g1", "g2", "g3", "g4", "g7", "cc"); | ||
417 | } else { | 277 | } else { |
418 | unsigned long addr = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); | 278 | unsigned long addr; |
419 | 279 | ||
280 | addr = compute_effective_address(regs, insn, | ||
281 | ((insn >> 25) & 0x1f)); | ||
420 | #ifdef DEBUG_MNA | 282 | #ifdef DEBUG_MNA |
421 | printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] retpc[%016lx]\n", | 283 | printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] " |
422 | regs->tpc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]); | 284 | "retpc[%016lx]\n", |
285 | regs->tpc, dirstrings[dir], addr, size, | ||
286 | regs->u_regs[UREG_RETPC]); | ||
423 | #endif | 287 | #endif |
424 | switch (dir) { | 288 | switch (dir) { |
425 | case load: | 289 | case load: |
426 | do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs), | 290 | do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs), |
427 | size, (unsigned long *) addr, | 291 | size, (unsigned long *) addr, |
428 | decode_signedness(insn), decode_asi(insn, regs), | 292 | decode_signedness(insn), |
429 | kernel_unaligned_trap_fault); | 293 | decode_asi(insn, regs)); |
430 | break; | 294 | break; |
431 | 295 | ||
432 | case store: | 296 | case store: |
433 | do_integer_store(((insn>>25)&0x1f), size, | 297 | do_int_store(((insn>>25)&0x1f), size, |
434 | (unsigned long *) addr, regs, | 298 | (unsigned long *) addr, regs, |
435 | decode_asi(insn, regs), | 299 | decode_asi(insn, regs)); |
436 | kernel_unaligned_trap_fault); | ||
437 | break; | ||
438 | #if 0 /* unsupported */ | ||
439 | case both: | ||
440 | do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs), | ||
441 | (unsigned long *) addr, | ||
442 | kernel_unaligned_trap_fault); | ||
443 | break; | 300 | break; |
444 | #endif | 301 | |
445 | default: | 302 | default: |
446 | panic("Impossible kernel unaligned trap."); | 303 | panic("Impossible kernel unaligned trap."); |
447 | /* Not reached... */ | 304 | /* Not reached... */ |
diff --git a/arch/sparc64/kernel/us2e_cpufreq.c b/arch/sparc64/kernel/us2e_cpufreq.c index 7aae0a18aabe..686e526bec04 100644 --- a/arch/sparc64/kernel/us2e_cpufreq.c +++ b/arch/sparc64/kernel/us2e_cpufreq.c | |||
@@ -88,7 +88,6 @@ static void frob_mem_refresh(int cpu_slowing_down, | |||
88 | { | 88 | { |
89 | unsigned long old_refr_count, refr_count, mctrl; | 89 | unsigned long old_refr_count, refr_count, mctrl; |
90 | 90 | ||
91 | |||
92 | refr_count = (clock_tick * MCTRL0_REFR_INTERVAL); | 91 | refr_count = (clock_tick * MCTRL0_REFR_INTERVAL); |
93 | refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); | 92 | refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); |
94 | 93 | ||
@@ -230,6 +229,25 @@ static unsigned long estar_to_divisor(unsigned long estar) | |||
230 | return ret; | 229 | return ret; |
231 | } | 230 | } |
232 | 231 | ||
232 | static unsigned int us2e_freq_get(unsigned int cpu) | ||
233 | { | ||
234 | cpumask_t cpus_allowed; | ||
235 | unsigned long clock_tick, estar; | ||
236 | |||
237 | if (!cpu_online(cpu)) | ||
238 | return 0; | ||
239 | |||
240 | cpus_allowed = current->cpus_allowed; | ||
241 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | ||
242 | |||
243 | clock_tick = sparc64_get_clock_tick(cpu) / 1000; | ||
244 | estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); | ||
245 | |||
246 | set_cpus_allowed(current, cpus_allowed); | ||
247 | |||
248 | return clock_tick / estar_to_divisor(estar); | ||
249 | } | ||
250 | |||
233 | static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 251 | static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) |
234 | { | 252 | { |
235 | unsigned long new_bits, new_freq; | 253 | unsigned long new_bits, new_freq; |
@@ -243,7 +261,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
243 | cpus_allowed = current->cpus_allowed; | 261 | cpus_allowed = current->cpus_allowed; |
244 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 262 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
245 | 263 | ||
246 | new_freq = clock_tick = sparc64_get_clock_tick(cpu); | 264 | new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
247 | new_bits = index_to_estar_mode(index); | 265 | new_bits = index_to_estar_mode(index); |
248 | divisor = index_to_divisor(index); | 266 | divisor = index_to_divisor(index); |
249 | new_freq /= divisor; | 267 | new_freq /= divisor; |
@@ -258,7 +276,8 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
258 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | 276 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); |
259 | 277 | ||
260 | if (old_divisor != divisor) | 278 | if (old_divisor != divisor) |
261 | us2e_transition(estar, new_bits, clock_tick, old_divisor, divisor); | 279 | us2e_transition(estar, new_bits, clock_tick * 1000, |
280 | old_divisor, divisor); | ||
262 | 281 | ||
263 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 282 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
264 | 283 | ||
@@ -272,10 +291,8 @@ static int us2e_freq_target(struct cpufreq_policy *policy, | |||
272 | unsigned int new_index = 0; | 291 | unsigned int new_index = 0; |
273 | 292 | ||
274 | if (cpufreq_frequency_table_target(policy, | 293 | if (cpufreq_frequency_table_target(policy, |
275 | &us2e_freq_table[policy->cpu].table[0], | 294 | &us2e_freq_table[policy->cpu].table[0], |
276 | target_freq, | 295 | target_freq, relation, &new_index)) |
277 | relation, | ||
278 | &new_index)) | ||
279 | return -EINVAL; | 296 | return -EINVAL; |
280 | 297 | ||
281 | us2e_set_cpu_divider_index(policy->cpu, new_index); | 298 | us2e_set_cpu_divider_index(policy->cpu, new_index); |
@@ -292,7 +309,7 @@ static int us2e_freq_verify(struct cpufreq_policy *policy) | |||
292 | static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) | 309 | static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) |
293 | { | 310 | { |
294 | unsigned int cpu = policy->cpu; | 311 | unsigned int cpu = policy->cpu; |
295 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 312 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
296 | struct cpufreq_frequency_table *table = | 313 | struct cpufreq_frequency_table *table = |
297 | &us2e_freq_table[cpu].table[0]; | 314 | &us2e_freq_table[cpu].table[0]; |
298 | 315 | ||
@@ -351,9 +368,10 @@ static int __init us2e_freq_init(void) | |||
351 | memset(us2e_freq_table, 0, | 368 | memset(us2e_freq_table, 0, |
352 | (NR_CPUS * sizeof(struct us2e_freq_percpu_info))); | 369 | (NR_CPUS * sizeof(struct us2e_freq_percpu_info))); |
353 | 370 | ||
371 | driver->init = us2e_freq_cpu_init; | ||
354 | driver->verify = us2e_freq_verify; | 372 | driver->verify = us2e_freq_verify; |
355 | driver->target = us2e_freq_target; | 373 | driver->target = us2e_freq_target; |
356 | driver->init = us2e_freq_cpu_init; | 374 | driver->get = us2e_freq_get; |
357 | driver->exit = us2e_freq_cpu_exit; | 375 | driver->exit = us2e_freq_cpu_exit; |
358 | driver->owner = THIS_MODULE, | 376 | driver->owner = THIS_MODULE, |
359 | strcpy(driver->name, "UltraSPARC-IIe"); | 377 | strcpy(driver->name, "UltraSPARC-IIe"); |
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c index 18fe54b8aa55..9080e7cd4bb0 100644 --- a/arch/sparc64/kernel/us3_cpufreq.c +++ b/arch/sparc64/kernel/us3_cpufreq.c | |||
@@ -56,7 +56,7 @@ static void write_safari_cfg(unsigned long val) | |||
56 | 56 | ||
57 | static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg) | 57 | static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg) |
58 | { | 58 | { |
59 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 59 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
60 | unsigned long ret; | 60 | unsigned long ret; |
61 | 61 | ||
62 | switch (safari_cfg & SAFARI_CFG_DIV_MASK) { | 62 | switch (safari_cfg & SAFARI_CFG_DIV_MASK) { |
@@ -76,6 +76,26 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg | |||
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | static unsigned int us3_freq_get(unsigned int cpu) | ||
80 | { | ||
81 | cpumask_t cpus_allowed; | ||
82 | unsigned long reg; | ||
83 | unsigned int ret; | ||
84 | |||
85 | if (!cpu_online(cpu)) | ||
86 | return 0; | ||
87 | |||
88 | cpus_allowed = current->cpus_allowed; | ||
89 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | ||
90 | |||
91 | reg = read_safari_cfg(); | ||
92 | ret = get_current_freq(cpu, reg); | ||
93 | |||
94 | set_cpus_allowed(current, cpus_allowed); | ||
95 | |||
96 | return ret; | ||
97 | } | ||
98 | |||
79 | static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 99 | static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) |
80 | { | 100 | { |
81 | unsigned long new_bits, new_freq, reg; | 101 | unsigned long new_bits, new_freq, reg; |
@@ -88,7 +108,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
88 | cpus_allowed = current->cpus_allowed; | 108 | cpus_allowed = current->cpus_allowed; |
89 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 109 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
90 | 110 | ||
91 | new_freq = sparc64_get_clock_tick(cpu); | 111 | new_freq = sparc64_get_clock_tick(cpu) / 1000; |
92 | switch (index) { | 112 | switch (index) { |
93 | case 0: | 113 | case 0: |
94 | new_bits = SAFARI_CFG_DIV_1; | 114 | new_bits = SAFARI_CFG_DIV_1; |
@@ -150,7 +170,7 @@ static int us3_freq_verify(struct cpufreq_policy *policy) | |||
150 | static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) | 170 | static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) |
151 | { | 171 | { |
152 | unsigned int cpu = policy->cpu; | 172 | unsigned int cpu = policy->cpu; |
153 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 173 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
154 | struct cpufreq_frequency_table *table = | 174 | struct cpufreq_frequency_table *table = |
155 | &us3_freq_table[cpu].table[0]; | 175 | &us3_freq_table[cpu].table[0]; |
156 | 176 | ||
@@ -206,9 +226,10 @@ static int __init us3_freq_init(void) | |||
206 | memset(us3_freq_table, 0, | 226 | memset(us3_freq_table, 0, |
207 | (NR_CPUS * sizeof(struct us3_freq_percpu_info))); | 227 | (NR_CPUS * sizeof(struct us3_freq_percpu_info))); |
208 | 228 | ||
229 | driver->init = us3_freq_cpu_init; | ||
209 | driver->verify = us3_freq_verify; | 230 | driver->verify = us3_freq_verify; |
210 | driver->target = us3_freq_target; | 231 | driver->target = us3_freq_target; |
211 | driver->init = us3_freq_cpu_init; | 232 | driver->get = us3_freq_get; |
212 | driver->exit = us3_freq_cpu_exit; | 233 | driver->exit = us3_freq_cpu_exit; |
213 | driver->owner = THIS_MODULE, | 234 | driver->owner = THIS_MODULE, |
214 | strcpy(driver->name, "UltraSPARC-III"); | 235 | strcpy(driver->name, "UltraSPARC-III"); |
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 6dd9e5bf18ed..f228f8b54194 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -61,7 +61,11 @@ void wait_stub_done(int pid, int sig, char * fname) | |||
61 | 61 | ||
62 | CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); | 62 | CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); |
63 | } while((n >= 0) && WIFSTOPPED(status) && | 63 | } while((n >= 0) && WIFSTOPPED(status) && |
64 | (WSTOPSIG(status) == SIGVTALRM)); | 64 | ((WSTOPSIG(status) == SIGVTALRM) || |
65 | /* running UML inside a detached screen can cause | ||
66 | * SIGWINCHes | ||
67 | */ | ||
68 | (WSTOPSIG(status) == SIGWINCH))); | ||
65 | 69 | ||
66 | if((n < 0) || !WIFSTOPPED(status) || | 70 | if((n < 0) || !WIFSTOPPED(status) || |
67 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ | 71 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ |
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index 9416e1c29926..4cca3e9c23fe 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <elf.h> | 10 | #include <elf.h> |
11 | #include <stddef.h> | 11 | #include <stddef.h> |
12 | #include <asm/elf.h> | ||
13 | #include "init.h" | 12 | #include "init.h" |
14 | #include "elf_user.h" | 13 | #include "elf_user.h" |
15 | #include "mem_user.h" | 14 | #include "mem_user.h" |
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index b15761ff4101..fa25e39fe54d 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -492,6 +492,14 @@ void __cpuinit start_secondary(void) | |||
492 | */ | 492 | */ |
493 | set_cpu_sibling_map(smp_processor_id()); | 493 | set_cpu_sibling_map(smp_processor_id()); |
494 | 494 | ||
495 | /* | ||
496 | * Wait for TSC sync to not schedule things before. | ||
497 | * We still process interrupts, which could see an inconsistent | ||
498 | * time in that window unfortunately. | ||
499 | * Do this here because TSC sync has global unprotected state. | ||
500 | */ | ||
501 | tsc_sync_wait(); | ||
502 | |||
495 | /* | 503 | /* |
496 | * We need to hold call_lock, so there is no inconsistency | 504 | * We need to hold call_lock, so there is no inconsistency |
497 | * between the time smp_call_function() determines number of | 505 | * between the time smp_call_function() determines number of |
@@ -509,13 +517,6 @@ void __cpuinit start_secondary(void) | |||
509 | per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; | 517 | per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; |
510 | unlock_ipi_call_lock(); | 518 | unlock_ipi_call_lock(); |
511 | 519 | ||
512 | mb(); | ||
513 | |||
514 | /* Wait for TSC sync to not schedule things before. | ||
515 | We still process interrupts, which could see an inconsistent | ||
516 | time in that window unfortunately. */ | ||
517 | tsc_sync_wait(); | ||
518 | |||
519 | cpu_idle(); | 520 | cpu_idle(); |
520 | } | 521 | } |
521 | 522 | ||
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 493819e543a5..ca914c3bd49c 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c | |||
@@ -211,9 +211,7 @@ int unhandled_signal(struct task_struct *tsk, int sig) | |||
211 | { | 211 | { |
212 | if (tsk->pid == 1) | 212 | if (tsk->pid == 1) |
213 | return 1; | 213 | return 1; |
214 | /* Warn for strace, but not for gdb */ | 214 | if (tsk->ptrace & PT_PTRACED) |
215 | if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) && | ||
216 | (tsk->ptrace & PT_PTRACED)) | ||
217 | return 0; | 215 | return 0; |
218 | return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || | 216 | return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || |
219 | (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); | 217 | (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 5f33df47aa74..1cadd2c3cadd 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -764,6 +764,7 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST | |||
764 | config BLK_DEV_IDEDMA_PMAC | 764 | config BLK_DEV_IDEDMA_PMAC |
765 | bool "PowerMac IDE DMA support" | 765 | bool "PowerMac IDE DMA support" |
766 | depends on BLK_DEV_IDE_PMAC | 766 | depends on BLK_DEV_IDE_PMAC |
767 | select BLK_DEV_IDEDMA_PCI | ||
767 | help | 768 | help |
768 | This option allows the driver for the built-in IDE controller on | 769 | This option allows the driver for the built-in IDE controller on |
769 | Power Macintoshes and PowerBooks to use DMA (direct memory access) | 770 | Power Macintoshes and PowerBooks to use DMA (direct memory access) |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 9eab6426148e..29c22fc278c6 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -317,7 +317,7 @@ typedef struct ide_floppy_obj { | |||
317 | unsigned long flags; | 317 | unsigned long flags; |
318 | } idefloppy_floppy_t; | 318 | } idefloppy_floppy_t; |
319 | 319 | ||
320 | #define IDEFLOPPY_TICKS_DELAY 3 /* default delay for ZIP 100 */ | 320 | #define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ |
321 | 321 | ||
322 | /* | 322 | /* |
323 | * Floppy flag bits values. | 323 | * Floppy flag bits values. |
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index da46577380f3..6e3ab0c38c4d 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -173,6 +173,12 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { | |||
173 | .channels = 2, | 173 | .channels = 2, |
174 | .autodma = NOAUTODMA, | 174 | .autodma = NOAUTODMA, |
175 | .bootable = ON_BOARD, | 175 | .bootable = ON_BOARD, |
176 | },{ /* 14 */ | ||
177 | .name = "Revolution", | ||
178 | .init_hwif = init_hwif_generic, | ||
179 | .channels = 2, | ||
180 | .autodma = AUTODMA, | ||
181 | .bootable = OFF_BOARD, | ||
176 | } | 182 | } |
177 | }; | 183 | }; |
178 | 184 | ||
@@ -231,6 +237,7 @@ static struct pci_device_id generic_pci_tbl[] = { | |||
231 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, | 237 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, |
232 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, | 238 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, |
233 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, | 239 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, |
240 | { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, | ||
234 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ | 241 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ |
235 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, | 242 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, |
236 | { 0, }, | 243 | { 0, }, |
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index c6f5fa4b4ca6..ff2e217a8c84 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -21,6 +21,9 @@ | |||
21 | * | 21 | * |
22 | * CSB6: `Champion South Bridge' IDE Interface (optional: third channel) | 22 | * CSB6: `Champion South Bridge' IDE Interface (optional: third channel) |
23 | * | 23 | * |
24 | * HT1000: AKA BCM5785 - Hypertransport Southbridge for Opteron systems. IDE | ||
25 | * controller same as the CSB6. Single channel ATA100 only. | ||
26 | * | ||
24 | * Documentation: | 27 | * Documentation: |
25 | * Available under NDA only. Errata info very hard to get. | 28 | * Available under NDA only. Errata info very hard to get. |
26 | * | 29 | * |
@@ -71,6 +74,8 @@ static u8 svwks_ratemask (ide_drive_t *drive) | |||
71 | if (!svwks_revision) | 74 | if (!svwks_revision) |
72 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); | 75 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); |
73 | 76 | ||
77 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) | ||
78 | return 2; | ||
74 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { | 79 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { |
75 | u32 reg = 0; | 80 | u32 reg = 0; |
76 | if (isa_dev) | 81 | if (isa_dev) |
@@ -109,6 +114,7 @@ static u8 svwks_csb_check (struct pci_dev *dev) | |||
109 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: | 114 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: |
110 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: | 115 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: |
111 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: | 116 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: |
117 | case PCI_DEVICE_ID_SERVERWORKS_HT1000IDE: | ||
112 | return 1; | 118 | return 1; |
113 | default: | 119 | default: |
114 | break; | 120 | break; |
@@ -438,6 +444,13 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
438 | btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; | 444 | btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; |
439 | pci_write_config_byte(dev, 0x5A, btr); | 445 | pci_write_config_byte(dev, 0x5A, btr); |
440 | } | 446 | } |
447 | /* Setup HT1000 SouthBridge Controller - Single Channel Only */ | ||
448 | else if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) { | ||
449 | pci_read_config_byte(dev, 0x5A, &btr); | ||
450 | btr &= ~0x40; | ||
451 | btr |= 0x3; | ||
452 | pci_write_config_byte(dev, 0x5A, btr); | ||
453 | } | ||
441 | 454 | ||
442 | return (dev->irq) ? dev->irq : 0; | 455 | return (dev->irq) ? dev->irq : 0; |
443 | } | 456 | } |
@@ -629,6 +642,15 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = { | |||
629 | .channels = 1, /* 2 */ | 642 | .channels = 1, /* 2 */ |
630 | .autodma = AUTODMA, | 643 | .autodma = AUTODMA, |
631 | .bootable = ON_BOARD, | 644 | .bootable = ON_BOARD, |
645 | },{ /* 4 */ | ||
646 | .name = "SvrWks HT1000", | ||
647 | .init_setup = init_setup_svwks, | ||
648 | .init_chipset = init_chipset_svwks, | ||
649 | .init_hwif = init_hwif_svwks, | ||
650 | .init_dma = init_dma_svwks, | ||
651 | .channels = 1, /* 2 */ | ||
652 | .autodma = AUTODMA, | ||
653 | .bootable = ON_BOARD, | ||
632 | } | 654 | } |
633 | }; | 655 | }; |
634 | 656 | ||
@@ -653,6 +675,7 @@ static struct pci_device_id svwks_pci_tbl[] = { | |||
653 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | 675 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
654 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, | 676 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, |
655 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, | 677 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, |
678 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, | ||
656 | { 0, }, | 679 | { 0, }, |
657 | }; | 680 | }; |
658 | MODULE_DEVICE_TABLE(pci, svwks_pci_tbl); | 681 | MODULE_DEVICE_TABLE(pci, svwks_pci_tbl); |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index be0fcc8f4b15..ea65b070a367 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -1664,7 +1664,7 @@ static struct macio_driver pmac_ide_macio_driver = | |||
1664 | }; | 1664 | }; |
1665 | 1665 | ||
1666 | static struct pci_device_id pmac_ide_pci_match[] = { | 1666 | static struct pci_device_id pmac_ide_pci_match[] = { |
1667 | { PCI_VENDOR_ID_APPLE, PCI_DEVIEC_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1667 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1668 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1668 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1669 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1669 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1670 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, | 1670 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 77da827b2898..18ed7765417c 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -229,6 +229,7 @@ second_chance_to_dma: | |||
229 | case PCI_DEVICE_ID_AMD_VIPER_7409: | 229 | case PCI_DEVICE_ID_AMD_VIPER_7409: |
230 | case PCI_DEVICE_ID_CMD_643: | 230 | case PCI_DEVICE_ID_CMD_643: |
231 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: | 231 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: |
232 | case PCI_DEVICE_ID_REVOLUTION: | ||
232 | simplex_stat = hwif->INB(dma_base + 2); | 233 | simplex_stat = hwif->INB(dma_base + 2); |
233 | hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); | 234 | hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); |
234 | simplex_stat = hwif->INB(dma_base + 2); | 235 | simplex_stat = hwif->INB(dma_base + 2); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 480f658db6f2..d4c275604a3e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -623,6 +623,7 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
623 | mddev->raid_disks = sb->raid_disks; | 623 | mddev->raid_disks = sb->raid_disks; |
624 | mddev->size = sb->size; | 624 | mddev->size = sb->size; |
625 | mddev->events = md_event(sb); | 625 | mddev->events = md_event(sb); |
626 | mddev->bitmap_offset = 0; | ||
626 | 627 | ||
627 | if (sb->state & (1<<MD_SB_CLEAN)) | 628 | if (sb->state & (1<<MD_SB_CLEAN)) |
628 | mddev->recovery_cp = MaxSector; | 629 | mddev->recovery_cp = MaxSector; |
@@ -938,6 +939,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
938 | mddev->raid_disks = le32_to_cpu(sb->raid_disks); | 939 | mddev->raid_disks = le32_to_cpu(sb->raid_disks); |
939 | mddev->size = le64_to_cpu(sb->size)/2; | 940 | mddev->size = le64_to_cpu(sb->size)/2; |
940 | mddev->events = le64_to_cpu(sb->events); | 941 | mddev->events = le64_to_cpu(sb->events); |
942 | mddev->bitmap_offset = 0; | ||
941 | 943 | ||
942 | mddev->recovery_cp = le64_to_cpu(sb->resync_offset); | 944 | mddev->recovery_cp = le64_to_cpu(sb->resync_offset); |
943 | memcpy(mddev->uuid, sb->set_uuid, 16); | 945 | memcpy(mddev->uuid, sb->set_uuid, 16); |
@@ -1824,6 +1826,7 @@ static int do_md_stop(mddev_t * mddev, int ro) | |||
1824 | fput(mddev->bitmap_file); | 1826 | fput(mddev->bitmap_file); |
1825 | mddev->bitmap_file = NULL; | 1827 | mddev->bitmap_file = NULL; |
1826 | } | 1828 | } |
1829 | mddev->bitmap_offset = 0; | ||
1827 | 1830 | ||
1828 | /* | 1831 | /* |
1829 | * Free resources if final stop | 1832 | * Free resources if final stop |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 7b293f01c9ed..34b80de34fae 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1897,6 +1897,7 @@ static int cp_resume (struct pci_dev *pdev) | |||
1897 | { | 1897 | { |
1898 | struct net_device *dev; | 1898 | struct net_device *dev; |
1899 | struct cp_private *cp; | 1899 | struct cp_private *cp; |
1900 | unsigned long flags; | ||
1900 | 1901 | ||
1901 | dev = pci_get_drvdata (pdev); | 1902 | dev = pci_get_drvdata (pdev); |
1902 | cp = netdev_priv(dev); | 1903 | cp = netdev_priv(dev); |
@@ -1910,6 +1911,12 @@ static int cp_resume (struct pci_dev *pdev) | |||
1910 | 1911 | ||
1911 | cp_init_hw (cp); | 1912 | cp_init_hw (cp); |
1912 | netif_start_queue (dev); | 1913 | netif_start_queue (dev); |
1914 | |||
1915 | spin_lock_irqsave (&cp->lock, flags); | ||
1916 | |||
1917 | mii_check_media(&cp->mii_if, netif_msg_link(cp), FALSE); | ||
1918 | |||
1919 | spin_unlock_irqrestore (&cp->lock, flags); | ||
1913 | 1920 | ||
1914 | return 0; | 1921 | return 0; |
1915 | } | 1922 | } |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 5fddc0ff8878..6440a892bb81 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -48,6 +48,10 @@ | |||
48 | * net_device_stats | 48 | * net_device_stats |
49 | * * introduced tx_timeout function | 49 | * * introduced tx_timeout function |
50 | * * reworked locking | 50 | * * reworked locking |
51 | * | ||
52 | * 01-Jul-2005 Ben Dooks <ben@simtec.co.uk> | ||
53 | * * fixed spinlock call without pointer | ||
54 | * * ensure spinlock is initialised | ||
51 | */ | 55 | */ |
52 | 56 | ||
53 | #include <linux/module.h> | 57 | #include <linux/module.h> |
@@ -148,7 +152,6 @@ static int dm9000_probe(struct device *); | |||
148 | static int dm9000_open(struct net_device *); | 152 | static int dm9000_open(struct net_device *); |
149 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); | 153 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); |
150 | static int dm9000_stop(struct net_device *); | 154 | static int dm9000_stop(struct net_device *); |
151 | static int dm9000_do_ioctl(struct net_device *, struct ifreq *, int); | ||
152 | 155 | ||
153 | 156 | ||
154 | static void dm9000_timer(unsigned long); | 157 | static void dm9000_timer(unsigned long); |
@@ -322,7 +325,7 @@ static void dm9000_timeout(struct net_device *dev) | |||
322 | 325 | ||
323 | /* Save previous register address */ | 326 | /* Save previous register address */ |
324 | reg_save = readb(db->io_addr); | 327 | reg_save = readb(db->io_addr); |
325 | spin_lock_irqsave(db->lock,flags); | 328 | spin_lock_irqsave(&db->lock,flags); |
326 | 329 | ||
327 | netif_stop_queue(dev); | 330 | netif_stop_queue(dev); |
328 | dm9000_reset(db); | 331 | dm9000_reset(db); |
@@ -333,7 +336,7 @@ static void dm9000_timeout(struct net_device *dev) | |||
333 | 336 | ||
334 | /* Restore previous register address */ | 337 | /* Restore previous register address */ |
335 | writeb(reg_save, db->io_addr); | 338 | writeb(reg_save, db->io_addr); |
336 | spin_unlock_irqrestore(db->lock,flags); | 339 | spin_unlock_irqrestore(&db->lock,flags); |
337 | } | 340 | } |
338 | 341 | ||
339 | 342 | ||
@@ -387,8 +390,6 @@ dm9000_probe(struct device *dev) | |||
387 | int i; | 390 | int i; |
388 | u32 id_val; | 391 | u32 id_val; |
389 | 392 | ||
390 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); | ||
391 | |||
392 | /* Init network device */ | 393 | /* Init network device */ |
393 | ndev = alloc_etherdev(sizeof (struct board_info)); | 394 | ndev = alloc_etherdev(sizeof (struct board_info)); |
394 | if (!ndev) { | 395 | if (!ndev) { |
@@ -405,6 +406,8 @@ dm9000_probe(struct device *dev) | |||
405 | db = (struct board_info *) ndev->priv; | 406 | db = (struct board_info *) ndev->priv; |
406 | memset(db, 0, sizeof (*db)); | 407 | memset(db, 0, sizeof (*db)); |
407 | 408 | ||
409 | spin_lock_init(&db->lock); | ||
410 | |||
408 | if (pdev->num_resources < 2) { | 411 | if (pdev->num_resources < 2) { |
409 | ret = -ENODEV; | 412 | ret = -ENODEV; |
410 | goto out; | 413 | goto out; |
@@ -541,7 +544,6 @@ dm9000_probe(struct device *dev) | |||
541 | ndev->stop = &dm9000_stop; | 544 | ndev->stop = &dm9000_stop; |
542 | ndev->get_stats = &dm9000_get_stats; | 545 | ndev->get_stats = &dm9000_get_stats; |
543 | ndev->set_multicast_list = &dm9000_hash_table; | 546 | ndev->set_multicast_list = &dm9000_hash_table; |
544 | ndev->do_ioctl = &dm9000_do_ioctl; | ||
545 | 547 | ||
546 | #ifdef DM9000_PROGRAM_EEPROM | 548 | #ifdef DM9000_PROGRAM_EEPROM |
547 | program_eeprom(db); | 549 | program_eeprom(db); |
@@ -612,7 +614,7 @@ dm9000_open(struct net_device *dev) | |||
612 | 614 | ||
613 | /* set and active a timer process */ | 615 | /* set and active a timer process */ |
614 | init_timer(&db->timer); | 616 | init_timer(&db->timer); |
615 | db->timer.expires = DM9000_TIMER_WUT * 2; | 617 | db->timer.expires = DM9000_TIMER_WUT; |
616 | db->timer.data = (unsigned long) dev; | 618 | db->timer.data = (unsigned long) dev; |
617 | db->timer.function = &dm9000_timer; | 619 | db->timer.function = &dm9000_timer; |
618 | add_timer(&db->timer); | 620 | add_timer(&db->timer); |
@@ -845,15 +847,6 @@ dm9000_get_stats(struct net_device *dev) | |||
845 | return &db->stats; | 847 | return &db->stats; |
846 | } | 848 | } |
847 | 849 | ||
848 | /* | ||
849 | * Process the upper socket ioctl command | ||
850 | */ | ||
851 | static int | ||
852 | dm9000_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | ||
853 | { | ||
854 | PRINTK1("entering %s\n",__FUNCTION__); | ||
855 | return 0; | ||
856 | } | ||
857 | 850 | ||
858 | /* | 851 | /* |
859 | * A periodic timer routine | 852 | * A periodic timer routine |
@@ -864,21 +857,11 @@ dm9000_timer(unsigned long data) | |||
864 | { | 857 | { |
865 | struct net_device *dev = (struct net_device *) data; | 858 | struct net_device *dev = (struct net_device *) data; |
866 | board_info_t *db = (board_info_t *) dev->priv; | 859 | board_info_t *db = (board_info_t *) dev->priv; |
867 | u8 reg_save; | ||
868 | unsigned long flags; | ||
869 | 860 | ||
870 | PRINTK3("dm9000_timer()\n"); | 861 | PRINTK3("dm9000_timer()\n"); |
871 | 862 | ||
872 | spin_lock_irqsave(db->lock,flags); | ||
873 | /* Save previous register address */ | ||
874 | reg_save = readb(db->io_addr); | ||
875 | |||
876 | mii_check_media(&db->mii, netif_msg_link(db), 0); | 863 | mii_check_media(&db->mii, netif_msg_link(db), 0); |
877 | 864 | ||
878 | /* Restore previous register address */ | ||
879 | writeb(reg_save, db->io_addr); | ||
880 | spin_unlock_irqrestore(db->lock,flags); | ||
881 | |||
882 | /* Set timer again */ | 865 | /* Set timer again */ |
883 | db->timer.expires = DM9000_TIMER_WUT; | 866 | db->timer.expires = DM9000_TIMER_WUT; |
884 | add_timer(&db->timer); | 867 | add_timer(&db->timer); |
@@ -1098,9 +1081,14 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) | |||
1098 | { | 1081 | { |
1099 | board_info_t *db = (board_info_t *) dev->priv; | 1082 | board_info_t *db = (board_info_t *) dev->priv; |
1100 | unsigned long flags; | 1083 | unsigned long flags; |
1084 | unsigned int reg_save; | ||
1101 | int ret; | 1085 | int ret; |
1102 | 1086 | ||
1103 | spin_lock_irqsave(&db->lock,flags); | 1087 | spin_lock_irqsave(&db->lock,flags); |
1088 | |||
1089 | /* Save previous register address */ | ||
1090 | reg_save = readb(db->io_addr); | ||
1091 | |||
1104 | /* Fill the phyxcer register into REG_0C */ | 1092 | /* Fill the phyxcer register into REG_0C */ |
1105 | iow(db, DM9000_EPAR, DM9000_PHY | reg); | 1093 | iow(db, DM9000_EPAR, DM9000_PHY | reg); |
1106 | 1094 | ||
@@ -1111,6 +1099,9 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) | |||
1111 | /* The read data keeps on REG_0D & REG_0E */ | 1099 | /* The read data keeps on REG_0D & REG_0E */ |
1112 | ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); | 1100 | ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); |
1113 | 1101 | ||
1102 | /* restore the previous address */ | ||
1103 | writeb(reg_save, db->io_addr); | ||
1104 | |||
1114 | spin_unlock_irqrestore(&db->lock,flags); | 1105 | spin_unlock_irqrestore(&db->lock,flags); |
1115 | 1106 | ||
1116 | return ret; | 1107 | return ret; |
@@ -1124,9 +1115,13 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1124 | { | 1115 | { |
1125 | board_info_t *db = (board_info_t *) dev->priv; | 1116 | board_info_t *db = (board_info_t *) dev->priv; |
1126 | unsigned long flags; | 1117 | unsigned long flags; |
1118 | unsigned long reg_save; | ||
1127 | 1119 | ||
1128 | spin_lock_irqsave(&db->lock,flags); | 1120 | spin_lock_irqsave(&db->lock,flags); |
1129 | 1121 | ||
1122 | /* Save previous register address */ | ||
1123 | reg_save = readb(db->io_addr); | ||
1124 | |||
1130 | /* Fill the phyxcer register into REG_0C */ | 1125 | /* Fill the phyxcer register into REG_0C */ |
1131 | iow(db, DM9000_EPAR, DM9000_PHY | reg); | 1126 | iow(db, DM9000_EPAR, DM9000_PHY | reg); |
1132 | 1127 | ||
@@ -1138,6 +1133,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1138 | udelay(500); /* Wait write complete */ | 1133 | udelay(500); /* Wait write complete */ |
1139 | iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ | 1134 | iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ |
1140 | 1135 | ||
1136 | /* restore the previous address */ | ||
1137 | writeb(reg_save, db->io_addr); | ||
1138 | |||
1141 | spin_unlock_irqrestore(&db->lock,flags); | 1139 | spin_unlock_irqrestore(&db->lock,flags); |
1142 | } | 1140 | } |
1143 | 1141 | ||
@@ -1202,6 +1200,8 @@ static struct device_driver dm9000_driver = { | |||
1202 | static int __init | 1200 | static int __init |
1203 | dm9000_init(void) | 1201 | dm9000_init(void) |
1204 | { | 1202 | { |
1203 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); | ||
1204 | |||
1205 | return driver_register(&dm9000_driver); /* search board and register */ | 1205 | return driver_register(&dm9000_driver); /* search board and register */ |
1206 | } | 1206 | } |
1207 | 1207 | ||
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index d520b5920d6c..49e5467bdd73 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c | |||
@@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg) | |||
499 | ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); | 499 | ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); |
500 | while (ioc3_r_micr() & MICR_BUSY); | 500 | while (ioc3_r_micr() & MICR_BUSY); |
501 | 501 | ||
502 | return ioc3_r_micr() & MIDR_DATA_MASK; | 502 | return ioc3_r_midr_r() & MIDR_DATA_MASK; |
503 | } | 503 | } |
504 | 504 | ||
505 | static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) | 505 | static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) |
@@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1291 | dev->features = NETIF_F_IP_CSUM; | 1291 | dev->features = NETIF_F_IP_CSUM; |
1292 | #endif | 1292 | #endif |
1293 | 1293 | ||
1294 | ioc3_setup_duplex(ip); | ||
1295 | sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); | 1294 | sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); |
1296 | sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); | 1295 | sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); |
1297 | 1296 | ||
@@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1300 | goto out_stop; | 1299 | goto out_stop; |
1301 | 1300 | ||
1302 | mii_check_media(&ip->mii, 1, 1); | 1301 | mii_check_media(&ip->mii, 1, 1); |
1302 | ioc3_setup_duplex(ip); | ||
1303 | 1303 | ||
1304 | vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); | 1304 | vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); |
1305 | model = (sw_physid2 >> 4) & 0x3f; | 1305 | model = (sw_physid2 >> 4) & 0x3f; |
@@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev, | |||
1524 | struct ethtool_drvinfo *info) | 1524 | struct ethtool_drvinfo *info) |
1525 | { | 1525 | { |
1526 | struct ioc3_private *ip = netdev_priv(dev); | 1526 | struct ioc3_private *ip = netdev_priv(dev); |
1527 | 1527 | ||
1528 | strcpy (info->driver, IOC3_NAME); | 1528 | strcpy (info->driver, IOC3_NAME); |
1529 | strcpy (info->version, IOC3_VERSION); | 1529 | strcpy (info->version, IOC3_VERSION); |
1530 | strcpy (info->bus_info, pci_name(ip->pdev)); | 1530 | strcpy (info->bus_info, pci_name(ip->pdev)); |
@@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1550 | spin_lock_irq(&ip->ioc3_lock); | 1550 | spin_lock_irq(&ip->ioc3_lock); |
1551 | rc = mii_ethtool_sset(&ip->mii, cmd); | 1551 | rc = mii_ethtool_sset(&ip->mii, cmd); |
1552 | spin_unlock_irq(&ip->ioc3_lock); | 1552 | spin_unlock_irq(&ip->ioc3_lock); |
1553 | 1553 | ||
1554 | return rc; | 1554 | return rc; |
1555 | } | 1555 | } |
1556 | 1556 | ||
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index b33111e21313..1f61f0cc95d8 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -214,7 +214,7 @@ struct net_device loopback_dev = { | |||
214 | .ethtool_ops = &loopback_ethtool_ops, | 214 | .ethtool_ops = &loopback_ethtool_ops, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | /* Setup and register the of the LOOPBACK device. */ | 217 | /* Setup and register the loopback device. */ |
218 | int __init loopback_init(void) | 218 | int __init loopback_init(void) |
219 | { | 219 | { |
220 | struct net_device_stats *stats; | 220 | struct net_device_stats *stats; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 368b8fb14023..01419aff333e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -66,8 +66,8 @@ | |||
66 | 66 | ||
67 | #define DRV_MODULE_NAME "tg3" | 67 | #define DRV_MODULE_NAME "tg3" |
68 | #define PFX DRV_MODULE_NAME ": " | 68 | #define PFX DRV_MODULE_NAME ": " |
69 | #define DRV_MODULE_VERSION "3.35" | 69 | #define DRV_MODULE_VERSION "3.36" |
70 | #define DRV_MODULE_RELDATE "August 6, 2005" | 70 | #define DRV_MODULE_RELDATE "August 19, 2005" |
71 | 71 | ||
72 | #define TG3_DEF_MAC_MODE 0 | 72 | #define TG3_DEF_MAC_MODE 0 |
73 | #define TG3_DEF_RX_MODE 0 | 73 | #define TG3_DEF_RX_MODE 0 |
@@ -8970,6 +8970,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) | |||
8970 | tp->phy_id = hw_phy_id; | 8970 | tp->phy_id = hw_phy_id; |
8971 | if (hw_phy_id_masked == PHY_ID_BCM8002) | 8971 | if (hw_phy_id_masked == PHY_ID_BCM8002) |
8972 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 8972 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
8973 | else | ||
8974 | tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES; | ||
8973 | } else { | 8975 | } else { |
8974 | if (tp->phy_id != PHY_ID_INVALID) { | 8976 | if (tp->phy_id != PHY_ID_INVALID) { |
8975 | /* Do nothing, phy ID already set up in | 8977 | /* Do nothing, phy ID already set up in |
diff --git a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c index c46387024b1d..a78b9bd8f897 100644 --- a/drivers/video/radeonfb.c +++ b/drivers/video/radeonfb.c | |||
@@ -80,7 +80,7 @@ | |||
80 | #include <video/radeon.h> | 80 | #include <video/radeon.h> |
81 | #include <linux/radeonfb.h> | 81 | #include <linux/radeonfb.h> |
82 | 82 | ||
83 | #define DEBUG 1 | 83 | #define DEBUG 0 |
84 | 84 | ||
85 | #if DEBUG | 85 | #if DEBUG |
86 | #define RTRACE printk | 86 | #define RTRACE printk |
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index bfc28abe1cb1..31ee06590de5 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
@@ -30,7 +30,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir, | |||
30 | struct dentry *dentry, | 30 | struct dentry *dentry, |
31 | struct nameidata *nd); | 31 | struct nameidata *nd); |
32 | static int afs_mntpt_open(struct inode *inode, struct file *file); | 32 | static int afs_mntpt_open(struct inode *inode, struct file *file); |
33 | static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); | 33 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); |
34 | 34 | ||
35 | struct file_operations afs_mntpt_file_operations = { | 35 | struct file_operations afs_mntpt_file_operations = { |
36 | .open = afs_mntpt_open, | 36 | .open = afs_mntpt_open, |
@@ -233,7 +233,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt) | |||
233 | /* | 233 | /* |
234 | * follow a link from a mountpoint directory, thus causing it to be mounted | 234 | * follow a link from a mountpoint directory, thus causing it to be mounted |
235 | */ | 235 | */ |
236 | static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | 236 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) |
237 | { | 237 | { |
238 | struct vfsmount *newmnt; | 238 | struct vfsmount *newmnt; |
239 | struct dentry *old_dentry; | 239 | struct dentry *old_dentry; |
@@ -249,7 +249,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
249 | newmnt = afs_mntpt_do_automount(dentry); | 249 | newmnt = afs_mntpt_do_automount(dentry); |
250 | if (IS_ERR(newmnt)) { | 250 | if (IS_ERR(newmnt)) { |
251 | path_release(nd); | 251 | path_release(nd); |
252 | return PTR_ERR(newmnt); | 252 | return (void *)newmnt; |
253 | } | 253 | } |
254 | 254 | ||
255 | old_dentry = nd->dentry; | 255 | old_dentry = nd->dentry; |
@@ -267,7 +267,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | kleave(" = %d", err); | 269 | kleave(" = %d", err); |
270 | return err; | 270 | return ERR_PTR(err); |
271 | } /* end afs_mntpt_follow_link() */ | 271 | } /* end afs_mntpt_follow_link() */ |
272 | 272 | ||
273 | /*****************************************************************************/ | 273 | /*****************************************************************************/ |
diff --git a/fs/autofs/symlink.c b/fs/autofs/symlink.c index f028396f1383..52e8772b066e 100644 --- a/fs/autofs/symlink.c +++ b/fs/autofs/symlink.c | |||
@@ -12,11 +12,12 @@ | |||
12 | 12 | ||
13 | #include "autofs_i.h" | 13 | #include "autofs_i.h" |
14 | 14 | ||
15 | static int autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | 15 | /* Nothing to release.. */ |
16 | static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | ||
16 | { | 17 | { |
17 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; | 18 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; |
18 | nd_set_link(nd, s); | 19 | nd_set_link(nd, s); |
19 | return 0; | 20 | return NULL; |
20 | } | 21 | } |
21 | 22 | ||
22 | struct inode_operations autofs_symlink_inode_operations = { | 23 | struct inode_operations autofs_symlink_inode_operations = { |
diff --git a/fs/autofs4/symlink.c b/fs/autofs4/symlink.c index c265a66edf0f..2ea2c98fd84b 100644 --- a/fs/autofs4/symlink.c +++ b/fs/autofs4/symlink.c | |||
@@ -12,11 +12,11 @@ | |||
12 | 12 | ||
13 | #include "autofs_i.h" | 13 | #include "autofs_i.h" |
14 | 14 | ||
15 | static int autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | 15 | static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) |
16 | { | 16 | { |
17 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | 17 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
18 | nd_set_link(nd, (char *)ino->u.symlink); | 18 | nd_set_link(nd, (char *)ino->u.symlink); |
19 | return 0; | 19 | return NULL; |
20 | } | 20 | } |
21 | 21 | ||
22 | struct inode_operations autofs4_symlink_inode_operations = { | 22 | struct inode_operations autofs4_symlink_inode_operations = { |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index de5bb280a828..e0a6025f1d06 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -41,8 +41,8 @@ static struct inode *befs_alloc_inode(struct super_block *sb); | |||
41 | static void befs_destroy_inode(struct inode *inode); | 41 | static void befs_destroy_inode(struct inode *inode); |
42 | static int befs_init_inodecache(void); | 42 | static int befs_init_inodecache(void); |
43 | static void befs_destroy_inodecache(void); | 43 | static void befs_destroy_inodecache(void); |
44 | static int befs_follow_link(struct dentry *, struct nameidata *); | 44 | static void *befs_follow_link(struct dentry *, struct nameidata *); |
45 | static void befs_put_link(struct dentry *, struct nameidata *); | 45 | static void befs_put_link(struct dentry *, struct nameidata *, void *); |
46 | static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, | 46 | static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, |
47 | char **out, int *out_len); | 47 | char **out, int *out_len); |
48 | static int befs_nls2utf(struct super_block *sb, const char *in, int in_len, | 48 | static int befs_nls2utf(struct super_block *sb, const char *in, int in_len, |
@@ -461,7 +461,7 @@ befs_destroy_inodecache(void) | |||
461 | * The data stream become link name. Unless the LONG_SYMLINK | 461 | * The data stream become link name. Unless the LONG_SYMLINK |
462 | * flag is set. | 462 | * flag is set. |
463 | */ | 463 | */ |
464 | static int | 464 | static void * |
465 | befs_follow_link(struct dentry *dentry, struct nameidata *nd) | 465 | befs_follow_link(struct dentry *dentry, struct nameidata *nd) |
466 | { | 466 | { |
467 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); | 467 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); |
@@ -487,10 +487,10 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
487 | } | 487 | } |
488 | 488 | ||
489 | nd_set_link(nd, link); | 489 | nd_set_link(nd, link); |
490 | return 0; | 490 | return NULL; |
491 | } | 491 | } |
492 | 492 | ||
493 | static void befs_put_link(struct dentry *dentry, struct nameidata *nd) | 493 | static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
494 | { | 494 | { |
495 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); | 495 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); |
496 | if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { | 496 | if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 78af5850c558..1fd21f66f243 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -83,8 +83,8 @@ extern int cifs_dir_notify(struct file *, unsigned long arg); | |||
83 | extern struct dentry_operations cifs_dentry_ops; | 83 | extern struct dentry_operations cifs_dentry_ops; |
84 | 84 | ||
85 | /* Functions related to symlinks */ | 85 | /* Functions related to symlinks */ |
86 | extern int cifs_follow_link(struct dentry *direntry, struct nameidata *nd); | 86 | extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd); |
87 | extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd); | 87 | extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *); |
88 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, | 88 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, |
89 | int buflen); | 89 | int buflen); |
90 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, | 90 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index bde0fabfece0..ab925ef4f863 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -92,7 +92,7 @@ cifs_hl_exit: | |||
92 | return rc; | 92 | return rc; |
93 | } | 93 | } |
94 | 94 | ||
95 | int | 95 | void * |
96 | cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | 96 | cifs_follow_link(struct dentry *direntry, struct nameidata *nd) |
97 | { | 97 | { |
98 | struct inode *inode = direntry->d_inode; | 98 | struct inode *inode = direntry->d_inode; |
@@ -148,7 +148,7 @@ out: | |||
148 | out_no_free: | 148 | out_no_free: |
149 | FreeXid(xid); | 149 | FreeXid(xid); |
150 | nd_set_link(nd, target_path); | 150 | nd_set_link(nd, target_path); |
151 | return 0; | 151 | return NULL; /* No cookie */ |
152 | } | 152 | } |
153 | 153 | ||
154 | int | 154 | int |
@@ -330,7 +330,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) | |||
330 | return rc; | 330 | return rc; |
331 | } | 331 | } |
332 | 332 | ||
333 | void cifs_put_link(struct dentry *direntry, struct nameidata *nd) | 333 | void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie) |
334 | { | 334 | { |
335 | char *p = nd_get_link(nd); | 335 | char *p = nd_get_link(nd); |
336 | if (!IS_ERR(p)) | 336 | if (!IS_ERR(p)) |
diff --git a/fs/devfs/base.c b/fs/devfs/base.c index 1ecfe1f184d4..8b679b67e5e0 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c | |||
@@ -2491,11 +2491,11 @@ static int devfs_mknod(struct inode *dir, struct dentry *dentry, int mode, | |||
2491 | return 0; | 2491 | return 0; |
2492 | } /* End Function devfs_mknod */ | 2492 | } /* End Function devfs_mknod */ |
2493 | 2493 | ||
2494 | static int devfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 2494 | static void *devfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
2495 | { | 2495 | { |
2496 | struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode); | 2496 | struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode); |
2497 | nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV)); | 2497 | nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV)); |
2498 | return 0; | 2498 | return NULL; |
2499 | } /* End Function devfs_follow_link */ | 2499 | } /* End Function devfs_follow_link */ |
2500 | 2500 | ||
2501 | static struct inode_operations devfs_iops = { | 2501 | static struct inode_operations devfs_iops = { |
diff --git a/fs/ext2/symlink.c b/fs/ext2/symlink.c index 9f7bac01d557..1e67d87cfa91 100644 --- a/fs/ext2/symlink.c +++ b/fs/ext2/symlink.c | |||
@@ -21,11 +21,11 @@ | |||
21 | #include "xattr.h" | 21 | #include "xattr.h" |
22 | #include <linux/namei.h> | 22 | #include <linux/namei.h> |
23 | 23 | ||
24 | static int ext2_follow_link(struct dentry *dentry, struct nameidata *nd) | 24 | static void *ext2_follow_link(struct dentry *dentry, struct nameidata *nd) |
25 | { | 25 | { |
26 | struct ext2_inode_info *ei = EXT2_I(dentry->d_inode); | 26 | struct ext2_inode_info *ei = EXT2_I(dentry->d_inode); |
27 | nd_set_link(nd, (char *)ei->i_data); | 27 | nd_set_link(nd, (char *)ei->i_data); |
28 | return 0; | 28 | return NULL; |
29 | } | 29 | } |
30 | 30 | ||
31 | struct inode_operations ext2_symlink_inode_operations = { | 31 | struct inode_operations ext2_symlink_inode_operations = { |
diff --git a/fs/ext3/symlink.c b/fs/ext3/symlink.c index 8c3e72818fb0..4f79122cde67 100644 --- a/fs/ext3/symlink.c +++ b/fs/ext3/symlink.c | |||
@@ -23,11 +23,11 @@ | |||
23 | #include <linux/namei.h> | 23 | #include <linux/namei.h> |
24 | #include "xattr.h" | 24 | #include "xattr.h" |
25 | 25 | ||
26 | static int ext3_follow_link(struct dentry *dentry, struct nameidata *nd) | 26 | static void * ext3_follow_link(struct dentry *dentry, struct nameidata *nd) |
27 | { | 27 | { |
28 | struct ext3_inode_info *ei = EXT3_I(dentry->d_inode); | 28 | struct ext3_inode_info *ei = EXT3_I(dentry->d_inode); |
29 | nd_set_link(nd, (char*)ei->i_data); | 29 | nd_set_link(nd, (char*)ei->i_data); |
30 | return 0; | 30 | return NULL; |
31 | } | 31 | } |
32 | 32 | ||
33 | struct inode_operations ext3_symlink_inode_operations = { | 33 | struct inode_operations ext3_symlink_inode_operations = { |
diff --git a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c index ac677ab262b2..d0401dc68d41 100644 --- a/fs/freevxfs/vxfs_immed.c +++ b/fs/freevxfs/vxfs_immed.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "vxfs_inode.h" | 38 | #include "vxfs_inode.h" |
39 | 39 | ||
40 | 40 | ||
41 | static int vxfs_immed_follow_link(struct dentry *, struct nameidata *); | 41 | static void * vxfs_immed_follow_link(struct dentry *, struct nameidata *); |
42 | 42 | ||
43 | static int vxfs_immed_readpage(struct file *, struct page *); | 43 | static int vxfs_immed_readpage(struct file *, struct page *); |
44 | 44 | ||
@@ -72,12 +72,12 @@ struct address_space_operations vxfs_immed_aops = { | |||
72 | * Returns: | 72 | * Returns: |
73 | * Zero on success, else a negative error code. | 73 | * Zero on success, else a negative error code. |
74 | */ | 74 | */ |
75 | static int | 75 | static void * |
76 | vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np) | 76 | vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np) |
77 | { | 77 | { |
78 | struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); | 78 | struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); |
79 | nd_set_link(np, vip->vii_immed.vi_immed); | 79 | nd_set_link(np, vip->vii_immed.vi_immed); |
80 | return 0; | 80 | return NULL; |
81 | } | 81 | } |
82 | 82 | ||
83 | /** | 83 | /** |
diff --git a/fs/ioprio.c b/fs/ioprio.c index 97e1f088ba00..d1c1f2b2c9da 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -62,6 +62,8 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) | |||
62 | 62 | ||
63 | break; | 63 | break; |
64 | case IOPRIO_CLASS_IDLE: | 64 | case IOPRIO_CLASS_IDLE: |
65 | if (!capable(CAP_SYS_ADMIN)) | ||
66 | return -EPERM; | ||
65 | break; | 67 | break; |
66 | default: | 68 | default: |
67 | return -EINVAL; | 69 | return -EINVAL; |
diff --git a/fs/jffs2/symlink.c b/fs/jffs2/symlink.c index 65ab6b001dca..82ef484f5e12 100644 --- a/fs/jffs2/symlink.c +++ b/fs/jffs2/symlink.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/namei.h> | 18 | #include <linux/namei.h> |
19 | #include "nodelist.h" | 19 | #include "nodelist.h" |
20 | 20 | ||
21 | static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); | 21 | static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); |
22 | 22 | ||
23 | struct inode_operations jffs2_symlink_inode_operations = | 23 | struct inode_operations jffs2_symlink_inode_operations = |
24 | { | 24 | { |
@@ -27,9 +27,10 @@ struct inode_operations jffs2_symlink_inode_operations = | |||
27 | .setattr = jffs2_setattr | 27 | .setattr = jffs2_setattr |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) | 30 | static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) |
31 | { | 31 | { |
32 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode); | 32 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode); |
33 | char *p = (char *)f->dents; | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * We don't acquire the f->sem mutex here since the only data we | 36 | * We don't acquire the f->sem mutex here since the only data we |
@@ -45,19 +46,20 @@ static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
45 | * nd_set_link() call. | 46 | * nd_set_link() call. |
46 | */ | 47 | */ |
47 | 48 | ||
48 | if (!f->dents) { | 49 | if (!p) { |
49 | printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n"); | 50 | printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n"); |
50 | return -EIO; | 51 | p = ERR_PTR(-EIO); |
52 | } else { | ||
53 | D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents)); | ||
51 | } | 54 | } |
52 | D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents)); | ||
53 | 55 | ||
54 | nd_set_link(nd, (char *)f->dents); | 56 | nd_set_link(nd, p); |
55 | 57 | ||
56 | /* | 58 | /* |
57 | * We unlock the f->sem mutex but VFS will use the f->dents string. This is safe | 59 | * We unlock the f->sem mutex but VFS will use the f->dents string. This is safe |
58 | * since the only way that may cause f->dents to be changed is iput() operation. | 60 | * since the only way that may cause f->dents to be changed is iput() operation. |
59 | * But VFS will not use f->dents after iput() has been called. | 61 | * But VFS will not use f->dents after iput() has been called. |
60 | */ | 62 | */ |
61 | return 0; | 63 | return NULL; |
62 | } | 64 | } |
63 | 65 | ||
diff --git a/fs/jfs/symlink.c b/fs/jfs/symlink.c index 287d8d6c3cfd..16477b3835e1 100644 --- a/fs/jfs/symlink.c +++ b/fs/jfs/symlink.c | |||
@@ -22,11 +22,11 @@ | |||
22 | #include "jfs_inode.h" | 22 | #include "jfs_inode.h" |
23 | #include "jfs_xattr.h" | 23 | #include "jfs_xattr.h" |
24 | 24 | ||
25 | static int jfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 25 | static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
26 | { | 26 | { |
27 | char *s = JFS_IP(dentry->d_inode)->i_inline; | 27 | char *s = JFS_IP(dentry->d_inode)->i_inline; |
28 | nd_set_link(nd, s); | 28 | nd_set_link(nd, s); |
29 | return 0; | 29 | return NULL; |
30 | } | 30 | } |
31 | 31 | ||
32 | struct inode_operations jfs_symlink_inode_operations = { | 32 | struct inode_operations jfs_symlink_inode_operations = { |
diff --git a/fs/namei.c b/fs/namei.c index b85f158aef0c..6ec1f0fefc5b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -501,6 +501,7 @@ struct path { | |||
501 | static inline int __do_follow_link(struct path *path, struct nameidata *nd) | 501 | static inline int __do_follow_link(struct path *path, struct nameidata *nd) |
502 | { | 502 | { |
503 | int error; | 503 | int error; |
504 | void *cookie; | ||
504 | struct dentry *dentry = path->dentry; | 505 | struct dentry *dentry = path->dentry; |
505 | 506 | ||
506 | touch_atime(path->mnt, dentry); | 507 | touch_atime(path->mnt, dentry); |
@@ -508,13 +509,15 @@ static inline int __do_follow_link(struct path *path, struct nameidata *nd) | |||
508 | 509 | ||
509 | if (path->mnt == nd->mnt) | 510 | if (path->mnt == nd->mnt) |
510 | mntget(path->mnt); | 511 | mntget(path->mnt); |
511 | error = dentry->d_inode->i_op->follow_link(dentry, nd); | 512 | cookie = dentry->d_inode->i_op->follow_link(dentry, nd); |
512 | if (!error) { | 513 | error = PTR_ERR(cookie); |
514 | if (!IS_ERR(cookie)) { | ||
513 | char *s = nd_get_link(nd); | 515 | char *s = nd_get_link(nd); |
516 | error = 0; | ||
514 | if (s) | 517 | if (s) |
515 | error = __vfs_follow_link(nd, s); | 518 | error = __vfs_follow_link(nd, s); |
516 | if (dentry->d_inode->i_op->put_link) | 519 | if (dentry->d_inode->i_op->put_link) |
517 | dentry->d_inode->i_op->put_link(dentry, nd); | 520 | dentry->d_inode->i_op->put_link(dentry, nd, cookie); |
518 | } | 521 | } |
519 | dput(dentry); | 522 | dput(dentry); |
520 | mntput(path->mnt); | 523 | mntput(path->mnt); |
@@ -2344,15 +2347,17 @@ out: | |||
2344 | int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | 2347 | int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) |
2345 | { | 2348 | { |
2346 | struct nameidata nd; | 2349 | struct nameidata nd; |
2347 | int res; | 2350 | void *cookie; |
2351 | |||
2348 | nd.depth = 0; | 2352 | nd.depth = 0; |
2349 | res = dentry->d_inode->i_op->follow_link(dentry, &nd); | 2353 | cookie = dentry->d_inode->i_op->follow_link(dentry, &nd); |
2350 | if (!res) { | 2354 | if (!IS_ERR(cookie)) { |
2351 | res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd)); | 2355 | int res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd)); |
2352 | if (dentry->d_inode->i_op->put_link) | 2356 | if (dentry->d_inode->i_op->put_link) |
2353 | dentry->d_inode->i_op->put_link(dentry, &nd); | 2357 | dentry->d_inode->i_op->put_link(dentry, &nd, cookie); |
2358 | cookie = ERR_PTR(res); | ||
2354 | } | 2359 | } |
2355 | return res; | 2360 | return PTR_ERR(cookie); |
2356 | } | 2361 | } |
2357 | 2362 | ||
2358 | int vfs_follow_link(struct nameidata *nd, const char *link) | 2363 | int vfs_follow_link(struct nameidata *nd, const char *link) |
@@ -2395,23 +2400,20 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) | |||
2395 | return res; | 2400 | return res; |
2396 | } | 2401 | } |
2397 | 2402 | ||
2398 | int page_follow_link_light(struct dentry *dentry, struct nameidata *nd) | 2403 | void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd) |
2399 | { | 2404 | { |
2400 | struct page *page; | 2405 | struct page *page = NULL; |
2401 | nd_set_link(nd, page_getlink(dentry, &page)); | 2406 | nd_set_link(nd, page_getlink(dentry, &page)); |
2402 | return 0; | 2407 | return page; |
2403 | } | 2408 | } |
2404 | 2409 | ||
2405 | void page_put_link(struct dentry *dentry, struct nameidata *nd) | 2410 | void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
2406 | { | 2411 | { |
2407 | if (!IS_ERR(nd_get_link(nd))) { | 2412 | struct page *page = cookie; |
2408 | struct page *page; | 2413 | |
2409 | page = find_get_page(dentry->d_inode->i_mapping, 0); | 2414 | if (page) { |
2410 | if (!page) | ||
2411 | BUG(); | ||
2412 | kunmap(page); | 2415 | kunmap(page); |
2413 | page_cache_release(page); | 2416 | page_cache_release(page); |
2414 | page_cache_release(page); | ||
2415 | } | 2417 | } |
2416 | } | 2418 | } |
2417 | 2419 | ||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b38a57e78a63..2df639f143e8 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -182,14 +182,16 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
182 | /* We requested READDIRPLUS, but the server doesn't grok it */ | 182 | /* We requested READDIRPLUS, but the server doesn't grok it */ |
183 | if (error == -ENOTSUPP && desc->plus) { | 183 | if (error == -ENOTSUPP && desc->plus) { |
184 | NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS; | 184 | NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS; |
185 | NFS_FLAGS(inode) &= ~NFS_INO_ADVISE_RDPLUS; | 185 | clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
186 | desc->plus = 0; | 186 | desc->plus = 0; |
187 | goto again; | 187 | goto again; |
188 | } | 188 | } |
189 | goto error; | 189 | goto error; |
190 | } | 190 | } |
191 | SetPageUptodate(page); | 191 | SetPageUptodate(page); |
192 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 192 | spin_lock(&inode->i_lock); |
193 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
194 | spin_unlock(&inode->i_lock); | ||
193 | /* Ensure consistent page alignment of the data. | 195 | /* Ensure consistent page alignment of the data. |
194 | * Note: assumes we have exclusive access to this mapping either | 196 | * Note: assumes we have exclusive access to this mapping either |
195 | * through inode->i_sem or some other mechanism. | 197 | * through inode->i_sem or some other mechanism. |
@@ -462,7 +464,9 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
462 | page, | 464 | page, |
463 | NFS_SERVER(inode)->dtsize, | 465 | NFS_SERVER(inode)->dtsize, |
464 | desc->plus); | 466 | desc->plus); |
465 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 467 | spin_lock(&inode->i_lock); |
468 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
469 | spin_unlock(&inode->i_lock); | ||
466 | desc->page = page; | 470 | desc->page = page; |
467 | desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */ | 471 | desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */ |
468 | if (desc->error >= 0) { | 472 | if (desc->error >= 0) { |
@@ -545,7 +549,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
545 | break; | 549 | break; |
546 | } | 550 | } |
547 | if (res == -ETOOSMALL && desc->plus) { | 551 | if (res == -ETOOSMALL && desc->plus) { |
548 | NFS_FLAGS(inode) &= ~NFS_INO_ADVISE_RDPLUS; | 552 | clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
549 | nfs_zap_caches(inode); | 553 | nfs_zap_caches(inode); |
550 | desc->plus = 0; | 554 | desc->plus = 0; |
551 | desc->entry->eof = 0; | 555 | desc->entry->eof = 0; |
@@ -608,7 +612,7 @@ static inline int nfs_check_verifier(struct inode *dir, struct dentry *dentry) | |||
608 | { | 612 | { |
609 | if (IS_ROOT(dentry)) | 613 | if (IS_ROOT(dentry)) |
610 | return 1; | 614 | return 1; |
611 | if ((NFS_FLAGS(dir) & NFS_INO_INVALID_ATTR) != 0 | 615 | if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0 |
612 | || nfs_attribute_timeout(dir)) | 616 | || nfs_attribute_timeout(dir)) |
613 | return 0; | 617 | return 0; |
614 | return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); | 618 | return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); |
@@ -935,6 +939,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
935 | error = nfs_revalidate_inode(NFS_SERVER(dir), dir); | 939 | error = nfs_revalidate_inode(NFS_SERVER(dir), dir); |
936 | if (error < 0) { | 940 | if (error < 0) { |
937 | res = ERR_PTR(error); | 941 | res = ERR_PTR(error); |
942 | unlock_kernel(); | ||
938 | goto out; | 943 | goto out; |
939 | } | 944 | } |
940 | 945 | ||
@@ -1575,11 +1580,12 @@ out: | |||
1575 | 1580 | ||
1576 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) | 1581 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) |
1577 | { | 1582 | { |
1578 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1583 | struct nfs_inode *nfsi = NFS_I(inode); |
1584 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1579 | 1585 | ||
1580 | if (cache->cred != cred | 1586 | if (cache->cred != cred |
1581 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) | 1587 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) |
1582 | || (NFS_FLAGS(inode) & NFS_INO_INVALID_ACCESS)) | 1588 | || (nfsi->cache_validity & NFS_INO_INVALID_ACCESS)) |
1583 | return -ENOENT; | 1589 | return -ENOENT; |
1584 | memcpy(res, cache, sizeof(*res)); | 1590 | memcpy(res, cache, sizeof(*res)); |
1585 | return 0; | 1591 | return 0; |
@@ -1587,14 +1593,18 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs | |||
1587 | 1593 | ||
1588 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) | 1594 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) |
1589 | { | 1595 | { |
1590 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1596 | struct nfs_inode *nfsi = NFS_I(inode); |
1597 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1591 | 1598 | ||
1592 | if (cache->cred != set->cred) { | 1599 | if (cache->cred != set->cred) { |
1593 | if (cache->cred) | 1600 | if (cache->cred) |
1594 | put_rpccred(cache->cred); | 1601 | put_rpccred(cache->cred); |
1595 | cache->cred = get_rpccred(set->cred); | 1602 | cache->cred = get_rpccred(set->cred); |
1596 | } | 1603 | } |
1597 | NFS_FLAGS(inode) &= ~NFS_INO_INVALID_ACCESS; | 1604 | /* FIXME: replace current access_cache BKL reliance with inode->i_lock */ |
1605 | spin_lock(&inode->i_lock); | ||
1606 | nfsi->cache_validity &= ~NFS_INO_INVALID_ACCESS; | ||
1607 | spin_unlock(&inode->i_lock); | ||
1598 | cache->jiffies = set->jiffies; | 1608 | cache->jiffies = set->jiffies; |
1599 | cache->mask = set->mask; | 1609 | cache->mask = set->mask; |
1600 | } | 1610 | } |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 5621ba9885f4..f6b9eda925c5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -134,9 +134,10 @@ nfs_file_release(struct inode *inode, struct file *filp) | |||
134 | */ | 134 | */ |
135 | static int nfs_revalidate_file(struct inode *inode, struct file *filp) | 135 | static int nfs_revalidate_file(struct inode *inode, struct file *filp) |
136 | { | 136 | { |
137 | struct nfs_inode *nfsi = NFS_I(inode); | ||
137 | int retval = 0; | 138 | int retval = 0; |
138 | 139 | ||
139 | if ((NFS_FLAGS(inode) & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) | 140 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) |
140 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 141 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
141 | nfs_revalidate_mapping(inode, filp->f_mapping); | 142 | nfs_revalidate_mapping(inode, filp->f_mapping); |
142 | return 0; | 143 | return 0; |
@@ -164,7 +165,7 @@ static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) | |||
164 | goto force_reval; | 165 | goto force_reval; |
165 | if (nfsi->npages != 0) | 166 | if (nfsi->npages != 0) |
166 | return 0; | 167 | return 0; |
167 | if (!(NFS_FLAGS(inode) & NFS_INO_REVAL_PAGECACHE) && !nfs_attribute_timeout(inode)) | 168 | if (!(nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) && !nfs_attribute_timeout(inode)) |
168 | return 0; | 169 | return 0; |
169 | force_reval: | 170 | force_reval: |
170 | return __nfs_revalidate_inode(server, inode); | 171 | return __nfs_revalidate_inode(server, inode); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index bb7ca022bcb2..541b418327c8 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -615,14 +615,18 @@ nfs_zap_caches(struct inode *inode) | |||
615 | struct nfs_inode *nfsi = NFS_I(inode); | 615 | struct nfs_inode *nfsi = NFS_I(inode); |
616 | int mode = inode->i_mode; | 616 | int mode = inode->i_mode; |
617 | 617 | ||
618 | spin_lock(&inode->i_lock); | ||
619 | |||
618 | NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); | 620 | NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); |
619 | NFS_ATTRTIMEO_UPDATE(inode) = jiffies; | 621 | NFS_ATTRTIMEO_UPDATE(inode) = jiffies; |
620 | 622 | ||
621 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); | 623 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); |
622 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) | 624 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) |
623 | nfsi->flags |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 625 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
624 | else | 626 | else |
625 | nfsi->flags |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 627 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
628 | |||
629 | spin_unlock(&inode->i_lock); | ||
626 | } | 630 | } |
627 | 631 | ||
628 | static void nfs_zap_acl_cache(struct inode *inode) | 632 | static void nfs_zap_acl_cache(struct inode *inode) |
@@ -632,7 +636,9 @@ static void nfs_zap_acl_cache(struct inode *inode) | |||
632 | clear_acl_cache = NFS_PROTO(inode)->clear_acl_cache; | 636 | clear_acl_cache = NFS_PROTO(inode)->clear_acl_cache; |
633 | if (clear_acl_cache != NULL) | 637 | if (clear_acl_cache != NULL) |
634 | clear_acl_cache(inode); | 638 | clear_acl_cache(inode); |
635 | NFS_I(inode)->flags &= ~NFS_INO_INVALID_ACL; | 639 | spin_lock(&inode->i_lock); |
640 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; | ||
641 | spin_unlock(&inode->i_lock); | ||
636 | } | 642 | } |
637 | 643 | ||
638 | /* | 644 | /* |
@@ -739,7 +745,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
739 | inode->i_fop = &nfs_dir_operations; | 745 | inode->i_fop = &nfs_dir_operations; |
740 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) | 746 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) |
741 | && fattr->size <= NFS_LIMIT_READDIRPLUS) | 747 | && fattr->size <= NFS_LIMIT_READDIRPLUS) |
742 | NFS_FLAGS(inode) |= NFS_INO_ADVISE_RDPLUS; | 748 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
743 | } else if (S_ISLNK(inode->i_mode)) | 749 | } else if (S_ISLNK(inode->i_mode)) |
744 | inode->i_op = &nfs_symlink_inode_operations; | 750 | inode->i_op = &nfs_symlink_inode_operations; |
745 | else | 751 | else |
@@ -841,7 +847,9 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr) | |||
841 | inode->i_uid = attr->ia_uid; | 847 | inode->i_uid = attr->ia_uid; |
842 | if ((attr->ia_valid & ATTR_GID) != 0) | 848 | if ((attr->ia_valid & ATTR_GID) != 0) |
843 | inode->i_gid = attr->ia_gid; | 849 | inode->i_gid = attr->ia_gid; |
844 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | 850 | spin_lock(&inode->i_lock); |
851 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | ||
852 | spin_unlock(&inode->i_lock); | ||
845 | } | 853 | } |
846 | if ((attr->ia_valid & ATTR_SIZE) != 0) { | 854 | if ((attr->ia_valid & ATTR_SIZE) != 0) { |
847 | inode->i_size = attr->ia_size; | 855 | inode->i_size = attr->ia_size; |
@@ -849,31 +857,47 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr) | |||
849 | } | 857 | } |
850 | } | 858 | } |
851 | 859 | ||
860 | static int nfs_wait_schedule(void *word) | ||
861 | { | ||
862 | if (signal_pending(current)) | ||
863 | return -ERESTARTSYS; | ||
864 | schedule(); | ||
865 | return 0; | ||
866 | } | ||
867 | |||
852 | /* | 868 | /* |
853 | * Wait for the inode to get unlocked. | 869 | * Wait for the inode to get unlocked. |
854 | * (Used for NFS_INO_LOCKED and NFS_INO_REVALIDATING). | ||
855 | */ | 870 | */ |
856 | static int | 871 | static int nfs_wait_on_inode(struct inode *inode) |
857 | nfs_wait_on_inode(struct inode *inode, int flag) | ||
858 | { | 872 | { |
859 | struct rpc_clnt *clnt = NFS_CLIENT(inode); | 873 | struct rpc_clnt *clnt = NFS_CLIENT(inode); |
860 | struct nfs_inode *nfsi = NFS_I(inode); | 874 | struct nfs_inode *nfsi = NFS_I(inode); |
861 | 875 | sigset_t oldmask; | |
862 | int error; | 876 | int error; |
863 | if (!(NFS_FLAGS(inode) & flag)) | 877 | |
864 | return 0; | ||
865 | atomic_inc(&inode->i_count); | 878 | atomic_inc(&inode->i_count); |
866 | error = nfs_wait_event(clnt, nfsi->nfs_i_wait, | 879 | rpc_clnt_sigmask(clnt, &oldmask); |
867 | !(NFS_FLAGS(inode) & flag)); | 880 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, |
881 | nfs_wait_schedule, TASK_INTERRUPTIBLE); | ||
882 | rpc_clnt_sigunmask(clnt, &oldmask); | ||
868 | iput(inode); | 883 | iput(inode); |
884 | |||
869 | return error; | 885 | return error; |
870 | } | 886 | } |
871 | 887 | ||
888 | static void nfs_wake_up_inode(struct inode *inode) | ||
889 | { | ||
890 | struct nfs_inode *nfsi = NFS_I(inode); | ||
891 | |||
892 | clear_bit(NFS_INO_REVALIDATING, &nfsi->flags); | ||
893 | smp_mb__after_clear_bit(); | ||
894 | wake_up_bit(&nfsi->flags, NFS_INO_REVALIDATING); | ||
895 | } | ||
896 | |||
872 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 897 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
873 | { | 898 | { |
874 | struct inode *inode = dentry->d_inode; | 899 | struct inode *inode = dentry->d_inode; |
875 | struct nfs_inode *nfsi = NFS_I(inode); | 900 | int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME; |
876 | int need_atime = nfsi->flags & NFS_INO_INVALID_ATIME; | ||
877 | int err; | 901 | int err; |
878 | 902 | ||
879 | if (__IS_FLG(inode, MS_NOATIME)) | 903 | if (__IS_FLG(inode, MS_NOATIME)) |
@@ -1019,7 +1043,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1019 | struct nfs_fattr fattr; | 1043 | struct nfs_fattr fattr; |
1020 | struct nfs_inode *nfsi = NFS_I(inode); | 1044 | struct nfs_inode *nfsi = NFS_I(inode); |
1021 | unsigned long verifier; | 1045 | unsigned long verifier; |
1022 | unsigned int flags; | 1046 | unsigned long cache_validity; |
1023 | 1047 | ||
1024 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", | 1048 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", |
1025 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); | 1049 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); |
@@ -1030,18 +1054,19 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1030 | if (NFS_STALE(inode)) | 1054 | if (NFS_STALE(inode)) |
1031 | goto out_nowait; | 1055 | goto out_nowait; |
1032 | 1056 | ||
1033 | while (NFS_REVALIDATING(inode)) { | 1057 | status = nfs_wait_on_inode(inode); |
1034 | status = nfs_wait_on_inode(inode, NFS_INO_REVALIDATING); | 1058 | if (status < 0) |
1035 | if (status < 0) | 1059 | goto out; |
1036 | goto out_nowait; | 1060 | if (NFS_STALE(inode)) { |
1037 | if (NFS_ATTRTIMEO(inode) == 0) | 1061 | status = -ESTALE; |
1038 | continue; | 1062 | /* Do we trust the cached ESTALE? */ |
1039 | if (NFS_FLAGS(inode) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ATIME)) | 1063 | if (NFS_ATTRTIMEO(inode) != 0) { |
1040 | continue; | 1064 | if (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ATIME)) { |
1041 | status = NFS_STALE(inode) ? -ESTALE : 0; | 1065 | /* no */ |
1042 | goto out_nowait; | 1066 | } else |
1067 | goto out; | ||
1068 | } | ||
1043 | } | 1069 | } |
1044 | NFS_FLAGS(inode) |= NFS_INO_REVALIDATING; | ||
1045 | 1070 | ||
1046 | /* Protect against RPC races by saving the change attribute */ | 1071 | /* Protect against RPC races by saving the change attribute */ |
1047 | verifier = nfs_save_change_attribute(inode); | 1072 | verifier = nfs_save_change_attribute(inode); |
@@ -1053,7 +1078,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1053 | if (status == -ESTALE) { | 1078 | if (status == -ESTALE) { |
1054 | nfs_zap_caches(inode); | 1079 | nfs_zap_caches(inode); |
1055 | if (!S_ISDIR(inode->i_mode)) | 1080 | if (!S_ISDIR(inode->i_mode)) |
1056 | NFS_FLAGS(inode) |= NFS_INO_STALE; | 1081 | set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); |
1057 | } | 1082 | } |
1058 | goto out; | 1083 | goto out; |
1059 | } | 1084 | } |
@@ -1065,25 +1090,30 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1065 | (long long)NFS_FILEID(inode), status); | 1090 | (long long)NFS_FILEID(inode), status); |
1066 | goto out; | 1091 | goto out; |
1067 | } | 1092 | } |
1068 | flags = nfsi->flags; | 1093 | spin_lock(&inode->i_lock); |
1069 | nfsi->flags &= ~NFS_INO_REVAL_PAGECACHE; | 1094 | cache_validity = nfsi->cache_validity; |
1095 | nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE; | ||
1096 | |||
1070 | /* | 1097 | /* |
1071 | * We may need to keep the attributes marked as invalid if | 1098 | * We may need to keep the attributes marked as invalid if |
1072 | * we raced with nfs_end_attr_update(). | 1099 | * we raced with nfs_end_attr_update(). |
1073 | */ | 1100 | */ |
1074 | if (verifier == nfsi->cache_change_attribute) | 1101 | if (verifier == nfsi->cache_change_attribute) |
1075 | nfsi->flags &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); | 1102 | nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); |
1076 | /* Do the page cache invalidation */ | 1103 | spin_unlock(&inode->i_lock); |
1104 | |||
1077 | nfs_revalidate_mapping(inode, inode->i_mapping); | 1105 | nfs_revalidate_mapping(inode, inode->i_mapping); |
1078 | if (flags & NFS_INO_INVALID_ACL) | 1106 | |
1107 | if (cache_validity & NFS_INO_INVALID_ACL) | ||
1079 | nfs_zap_acl_cache(inode); | 1108 | nfs_zap_acl_cache(inode); |
1109 | |||
1080 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n", | 1110 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n", |
1081 | inode->i_sb->s_id, | 1111 | inode->i_sb->s_id, |
1082 | (long long)NFS_FILEID(inode)); | 1112 | (long long)NFS_FILEID(inode)); |
1083 | 1113 | ||
1084 | out: | 1114 | out: |
1085 | NFS_FLAGS(inode) &= ~NFS_INO_REVALIDATING; | 1115 | nfs_wake_up_inode(inode); |
1086 | wake_up(&nfsi->nfs_i_wait); | 1116 | |
1087 | out_nowait: | 1117 | out_nowait: |
1088 | unlock_kernel(); | 1118 | unlock_kernel(); |
1089 | return status; | 1119 | return status; |
@@ -1107,7 +1137,7 @@ int nfs_attribute_timeout(struct inode *inode) | |||
1107 | */ | 1137 | */ |
1108 | int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | 1138 | int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) |
1109 | { | 1139 | { |
1110 | if (!(NFS_FLAGS(inode) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA)) | 1140 | if (!(NFS_I(inode)->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA)) |
1111 | && !nfs_attribute_timeout(inode)) | 1141 | && !nfs_attribute_timeout(inode)) |
1112 | return NFS_STALE(inode) ? -ESTALE : 0; | 1142 | return NFS_STALE(inode) ? -ESTALE : 0; |
1113 | return __nfs_revalidate_inode(server, inode); | 1143 | return __nfs_revalidate_inode(server, inode); |
@@ -1122,19 +1152,23 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
1122 | { | 1152 | { |
1123 | struct nfs_inode *nfsi = NFS_I(inode); | 1153 | struct nfs_inode *nfsi = NFS_I(inode); |
1124 | 1154 | ||
1125 | if (nfsi->flags & NFS_INO_INVALID_DATA) { | 1155 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { |
1126 | if (S_ISREG(inode->i_mode)) { | 1156 | if (S_ISREG(inode->i_mode)) { |
1127 | if (filemap_fdatawrite(mapping) == 0) | 1157 | if (filemap_fdatawrite(mapping) == 0) |
1128 | filemap_fdatawait(mapping); | 1158 | filemap_fdatawait(mapping); |
1129 | nfs_wb_all(inode); | 1159 | nfs_wb_all(inode); |
1130 | } | 1160 | } |
1131 | invalidate_inode_pages2(mapping); | 1161 | invalidate_inode_pages2(mapping); |
1132 | nfsi->flags &= ~NFS_INO_INVALID_DATA; | 1162 | |
1163 | spin_lock(&inode->i_lock); | ||
1164 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; | ||
1133 | if (S_ISDIR(inode->i_mode)) { | 1165 | if (S_ISDIR(inode->i_mode)) { |
1134 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); | 1166 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); |
1135 | /* This ensures we revalidate child dentries */ | 1167 | /* This ensures we revalidate child dentries */ |
1136 | nfsi->cache_change_attribute++; | 1168 | nfsi->cache_change_attribute++; |
1137 | } | 1169 | } |
1170 | spin_unlock(&inode->i_lock); | ||
1171 | |||
1138 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", | 1172 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", |
1139 | inode->i_sb->s_id, | 1173 | inode->i_sb->s_id, |
1140 | (long long)NFS_FILEID(inode)); | 1174 | (long long)NFS_FILEID(inode)); |
@@ -1164,10 +1198,12 @@ void nfs_end_data_update(struct inode *inode) | |||
1164 | 1198 | ||
1165 | if (!nfs_have_delegation(inode, FMODE_READ)) { | 1199 | if (!nfs_have_delegation(inode, FMODE_READ)) { |
1166 | /* Mark the attribute cache for revalidation */ | 1200 | /* Mark the attribute cache for revalidation */ |
1167 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1201 | spin_lock(&inode->i_lock); |
1202 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; | ||
1168 | /* Directories and symlinks: invalidate page cache too */ | 1203 | /* Directories and symlinks: invalidate page cache too */ |
1169 | if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) | 1204 | if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) |
1170 | nfsi->flags |= NFS_INO_INVALID_DATA; | 1205 | nfsi->cache_validity |= NFS_INO_INVALID_DATA; |
1206 | spin_unlock(&inode->i_lock); | ||
1171 | } | 1207 | } |
1172 | nfsi->cache_change_attribute ++; | 1208 | nfsi->cache_change_attribute ++; |
1173 | atomic_dec(&nfsi->data_updates); | 1209 | atomic_dec(&nfsi->data_updates); |
@@ -1192,6 +1228,8 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1192 | if (nfs_have_delegation(inode, FMODE_READ)) | 1228 | if (nfs_have_delegation(inode, FMODE_READ)) |
1193 | return 0; | 1229 | return 0; |
1194 | 1230 | ||
1231 | spin_lock(&inode->i_lock); | ||
1232 | |||
1195 | /* Are we in the process of updating data on the server? */ | 1233 | /* Are we in the process of updating data on the server? */ |
1196 | data_unstable = nfs_caches_unstable(inode); | 1234 | data_unstable = nfs_caches_unstable(inode); |
1197 | 1235 | ||
@@ -1200,19 +1238,23 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1200 | && nfsi->change_attr == fattr->pre_change_attr) | 1238 | && nfsi->change_attr == fattr->pre_change_attr) |
1201 | nfsi->change_attr = fattr->change_attr; | 1239 | nfsi->change_attr = fattr->change_attr; |
1202 | if (nfsi->change_attr != fattr->change_attr) { | 1240 | if (nfsi->change_attr != fattr->change_attr) { |
1203 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1241 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1204 | if (!data_unstable) | 1242 | if (!data_unstable) |
1205 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1243 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1206 | } | 1244 | } |
1207 | } | 1245 | } |
1208 | 1246 | ||
1209 | if ((fattr->valid & NFS_ATTR_FATTR) == 0) | 1247 | if ((fattr->valid & NFS_ATTR_FATTR) == 0) { |
1248 | spin_unlock(&inode->i_lock); | ||
1210 | return 0; | 1249 | return 0; |
1250 | } | ||
1211 | 1251 | ||
1212 | /* Has the inode gone and changed behind our back? */ | 1252 | /* Has the inode gone and changed behind our back? */ |
1213 | if (nfsi->fileid != fattr->fileid | 1253 | if (nfsi->fileid != fattr->fileid |
1214 | || (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1254 | || (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1255 | spin_unlock(&inode->i_lock); | ||
1215 | return -EIO; | 1256 | return -EIO; |
1257 | } | ||
1216 | 1258 | ||
1217 | cur_size = i_size_read(inode); | 1259 | cur_size = i_size_read(inode); |
1218 | new_isize = nfs_size_to_loff_t(fattr->size); | 1260 | new_isize = nfs_size_to_loff_t(fattr->size); |
@@ -1227,30 +1269,31 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1227 | 1269 | ||
1228 | /* Verify a few of the more important attributes */ | 1270 | /* Verify a few of the more important attributes */ |
1229 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { | 1271 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { |
1230 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1272 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1231 | if (!data_unstable) | 1273 | if (!data_unstable) |
1232 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1274 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1233 | } | 1275 | } |
1234 | if (cur_size != new_isize) { | 1276 | if (cur_size != new_isize) { |
1235 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1277 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1236 | if (nfsi->npages == 0) | 1278 | if (nfsi->npages == 0) |
1237 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1279 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1238 | } | 1280 | } |
1239 | 1281 | ||
1240 | /* Have any file permissions changed? */ | 1282 | /* Have any file permissions changed? */ |
1241 | if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) | 1283 | if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) |
1242 | || inode->i_uid != fattr->uid | 1284 | || inode->i_uid != fattr->uid |
1243 | || inode->i_gid != fattr->gid) | 1285 | || inode->i_gid != fattr->gid) |
1244 | nfsi->flags |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL; | 1286 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL; |
1245 | 1287 | ||
1246 | /* Has the link count changed? */ | 1288 | /* Has the link count changed? */ |
1247 | if (inode->i_nlink != fattr->nlink) | 1289 | if (inode->i_nlink != fattr->nlink) |
1248 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1290 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1249 | 1291 | ||
1250 | if (!timespec_equal(&inode->i_atime, &fattr->atime)) | 1292 | if (!timespec_equal(&inode->i_atime, &fattr->atime)) |
1251 | nfsi->flags |= NFS_INO_INVALID_ATIME; | 1293 | nfsi->cache_validity |= NFS_INO_INVALID_ATIME; |
1252 | 1294 | ||
1253 | nfsi->read_cache_jiffies = fattr->timestamp; | 1295 | nfsi->read_cache_jiffies = fattr->timestamp; |
1296 | spin_unlock(&inode->i_lock); | ||
1254 | return 0; | 1297 | return 0; |
1255 | } | 1298 | } |
1256 | 1299 | ||
@@ -1289,11 +1332,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1289 | goto out_err; | 1332 | goto out_err; |
1290 | } | 1333 | } |
1291 | 1334 | ||
1335 | spin_lock(&inode->i_lock); | ||
1336 | |||
1292 | /* | 1337 | /* |
1293 | * Make sure the inode's type hasn't changed. | 1338 | * Make sure the inode's type hasn't changed. |
1294 | */ | 1339 | */ |
1295 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1340 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1341 | spin_unlock(&inode->i_lock); | ||
1296 | goto out_changed; | 1342 | goto out_changed; |
1343 | } | ||
1297 | 1344 | ||
1298 | /* | 1345 | /* |
1299 | * Update the read time so we don't revalidate too often. | 1346 | * Update the read time so we don't revalidate too often. |
@@ -1384,8 +1431,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1384 | || S_ISLNK(inode->i_mode))) | 1431 | || S_ISLNK(inode->i_mode))) |
1385 | invalid &= ~NFS_INO_INVALID_DATA; | 1432 | invalid &= ~NFS_INO_INVALID_DATA; |
1386 | if (!nfs_have_delegation(inode, FMODE_READ)) | 1433 | if (!nfs_have_delegation(inode, FMODE_READ)) |
1387 | nfsi->flags |= invalid; | 1434 | nfsi->cache_validity |= invalid; |
1388 | 1435 | ||
1436 | spin_unlock(&inode->i_lock); | ||
1389 | return 0; | 1437 | return 0; |
1390 | out_changed: | 1438 | out_changed: |
1391 | /* | 1439 | /* |
@@ -1402,7 +1450,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1402 | */ | 1450 | */ |
1403 | nfs_invalidate_inode(inode); | 1451 | nfs_invalidate_inode(inode); |
1404 | out_err: | 1452 | out_err: |
1405 | NFS_FLAGS(inode) |= NFS_INO_STALE; | 1453 | set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); |
1406 | return -ESTALE; | 1454 | return -ESTALE; |
1407 | } | 1455 | } |
1408 | 1456 | ||
@@ -1961,7 +2009,8 @@ static struct inode *nfs_alloc_inode(struct super_block *sb) | |||
1961 | nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, SLAB_KERNEL); | 2009 | nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, SLAB_KERNEL); |
1962 | if (!nfsi) | 2010 | if (!nfsi) |
1963 | return NULL; | 2011 | return NULL; |
1964 | nfsi->flags = 0; | 2012 | nfsi->flags = 0UL; |
2013 | nfsi->cache_validity = 0UL; | ||
1965 | #ifdef CONFIG_NFS_V3_ACL | 2014 | #ifdef CONFIG_NFS_V3_ACL |
1966 | nfsi->acl_access = ERR_PTR(-EAGAIN); | 2015 | nfsi->acl_access = ERR_PTR(-EAGAIN); |
1967 | nfsi->acl_default = ERR_PTR(-EAGAIN); | 2016 | nfsi->acl_default = ERR_PTR(-EAGAIN); |
@@ -1993,7 +2042,6 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) | |||
1993 | nfsi->ndirty = 0; | 2042 | nfsi->ndirty = 0; |
1994 | nfsi->ncommit = 0; | 2043 | nfsi->ncommit = 0; |
1995 | nfsi->npages = 0; | 2044 | nfsi->npages = 0; |
1996 | init_waitqueue_head(&nfsi->nfs_i_wait); | ||
1997 | nfs4_init_once(nfsi); | 2045 | nfs4_init_once(nfsi); |
1998 | } | 2046 | } |
1999 | } | 2047 | } |
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 1b7a3ef2f813..6a5bbc0ae941 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -308,7 +308,9 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | |||
308 | nfs_begin_data_update(inode); | 308 | nfs_begin_data_update(inode); |
309 | status = rpc_call(server->client_acl, ACLPROC3_SETACL, | 309 | status = rpc_call(server->client_acl, ACLPROC3_SETACL, |
310 | &args, &fattr, 0); | 310 | &args, &fattr, 0); |
311 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ACCESS; | 311 | spin_lock(&inode->i_lock); |
312 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS; | ||
313 | spin_unlock(&inode->i_lock); | ||
312 | nfs_end_data_update(inode); | 314 | nfs_end_data_update(inode); |
313 | dprintk("NFS reply setacl: %d\n", status); | 315 | dprintk("NFS reply setacl: %d\n", status); |
314 | 316 | ||
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 6f866b8aa2d5..6ceb1d471f20 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -140,7 +140,9 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, | |||
140 | if (rdata->res.eof != 0 || result == 0) | 140 | if (rdata->res.eof != 0 || result == 0) |
141 | break; | 141 | break; |
142 | } while (count); | 142 | } while (count); |
143 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 143 | spin_lock(&inode->i_lock); |
144 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
145 | spin_unlock(&inode->i_lock); | ||
144 | 146 | ||
145 | if (count) | 147 | if (count) |
146 | memclear_highpage_flush(page, rdata->args.pgbase, count); | 148 | memclear_highpage_flush(page, rdata->args.pgbase, count); |
@@ -473,7 +475,9 @@ void nfs_readpage_result(struct rpc_task *task) | |||
473 | } | 475 | } |
474 | task->tk_status = -EIO; | 476 | task->tk_status = -EIO; |
475 | } | 477 | } |
476 | NFS_FLAGS(data->inode) |= NFS_INO_INVALID_ATIME; | 478 | spin_lock(&data->inode->i_lock); |
479 | NFS_I(data->inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
480 | spin_unlock(&data->inode->i_lock); | ||
477 | data->complete(data, status); | 481 | data->complete(data, status); |
478 | } | 482 | } |
479 | 483 | ||
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 35f106599144..18dc95b0b646 100644 --- a/fs/nfs/symlink.c +++ b/fs/nfs/symlink.c | |||
@@ -27,26 +27,14 @@ | |||
27 | 27 | ||
28 | /* Symlink caching in the page cache is even more simplistic | 28 | /* Symlink caching in the page cache is even more simplistic |
29 | * and straight-forward than readdir caching. | 29 | * and straight-forward than readdir caching. |
30 | * | ||
31 | * At the beginning of the page we store pointer to struct page in question, | ||
32 | * simplifying nfs_put_link() (if inode got invalidated we can't find the page | ||
33 | * to be freed via pagecache lookup). | ||
34 | * The NUL-terminated string follows immediately thereafter. | ||
35 | */ | 30 | */ |
36 | 31 | ||
37 | struct nfs_symlink { | ||
38 | struct page *page; | ||
39 | char body[0]; | ||
40 | }; | ||
41 | |||
42 | static int nfs_symlink_filler(struct inode *inode, struct page *page) | 32 | static int nfs_symlink_filler(struct inode *inode, struct page *page) |
43 | { | 33 | { |
44 | const unsigned int pgbase = offsetof(struct nfs_symlink, body); | ||
45 | const unsigned int pglen = PAGE_SIZE - pgbase; | ||
46 | int error; | 34 | int error; |
47 | 35 | ||
48 | lock_kernel(); | 36 | lock_kernel(); |
49 | error = NFS_PROTO(inode)->readlink(inode, page, pgbase, pglen); | 37 | error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE); |
50 | unlock_kernel(); | 38 | unlock_kernel(); |
51 | if (error < 0) | 39 | if (error < 0) |
52 | goto error; | 40 | goto error; |
@@ -60,11 +48,10 @@ error: | |||
60 | return -EIO; | 48 | return -EIO; |
61 | } | 49 | } |
62 | 50 | ||
63 | static int nfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 51 | static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
64 | { | 52 | { |
65 | struct inode *inode = dentry->d_inode; | 53 | struct inode *inode = dentry->d_inode; |
66 | struct page *page; | 54 | struct page *page; |
67 | struct nfs_symlink *p; | ||
68 | void *err = ERR_PTR(nfs_revalidate_inode(NFS_SERVER(inode), inode)); | 55 | void *err = ERR_PTR(nfs_revalidate_inode(NFS_SERVER(inode), inode)); |
69 | if (err) | 56 | if (err) |
70 | goto read_failed; | 57 | goto read_failed; |
@@ -78,28 +65,20 @@ static int nfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
78 | err = ERR_PTR(-EIO); | 65 | err = ERR_PTR(-EIO); |
79 | goto getlink_read_error; | 66 | goto getlink_read_error; |
80 | } | 67 | } |
81 | p = kmap(page); | 68 | nd_set_link(nd, kmap(page)); |
82 | p->page = page; | 69 | return page; |
83 | nd_set_link(nd, p->body); | ||
84 | return 0; | ||
85 | 70 | ||
86 | getlink_read_error: | 71 | getlink_read_error: |
87 | page_cache_release(page); | 72 | page_cache_release(page); |
88 | read_failed: | 73 | read_failed: |
89 | nd_set_link(nd, err); | 74 | nd_set_link(nd, err); |
90 | return 0; | 75 | return NULL; |
91 | } | 76 | } |
92 | 77 | ||
93 | static void nfs_put_link(struct dentry *dentry, struct nameidata *nd) | 78 | static void nfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
94 | { | 79 | { |
95 | char *s = nd_get_link(nd); | 80 | if (cookie) { |
96 | if (!IS_ERR(s)) { | 81 | struct page *page = cookie; |
97 | struct nfs_symlink *p; | ||
98 | struct page *page; | ||
99 | |||
100 | p = container_of(s, struct nfs_symlink, body[0]); | ||
101 | page = p->page; | ||
102 | |||
103 | kunmap(page); | 82 | kunmap(page); |
104 | page_cache_release(page); | 83 | page_cache_release(page); |
105 | } | 84 | } |
diff --git a/fs/proc/base.c b/fs/proc/base.c index ace151fa4878..491f2d9f89ac 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -890,7 +890,7 @@ static struct file_operations proc_seccomp_operations = { | |||
890 | }; | 890 | }; |
891 | #endif /* CONFIG_SECCOMP */ | 891 | #endif /* CONFIG_SECCOMP */ |
892 | 892 | ||
893 | static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) | 893 | static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) |
894 | { | 894 | { |
895 | struct inode *inode = dentry->d_inode; | 895 | struct inode *inode = dentry->d_inode; |
896 | int error = -EACCES; | 896 | int error = -EACCES; |
@@ -907,7 +907,7 @@ static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
907 | error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); | 907 | error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); |
908 | nd->last_type = LAST_BIND; | 908 | nd->last_type = LAST_BIND; |
909 | out: | 909 | out: |
910 | return error; | 910 | return ERR_PTR(error); |
911 | } | 911 | } |
912 | 912 | ||
913 | static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, | 913 | static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, |
@@ -1692,11 +1692,11 @@ static int proc_self_readlink(struct dentry *dentry, char __user *buffer, | |||
1692 | return vfs_readlink(dentry,buffer,buflen,tmp); | 1692 | return vfs_readlink(dentry,buffer,buflen,tmp); |
1693 | } | 1693 | } |
1694 | 1694 | ||
1695 | static int proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | 1695 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) |
1696 | { | 1696 | { |
1697 | char tmp[30]; | 1697 | char tmp[30]; |
1698 | sprintf(tmp, "%d", current->tgid); | 1698 | sprintf(tmp, "%d", current->tgid); |
1699 | return vfs_follow_link(nd,tmp); | 1699 | return ERR_PTR(vfs_follow_link(nd,tmp)); |
1700 | } | 1700 | } |
1701 | 1701 | ||
1702 | static struct inode_operations proc_self_inode_operations = { | 1702 | static struct inode_operations proc_self_inode_operations = { |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 6c6315d04028..abe8920313fb 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -329,10 +329,10 @@ static void release_inode_number(unsigned int inum) | |||
329 | spin_unlock(&proc_inum_lock); | 329 | spin_unlock(&proc_inum_lock); |
330 | } | 330 | } |
331 | 331 | ||
332 | static int proc_follow_link(struct dentry *dentry, struct nameidata *nd) | 332 | static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) |
333 | { | 333 | { |
334 | nd_set_link(nd, PDE(dentry->d_inode)->data); | 334 | nd_set_link(nd, PDE(dentry->d_inode)->data); |
335 | return 0; | 335 | return NULL; |
336 | } | 336 | } |
337 | 337 | ||
338 | static struct inode_operations proc_link_inode_operations = { | 338 | static struct inode_operations proc_link_inode_operations = { |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index d9f614a57731..ff291c973a56 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1985,7 +1985,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1985 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking | 1985 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking |
1986 | * code really needs to be reworked, but this will take care of it | 1986 | * code really needs to be reworked, but this will take care of it |
1987 | * for now. -jeffm */ | 1987 | * for now. -jeffm */ |
1988 | if (REISERFS_I(dir)->i_acl_default) { | 1988 | if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { |
1989 | reiserfs_write_unlock_xattrs(dir->i_sb); | 1989 | reiserfs_write_unlock_xattrs(dir->i_sb); |
1990 | iput(inode); | 1990 | iput(inode); |
1991 | reiserfs_write_lock_xattrs(dir->i_sb); | 1991 | reiserfs_write_lock_xattrs(dir->i_sb); |
diff --git a/fs/smbfs/symlink.c b/fs/smbfs/symlink.c index 8b069e06433d..0c64bc3a0127 100644 --- a/fs/smbfs/symlink.c +++ b/fs/smbfs/symlink.c | |||
@@ -34,7 +34,7 @@ int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname) | |||
34 | return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname); | 34 | return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname); |
35 | } | 35 | } |
36 | 36 | ||
37 | static int smb_follow_link(struct dentry *dentry, struct nameidata *nd) | 37 | static void *smb_follow_link(struct dentry *dentry, struct nameidata *nd) |
38 | { | 38 | { |
39 | char *link = __getname(); | 39 | char *link = __getname(); |
40 | DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry)); | 40 | DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry)); |
@@ -52,10 +52,10 @@ static int smb_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
52 | } | 52 | } |
53 | } | 53 | } |
54 | nd_set_link(nd, link); | 54 | nd_set_link(nd, link); |
55 | return 0; | 55 | return NULL; |
56 | } | 56 | } |
57 | 57 | ||
58 | static void smb_put_link(struct dentry *dentry, struct nameidata *nd) | 58 | static void smb_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
59 | { | 59 | { |
60 | char *s = nd_get_link(nd); | 60 | char *s = nd_get_link(nd); |
61 | if (!IS_ERR(s)) | 61 | if (!IS_ERR(s)) |
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index fae57c83a722..de402fa915f2 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -151,17 +151,17 @@ static int sysfs_getlink(struct dentry *dentry, char * path) | |||
151 | 151 | ||
152 | } | 152 | } |
153 | 153 | ||
154 | static int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 154 | static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
155 | { | 155 | { |
156 | int error = -ENOMEM; | 156 | int error = -ENOMEM; |
157 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 157 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
158 | if (page) | 158 | if (page) |
159 | error = sysfs_getlink(dentry, (char *) page); | 159 | error = sysfs_getlink(dentry, (char *) page); |
160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); | 160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); |
161 | return 0; | 161 | return NULL; |
162 | } | 162 | } |
163 | 163 | ||
164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd) | 164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
165 | { | 165 | { |
166 | char *page = nd_get_link(nd); | 166 | char *page = nd_get_link(nd); |
167 | if (!IS_ERR(page)) | 167 | if (!IS_ERR(page)) |
diff --git a/fs/sysv/symlink.c b/fs/sysv/symlink.c index ed637db2dcb1..b85ce61d635c 100644 --- a/fs/sysv/symlink.c +++ b/fs/sysv/symlink.c | |||
@@ -8,10 +8,10 @@ | |||
8 | #include "sysv.h" | 8 | #include "sysv.h" |
9 | #include <linux/namei.h> | 9 | #include <linux/namei.h> |
10 | 10 | ||
11 | static int sysv_follow_link(struct dentry *dentry, struct nameidata *nd) | 11 | static void *sysv_follow_link(struct dentry *dentry, struct nameidata *nd) |
12 | { | 12 | { |
13 | nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data); | 13 | nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data); |
14 | return 0; | 14 | return NULL; |
15 | } | 15 | } |
16 | 16 | ||
17 | struct inode_operations sysv_fast_symlink_inode_operations = { | 17 | struct inode_operations sysv_fast_symlink_inode_operations = { |
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c index a0e49149098f..337512ed5781 100644 --- a/fs/ufs/symlink.c +++ b/fs/ufs/symlink.c | |||
@@ -29,11 +29,11 @@ | |||
29 | #include <linux/namei.h> | 29 | #include <linux/namei.h> |
30 | #include <linux/ufs_fs.h> | 30 | #include <linux/ufs_fs.h> |
31 | 31 | ||
32 | static int ufs_follow_link(struct dentry *dentry, struct nameidata *nd) | 32 | static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd) |
33 | { | 33 | { |
34 | struct ufs_inode_info *p = UFS_I(dentry->d_inode); | 34 | struct ufs_inode_info *p = UFS_I(dentry->d_inode); |
35 | nd_set_link(nd, (char*)p->i_u1.i_symlink); | 35 | nd_set_link(nd, (char*)p->i_u1.i_symlink); |
36 | return 0; | 36 | return NULL; |
37 | } | 37 | } |
38 | 38 | ||
39 | struct inode_operations ufs_fast_symlink_inode_operations = { | 39 | struct inode_operations ufs_fast_symlink_inode_operations = { |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 407e99359391..f252605514eb 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -374,7 +374,7 @@ linvfs_rename( | |||
374 | * we need to be very careful about how much stack we use. | 374 | * we need to be very careful about how much stack we use. |
375 | * uio is kmalloced for this reason... | 375 | * uio is kmalloced for this reason... |
376 | */ | 376 | */ |
377 | STATIC int | 377 | STATIC void * |
378 | linvfs_follow_link( | 378 | linvfs_follow_link( |
379 | struct dentry *dentry, | 379 | struct dentry *dentry, |
380 | struct nameidata *nd) | 380 | struct nameidata *nd) |
@@ -391,14 +391,14 @@ linvfs_follow_link( | |||
391 | link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL); | 391 | link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL); |
392 | if (!link) { | 392 | if (!link) { |
393 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | 393 | nd_set_link(nd, ERR_PTR(-ENOMEM)); |
394 | return 0; | 394 | return NULL; |
395 | } | 395 | } |
396 | 396 | ||
397 | uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); | 397 | uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); |
398 | if (!uio) { | 398 | if (!uio) { |
399 | kfree(link); | 399 | kfree(link); |
400 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | 400 | nd_set_link(nd, ERR_PTR(-ENOMEM)); |
401 | return 0; | 401 | return NULL; |
402 | } | 402 | } |
403 | 403 | ||
404 | vp = LINVFS_GET_VP(dentry->d_inode); | 404 | vp = LINVFS_GET_VP(dentry->d_inode); |
@@ -422,10 +422,10 @@ linvfs_follow_link( | |||
422 | kfree(uio); | 422 | kfree(uio); |
423 | 423 | ||
424 | nd_set_link(nd, link); | 424 | nd_set_link(nd, link); |
425 | return 0; | 425 | return NULL; |
426 | } | 426 | } |
427 | 427 | ||
428 | static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd) | 428 | static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
429 | { | 429 | { |
430 | char *s = nd_get_link(nd); | 430 | char *s = nd_get_link(nd); |
431 | if (!IS_ERR(s)) | 431 | if (!IS_ERR(s)) |
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h index 21e41c9b7267..e5374be86aef 100644 --- a/include/asm-ppc/ibm44x.h +++ b/include/asm-ppc/ibm44x.h | |||
@@ -423,11 +423,7 @@ | |||
423 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 | 423 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 |
424 | 424 | ||
425 | /* Internal SRAM Controller 440GX/440SP */ | 425 | /* Internal SRAM Controller 440GX/440SP */ |
426 | #ifdef CONFIG_440SP | ||
427 | #define DCRN_SRAM0_BASE 0x100 | ||
428 | #else /* 440GX */ | ||
429 | #define DCRN_SRAM0_BASE 0x000 | 426 | #define DCRN_SRAM0_BASE 0x000 |
430 | #endif | ||
431 | 427 | ||
432 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) | 428 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) |
433 | #define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) | 429 | #define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) |
diff --git a/include/asm-ppc/ppc4xx_dma.h b/include/asm-ppc/ppc4xx_dma.h index 8636cdbf6f8f..a415001165fa 100644 --- a/include/asm-ppc/ppc4xx_dma.h +++ b/include/asm-ppc/ppc4xx_dma.h | |||
@@ -285,7 +285,7 @@ typedef uint32_t sgl_handle_t; | |||
285 | 285 | ||
286 | #define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan)) | 286 | #define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan)) |
287 | 287 | ||
288 | #elif defined(CONFIG_STBXXX_DMA) /* stb03xxx */ | 288 | #elif defined(CONFIG_STB03xxx) /* stb03xxx */ |
289 | 289 | ||
290 | #define DMA_PPC4xx_SIZE 4096 | 290 | #define DMA_PPC4xx_SIZE 4096 |
291 | 291 | ||
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index 4e7701d6d23c..ea89e8f223ea 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -295,8 +295,14 @@ | |||
295 | #define __NR_add_key 285 | 295 | #define __NR_add_key 285 |
296 | #define __NR_request_key 286 | 296 | #define __NR_request_key 286 |
297 | #define __NR_keyctl 287 | 297 | #define __NR_keyctl 287 |
298 | #define __NR_ioprio_set 288 | ||
299 | #define __NR_ioprio_get 289 | ||
300 | #define __NR_inotify_init 290 | ||
301 | #define __NR_inotify_add_watch 291 | ||
302 | #define __NR_inotify_rm_watch 292 | ||
298 | 303 | ||
299 | #define NR_syscalls 288 | 304 | |
305 | #define NR_syscalls 293 | ||
300 | 306 | ||
301 | /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ | 307 | /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ |
302 | 308 | ||
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 95f0b130405c..2a1cfa404ea4 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -338,8 +338,13 @@ | |||
338 | #define __NR_add_key 313 | 338 | #define __NR_add_key 313 |
339 | #define __NR_request_key 314 | 339 | #define __NR_request_key 314 |
340 | #define __NR_keyctl 315 | 340 | #define __NR_keyctl 315 |
341 | #define __NR_ioprio_set 316 | ||
342 | #define __NR_ioprio_get 317 | ||
343 | #define __NR_inotify_init 318 | ||
344 | #define __NR_inotify_add_watch 319 | ||
345 | #define __NR_inotify_rm_watch 320 | ||
341 | 346 | ||
342 | #define NR_syscalls 316 | 347 | #define NR_syscalls 321 |
343 | 348 | ||
344 | /* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ | 349 | /* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ |
345 | 350 | ||
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h index 352d9943661a..c94d8b3991bd 100644 --- a/include/asm-sparc64/thread_info.h +++ b/include/asm-sparc64/thread_info.h | |||
@@ -68,6 +68,9 @@ struct thread_info { | |||
68 | 68 | ||
69 | struct restart_block restart_block; | 69 | struct restart_block restart_block; |
70 | 70 | ||
71 | struct pt_regs *kern_una_regs; | ||
72 | unsigned int kern_una_insn; | ||
73 | |||
71 | unsigned long fpregs[0] __attribute__ ((aligned(64))); | 74 | unsigned long fpregs[0] __attribute__ ((aligned(64))); |
72 | }; | 75 | }; |
73 | 76 | ||
@@ -103,6 +106,8 @@ struct thread_info { | |||
103 | #define TI_PCR 0x00000490 | 106 | #define TI_PCR 0x00000490 |
104 | #define TI_CEE_STUFF 0x00000498 | 107 | #define TI_CEE_STUFF 0x00000498 |
105 | #define TI_RESTART_BLOCK 0x000004a0 | 108 | #define TI_RESTART_BLOCK 0x000004a0 |
109 | #define TI_KUNA_REGS 0x000004c8 | ||
110 | #define TI_KUNA_INSN 0x000004d0 | ||
106 | #define TI_FPREGS 0x00000500 | 111 | #define TI_FPREGS 0x00000500 |
107 | 112 | ||
108 | /* We embed this in the uppermost byte of thread_info->flags */ | 113 | /* We embed this in the uppermost byte of thread_info->flags */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f9adf75fd9b4..67e6732d4fdc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -993,8 +993,8 @@ struct inode_operations { | |||
993 | int (*rename) (struct inode *, struct dentry *, | 993 | int (*rename) (struct inode *, struct dentry *, |
994 | struct inode *, struct dentry *); | 994 | struct inode *, struct dentry *); |
995 | int (*readlink) (struct dentry *, char __user *,int); | 995 | int (*readlink) (struct dentry *, char __user *,int); |
996 | int (*follow_link) (struct dentry *, struct nameidata *); | 996 | void * (*follow_link) (struct dentry *, struct nameidata *); |
997 | void (*put_link) (struct dentry *, struct nameidata *); | 997 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
998 | void (*truncate) (struct inode *); | 998 | void (*truncate) (struct inode *); |
999 | int (*permission) (struct inode *, int, struct nameidata *); | 999 | int (*permission) (struct inode *, int, struct nameidata *); |
1000 | int (*setattr) (struct dentry *, struct iattr *); | 1000 | int (*setattr) (struct dentry *, struct iattr *); |
@@ -1602,8 +1602,8 @@ extern struct file_operations generic_ro_fops; | |||
1602 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); | 1602 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); |
1603 | extern int vfs_follow_link(struct nameidata *, const char *); | 1603 | extern int vfs_follow_link(struct nameidata *, const char *); |
1604 | extern int page_readlink(struct dentry *, char __user *, int); | 1604 | extern int page_readlink(struct dentry *, char __user *, int); |
1605 | extern int page_follow_link_light(struct dentry *, struct nameidata *); | 1605 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
1606 | extern void page_put_link(struct dentry *, struct nameidata *); | 1606 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |
1607 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 1607 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
1608 | extern struct inode_operations page_symlink_inode_operations; | 1608 | extern struct inode_operations page_symlink_inode_operations; |
1609 | extern int generic_readlink(struct dentry *, char __user *, int); | 1609 | extern int generic_readlink(struct dentry *, char __user *, int); |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 7d78a783c64a..9a6047ff1b25 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -112,7 +112,8 @@ struct nfs_inode { | |||
112 | /* | 112 | /* |
113 | * Various flags | 113 | * Various flags |
114 | */ | 114 | */ |
115 | unsigned int flags; | 115 | unsigned long flags; /* atomic bit ops */ |
116 | unsigned long cache_validity; /* bit mask */ | ||
116 | 117 | ||
117 | /* | 118 | /* |
118 | * read_cache_jiffies is when we started read-caching this inode, | 119 | * read_cache_jiffies is when we started read-caching this inode, |
@@ -174,8 +175,6 @@ struct nfs_inode { | |||
174 | /* Open contexts for shared mmap writes */ | 175 | /* Open contexts for shared mmap writes */ |
175 | struct list_head open_files; | 176 | struct list_head open_files; |
176 | 177 | ||
177 | wait_queue_head_t nfs_i_wait; | ||
178 | |||
179 | #ifdef CONFIG_NFS_V4 | 178 | #ifdef CONFIG_NFS_V4 |
180 | struct nfs4_cached_acl *nfs4_acl; | 179 | struct nfs4_cached_acl *nfs4_acl; |
181 | /* NFSv4 state */ | 180 | /* NFSv4 state */ |
@@ -188,17 +187,21 @@ struct nfs_inode { | |||
188 | }; | 187 | }; |
189 | 188 | ||
190 | /* | 189 | /* |
191 | * Legal inode flag values | 190 | * Cache validity bit flags |
192 | */ | 191 | */ |
193 | #define NFS_INO_STALE 0x0001 /* possible stale inode */ | 192 | #define NFS_INO_INVALID_ATTR 0x0001 /* cached attrs are invalid */ |
194 | #define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */ | 193 | #define NFS_INO_INVALID_DATA 0x0002 /* cached data is invalid */ |
195 | #define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */ | 194 | #define NFS_INO_INVALID_ATIME 0x0004 /* cached atime is invalid */ |
196 | #define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */ | 195 | #define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ |
197 | #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ | 196 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ |
198 | #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ | 197 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ |
199 | #define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ | 198 | |
200 | #define NFS_INO_INVALID_ACL 0x0080 /* cached acls are invalid */ | 199 | /* |
201 | #define NFS_INO_REVAL_PAGECACHE 0x1000 /* must revalidate pagecache */ | 200 | * Bit offsets in flags field |
201 | */ | ||
202 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ | ||
203 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | ||
204 | #define NFS_INO_STALE (2) /* possible stale inode */ | ||
202 | 205 | ||
203 | static inline struct nfs_inode *NFS_I(struct inode *inode) | 206 | static inline struct nfs_inode *NFS_I(struct inode *inode) |
204 | { | 207 | { |
@@ -224,8 +227,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode) | |||
224 | #define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) | 227 | #define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) |
225 | 228 | ||
226 | #define NFS_FLAGS(inode) (NFS_I(inode)->flags) | 229 | #define NFS_FLAGS(inode) (NFS_I(inode)->flags) |
227 | #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING) | 230 | #define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode))) |
228 | #define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE) | ||
229 | 231 | ||
230 | #define NFS_FILEID(inode) (NFS_I(inode)->fileid) | 232 | #define NFS_FILEID(inode) (NFS_I(inode)->fileid) |
231 | 233 | ||
@@ -236,8 +238,11 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
236 | 238 | ||
237 | static inline void NFS_CACHEINV(struct inode *inode) | 239 | static inline void NFS_CACHEINV(struct inode *inode) |
238 | { | 240 | { |
239 | if (!nfs_caches_unstable(inode)) | 241 | if (!nfs_caches_unstable(inode)) { |
240 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | 242 | spin_lock(&inode->i_lock); |
243 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
244 | spin_unlock(&inode->i_lock); | ||
245 | } | ||
241 | } | 246 | } |
242 | 247 | ||
243 | static inline int nfs_server_capable(struct inode *inode, int cap) | 248 | static inline int nfs_server_capable(struct inode *inode, int cap) |
@@ -247,7 +252,7 @@ static inline int nfs_server_capable(struct inode *inode, int cap) | |||
247 | 252 | ||
248 | static inline int NFS_USE_READDIRPLUS(struct inode *inode) | 253 | static inline int NFS_USE_READDIRPLUS(struct inode *inode) |
249 | { | 254 | { |
250 | return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS; | 255 | return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
251 | } | 256 | } |
252 | 257 | ||
253 | /** | 258 | /** |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 51e61e96051c..927ed487630d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -881,7 +881,7 @@ | |||
881 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e | 881 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e |
882 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 | 882 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 |
883 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 | 883 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 |
884 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 | 884 | #define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 |
885 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 | 885 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 |
886 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b | 886 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b |
887 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e | 887 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e |
@@ -1580,6 +1580,7 @@ | |||
1580 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 | 1580 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 |
1581 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 | 1581 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 |
1582 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1582 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
1583 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 | ||
1583 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 | 1584 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 |
1584 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 | 1585 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 |
1585 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB | 1586 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB |
@@ -2184,6 +2185,9 @@ | |||
2184 | #define PCI_VENDOR_ID_SIBYTE 0x166d | 2185 | #define PCI_VENDOR_ID_SIBYTE 0x166d |
2185 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 | 2186 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 |
2186 | 2187 | ||
2188 | #define PCI_VENDOR_ID_NETCELL 0x169c | ||
2189 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | ||
2190 | |||
2187 | #define PCI_VENDOR_ID_LINKSYS 0x1737 | 2191 | #define PCI_VENDOR_ID_LINKSYS 0x1737 |
2188 | #define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 | 2192 | #define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 |
2189 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 | 2193 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 |
diff --git a/kernel/sched.c b/kernel/sched.c index a646e4f36c41..5f889d0cbfcc 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3378,8 +3378,8 @@ EXPORT_SYMBOL(set_user_nice); | |||
3378 | */ | 3378 | */ |
3379 | int can_nice(const task_t *p, const int nice) | 3379 | int can_nice(const task_t *p, const int nice) |
3380 | { | 3380 | { |
3381 | /* convert nice value [19,-20] to rlimit style value [0,39] */ | 3381 | /* convert nice value [19,-20] to rlimit style value [1,40] */ |
3382 | int nice_rlim = 19 - nice; | 3382 | int nice_rlim = 20 - nice; |
3383 | return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || | 3383 | return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || |
3384 | capable(CAP_SYS_NICE)); | 3384 | capable(CAP_SYS_NICE)); |
3385 | } | 3385 | } |
diff --git a/mm/shmem.c b/mm/shmem.c index e64fa726a790..5a81b1ee4f7a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -1773,32 +1773,27 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s | |||
1773 | return 0; | 1773 | return 0; |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | static int shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) | 1776 | static void *shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) |
1777 | { | 1777 | { |
1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); | 1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); |
1779 | return 0; | 1779 | return NULL; |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd) | 1782 | static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd) |
1783 | { | 1783 | { |
1784 | struct page *page = NULL; | 1784 | struct page *page = NULL; |
1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); | 1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); |
1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); | 1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); |
1787 | return 0; | 1787 | return page; |
1788 | } | 1788 | } |
1789 | 1789 | ||
1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd) | 1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
1791 | { | 1791 | { |
1792 | if (!IS_ERR(nd_get_link(nd))) { | 1792 | if (!IS_ERR(nd_get_link(nd))) { |
1793 | struct page *page; | 1793 | struct page *page = cookie; |
1794 | |||
1795 | page = find_get_page(dentry->d_inode->i_mapping, 0); | ||
1796 | if (!page) | ||
1797 | BUG(); | ||
1798 | kunmap(page); | 1794 | kunmap(page); |
1799 | mark_page_accessed(page); | 1795 | mark_page_accessed(page); |
1800 | page_cache_release(page); | 1796 | page_cache_release(page); |
1801 | page_cache_release(page); | ||
1802 | } | 1797 | } |
1803 | } | 1798 | } |
1804 | 1799 | ||
diff --git a/net/802/tr.c b/net/802/tr.c index a755e880f4ba..1bb7dc1b85cd 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -251,10 +251,11 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device * | |||
251 | unsigned int hash; | 251 | unsigned int hash; |
252 | struct rif_cache *entry; | 252 | struct rif_cache *entry; |
253 | unsigned char *olddata; | 253 | unsigned char *olddata; |
254 | unsigned long flags; | ||
254 | static const unsigned char mcast_func_addr[] | 255 | static const unsigned char mcast_func_addr[] |
255 | = {0xC0,0x00,0x00,0x04,0x00,0x00}; | 256 | = {0xC0,0x00,0x00,0x04,0x00,0x00}; |
256 | 257 | ||
257 | spin_lock_bh(&rif_lock); | 258 | spin_lock_irqsave(&rif_lock, flags); |
258 | 259 | ||
259 | /* | 260 | /* |
260 | * Broadcasts are single route as stated in RFC 1042 | 261 | * Broadcasts are single route as stated in RFC 1042 |
@@ -323,7 +324,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], | |||
323 | else | 324 | else |
324 | slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8); | 325 | slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8); |
325 | olddata = skb->data; | 326 | olddata = skb->data; |
326 | spin_unlock_bh(&rif_lock); | 327 | spin_unlock_irqrestore(&rif_lock, flags); |
327 | 328 | ||
328 | skb_pull(skb, slack); | 329 | skb_pull(skb, slack); |
329 | memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack); | 330 | memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack); |
@@ -337,10 +338,11 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], | |||
337 | static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev) | 338 | static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev) |
338 | { | 339 | { |
339 | unsigned int hash, rii_p = 0; | 340 | unsigned int hash, rii_p = 0; |
341 | unsigned long flags; | ||
340 | struct rif_cache *entry; | 342 | struct rif_cache *entry; |
341 | 343 | ||
342 | 344 | ||
343 | spin_lock_bh(&rif_lock); | 345 | spin_lock_irqsave(&rif_lock, flags); |
344 | 346 | ||
345 | /* | 347 | /* |
346 | * Firstly see if the entry exists | 348 | * Firstly see if the entry exists |
@@ -378,7 +380,7 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
378 | if(!entry) | 380 | if(!entry) |
379 | { | 381 | { |
380 | printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n"); | 382 | printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n"); |
381 | spin_unlock_bh(&rif_lock); | 383 | spin_unlock_irqrestore(&rif_lock, flags); |
382 | return; | 384 | return; |
383 | } | 385 | } |
384 | 386 | ||
@@ -420,7 +422,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
420 | } | 422 | } |
421 | entry->last_used=jiffies; | 423 | entry->last_used=jiffies; |
422 | } | 424 | } |
423 | spin_unlock_bh(&rif_lock); | 425 | spin_unlock_irqrestore(&rif_lock, flags); |
424 | } | 426 | } |
425 | 427 | ||
426 | /* | 428 | /* |
@@ -430,9 +432,9 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
430 | static void rif_check_expire(unsigned long dummy) | 432 | static void rif_check_expire(unsigned long dummy) |
431 | { | 433 | { |
432 | int i; | 434 | int i; |
433 | unsigned long next_interval = jiffies + sysctl_tr_rif_timeout/2; | 435 | unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2; |
434 | 436 | ||
435 | spin_lock_bh(&rif_lock); | 437 | spin_lock_irqsave(&rif_lock, flags); |
436 | 438 | ||
437 | for(i =0; i < RIF_TABLE_SIZE; i++) { | 439 | for(i =0; i < RIF_TABLE_SIZE; i++) { |
438 | struct rif_cache *entry, **pentry; | 440 | struct rif_cache *entry, **pentry; |
@@ -454,7 +456,7 @@ static void rif_check_expire(unsigned long dummy) | |||
454 | } | 456 | } |
455 | } | 457 | } |
456 | 458 | ||
457 | spin_unlock_bh(&rif_lock); | 459 | spin_unlock_irqrestore(&rif_lock, flags); |
458 | 460 | ||
459 | mod_timer(&rif_timer, next_interval); | 461 | mod_timer(&rif_timer, next_interval); |
460 | 462 | ||
@@ -485,7 +487,7 @@ static struct rif_cache *rif_get_idx(loff_t pos) | |||
485 | 487 | ||
486 | static void *rif_seq_start(struct seq_file *seq, loff_t *pos) | 488 | static void *rif_seq_start(struct seq_file *seq, loff_t *pos) |
487 | { | 489 | { |
488 | spin_lock_bh(&rif_lock); | 490 | spin_lock_irq(&rif_lock); |
489 | 491 | ||
490 | return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN; | 492 | return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN; |
491 | } | 493 | } |
@@ -516,7 +518,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
516 | 518 | ||
517 | static void rif_seq_stop(struct seq_file *seq, void *v) | 519 | static void rif_seq_stop(struct seq_file *seq, void *v) |
518 | { | 520 | { |
519 | spin_unlock_bh(&rif_lock); | 521 | spin_unlock_irq(&rif_lock); |
520 | } | 522 | } |
521 | 523 | ||
522 | static int rif_seq_show(struct seq_file *seq, void *v) | 524 | static int rif_seq_show(struct seq_file *seq, void *v) |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 3d78464f64ea..badfc5849973 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, | |||
349 | { | 349 | { |
350 | struct sk_buff *skb; | 350 | struct sk_buff *skb; |
351 | 351 | ||
352 | ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, | 352 | if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, |
353 | icmp_param->data_len+icmp_param->head_len, | 353 | icmp_param->data_len+icmp_param->head_len, |
354 | icmp_param->head_len, | 354 | icmp_param->head_len, |
355 | ipc, rt, MSG_DONTWAIT); | 355 | ipc, rt, MSG_DONTWAIT) < 0) |
356 | 356 | ip_flush_pending_frames(icmp_socket->sk); | |
357 | if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { | 357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { |
358 | struct icmphdr *icmph = skb->h.icmph; | 358 | struct icmphdr *icmph = skb->h.icmph; |
359 | unsigned int csum = 0; | 359 | unsigned int csum = 0; |
360 | struct sk_buff *skb1; | 360 | struct sk_buff *skb1; |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 2065944fd9e5..7ded6e60f43a 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -358,7 +358,7 @@ static struct crypto_tfm **ipcomp_alloc_tfms(const char *alg_name) | |||
358 | int cpu; | 358 | int cpu; |
359 | 359 | ||
360 | /* This can be any valid CPU ID so we don't need locking. */ | 360 | /* This can be any valid CPU ID so we don't need locking. */ |
361 | cpu = smp_processor_id(); | 361 | cpu = raw_smp_processor_id(); |
362 | 362 | ||
363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { | 363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { |
364 | struct crypto_tfm *tfm; | 364 | struct crypto_tfm *tfm; |
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index ada9911118e9..94a0ce1c1c9d 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c | |||
@@ -61,16 +61,20 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
61 | if (!tcph) | 61 | if (!tcph) |
62 | return 0; | 62 | return 0; |
63 | 63 | ||
64 | if (!(einfo->operation & IPT_ECN_OP_SET_ECE | 64 | if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) || |
65 | || tcph->ece == einfo->proto.tcp.ece) | 65 | tcph->ece == einfo->proto.tcp.ece) && |
66 | && (!(einfo->operation & IPT_ECN_OP_SET_CWR | 66 | ((!(einfo->operation & IPT_ECN_OP_SET_CWR) || |
67 | || tcph->cwr == einfo->proto.tcp.cwr))) | 67 | tcph->cwr == einfo->proto.tcp.cwr))) |
68 | return 1; | 68 | return 1; |
69 | 69 | ||
70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) | 70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) |
71 | return 0; | 71 | return 0; |
72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; | 72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; |
73 | 73 | ||
74 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
75 | skb_checksum_help(*pskb, inward)) | ||
76 | return 0; | ||
77 | |||
74 | diffs[0] = ((u_int16_t *)tcph)[6]; | 78 | diffs[0] = ((u_int16_t *)tcph)[6]; |
75 | if (einfo->operation & IPT_ECN_OP_SET_ECE) | 79 | if (einfo->operation & IPT_ECN_OP_SET_ECE) |
76 | tcph->ece = einfo->proto.tcp.ece; | 80 | tcph->ece = einfo->proto.tcp.ece; |
@@ -79,13 +83,10 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
79 | diffs[1] = ((u_int16_t *)tcph)[6]; | 83 | diffs[1] = ((u_int16_t *)tcph)[6]; |
80 | diffs[0] = diffs[0] ^ 0xFFFF; | 84 | diffs[0] = diffs[0] ^ 0xFFFF; |
81 | 85 | ||
82 | if ((*pskb)->ip_summed != CHECKSUM_HW) | 86 | if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY) |
83 | tcph->check = csum_fold(csum_partial((char *)diffs, | 87 | tcph->check = csum_fold(csum_partial((char *)diffs, |
84 | sizeof(diffs), | 88 | sizeof(diffs), |
85 | tcph->check^0xFFFF)); | 89 | tcph->check^0xFFFF)); |
86 | else | ||
87 | if (skb_checksum_help(*pskb, inward)) | ||
88 | return 0; | ||
89 | (*pskb)->nfcache |= NFC_ALTERED; | 90 | (*pskb)->nfcache |= NFC_ALTERED; |
90 | return 1; | 91 | return 1; |
91 | } | 92 | } |
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c index 1049050b2bfb..7b84a254440e 100644 --- a/net/ipv4/netfilter/ipt_TCPMSS.c +++ b/net/ipv4/netfilter/ipt_TCPMSS.c | |||
@@ -61,6 +61,10 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) | 61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) |
62 | return NF_DROP; | 62 | return NF_DROP; |
63 | 63 | ||
64 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
65 | skb_checksum_help(*pskb, out == NULL)) | ||
66 | return NF_DROP; | ||
67 | |||
64 | iph = (*pskb)->nh.iph; | 68 | iph = (*pskb)->nh.iph; |
65 | tcplen = (*pskb)->len - iph->ihl*4; | 69 | tcplen = (*pskb)->len - iph->ihl*4; |
66 | 70 | ||
@@ -186,9 +190,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
186 | newmss); | 190 | newmss); |
187 | 191 | ||
188 | retmodified: | 192 | retmodified: |
189 | /* We never hw checksum SYN packets. */ | ||
190 | BUG_ON((*pskb)->ip_summed == CHECKSUM_HW); | ||
191 | |||
192 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; | 193 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; |
193 | return IPT_CONTINUE; | 194 | return IPT_CONTINUE; |
194 | } | 195 | } |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 423feb46ccc0..135383ef538f 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -354,7 +354,7 @@ static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name) | |||
354 | int cpu; | 354 | int cpu; |
355 | 355 | ||
356 | /* This can be any valid CPU ID so we don't need locking. */ | 356 | /* This can be any valid CPU ID so we don't need locking. */ |
357 | cpu = smp_processor_id(); | 357 | cpu = raw_smp_processor_id(); |
358 | 358 | ||
359 | list_for_each_entry(pos, &ipcomp6_tfms_list, list) { | 359 | list_for_each_entry(pos, &ipcomp6_tfms_list, list) { |
360 | struct crypto_tfm *tfm; | 360 | struct crypto_tfm *tfm; |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9b9f94c915d2..09ffca54b373 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -359,11 +359,16 @@ handle_modversions(struct module *mod, struct elf_info *info, | |||
359 | /* ignore __this_module, it will be resolved shortly */ | 359 | /* ignore __this_module, it will be resolved shortly */ |
360 | if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0) | 360 | if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0) |
361 | break; | 361 | break; |
362 | #ifdef STT_REGISTER | 362 | /* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */ |
363 | #if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER) | ||
364 | /* add compatibility with older glibc */ | ||
365 | #ifndef STT_SPARC_REGISTER | ||
366 | #define STT_SPARC_REGISTER STT_REGISTER | ||
367 | #endif | ||
363 | if (info->hdr->e_machine == EM_SPARC || | 368 | if (info->hdr->e_machine == EM_SPARC || |
364 | info->hdr->e_machine == EM_SPARCV9) { | 369 | info->hdr->e_machine == EM_SPARCV9) { |
365 | /* Ignore register directives. */ | 370 | /* Ignore register directives. */ |
366 | if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER) | 371 | if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) |
367 | break; | 372 | break; |
368 | } | 373 | } |
369 | #endif | 374 | #endif |