diff options
32 files changed, 314 insertions, 175 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/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/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/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/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/nfs/dir.c b/fs/nfs/dir.c index b38a57e78a63..147cbf9261ce 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); |
@@ -1575,11 +1579,12 @@ out: | |||
1575 | 1579 | ||
1576 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) | 1580 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) |
1577 | { | 1581 | { |
1578 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1582 | struct nfs_inode *nfsi = NFS_I(inode); |
1583 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1579 | 1584 | ||
1580 | if (cache->cred != cred | 1585 | if (cache->cred != cred |
1581 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) | 1586 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) |
1582 | || (NFS_FLAGS(inode) & NFS_INO_INVALID_ACCESS)) | 1587 | || (nfsi->cache_validity & NFS_INO_INVALID_ACCESS)) |
1583 | return -ENOENT; | 1588 | return -ENOENT; |
1584 | memcpy(res, cache, sizeof(*res)); | 1589 | memcpy(res, cache, sizeof(*res)); |
1585 | return 0; | 1590 | return 0; |
@@ -1587,14 +1592,18 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs | |||
1587 | 1592 | ||
1588 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) | 1593 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) |
1589 | { | 1594 | { |
1590 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1595 | struct nfs_inode *nfsi = NFS_I(inode); |
1596 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1591 | 1597 | ||
1592 | if (cache->cred != set->cred) { | 1598 | if (cache->cred != set->cred) { |
1593 | if (cache->cred) | 1599 | if (cache->cred) |
1594 | put_rpccred(cache->cred); | 1600 | put_rpccred(cache->cred); |
1595 | cache->cred = get_rpccred(set->cred); | 1601 | cache->cred = get_rpccred(set->cred); |
1596 | } | 1602 | } |
1597 | NFS_FLAGS(inode) &= ~NFS_INO_INVALID_ACCESS; | 1603 | /* FIXME: replace current access_cache BKL reliance with inode->i_lock */ |
1604 | spin_lock(&inode->i_lock); | ||
1605 | nfsi->cache_validity &= ~NFS_INO_INVALID_ACCESS; | ||
1606 | spin_unlock(&inode->i_lock); | ||
1598 | cache->jiffies = set->jiffies; | 1607 | cache->jiffies = set->jiffies; |
1599 | cache->mask = set->mask; | 1608 | cache->mask = set->mask; |
1600 | } | 1609 | } |
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/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/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/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/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/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/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; |