GIT 12074a35b4ef36d7a971beaf42412b22f304cdd1 master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git commit 49c91fb01ff3948285608c65754b3ffbf57d50f2 Author: Trond Myklebust Date: Tue Nov 29 19:27:22 2005 -0500 [PATCH] VM: Fix typos in get_locked_pte Signed-off-by: Trond Myklebust Signed-off-by: Linus Torvalds commit 34a0b3cdc078746788ffc49e56da0db62b8b6ea4 Author: Adrian Bunk Date: Tue Nov 29 16:28:56 2005 -0800 [IPV6]: make two functions static This patch makes two needlessly global functions static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller commit d127e94a5cf1c9c996b8c67cd2595b96c3e35e4c Author: Adrian Bunk Date: Tue Nov 29 16:28:18 2005 -0800 [NETFILTER] ipv4: small cleanups This patch contains the following cleanups: - make needlessly global code static - ip_conntrack_core.c: ip_conntrack_flush() -> ip_conntrack_flush(void) Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller commit 4b30b1c6a3e58dc74f2dbb0aa39f16a23cfcdd56 Author: Adrian Bunk Date: Tue Nov 29 16:27:20 2005 -0800 [IPV4]: make two functions static This patch makes two needlessly global functions static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller commit 9b5b5cff9a6655dbb6d2e2be365bb95eec3950eb Author: Arjan van de Ven Date: Tue Nov 29 16:21:38 2005 -0800 [NET]: Add const markers to various variables. the patch below marks various variables const in net/; the goal is to move them to the .rodata section so that they can't false-share cachelines with things that get written to, as well as potentially helping gcc a bit with optimisations. (these were found using a gcc patch to warn about such variables) Signed-off-by: Arjan van de Ven Signed-off-by: David S. Miller commit fb29644994744a63bc57186cefa79534b5d9b5a9 Author: Chas Williams Date: Tue Nov 29 16:17:11 2005 -0800 [ATM]: [adummy] dummy ATM driver (similar to net/dummy) Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit 64bf69ddff7637b7ed7acf9b2a823cc0ee519439 Author: Stanislaw Gruszka Date: Tue Nov 29 16:16:41 2005 -0800 [ATM]: deregistration removes device from atm_devs list immediately atm_dev_deregister() removes device from atm_dev list immediately to prevent operations on a phantom device. Decision to free device based only on ->refcnt now. Remove shutdown_atm_dev() use atm_dev_deregister() instead. atm_dev_deregister() also asynchronously releases all vccs related to device. Signed-off-by: Stanislaw Gruszka Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit aaaaaadbe7a663d110814db50fcbe7d320eb4c32 Author: Stanislaw Gruszka Date: Tue Nov 29 16:16:21 2005 -0800 [ATM]: avoid race conditions related to atm_devs list Use semaphore to protect atm_devs list, as no one need access to it from interrupt context. Avoid race conditions between atm_dev_register(), atm_dev_lookup() and atm_dev_deregister(). Fix double spin_unlock() bug. Signed-off-by: Stanislaw Gruszka Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit 49693280262a149e5430d3401e263e464c88334a Author: Mitchell Blank Jr Date: Tue Nov 29 16:15:59 2005 -0800 [ATM]: [lanai] kill lanai_ioctl() which just contains some old debugging code Signed-off-by: Mitchell Blank Jr Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit 5045b6d34c6a9efa4a8a1815265ca9fcf44d6a7c Author: Chas Williams Date: Tue Nov 29 16:15:38 2005 -0800 [ATM]: linux/config.h only needed for #ifdef __KERNEL__ section Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit 50accc9c428273501dd2a6295c84a533dd1fe645 Author: Mitchell Blank Jr Date: Tue Nov 29 16:15:18 2005 -0800 [ATM]: attempt to autoload atm drivers From: Mitchell Blank Jr Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit e91a73568b19b4a8145fc6e05314d522ee35a0b1 Author: Jan Pieter Date: Tue Nov 29 16:14:58 2005 -0800 [ATM]: drivers/atm/atmdev_init.c no longer necessary From: Jan Pieter Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit fd22f1e037be33040f5583fe091d39d1e632e183 Author: Dave Jones Date: Tue Nov 29 16:14:33 2005 -0800 [ATM]: [lanai] lanai missing unregister Signed-off-by: Dave Jones Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit c22c28f69b1e28505bd0d26bd0f64554a9e66fe8 Author: Mitchell Blank Jr Date: Tue Nov 29 16:14:12 2005 -0800 [ATM]: [lanai] better constification Signed-off-by: Mitchell Blank Jr Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit c219750b2e667f4f79f4d8faca5057dad793db87 Author: Mitchell Blank Jr Date: Tue Nov 29 16:13:55 2005 -0800 [ATM]: atm_pcr_goal() doesn't modify its argument's contents -- mark it as const Signed-off-by: Mitchell Blank Jr Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit c9933d0856d6d0ede6b4b30e5e7330614f5203af Author: Mitchell Blank Jr Date: Tue Nov 29 16:13:32 2005 -0800 [ATM]: always return the first interface for ATM_ITF_ANY From: Mitchell Blank Jr Signed-off-by: Chas Williams Signed-off-by: David S. Miller commit 18955cfcb2a5d75a08e0cb297f13ccfb6904de48 Author: Mike Stroyan Date: Tue Nov 29 16:12:55 2005 -0800 [IPV4] tcp/route: Another look at hash table sizes The tcp_ehash hash table gets too big on systems with really big memory. It is worse on systems with pages larger than 4KB. It wastes memory that could be better used. It also makes the netstat command slow because reading /proc/net/tcp and /proc/net/tcp6 needs to go through the full hash table. The default value should not be larger for larger page sizes. It seems that the effect of page size is an unintended error dating back a long time. I also wonder if the default value really should be a larger fraction of memory for systems with more memory. While systems with really big ram can afford more space for hash tables, it is not clear to me that they benefit from increasing the allocation ratio for this table. The amount of memory allocated is determined by net/ipv4/tcp.c:tcp_init and mm/page_alloc.c:alloc_large_system_hash. tcp_init calls alloc_large_system_hash passing parameters- bucketsize=sizeof(struct tcp_ehash_bucket) numentries=thash_entries scale=(num_physpages >= 128 * 1024) ? (25-PAGE_SHIFT) : (27-PAGE_SHIFT) limit=0 On i386, PAGE_SHIFT is 12 for a page size of 4K On ia64, PAGE_SHIFT defaults to 14 for a page size of 16K The num_physpages test above makes the allocation take a larger fraction of the total memory on systems with larger memory. The threshold size for a i386 system is 512MB. For an ia64 system with 16KB pages the threshold is 2GB. For smaller memory systems- On i386, scale = (27 - 12) = 15 On ia64, scale = (27 - 14) = 13 For larger memory systems- On i386, scale = (25 - 12) = 13 On ia64, scale = (25 - 14) = 11 For the rest of this discussion, I'll just track the larger memory case. The default behavior has numentries=thash_entries=0, so the allocated size is determined by either scale or by the default limit of 1/16 of total memory. In alloc_large_system_hash- | numentries = (flags & HASH_HIGHMEM) ? nr_all_pages : nr_kernel_pages; | numentries += (1UL << (20 - PAGE_SHIFT)) - 1; | numentries >>= 20 - PAGE_SHIFT; | numentries <<= 20 - PAGE_SHIFT; At this point, numentries is pages for all of memory, rounded up to the nearest megabyte boundary. | /* limit to 1 bucket per 2^scale bytes of low memory */ | if (scale > PAGE_SHIFT) | numentries >>= (scale - PAGE_SHIFT); | else | numentries <<= (PAGE_SHIFT - scale); On i386, numentries >>= (13 - 12), so numentries is 1/8196 of bytes of total memory. On ia64, numentries <<= (14 - 11), so numentries is 1/2048 of bytes of total memory. | log2qty = long_log2(numentries); | | do { | size = bucketsize << log2qty; bucketsize is 16, so size is 16 times numentries, rounded down to a power of two. On i386, size is 1/512 of bytes of total memory. On ia64, size is 1/128 of bytes of total memory. For smaller systems the results are On i386, size is 1/2048 of bytes of total memory. On ia64, size is 1/512 of bytes of total memory. The large page effect can be removed by just replacing the use of PAGE_SHIFT with a constant of 12 in the calls to alloc_large_system_hash. That makes them more like the other uses of that function from fs/inode.c and fs/dcache.c Signed-off-by: David S. Miller commit f747307ed1defcdfd37a3ef84c48e3138691cd26 Author: Linus Torvalds Date: Tue Nov 29 14:21:57 2005 -0800 Revert "[PATCH] drivers/message/fusion/mptbase.c: make code static" This reverts commit 252ac865535e1ea9cc2d28be83f477d8d8b961a2. It impacts the LSI customers using the mptstm target mode drivers (source tar-ball at ftp://ftp.lsil.com/HostAdapterDrivers/linux/Fusion-MPT/mptstm-1.00.13-src.tar.gz for those who care). Signed-off-by: Linus Torvalds commit 325f04dbca60a4cfe4ac25e7cf246edd07eb4c5f Author: Hugh Dickins Date: Tue Nov 29 16:55:48 2005 +0000 [PATCH] pfnmap: do_no_page BUG_ON again Use copy_user_highpage directly instead of cow_user_page in do_no_page: in the immediately following page_cache_release, and elsewhere, it is assuming that new_page is normal. If any VM_PFNMAP driver can get to do_no_page, it's just a BUG (but not in the case of do_anonymous_page). Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds commit e5bbe4dfc8dbfc50ef89f8641e020616d4d1e69e Author: Hugh Dickins Date: Tue Nov 29 16:54:51 2005 +0000 [PATCH] pfnmap: remove src_page from do_wp_page Clean away do_wp_page's "src_page": cow_user_page makes it unnecessary. Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds commit 5d2a2dbbc1025dbf7998b9289574d9592b8f21cc Author: Linus Torvalds Date: Tue Nov 29 14:07:55 2005 -0800 cow_user_page: fix page alignment High Dickins points out that the user virtual address passed to the page fault handler isn't necessarily page-aligned. Also, add a comment on why the copy could fail for the user address case. Signed-off-by: Linus Torvalds commit c9cfcddfd65735437a4cb8563d6b66a6da8a5ed6 Author: Linus Torvalds Date: Tue Nov 29 14:03:14 2005 -0800 VM: add common helper function to create the page tables This logic was duplicated four times, for no good reason. Signed-off-by: Linus Torvalds commit cab3f16febeaf1a60e38159ff578f609f9976544 Author: David S. Miller Date: Tue Nov 29 13:59:03 2005 -0800 [SPARC64]: Fix >8K I/O mappings. Increment the PFN field of the PTE so that the tests on vm_pfn in mm/memory.c match up. The TLB ignores these lower bits for larger page sizes, so it's OK to set things like this. Signed-off-by: David S. Miller commit 238f9b063dcc9f23493a0d3fecca29fe332d4905 Author: Christoph Hellwig Date: Tue Nov 29 21:36:16 2005 +0100 [PATCH] fix megaraid.c locking This fixes locking in megaraid.c, namely: (1) make sure megaraid_queue release the adapter lock by changing the code to have a single return (2) remove the errornous scsi_assign_lock call Testing by Burton Windle. Signed-off-by: Christoph Hellwig Acked-by: Burton Windle Signed-off-by: Linus Torvalds commit 238f58d898df941aa9d1cb390fb27ff4febe8965 Author: Linus Torvalds Date: Tue Nov 29 13:01:56 2005 -0800 Support strange discontiguous PFN remappings These get created by some drivers that don't generally even want a pfn remapping at all, but would really mostly prefer to just map pages they've allocated individually instead. For now, create a helper function that turns such an incomplete PFN remapping call into a loop that does that explicit mapping. In the long run we almost certainly want to export a totally different interface for that, though. Signed-off-by: Linus Torvalds commit eca351336acb2fa943611e0846562ce3997ef53b Author: Ben Collins Date: Tue Nov 29 11:45:26 2005 -0800 [PATCH] Fix missing pfn variables caused by vm changes I image this showed up because of "unused var..." when the changes occured, because flush_cache_page() is a noop in most places. This showed up for me on parisc however, where flush_cache_page() is a real function. Signed-off-by: Linus Torvalds commit 2b9175c174b83b8d97db9398efe948fa9092938f Author: Adrian Bunk Date: Tue Nov 29 14:49:38 2005 +0000 [MTD] Make functions static, include header files with prototypes This patch contains the following possible cleanups: - every file should #include the headers containing the prototypes for it's global functions - make needlessly global functions static Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner commit ee2d49de3e3a0b846ecedb36fec0e4a5ff222dcb Author: Richard Purdie Date: Tue Nov 29 14:28:31 2005 +0000 [MTD] chips: make sharps driver usable again Update the pre-CFI Sharp driver sharps.c so it compiles. map_read32 / map_write32 no longer exist in the kernel so the driver is totally broken as it stands. The replacement functions use different parameters resulting in the other changes. Change collie to use this driver until someone works out why the cfi driver fails on that machine. Signed-off-by: Richard Purdie Tested-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner commit 72af3b2c5a9946e78125e143b636f3d7217bcf08 Author: Thomas Gleixner Date: Mon Nov 28 22:36:12 2005 +0000 [MTD] Remove bogus PQ2FADS driver Remove disfunctional driver, which slipped through the review mechanism Signed-off-by: Thomas Gleixner commit e2602b347aa6f62b61754c5f65191ef67ffd0dc7 Author: Luiz Capitulino Date: Tue Nov 29 14:30:03 2005 +0000 [MTD] maps: sparse fixup The patch below fixes the following sparse warning: drivers/mtd/maps/nettel.c:482:27: warning: Using plain integer as NULL pointer Signed-off-by: Luiz Capitulino Signed-off-by: Thomas Gleixner commit 8bc3b3804a6123e634be26359558aa998102506a Author: Nicolas Pitre Date: Wed Nov 23 22:07:56 2005 +0000 [MTD] cfi_cmdset_0001: relax locking rules for multi hardware partition support Signed-off-by: Nicolas Pitre Signed-off-by: Thomas Gleixner commit 7ac571f8d0f843fb818f7c70ec77784545e91bc4 Author: David Woodhouse Date: Thu Nov 17 08:20:31 2005 +0000 [MTD] Make some tables 'const' so they can live in .rodata arjan: drivers/mtd/maps/sc520cdp.c:167: warning: par_table is never written to and should be declared 'const' arjan: drivers/mtd/maps/pci.c:105: warning: mtd_pci_map is never written to and should be declared 'const' arjan: mind fixing those up ? Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner commit 3c77354794939143fdf1dd669895a812f94f9a38 Author: John Bowler Date: Wed Nov 16 16:23:25 2005 +0000 [MTD] maps/ixp4xx: half-word boundary and little-endian fixups ixp4xx updates: - Handle reads that don't start on a half-word boundary. - Make it work when CPU is in little-endian mode. Signed-off-by: John Bowler Signed-off-by: Alessandro Zummo Signed-off-by: David Vrabel Signed-off-by: Thomas Gleixner commit 987d24018dc83d27e491674c50ff2272f51eb719 Author: Todd Poynor Date: Tue Nov 15 23:28:20 2005 +0000 [MTD] CFI: Use 16-bit access to autoselect/read device id data Recent models of Intel/Sharp and Spansion CFI flash now have significant bits in the upper byte of device ID codes, read via what Spansion calls "autoselect" and Intel calls "read device identifier". Currently these values are truncated to the low 8 bits in the mtd data structures, as all CFI read query info has previously been read one byte at a time. Add a new method for reading 16-bit info, currently just manufacturer and device codes; datasheets hint at future uses for upper bytes in other fields. Signed-off-by: Todd Poynor Signed-off-by: Thomas Gleixner commit 3eb8ceac486ed9b6eceed098423f1ca6b180ec9d Author: Maciej W. Rozycki Date: Mon Nov 14 13:41:51 2005 +0000 [MTD] devices/ms02-nv: phys/virt address fixups Merge from linux-mips: Use physical addresses at the interface level, letting drivers remap them as appropriate. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner commit 5a94bcfd2a18edcf368b3128c7df07b58e529932 Author: Keshavamurthy Anil S Date: Tue Nov 22 14:15:49 2005 -0800 [IA64] Remove getting break_num by decoding instruction break.b always sets cr.iim to 0 and the current code tries to get the break_num by decoding instruction. However, their seems to be a race condition while reading the regs->cr_iip, as on other cpu the break.b at regs->cr_iip might have been replaced with the original instruction as a result of unregister_kprobe() and hence decoding instruction to obtain break_num will result in wrong value in this case. Also includes changes to kprobes.c which now has to handle break number zero. Signed-off-by: Anil S Keshavamurthy Signed-off-by: Tony Luck commit b77dae5293efba42ea1ff04d410ee68e66d5b0cf Author: Dean Roe Date: Wed Nov 9 14:25:06 2005 -0600 [IA64] - Make pfn_valid more precise for SGI Altix systems A single SGI Altix system can be divided into multiple partitions, each running their own instance of the Linux kernel. pfn_valid() is currently not optimal for any but the first partition, since it does not compare the pfn with min_low_pfn before calling the more costly ia64_pfn_valid(). Signed-off-by: Dean Roe Signed-off-by: Tony Luck commit 21eeb7aa116b1f59fc23339521173cbb13e57f1a Author: Thomas Gleixner Date: Tue Nov 29 16:57:17 2005 +0100 [JFFS2] Fix the slab cache constructor of 'struct jffs2_inode_info' objects. JFFS2 initialize f->sem mutex as "locked" in the slab constructor which is a bug. Objects are freed with unlocked f->sem mutex. So, when they allocated again, f->sem is unlocked because the slab cache constructor is not called for them. The constructor is called only once when memory pages are allocated for objects (namely, when the slab layer allocates new slabs). So, sometimes 'struct jffs2_inode_info' are allocated with unlocked f->sem, sometimes with locked. This is a bug. Instead, initialize f->sem as unlocked in the constructor. I.e., in the "constructed" state f->sem must be unlocked. From: Keijiro Yano Acked-by: Artem B. Bityutskiy Signed-off-by: Thomas Gleixner commit fa2a455b028f3b6ca4dae129c6337d7edf21f12c Author: Nick Piggin Date: Tue Nov 29 18:43:17 2005 +1100 [PATCH] Fix vma argument in get_usr_pages() for gate areas The system call gate area handling called vm_normal_page() with the wrong vma (which was always NULL, and caused an oops). Signed-off-by: Nick Piggin Signed-off-by: Linus Torvalds commit bc4117f8767203927e78b92e9e5b3ddb71d6a84d Author: Sean Young Date: Tue Nov 29 11:48:00 2005 +0000 [MTD] RFD_FTL: Use lanana assigned major device number A major block device number is now assigned by lanana. Signed-off-by: Sean Young Signed-off-by: Thomas Gleixner commit 220bbd748335f73aafb472a97716762a42cb0d58 Author: YOSHIFUJI Hideaki Date: Mon Nov 28 22:27:11 2005 -0800 [IPV6]: Implement appropriate dummy rule 4 in ipv6_dev_get_saddr(). Ensure to update hiscore.rule in dummy rule 4 in ipv6_dev_get_saddr(). Pointed out by Yan Zheng . Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller commit 666acb94d155106e494c6dfdd8b2fae44e0fad61 Author: Paul Mackerras Date: Tue Nov 29 15:50:58 2005 +1100 powerpc: Export __flush_icache_range for 32-bit Both 32-bit and 64-bit use the same inline flush_icache_range definition now, so both need to export __flush_icache_range, not just 64-bit. Signed-off-by: Paul Mackerras commit 0e2d94f6a09d0a2d39c3b7d9529ac5c378098245 Author: Otavio Salvador Date: Tue Nov 29 08:02:24 2005 +1100 [PATCH] ppc: Export symbol needed by MOL Export symbol needed to allow MOL to run. This was changed to be inline in past and forgot to be change here. Signed-off-by: Paul Mackerras --- diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index 0157281..5db9d3b 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c @@ -42,6 +42,7 @@ EXPORT_SYMBOL(clear_page); #ifdef CONFIG_VIRTUAL_MEM_MAP #include +EXPORT_SYMBOL(min_low_pfn); /* defined by bootmem.c, but not exported by generic code */ EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ #endif diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 801eeae..2895d6e 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -740,7 +740,7 @@ int __kprobes kprobe_exceptions_notify(s switch(val) { case DIE_BREAK: /* err is break number from ia64_bad_break() */ - if (args->err == 0x80200 || args->err == 0x80300) + if (args->err == 0x80200 || args->err == 0x80300 || args->err == 0) if (pre_kprobes_handler(args)) ret = NOTIFY_STOP; break; diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index fba5fdd..d3e0ecb 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c @@ -132,24 +132,6 @@ __kprobes ia64_bad_break (unsigned long siginfo_t siginfo; int sig, code; - /* break.b always sets cr.iim to 0, which causes problems for - * debuggers. Get the real break number from the original instruction, - * but only for kernel code. User space break.b is left alone, to - * preserve the existing behaviour. All break codings have the same - * format, so there is no need to check the slot type. - */ - if (break_num == 0 && !user_mode(regs)) { - struct ia64_psr *ipsr = ia64_psr(regs); - unsigned long *bundle = (unsigned long *)regs->cr_iip; - unsigned long slot; - switch (ipsr->ri) { - case 0: slot = (bundle[0] >> 5); break; - case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break; - default: slot = (bundle[1] >> 23); break; - } - break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff); - } - /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index af4d1bc..94db257 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c @@ -163,15 +163,13 @@ EXPORT_SYMBOL(giveup_altivec); EXPORT_SYMBOL(giveup_spe); #endif /* CONFIG_SPE */ -#ifdef CONFIG_PPC64 -EXPORT_SYMBOL(__flush_icache_range); -#else +#ifndef CONFIG_PPC64 EXPORT_SYMBOL(flush_instruction_cache); -EXPORT_SYMBOL(flush_icache_range); EXPORT_SYMBOL(flush_tlb_kernel_range); EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(_tlbie); #endif +EXPORT_SYMBOL(__flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); #ifdef CONFIG_SMP diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 66073f7..bb6a5c6 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c @@ -184,7 +184,7 @@ EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(flush_instruction_cache); EXPORT_SYMBOL(giveup_fpu); -EXPORT_SYMBOL(flush_icache_range); +EXPORT_SYMBOL(__flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_dcache_page); diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index d9396c1..580b63d 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c @@ -77,6 +77,7 @@ static inline void io_remap_pte_range(st BUG_ON(!pte_none(*pte)); set_pte_at(mm, address, pte, entry); address += PAGE_SIZE; + pte_val(entry) += PAGE_SIZE; pte++; } while (address < curend); } while (address < end); diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index 489de81..01a9f1c 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig @@ -5,6 +5,13 @@ menu "ATM drivers" depends on NETDEVICES && ATM +config ATM_DUMMY + tristate "Dummy ATM driver" + depends on ATM + help + Dummy ATM driver. Useful for proxy signalling, testing, + and development. If unsure, say N. + config ATM_TCP tristate "ATM over TCP" depends on INET && ATM diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile index 5b77188..b5077ce 100644 --- a/drivers/atm/Makefile +++ b/drivers/atm/Makefile @@ -31,6 +31,7 @@ ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y) obj-$(CONFIG_ATM_IDT77252) += suni.o endif +obj-$(CONFIG_ATM_DUMMY) += adummy.o obj-$(CONFIG_ATM_TCP) += atmtcp.o obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o obj-$(CONFIG_ATM_LANAI) += lanai.o diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c new file mode 100644 index 0000000..d15c194 --- /dev/null +++ b/drivers/atm/adummy.c @@ -0,0 +1,168 @@ +/* + * adummy.c: a dummy ATM driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* version definition */ + +#define DRV_VERSION "1.0" + +#define DEV_LABEL "adummy" + +#define ADUMMY_DEV(dev) ((struct adummy_dev *) (dev)->dev_data) + +struct adummy_dev { + struct atm_dev *atm_dev; + + struct list_head entry; +}; + +/* globals */ + +static LIST_HEAD(adummy_devs); + +static int __init +adummy_start(struct atm_dev *dev) +{ + dev->ci_range.vpi_bits = 4; + dev->ci_range.vci_bits = 12; + + return 0; +} + +static int +adummy_open(struct atm_vcc *vcc) +{ + short vpi = vcc->vpi; + int vci = vcc->vci; + + if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC) + return 0; + + set_bit(ATM_VF_ADDR, &vcc->flags); + set_bit(ATM_VF_READY, &vcc->flags); + + return 0; +} + +static void +adummy_close(struct atm_vcc *vcc) +{ + clear_bit(ATM_VF_READY, &vcc->flags); + clear_bit(ATM_VF_ADDR, &vcc->flags); +} + +static int +adummy_send(struct atm_vcc *vcc, struct sk_buff *skb) +{ + if (vcc->pop) + vcc->pop(vcc, skb); + else + dev_kfree_skb_any(skb); + atomic_inc(&vcc->stats->tx); + + return 0; +} + +static int +adummy_proc_read(struct atm_dev *dev, loff_t *pos, char *page) +{ + int left = *pos; + + if (!left--) + return sprintf(page, "version %s\n", DRV_VERSION); + + return 0; +} + +static struct atmdev_ops adummy_ops = +{ + .open = adummy_open, + .close = adummy_close, + .send = adummy_send, + .proc_read = adummy_proc_read, + .owner = THIS_MODULE +}; + +static int __init adummy_init(void) +{ + struct atm_dev *atm_dev; + struct adummy_dev *adummy_dev; + int err = 0; + + printk(KERN_ERR "adummy: version %s\n", DRV_VERSION); + + adummy_dev = (struct adummy_dev *) kmalloc(sizeof(struct adummy_dev), + GFP_KERNEL); + if (!adummy_dev) { + printk(KERN_ERR DEV_LABEL ": kmalloc() failed\n"); + err = -ENOMEM; + goto out; + } + memset(adummy_dev, 0, sizeof(struct adummy_dev)); + + atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, 0); + if (!atm_dev) { + printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); + err = -ENODEV; + goto out_kfree; + } + + adummy_dev->atm_dev = atm_dev; + atm_dev->dev_data = adummy_dev; + + if (adummy_start(atm_dev)) { + printk(KERN_ERR DEV_LABEL ": adummy_start() failed\n"); + err = -ENODEV; + goto out_unregister; + } + + list_add(&adummy_dev->entry, &adummy_devs); +out: + return err; + +out_unregister: + atm_dev_deregister(atm_dev); +out_kfree: + kfree(adummy_dev); + goto out; +} + +static void __exit adummy_cleanup(void) +{ + struct adummy_dev *adummy_dev, *next; + + list_for_each_entry_safe(adummy_dev, next, &adummy_devs, entry) { + atm_dev_deregister(adummy_dev->atm_dev); + kfree(adummy_dev); + } +} + +module_init(adummy_init); +module_exit(adummy_cleanup); + +MODULE_AUTHOR("chas williams "); +MODULE_DESCRIPTION("dummy ATM driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/atm/atmdev_init.c b/drivers/atm/atmdev_init.c deleted file mode 100644 index 0e09e5c..0000000 --- a/drivers/atm/atmdev_init.c +++ /dev/null @@ -1,54 +0,0 @@ -/* drivers/atm/atmdev_init.c - ATM device driver initialization */ - -/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ - - -#include -#include - - -#ifdef CONFIG_ATM_ZATM -extern int zatm_detect(void); -#endif -#ifdef CONFIG_ATM_AMBASSADOR -extern int amb_detect(void); -#endif -#ifdef CONFIG_ATM_HORIZON -extern int hrz_detect(void); -#endif -#ifdef CONFIG_ATM_FORE200E -extern int fore200e_detect(void); -#endif -#ifdef CONFIG_ATM_LANAI -extern int lanai_detect(void); -#endif - - -/* - * For historical reasons, atmdev_init returns the number of devices found. - * Note that some detections may not go via atmdev_init (e.g. eni.c), so this - * number is meaningless. - */ - -int __init atmdev_init(void) -{ - int devs; - - devs = 0; -#ifdef CONFIG_ATM_ZATM - devs += zatm_detect(); -#endif -#ifdef CONFIG_ATM_AMBASSADOR - devs += amb_detect(); -#endif -#ifdef CONFIG_ATM_HORIZON - devs += hrz_detect(); -#endif -#ifdef CONFIG_ATM_FORE200E - devs += fore200e_detect(); -#endif -#ifdef CONFIG_ATM_LANAI - devs += lanai_detect(); -#endif - return devs; -} diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index 57f1810..fc518d8 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c @@ -246,10 +246,6 @@ static void atmtcp_c_close(struct atm_vc { struct atm_dev *atmtcp_dev; struct atmtcp_dev_data *dev_data; - struct sock *s; - struct hlist_node *node; - struct atm_vcc *walk; - int i; atmtcp_dev = (struct atm_dev *) vcc->dev_data; dev_data = PRIV(atmtcp_dev); @@ -257,20 +253,8 @@ static void atmtcp_c_close(struct atm_vc if (dev_data->persist) return; atmtcp_dev->dev_data = NULL; kfree(dev_data); - shutdown_atm_dev(atmtcp_dev); + atm_dev_deregister(atmtcp_dev); vcc->dev_data = NULL; - read_lock(&vcc_sklist_lock); - for(i = 0; i < VCC_HTABLE_SIZE; ++i) { - struct hlist_head *head = &vcc_hash[i]; - - sk_for_each(s, node, head) { - walk = atm_sk(s); - if (walk->dev != atmtcp_dev) - continue; - wake_up(s->sk_sleep); - } - } - read_unlock(&vcc_sklist_lock); module_put(THIS_MODULE); } @@ -450,7 +434,7 @@ static int atmtcp_remove_persistent(int if (PRIV(dev)->vcc) return 0; kfree(dev_data); atm_dev_put(dev); - shutdown_atm_dev(dev); + atm_dev_deregister(dev); return 0; } diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 51ec147..69f4c7c 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -39,7 +39,7 @@ * o lanai_change_qos() isn't written yet * * o There aren't any ioctl's yet -- I'd like to eventually support - * setting loopback and LED modes that way. (see lanai_ioctl) + * setting loopback and LED modes that way. * * o If the segmentation engine or DMA gets shut down we should restart * card as per section 17.0i. (see lanai_reset) @@ -305,7 +305,7 @@ struct lanai_dev { * vci with their bit set */ static void vci_bitfield_iterate(struct lanai_dev *lanai, - /*const*/ unsigned long *lp, + const unsigned long *lp, void (*func)(struct lanai_dev *,vci_t vci)) { vci_t vci = find_first_bit(lp, NUM_VCI); @@ -951,7 +951,7 @@ static int __devinit eeprom_read(struct /* read a big-endian 4-byte value out of eeprom */ static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address) { - return be32_to_cpup((u32 *) (&lanai->eeprom[address])); + return be32_to_cpup((const u32 *) &lanai->eeprom[address]); } /* Checksum/validate EEPROM contents */ @@ -1160,7 +1160,7 @@ static inline int vcc_tx_space(const str } /* test if VCC is currently backlogged */ -static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc) +static inline int vcc_is_backlogged(const struct lanai_vcc *lvcc) { return !skb_queue_empty(&lvcc->tx.backlog); } @@ -1395,7 +1395,8 @@ static void vcc_rx_aal5(struct lanai_vcc { int size; struct sk_buff *skb; - /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4]; + const u32 *x; + u32 *end = &lvcc->rx.buf.start[endptr * 4]; int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr); if (n < 0) n += lanai_buf_size(&lvcc->rx.buf); @@ -2111,7 +2112,7 @@ static int lanai_normalize_ci(struct lan * shifted by that much as we compute * */ -static int pcr_to_cbricg(/*const*/ struct atm_qos *qos) +static int pcr_to_cbricg(const struct atm_qos *qos) { int rounddown = 0; /* 1 = Round PCR down, i.e. round ICG _up_ */ int x, icg, pcr = atm_pcr_goal(&qos->txtp); @@ -2434,93 +2435,6 @@ static int lanai_open(struct atm_vcc *at return result; } -#if 0 -/* ioctl operations for card */ -/* NOTE: these are all DEBUGGING ONLY currently */ -static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg) -{ - int result = 0; - struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; - switch(cmd) { - case 2106275: - shutdown_atm_dev(atmdev); - return 0; - case 2200000: { - unsigned long flags; - spin_lock_irqsave(&lanai->servicelock, flags); - run_service(lanai); - spin_unlock_irqrestore(&lanai->servicelock, flags); - return 0; } - case 2200002: - get_statistics(lanai); - return 0; - case 2200003: { - unsigned int i; - for (i = 0; i <= 0x5C ; i += 4) { - if (i==0x48) /* Write-only butt reg */ - continue; - printk(KERN_CRIT DEV_LABEL " 0x%02X: " - "0x%08X\n", i, - (unsigned int) readl(lanai->base + i)); - barrier(); mb(); - pcistatus_check(lanai, 0); - barrier(); mb(); - } - return 0; } - case 2200004: { - u8 b; - u16 w; - u32 dw; - struct pci_dev *pci = lanai->pci; - (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w); - DPRINTK("vendor = 0x%X\n", (unsigned int) w); - (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w); - DPRINTK("device = 0x%X\n", (unsigned int) w); - (void) pci_read_config_word(pci, PCI_COMMAND, &w); - DPRINTK("command = 0x%X\n", (unsigned int) w); - (void) pci_read_config_word(pci, PCI_STATUS, &w); - DPRINTK("status = 0x%X\n", (unsigned int) w); - (void) pci_read_config_dword(pci, - PCI_CLASS_REVISION, &dw); - DPRINTK("class/revision = 0x%X\n", (unsigned int) dw); - (void) pci_read_config_byte(pci, - PCI_CACHE_LINE_SIZE, &b); - DPRINTK("cache line size = 0x%X\n", (unsigned int) b); - (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b); - DPRINTK("latency = %d (0x%X)\n", - (int) b, (unsigned int) b); - (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b); - DPRINTK("header type = 0x%X\n", (unsigned int) b); - (void) pci_read_config_byte(pci, PCI_BIST, &b); - DPRINTK("bist = 0x%X\n", (unsigned int) b); - /* skipping a few here */ - (void) pci_read_config_byte(pci, - PCI_INTERRUPT_LINE, &b); - DPRINTK("pci_int_line = 0x%X\n", (unsigned int) b); - (void) pci_read_config_byte(pci, - PCI_INTERRUPT_PIN, &b); - DPRINTK("pci_int_pin = 0x%X\n", (unsigned int) b); - (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b); - DPRINTK("min_gnt = 0x%X\n", (unsigned int) b); - (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b); - DPRINTK("max_lat = 0x%X\n", (unsigned int) b); } - return 0; -#ifdef USE_POWERDOWN - case 2200005: - DPRINTK("Coming out of powerdown\n"); - lanai->conf1 &= ~CONFIG1_POWERDOWN; - conf1_write(lanai); - return 0; -#endif - default: - result = -ENOIOCTLCMD; - } - return result; -} -#else /* !0 */ -#define lanai_ioctl NULL -#endif /* 0 */ - static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb) { struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data; @@ -2678,7 +2592,6 @@ static const struct atmdev_ops ops = { .dev_close = lanai_dev_close, .open = lanai_open, .close = lanai_close, - .ioctl = lanai_ioctl, .getsockopt = NULL, .setsockopt = NULL, .send = lanai_send, @@ -2760,6 +2673,7 @@ static void __exit lanai_module_exit(voi * gone, so there isn't much to do */ DPRINTK("cleanup_module()\n"); + pci_unregister_driver(&lanai_driver); } module_init(lanai_module_init); diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 7402231..65c2ec5 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -91,9 +91,9 @@ static int mfcounter = 0; * Public data... */ int mpt_lan_index = -1; -static int mpt_stm_index = -1; +int mpt_stm_index = -1; -static struct proc_dir_entry *mpt_proc_root_dir; +struct proc_dir_entry *mpt_proc_root_dir; #define WHOINIT_UNKNOWN 0xAA @@ -6271,6 +6271,7 @@ EXPORT_SYMBOL(mpt_resume); EXPORT_SYMBOL(mpt_suspend); #endif EXPORT_SYMBOL(ioc_list); +EXPORT_SYMBOL(mpt_proc_root_dir); EXPORT_SYMBOL(mpt_register); EXPORT_SYMBOL(mpt_deregister); EXPORT_SYMBOL(mpt_event_register); @@ -6288,6 +6289,7 @@ EXPORT_SYMBOL(mpt_verify_adapter); EXPORT_SYMBOL(mpt_GetIocState); EXPORT_SYMBOL(mpt_print_ioc_summary); EXPORT_SYMBOL(mpt_lan_index); +EXPORT_SYMBOL(mpt_stm_index); EXPORT_SYMBOL(mpt_HardResetHandler); EXPORT_SYMBOL(mpt_config); EXPORT_SYMBOL(mpt_toolbox); diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 8ad277a..5f5b3fb 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -1006,8 +1006,10 @@ extern int mptbase_sas_persist_operatio * Public data decl's... */ extern struct list_head ioc_list; +extern struct proc_dir_entry *mpt_proc_root_dir; extern int mpt_lan_index; /* needed by mptlan.c */ +extern int mpt_stm_index; /* needed by mptstm.c */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif /* } __KERNEL__ */ diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 143f01a..69c0494 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $ + * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $ * * * 10/10/2000 Nicolas Pitre @@ -644,9 +644,8 @@ static int get_chip(struct map_info *map * * - contension arbitration is handled in the owner's context. * - * The 'shared' struct can be read when its lock is taken. - * However any writes to it can only be made when the current - * owner's lock is also held. + * The 'shared' struct can be read and/or written only when + * its lock is taken. */ struct flchip_shared *shared = chip->priv; struct flchip *contender; @@ -675,14 +674,13 @@ static int get_chip(struct map_info *map } timeo = jiffies + HZ; spin_lock(&shared->lock); + spin_unlock(contender->mutex); } /* We now own it */ shared->writing = chip; if (mode == FL_ERASING) shared->erasing = chip; - if (contender && contender != chip) - spin_unlock(contender->mutex); spin_unlock(&shared->lock); } diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index 90eb30e..e636aa8 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -1,7 +1,7 @@ /* Common Flash Interface probe code. (C) 2000 Red Hat. GPL'd. - $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $ + $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ */ #include @@ -230,8 +230,8 @@ static int __xipram cfi_chip_setup(struc cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL); - cfi->mfr = cfi_read_query(map, base); - cfi->id = cfi_read_query(map, base + ofs_factor); + cfi->mfr = cfi_read_query16(map, base); + cfi->id = cfi_read_query16(map, base + ofs_factor); /* Put it back into Read Mode */ cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); @@ -426,7 +426,7 @@ static struct mtd_chip_driver cfi_chipdr .module = THIS_MODULE }; -int __init cfi_probe_init(void) +static int __init cfi_probe_init(void) { register_mtd_chip_driver(&cfi_chipdrv); return 0; diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c index 2d26bde..36f61a6 100644 --- a/drivers/mtd/chips/sharp.c +++ b/drivers/mtd/chips/sharp.c @@ -4,7 +4,7 @@ * Copyright 2000,2001 David A. Schleef * 2000,2001 Lineo, Inc. * - * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $ + * $Id: sharp.c,v 1.17 2005/11/29 14:28:28 gleixner Exp $ * * Devices supported: * LH28F016SCT Symmetrical block flash memory, 2Mx8 @@ -160,22 +160,28 @@ struct mtd_info *sharp_probe(struct map_ return mtd; } +static inline void sharp_send_cmd(struct map_info *map, unsigned long cmd, unsigned long adr) +{ + map_word map_cmd; + map_cmd.x[0] = cmd; + map_write(map, map_cmd, adr); +} + static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) { - unsigned long tmp; + map_word tmp, read0, read4; unsigned long base = 0; - u32 read0, read4; int width = 4; - tmp = map_read32(map, base+0); + tmp = map_read(map, base+0); - map_write32(map, CMD_READ_ID, base+0); + sharp_send_cmd(map, CMD_READ_ID, base+0); - read0=map_read32(map, base+0); - read4=map_read32(map, base+4); - if(read0 == 0x89898989){ + read0 = map_read(map, base+0); + read4 = map_read(map, base+4); + if(read0.x[0] == 0x89898989){ printk("Looks like sharp flash\n"); - switch(read4){ + switch(read4.x[0]){ case 0xaaaaaaaa: case 0xa0a0a0a0: /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/ @@ -197,16 +203,16 @@ static int sharp_probe_map(struct map_in return width; #endif default: - printk("Sort-of looks like sharp flash, 0x%08x 0x%08x\n", - read0,read4); + printk("Sort-of looks like sharp flash, 0x%08lx 0x%08lx\n", + read0.x[0], read4.x[0]); } - }else if((map_read32(map, base+0) == CMD_READ_ID)){ + }else if((map_read(map, base+0).x[0] == CMD_READ_ID)){ /* RAM, probably */ printk("Looks like RAM\n"); - map_write32(map, tmp, base+0); + map_write(map, tmp, base+0); }else{ - printk("Doesn't look like sharp flash, 0x%08x 0x%08x\n", - read0,read4); + printk("Doesn't look like sharp flash, 0x%08lx 0x%08lx\n", + read0.x[0], read4.x[0]); } return 0; @@ -215,7 +221,8 @@ static int sharp_probe_map(struct map_in /* This function returns with the chip->mutex lock held. */ static int sharp_wait(struct map_info *map, struct flchip *chip) { - int status, i; + int i; + map_word status; unsigned long timeo = jiffies + HZ; DECLARE_WAITQUEUE(wait, current); int adr = 0; @@ -225,12 +232,12 @@ retry: switch(chip->state){ case FL_READY: - map_write32(map,CMD_READ_STATUS,adr); + sharp_send_cmd(map, CMD_READ_STATUS, adr); chip->state = FL_STATUS; case FL_STATUS: for(i=0;i<100;i++){ - status = map_read32(map,adr); - if((status & SR_READY)==SR_READY) + status = map_read(map, adr); + if((status.x[0] & SR_READY)==SR_READY) break; udelay(1); } @@ -254,7 +261,7 @@ retry: goto retry; } - map_write32(map,CMD_RESET, adr); + sharp_send_cmd(map, CMD_RESET, adr); chip->state = FL_READY; @@ -351,37 +358,39 @@ static int sharp_write_oneword(struct ma int timeo; int try; int i; - int status = 0; + map_word data, status; + status.x[0] = 0; ret = sharp_wait(map,chip); for(try=0;try<10;try++){ - map_write32(map,CMD_BYTE_WRITE,adr); + sharp_send_cmd(map, CMD_BYTE_WRITE, adr); /* cpu_to_le32 -> hack to fix the writel be->le conversion */ - map_write32(map,cpu_to_le32(datum),adr); + data.x[0] = cpu_to_le32(datum); + map_write(map, data, adr); chip->state = FL_WRITING; timeo = jiffies + (HZ/2); - map_write32(map,CMD_READ_STATUS,adr); + sharp_send_cmd(map, CMD_READ_STATUS, adr); for(i=0;i<100;i++){ - status = map_read32(map,adr); - if((status & SR_READY)==SR_READY) + status = map_read(map, adr); + if((status.x[0] & SR_READY) == SR_READY) break; } if(i==100){ printk("sharp: timed out writing\n"); } - if(!(status&SR_ERRORS)) + if(!(status.x[0] & SR_ERRORS)) break; - printk("sharp: error writing byte at addr=%08lx status=%08x\n",adr,status); + printk("sharp: error writing byte at addr=%08lx status=%08lx\n", adr, status.x[0]); - map_write32(map,CMD_CLEAR_STATUS,adr); + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); } - map_write32(map,CMD_RESET,adr); + sharp_send_cmd(map, CMD_RESET, adr); chip->state = FL_READY; wake_up(&chip->wq); @@ -434,18 +443,18 @@ static int sharp_do_wait_for_ready(struc { int ret; unsigned long timeo; - int status; + map_word status; DECLARE_WAITQUEUE(wait, current); - map_write32(map,CMD_READ_STATUS,adr); - status = map_read32(map,adr); + sharp_send_cmd(map, CMD_READ_STATUS, adr); + status = map_read(map, adr); timeo = jiffies + HZ; while(time_before(jiffies, timeo)){ - map_write32(map,CMD_READ_STATUS,adr); - status = map_read32(map,adr); - if((status & SR_READY)==SR_READY){ + sharp_send_cmd(map, CMD_READ_STATUS, adr); + status = map_read(map, adr); + if((status.x[0] & SR_READY)==SR_READY){ ret = 0; goto out; } @@ -476,7 +485,7 @@ static int sharp_erase_oneblock(struct m { int ret; //int timeo; - int status; + map_word status; //int i; //printk("sharp_erase_oneblock()\n"); @@ -486,26 +495,26 @@ static int sharp_erase_oneblock(struct m sharp_unlock_oneblock(map,chip,adr); #endif - map_write32(map,CMD_BLOCK_ERASE_1,adr); - map_write32(map,CMD_BLOCK_ERASE_2,adr); + sharp_send_cmd(map, CMD_BLOCK_ERASE_1, adr); + sharp_send_cmd(map, CMD_BLOCK_ERASE_2, adr); chip->state = FL_ERASING; ret = sharp_do_wait_for_ready(map,chip,adr); if(ret<0)return ret; - map_write32(map,CMD_READ_STATUS,adr); - status = map_read32(map,adr); + sharp_send_cmd(map, CMD_READ_STATUS, adr); + status = map_read(map, adr); - if(!(status&SR_ERRORS)){ - map_write32(map,CMD_RESET,adr); + if(!(status.x[0] & SR_ERRORS)){ + sharp_send_cmd(map, CMD_RESET, adr); chip->state = FL_READY; //spin_unlock_bh(chip->mutex); return 0; } - printk("sharp: error erasing block at addr=%08lx status=%08x\n",adr,status); - map_write32(map,CMD_CLEAR_STATUS,adr); + printk("sharp: error erasing block at addr=%08lx status=%08lx\n", adr, status.x[0]); + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); //spin_unlock_bh(chip->mutex); @@ -517,20 +526,20 @@ static void sharp_unlock_oneblock(struct unsigned long adr) { int i; - int status; + map_word status; - map_write32(map,CMD_CLEAR_BLOCK_LOCKS_1,adr); - map_write32(map,CMD_CLEAR_BLOCK_LOCKS_2,adr); + sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_1, adr); + sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_2, adr); udelay(100); - status = map_read32(map,adr); - printk("status=%08x\n",status); + status = map_read(map, adr); + printk("status=%08lx\n", status.x[0]); for(i=0;i<1000;i++){ - //map_write32(map,CMD_READ_STATUS,adr); - status = map_read32(map,adr); - if((status & SR_READY)==SR_READY) + //sharp_send_cmd(map, CMD_READ_STATUS, adr); + status = map_read(map, adr); + if((status.x[0] & SR_READY) == SR_READY) break; udelay(100); } @@ -538,14 +547,14 @@ static void sharp_unlock_oneblock(struct printk("sharp: timed out unlocking block\n"); } - if(!(status&SR_ERRORS)){ - map_write32(map,CMD_RESET,adr); + if(!(status.x[0] & SR_ERRORS)){ + sharp_send_cmd(map, CMD_RESET, adr); chip->state = FL_READY; return; } - printk("sharp: error unlocking block at addr=%08lx status=%08x\n",adr,status); - map_write32(map,CMD_CLEAR_STATUS,adr); + printk("sharp: error unlocking block at addr=%08lx status=%08lx\n", adr, status.x[0]); + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); } #endif diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index 0aaa0ce..7ff403b 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -1,5 +1,5 @@ /* - * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $ + * $Id: block2mtd.c,v 1.30 2005/11/29 14:48:32 gleixner Exp $ * * block2mtd.c - create an mtd from a block device * @@ -19,7 +19,7 @@ #include #include -#define VERSION "$Revision: 1.29 $" +#define VERSION "$Revision: 1.30 $" #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) @@ -40,7 +40,7 @@ static LIST_HEAD(blkmtd_device_list); #define PAGE_READAHEAD 64 -void cache_readahead(struct address_space *mapping, int index) +static void cache_readahead(struct address_space *mapping, int index) { filler_t *filler = (filler_t*)mapping->a_ops->readpage; int i, pagei; diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c index f5026ce..0ff2e43 100644 --- a/drivers/mtd/devices/ms02-nv.c +++ b/drivers/mtd/devices/ms02-nv.c @@ -6,7 +6,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * $Id: ms02-nv.c,v 1.10 2005/06/20 12:24:41 macro Exp $ + * $Id: ms02-nv.c,v 1.11 2005/11/14 13:41:47 macro Exp $ */ #include @@ -293,13 +293,13 @@ static int __init ms02nv_init(void) switch (mips_machtype) { case MACH_DS5000_200: - csr = (volatile u32 *)KN02_CSR_BASE; + csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR); if (*csr & KN02_CSR_BNK32M) stride = 2; break; case MACH_DS5000_2X0: case MACH_DS5900: - csr = (volatile u32 *)KN03_MCR_BASE; + csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR); if (*csr & KN03_MCR_BNK32M) stride = 2; break; diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index de7e231..8a878b3 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -1,5 +1,5 @@ /* This version ported to the Linux-MTD system by dwmw2@infradead.org - * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $ + * $Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $ * * Fixes: Arnaldo Carvalho de Melo * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups @@ -1084,9 +1084,9 @@ struct mtd_blktrans_ops ftl_tr = { .owner = THIS_MODULE, }; -int init_ftl(void) +static int init_ftl(void) { - DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n"); + DEBUG(0, "$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $\n"); return register_mtd_blktrans(&ftl_tr); } diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 846a533..452ccd5 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig @@ -538,12 +538,6 @@ config MTD_MPC1211 This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02). If you have such a board, say 'Y'. -config MTD_PQ2FADS - tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards" - depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT - help - This enables access to flash SIMM on PQ2FADS-like boards - config MTD_OMAP_NOR tristate "TI OMAP board mappings" depends on MTD_CFI && ARCH_OMAP diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index 7d9e940..2f7e254 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile @@ -70,6 +70,5 @@ obj-$(CONFIG_MTD_DMV182) += dmv182.o obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o -obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o obj-$(CONFIG_MTD_TQM834x) += tqm834x.o diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index a59f802..986c586 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $ + * $Id: ixp4xx.c,v 1.13 2005/11/16 16:23:21 dvrabel Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -34,10 +34,55 @@ #include +/* + * Read/write a 16 bit word from flash address 'addr'. + * + * When the cpu is in little-endian mode it swizzles the address lines + * ('address coherency') so we need to undo the swizzling to ensure commands + * and the like end up on the correct flash address. + * + * To further complicate matters, due to the way the expansion bus controller + * handles 32 bit reads, the byte stream ABCD is stored on the flash as: + * D15 D0 + * +---+---+ + * | A | B | 0 + * +---+---+ + * | C | D | 2 + * +---+---+ + * This means that on LE systems each 16 bit word must be swapped. Note that + * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI + * data and other flash commands which are always in D7-D0. + */ #ifndef __ARMEB__ +#ifndef CONFIG_MTD_CFI_BE_BYTE_SWAP +# error CONFIG_MTD_CFI_BE_BYTE_SWAP required +#endif + +static inline u16 flash_read16(void __iomem *addr) +{ + return be16_to_cpu(__raw_readw((void __iomem *)((unsigned long)addr ^ 0x2))); +} + +static inline void flash_write16(u16 d, void __iomem *addr) +{ + __raw_writew(cpu_to_be16(d), (void __iomem *)((unsigned long)addr ^ 0x2)); +} + #define BYTE0(h) ((h) & 0xFF) #define BYTE1(h) (((h) >> 8) & 0xFF) + #else + +static inline u16 flash_read16(const void __iomem *addr) +{ + return __raw_readw(addr); +} + +static inline void flash_write16(u16 d, void __iomem *addr) +{ + __raw_writew(d, addr); +} + #define BYTE0(h) (((h) >> 8) & 0xFF) #define BYTE1(h) ((h) & 0xFF) #endif @@ -45,7 +90,7 @@ static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) { map_word val; - val.x[0] = le16_to_cpu(readw(map->virt + ofs)); + val.x[0] = flash_read16(map->virt + ofs); return val; } @@ -57,19 +102,28 @@ static map_word ixp4xx_read16(struct map static void ixp4xx_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) { - int i; u8 *dest = (u8 *) to; void __iomem *src = map->virt + from; - u16 data; - for (i = 0; i < (len / 2); i++) { - data = le16_to_cpu(readw(src + 2*i)); - dest[i * 2] = BYTE0(data); - dest[i * 2 + 1] = BYTE1(data); + if (len <= 0) + return; + + if (from & 1) { + *dest++ = BYTE1(flash_read16(src)); + src++; + --len; } - if (len & 1) - dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); + while (len >= 2) { + u16 data = flash_read16(src); + *dest++ = BYTE0(data); + *dest++ = BYTE1(data); + src += 2; + len -= 2; + } + + if (len > 0) + *dest++ = BYTE0(flash_read16(src)); } /* @@ -79,7 +133,7 @@ static void ixp4xx_copy_from(struct map_ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) { if (!(adr & 1)) - writew(cpu_to_le16(d.x[0]), map->virt + adr); + flash_write16(d.x[0], map->virt + adr); } /* @@ -87,7 +141,7 @@ static void ixp4xx_probe_write16(struct */ static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) { - writew(cpu_to_le16(d.x[0]), map->virt + adr); + flash_write16(d.x[0], map->virt + adr); } struct ixp4xx_flash_info { diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c index f00ee7e..632eb2a 100644 --- a/drivers/mtd/maps/nettel.c +++ b/drivers/mtd/maps/nettel.c @@ -6,7 +6,7 @@ * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2001-2002, SnapGear (www.snapgear.com) * - * $Id: nettel.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $ + * $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $ */ /****************************************************************************/ @@ -479,7 +479,7 @@ void __exit nettel_cleanup(void) } if (nettel_intel_map.virt) { iounmap(nettel_intel_map.virt); - nettel_intel_map.virt = 0; + nettel_intel_map.virt = NULL; } #endif } diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index 8b3570b..21822c2 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $ + * $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $ * * Generic PCI memory map driver. We support the following boards: * - Intel IQ80310 ATU. @@ -102,7 +102,7 @@ static void mtd_pci_copyto(struct map_in memcpy_toio(map->base + map->translate(map, to), from, len); } -static struct map_info mtd_pci_map = { +static const struct map_info mtd_pci_map = { .phys = NO_XIP, .copy_from = mtd_pci_copyfrom, .copy_to = mtd_pci_copyto, diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 9ee760f..f49ebc3 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -1,5 +1,5 @@ /* - * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $ + * $Id: physmap.c,v 1.39 2005/11/29 14:49:36 gleixner Exp $ * * Normal mappings of chips in physical memory * @@ -19,6 +19,7 @@ #include #include #include +#include static struct mtd_info *mymtd; diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c index 6fb9f3c..ed92afa 100644 --- a/drivers/mtd/maps/sc520cdp.c +++ b/drivers/mtd/maps/sc520cdp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $ + * $Id: sc520cdp.c,v 1.23 2005/11/17 08:20:27 dwmw2 Exp $ * * * The SC520CDP is an evaluation board for the Elan SC520 processor available @@ -164,7 +164,7 @@ struct sc520_par_table unsigned long default_address; }; -static struct sc520_par_table par_table[NUM_FLASH_BANKS] = +static const struct sc520_par_table par_table[NUM_FLASH_BANKS] = { { /* Flash Bank #0: selected by ROMCS0 */ SC520_PAR_ROMCS0, diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index de45003..a0af92c 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -1486,7 +1486,7 @@ ns_nand_verify_buf(struct mtd_info *mtd, /* * Module initialization function */ -int __init ns_init_module(void) +static int __init ns_init_module(void) { struct nand_chip *chip; struct nandsim *nand; diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 0ab8d29..20ce212 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -30,11 +30,9 @@ MODULE_PARM_DESC(block_size, "Block size #define PREFIX "rfd_ftl: " -/* Major device # for FTL device */ - -/* A request for this major has been sent to device@lanana.org */ +/* This major has been assigned by device@lanana.org */ #ifndef RFD_FTL_MAJOR -#define RFD_FTL_MAJOR 95 +#define RFD_FTL_MAJOR 256 #endif /* Maximum number of partitions in an FTL region */ diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index dfea346..f979252 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -380,23 +380,23 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*d spin_lock_irqsave(&adapter->lock, flags); scb = mega_build_cmd(adapter, scmd, &busy); + if (!scb) + goto out; - if(scb) { - scb->state |= SCB_PENDQ; - list_add_tail(&scb->list, &adapter->pending_list); + scb->state |= SCB_PENDQ; + list_add_tail(&scb->list, &adapter->pending_list); - /* - * Check if the HBA is in quiescent state, e.g., during a - * delete logical drive opertion. If it is, don't run - * the pending_list. - */ - if(atomic_read(&adapter->quiescent) == 0) { - mega_runpendq(adapter); - } - return 0; - } - spin_unlock_irqrestore(&adapter->lock, flags); + /* + * Check if the HBA is in quiescent state, e.g., during a + * delete logical drive opertion. If it is, don't run + * the pending_list. + */ + if (atomic_read(&adapter->quiescent) == 0) + mega_runpendq(adapter); + busy = 0; + out: + spin_unlock_irqrestore(&adapter->lock, flags); return busy; } @@ -4677,7 +4677,6 @@ megaraid_probe_one(struct pci_dev *pdev, adapter->flag = flag; spin_lock_init(&adapter->lock); - scsi_assign_lock(host, &adapter->lock); host->cmd_per_lun = max_cmd_per_lun; host->max_sectors = max_sectors_per_io; diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index c466739..2e6593e 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -879,7 +879,7 @@ static int usbatm_atm_init(struct usbatm fail: instance->atm_dev = NULL; - shutdown_atm_dev(atm_dev); /* usbatm_atm_dev_close will eventually be called */ + atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ return ret; } @@ -1164,7 +1164,7 @@ void usbatm_usb_disconnect(struct usb_in /* ATM finalize */ if (instance->atm_dev) - shutdown_atm_dev(instance->atm_dev); + atm_dev_deregister(instance->atm_dev); usbatm_put_instance(instance); /* taken in usbatm_usb_probe */ } diff --git a/fs/exec.c b/fs/exec.c index 1f8a9fd..22533cc 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -306,9 +306,6 @@ void install_arg_page(struct vm_area_str struct page *page, unsigned long address) { struct mm_struct *mm = vma->vm_mm; - pgd_t * pgd; - pud_t * pud; - pmd_t * pmd; pte_t * pte; spinlock_t *ptl; @@ -316,14 +313,7 @@ void install_arg_page(struct vm_area_str goto out; flush_dcache_page(page); - pgd = pgd_offset(mm, address); - pud = pud_alloc(mm, pgd, address); - if (!pud) - goto out; - pmd = pmd_alloc(mm, pud, address); - if (!pmd) - goto out; - pte = pte_alloc_map_lock(mm, pmd, address, &ptl); + pte = get_locked_pte(mm, address, &ptl); if (!pte) goto out; if (!pte_none(*pte)) { diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 5434206..d0fcc5f 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -234,6 +234,7 @@ void jffs2_read_inode (struct inode *ino c = JFFS2_SB_INFO(inode->i_sb); jffs2_init_inode_info(f); + down(&f->sem); ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node); @@ -400,6 +401,7 @@ struct inode *jffs2_new_inode (struct in f = JFFS2_INODE_INFO(inode); jffs2_init_inode_info(f); + down(&f->sem); memset(ri, 0, sizeof(*ri)); /* Set OS-specific defaults for new inodes */ diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 9e0b545..9388381 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -51,7 +51,7 @@ static void jffs2_i_init_once(void * foo if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR) { - init_MUTEX_LOCKED(&ei->sem); + init_MUTEX(&ei->sem); inode_init_once(&ei->vfs_inode); } } diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 9dd9da1..5e6362a 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -110,8 +110,9 @@ extern int ia64_pfn_valid (unsigned long # define pfn_to_page(pfn) (mem_map + (pfn)) #elif defined(CONFIG_DISCONTIGMEM) extern struct page *vmem_map; +extern unsigned long min_low_pfn; extern unsigned long max_low_pfn; -# define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) +# define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) # define pfn_to_page(pfn) (vmem_map + (pfn)) #endif diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index e7d0593..b203ea8 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -7,7 +7,6 @@ #define LINUX_ATMDEV_H -#include #include #include #include @@ -210,6 +209,7 @@ struct atm_cirange { #ifdef __KERNEL__ +#include #include /* wait_queue_head_t */ #include /* struct timeval */ #include @@ -274,7 +274,7 @@ enum { enum { - ATM_DF_CLOSE, /* close device when last VCC is closed */ + ATM_DF_REMOVED, /* device was removed from atm_devs list */ }; @@ -415,7 +415,6 @@ struct atm_dev *atm_dev_register(const c int number,unsigned long *flags); /* number == -1: pick first available */ struct atm_dev *atm_dev_lookup(int number); void atm_dev_deregister(struct atm_dev *dev); -void shutdown_atm_dev(struct atm_dev *dev); void vcc_insert_socket(struct sock *sk); @@ -457,18 +456,19 @@ static inline void atm_dev_hold(struct a static inline void atm_dev_put(struct atm_dev *dev) { - atomic_dec(&dev->refcnt); - - if ((atomic_read(&dev->refcnt) == 1) && - test_bit(ATM_DF_CLOSE,&dev->flags)) - shutdown_atm_dev(dev); + if (atomic_dec_and_test(&dev->refcnt)) { + BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); + if (dev->ops->dev_close) + dev->ops->dev_close(dev); + kfree(dev); + } } int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, gfp_t gfp_flags); -int atm_pcr_goal(struct atm_trafprm *tp); +int atm_pcr_goal(const struct atm_trafprm *tp); void vcc_release_async(struct atm_vcc *vcc, int reply); diff --git a/include/linux/mm.h b/include/linux/mm.h index 6a75a7a..0e73f15 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -163,6 +163,7 @@ extern unsigned int kobjsize(const void #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ +#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */ #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS @@ -741,6 +742,8 @@ struct shrinker; extern struct shrinker *set_shrinker(int, shrinker_t); extern void remove_shrinker(struct shrinker *shrinker); +extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); + int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 3c9ea4b..23a5689 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -1,7 +1,7 @@ /* Common Flash Interface structures * See http://support.intel.com/design/flash/technote/index.htm - * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $ + * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $ */ #ifndef __MTD_CFI_H__ @@ -426,6 +426,22 @@ static inline uint8_t cfi_read_query(str } } +static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) +{ + map_word val = map_read(map, addr); + + if (map_bankwidth_is_1(map)) { + return val.x[0] & 0xff; + } else if (map_bankwidth_is_2(map)) { + return cfi16_to_cpu(val.x[0]); + } else { + /* No point in a 64-bit byteswap since that would just be + swapping the responses from different chips, and we are + only interested in one chip (a representative sample) */ + return cfi32_to_cpu(val.x[0]); + } +} + static inline void cfi_udelay(int us) { if (us >= 1000) { diff --git a/mm/fremap.c b/mm/fremap.c index f851775..9f381e5 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -55,20 +55,10 @@ int install_page(struct mm_struct *mm, s pgoff_t size; int err = -ENOMEM; pte_t *pte; - pmd_t *pmd; - pud_t *pud; - pgd_t *pgd; pte_t pte_val; spinlock_t *ptl; - pgd = pgd_offset(mm, addr); - pud = pud_alloc(mm, pgd, addr); - if (!pud) - goto out; - pmd = pmd_alloc(mm, pud, addr); - if (!pmd) - goto out; - pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); + pte = get_locked_pte(mm, addr, &ptl); if (!pte) goto out; @@ -110,20 +100,10 @@ int install_file_pte(struct mm_struct *m { int err = -ENOMEM; pte_t *pte; - pmd_t *pmd; - pud_t *pud; - pgd_t *pgd; pte_t pte_val; spinlock_t *ptl; - pgd = pgd_offset(mm, addr); - pud = pud_alloc(mm, pgd, addr); - if (!pud) - goto out; - pmd = pmd_alloc(mm, pud, addr); - if (!pmd) - goto out; - pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); + pte = get_locked_pte(mm, addr, &ptl); if (!pte) goto out; diff --git a/mm/memory.c b/mm/memory.c index 9ab206b..8d10b55 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -988,7 +988,7 @@ int get_user_pages(struct task_struct *t return i ? : -EFAULT; } if (pages) { - struct page *page = vm_normal_page(vma, start, *pte); + struct page *page = vm_normal_page(gate_vma, start, *pte); pages[i] = page; if (page) get_page(page); @@ -1146,6 +1146,97 @@ int zeromap_page_range(struct vm_area_st return err; } +pte_t * fastcall get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl) +{ + pgd_t * pgd = pgd_offset(mm, addr); + pud_t * pud = pud_alloc(mm, pgd, addr); + if (pud) { + pmd_t * pmd = pmd_alloc(mm, pud, addr); + if (pmd) + return pte_alloc_map_lock(mm, pmd, addr, ptl); + } + return NULL; +} + +/* + * This is the old fallback for page remapping. + * + * For historical reasons, it only allows reserved pages. Only + * old drivers should use this, and they needed to mark their + * pages reserved for the old functions anyway. + */ +static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *page, pgprot_t prot) +{ + int retval; + pte_t *pte; + spinlock_t *ptl; + + retval = -EINVAL; + if (PageAnon(page) || !PageReserved(page)) + goto out; + retval = -ENOMEM; + flush_dcache_page(page); + pte = get_locked_pte(mm, addr, &ptl); + if (!pte) + goto out; + retval = -EBUSY; + if (!pte_none(*pte)) + goto out_unlock; + + /* Ok, finally just insert the thing.. */ + get_page(page); + inc_mm_counter(mm, file_rss); + page_add_file_rmap(page); + set_pte_at(mm, addr, pte, mk_pte(page, prot)); + + retval = 0; +out_unlock: + pte_unmap_unlock(pte, ptl); +out: + return retval; +} + +/* + * Somebody does a pfn remapping that doesn't actually work as a vma. + * + * Do it as individual pages instead, and warn about it. It's bad form, + * and very inefficient. + */ +static int incomplete_pfn_remap(struct vm_area_struct *vma, + unsigned long start, unsigned long end, + unsigned long pfn, pgprot_t prot) +{ + static int warn = 10; + struct page *page; + int retval; + + if (!(vma->vm_flags & VM_INCOMPLETE)) { + if (warn) { + warn--; + printk("%s does an incomplete pfn remapping", current->comm); + dump_stack(); + } + } + vma->vm_flags |= VM_INCOMPLETE | VM_IO | VM_RESERVED; + + if (start < vma->vm_start || end > vma->vm_end) + return -EINVAL; + + if (!pfn_valid(pfn)) + return -EINVAL; + + retval = 0; + page = pfn_to_page(pfn); + while (start < end) { + retval = insert_page(vma->vm_mm, start, page, prot); + if (retval < 0) + break; + start += PAGE_SIZE; + page++; + } + return retval; +} + /* * maps a range of physical memory into the requested pages. the old * mappings are removed. any references to nonexistent pages results @@ -1220,6 +1311,9 @@ int remap_pfn_range(struct vm_area_struc struct mm_struct *mm = vma->vm_mm; int err; + if (addr != vma->vm_start || end != vma->vm_end) + return incomplete_pfn_remap(vma, addr, end, pfn, prot); + /* * Physically remapped pages are special. Tell the * rest of the world about it: @@ -1300,8 +1394,15 @@ static inline void cow_user_page(struct */ if (unlikely(!src)) { void *kaddr = kmap_atomic(dst, KM_USER0); - unsigned long left = __copy_from_user_inatomic(kaddr, (void __user *)va, PAGE_SIZE); - if (left) + void __user *uaddr = (void __user *)(va & PAGE_MASK); + + /* + * This really shouldn't fail, because the page is there + * in the page tables. But it might just be unreadable, + * in which case we just give up and fill the result with + * zeroes. + */ + if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) memset(kaddr, 0, PAGE_SIZE); kunmap_atomic(kaddr, KM_USER0); return; @@ -1332,12 +1433,11 @@ static int do_wp_page(struct mm_struct * unsigned long address, pte_t *page_table, pmd_t *pmd, spinlock_t *ptl, pte_t orig_pte) { - struct page *old_page, *src_page, *new_page; + struct page *old_page, *new_page; pte_t entry; int ret = VM_FAULT_MINOR; old_page = vm_normal_page(vma, address, orig_pte); - src_page = old_page; if (!old_page) goto gotten; @@ -1345,7 +1445,7 @@ static int do_wp_page(struct mm_struct * int reuse = can_share_swap_page(old_page); unlock_page(old_page); if (reuse) { - flush_cache_page(vma, address, pfn); + flush_cache_page(vma, address, pte_pfn(orig_pte)); entry = pte_mkyoung(orig_pte); entry = maybe_mkwrite(pte_mkdirty(entry), vma); ptep_set_access_flags(vma, address, page_table, entry, 1); @@ -1365,7 +1465,7 @@ gotten: if (unlikely(anon_vma_prepare(vma))) goto oom; - if (src_page == ZERO_PAGE(address)) { + if (old_page == ZERO_PAGE(address)) { new_page = alloc_zeroed_user_highpage(vma, address); if (!new_page) goto oom; @@ -1373,7 +1473,7 @@ gotten: new_page = alloc_page_vma(GFP_HIGHUSER, vma, address); if (!new_page) goto oom; - cow_user_page(new_page, src_page, address); + cow_user_page(new_page, old_page, address); } /* @@ -1389,7 +1489,7 @@ gotten: } } else inc_mm_counter(mm, anon_rss); - flush_cache_page(vma, address, pfn); + flush_cache_page(vma, address, pte_pfn(orig_pte)); entry = mk_pte(new_page, vma->vm_page_prot); entry = maybe_mkwrite(pte_mkdirty(entry), vma); ptep_establish(vma, address, page_table, entry); @@ -1909,6 +2009,8 @@ static int do_no_page(struct mm_struct * int anon = 0; pte_unmap(page_table); + BUG_ON(vma->vm_flags & VM_PFNMAP); + if (vma->vm_file) { mapping = vma->vm_file->f_mapping; sequence = mapping->truncate_count; @@ -1941,7 +2043,7 @@ retry: page = alloc_page_vma(GFP_HIGHUSER, vma, address); if (!page) goto oom; - cow_user_page(page, new_page, address); + copy_user_highpage(page, new_page, address); page_cache_release(new_page); new_page = page; anon = 1; diff --git a/mm/rmap.c b/mm/rmap.c index 491ac35..f853c6d 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -641,7 +641,7 @@ static void try_to_unmap_cluster(unsigne continue; /* Nuke the page table entry. */ - flush_cache_page(vma, address, pfn); + flush_cache_page(vma, address, pte_pfn(*pte)); pteval = ptep_clear_flush(vma, address, pte); /* If nonlinear, store the file page offset in the pte. */ diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c index 223c7ad..02cc7e7 100644 --- a/net/atm/atm_misc.c +++ b/net/atm/atm_misc.c @@ -74,11 +74,14 @@ struct sk_buff *atm_alloc_charge(struct */ -int atm_pcr_goal(struct atm_trafprm *tp) +int atm_pcr_goal(const struct atm_trafprm *tp) { - if (tp->pcr && tp->pcr != ATM_MAX_PCR) return -tp->pcr; - if (tp->min_pcr && !tp->pcr) return tp->min_pcr; - if (tp->max_pcr != ATM_MAX_PCR) return -tp->max_pcr; + if (tp->pcr && tp->pcr != ATM_MAX_PCR) + return -tp->pcr; + if (tp->min_pcr && !tp->pcr) + return tp->min_pcr; + if (tp->max_pcr != ATM_MAX_PCR) + return -tp->max_pcr; return 0; } diff --git a/net/atm/common.c b/net/atm/common.c index 63feea4..6656b11 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -221,6 +221,29 @@ void vcc_release_async(struct atm_vcc *v EXPORT_SYMBOL(vcc_release_async); +void atm_dev_release_vccs(struct atm_dev *dev) +{ + int i; + + write_lock_irq(&vcc_sklist_lock); + for (i = 0; i < VCC_HTABLE_SIZE; i++) { + struct hlist_head *head = &vcc_hash[i]; + struct hlist_node *node, *tmp; + struct sock *s; + struct atm_vcc *vcc; + + sk_for_each_safe(s, node, tmp, head) { + vcc = atm_sk(s); + if (vcc->dev == dev) { + vcc_release_async(vcc, -EPIPE); + sk_del_node_init(s); + } + } + } + write_unlock_irq(&vcc_sklist_lock); +} + + static int adjust_tp(struct atm_trafprm *tp,unsigned char aal) { int max_sdu; @@ -332,12 +355,13 @@ static int __vcc_connect(struct atm_vcc return -EINVAL; if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) return -EPERM; - error = 0; + error = -ENODEV; if (!try_module_get(dev->ops->owner)) - return -ENODEV; + return error; vcc->dev = dev; write_lock_irq(&vcc_sklist_lock); - if ((error = find_ci(vcc, &vpi, &vci))) { + if (test_bit(ATM_DF_REMOVED, &dev->flags) || + (error = find_ci(vcc, &vpi, &vci))) { write_unlock_irq(&vcc_sklist_lock); goto fail_module_put; } @@ -423,33 +447,23 @@ int vcc_connect(struct socket *sock, int if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) return -EINVAL; - if (itf != ATM_ITF_ANY) { - dev = atm_dev_lookup(itf); - if (!dev) - return -ENODEV; - error = __vcc_connect(vcc, dev, vpi, vci); - if (error) { - atm_dev_put(dev); - return error; - } + if (likely(itf != ATM_ITF_ANY)) { + dev = try_then_request_module(atm_dev_lookup(itf), "atm-device-%d", itf); } else { - struct list_head *p, *next; - dev = NULL; - spin_lock(&atm_dev_lock); - list_for_each_safe(p, next, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); + down(&atm_dev_mutex); + if (!list_empty(&atm_devs)) { + dev = list_entry(atm_devs.next, struct atm_dev, dev_list); atm_dev_hold(dev); - spin_unlock(&atm_dev_lock); - if (!__vcc_connect(vcc, dev, vpi, vci)) - break; - atm_dev_put(dev); - dev = NULL; - spin_lock(&atm_dev_lock); } - spin_unlock(&atm_dev_lock); - if (!dev) - return -ENODEV; + up(&atm_dev_mutex); + } + if (!dev) + return -ENODEV; + error = __vcc_connect(vcc, dev, vpi, vci); + if (error) { + atm_dev_put(dev); + return error; } if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) set_bit(ATM_VF_PARTIAL,&vcc->flags); diff --git a/net/atm/common.h b/net/atm/common.h index e49ed41..4887c31 100644 --- a/net/atm/common.h +++ b/net/atm/common.h @@ -47,4 +47,6 @@ static inline void atm_proc_exit(void) /* SVC */ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos); +void atm_dev_release_vccs(struct atm_dev *dev); + #endif diff --git a/net/atm/resources.c b/net/atm/resources.c index 415d261..c8c459f 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c @@ -25,7 +25,7 @@ LIST_HEAD(atm_devs); -DEFINE_SPINLOCK(atm_dev_lock); +DECLARE_MUTEX(atm_dev_mutex); static struct atm_dev *__alloc_atm_dev(const char *type) { @@ -52,7 +52,7 @@ static struct atm_dev *__atm_dev_lookup( list_for_each(p, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); - if ((dev->ops) && (dev->number == number)) { + if (dev->number == number) { atm_dev_hold(dev); return dev; } @@ -64,12 +64,13 @@ struct atm_dev *atm_dev_lookup(int numbe { struct atm_dev *dev; - spin_lock(&atm_dev_lock); + down(&atm_dev_mutex); dev = __atm_dev_lookup(number); - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); return dev; } + struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, int number, unsigned long *flags) { @@ -81,11 +82,11 @@ struct atm_dev *atm_dev_register(const c type); return NULL; } - spin_lock(&atm_dev_lock); + down(&atm_dev_mutex); if (number != -1) { if ((inuse = __atm_dev_lookup(number))) { atm_dev_put(inuse); - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); kfree(dev); return NULL; } @@ -105,19 +106,17 @@ struct atm_dev *atm_dev_register(const c memset(&dev->flags, 0, sizeof(dev->flags)); memset(&dev->stats, 0, sizeof(dev->stats)); atomic_set(&dev->refcnt, 1); - list_add_tail(&dev->dev_list, &atm_devs); - spin_unlock(&atm_dev_lock); if (atm_proc_dev_register(dev) < 0) { printk(KERN_ERR "atm_dev_register: " "atm_proc_dev_register failed for dev %s\n", type); - spin_lock(&atm_dev_lock); - list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); kfree(dev); return NULL; } + list_add_tail(&dev->dev_list, &atm_devs); + up(&atm_dev_mutex); return dev; } @@ -125,37 +124,22 @@ struct atm_dev *atm_dev_register(const c void atm_dev_deregister(struct atm_dev *dev) { - unsigned long warning_time; - - atm_proc_dev_deregister(dev); + BUG_ON(test_bit(ATM_DF_REMOVED, &dev->flags)); + set_bit(ATM_DF_REMOVED, &dev->flags); - spin_lock(&atm_dev_lock); + /* + * if we remove current device from atm_devs list, new device + * with same number can appear, such we need deregister proc, + * release async all vccs and remove them from vccs list too + */ + down(&atm_dev_mutex); list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); - warning_time = jiffies; - while (atomic_read(&dev->refcnt) != 1) { - msleep(250); - if ((jiffies - warning_time) > 10 * HZ) { - printk(KERN_EMERG "atm_dev_deregister: waiting for " - "dev %d to become free. Usage count = %d\n", - dev->number, atomic_read(&dev->refcnt)); - warning_time = jiffies; - } - } - - kfree(dev); -} - -void shutdown_atm_dev(struct atm_dev *dev) -{ - if (atomic_read(&dev->refcnt) > 1) { - set_bit(ATM_DF_CLOSE, &dev->flags); - return; - } - if (dev->ops->dev_close) - dev->ops->dev_close(dev); - atm_dev_deregister(dev); + atm_dev_release_vccs(dev); + atm_proc_dev_deregister(dev); + + atm_dev_put(dev); } @@ -211,16 +195,16 @@ int atm_dev_ioctl(unsigned int cmd, void return -EFAULT; if (get_user(len, &iobuf->length)) return -EFAULT; - spin_lock(&atm_dev_lock); + down(&atm_dev_mutex); list_for_each(p, &atm_devs) size += sizeof(int); if (size > len) { - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); return -E2BIG; } tmp_buf = kmalloc(size, GFP_ATOMIC); if (!tmp_buf) { - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); return -ENOMEM; } tmp_p = tmp_buf; @@ -228,7 +212,7 @@ int atm_dev_ioctl(unsigned int cmd, void dev = list_entry(p, struct atm_dev, dev_list); *tmp_p++ = dev->number; } - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); error = ((copy_to_user(buf, tmp_buf, size)) || put_user(size, &iobuf->length)) ? -EFAULT : 0; @@ -245,7 +229,8 @@ int atm_dev_ioctl(unsigned int cmd, void if (get_user(number, &sioc->number)) return -EFAULT; - if (!(dev = atm_dev_lookup(number))) + if (!(dev = try_then_request_module(atm_dev_lookup(number), + "atm-device-%d", number))) return -ENODEV; switch (cmd) { @@ -414,13 +399,13 @@ static __inline__ void *dev_get_idx(loff void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) { - spin_lock(&atm_dev_lock); + down(&atm_dev_mutex); return *pos ? dev_get_idx(*pos) : (void *) 1; } void atm_dev_seq_stop(struct seq_file *seq, void *v) { - spin_unlock(&atm_dev_lock); + up(&atm_dev_mutex); } void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -434,4 +419,3 @@ void *atm_dev_seq_next(struct seq_file * EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); EXPORT_SYMBOL(atm_dev_lookup); -EXPORT_SYMBOL(shutdown_atm_dev); diff --git a/net/atm/resources.h b/net/atm/resources.h index 1291061..b7fb82a 100644 --- a/net/atm/resources.h +++ b/net/atm/resources.h @@ -11,8 +11,7 @@ extern struct list_head atm_devs; -extern spinlock_t atm_dev_lock; - +extern struct semaphore atm_dev_mutex; int atm_dev_ioctl(unsigned int cmd, void __user *arg); diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 2a8c9af..7ea0209 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c @@ -975,7 +975,7 @@ static void fib_seq_stop(struct seq_file static unsigned fib_flag_trans(int type, u32 mask, struct fib_info *fi) { - static unsigned type2flags[RTN_MAX + 1] = { + static const unsigned type2flags[RTN_MAX + 1] = { [7] = RTF_REJECT, [8] = RTF_REJECT, }; unsigned flags = type2flags[type]; diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 186f20c..6d2a6ac 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -83,7 +83,7 @@ for (nhsel=0; nhsel < 1; nhsel++) #define endfor_nexthops(fi) } -static struct +static const struct { int error; u8 scope; diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index e3eceec..92e23b2 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -220,7 +220,7 @@ struct icmp_control { short error; /* This ICMP is classed as an error message */ }; -static struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; +static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; /* * The ICMP socket(s). This is the most convenient way to flow control @@ -994,7 +994,7 @@ error: /* * This table is the definition of how we handle ICMP. */ -static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { +static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { [ICMP_ECHOREPLY] = { .output_entry = ICMP_MIB_OUTECHOREPS, .input_entry = ICMP_MIB_INECHOREPS, diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 4e9c74b..a4c347c 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1217,7 +1217,7 @@ static int ipgre_tunnel_init(struct net_ return 0; } -int __init ipgre_fb_tunnel_init(struct net_device *dev) +static int __init ipgre_fb_tunnel_init(struct net_device *dev) { struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv; struct iphdr *iph = &tunnel->parms.iph; diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 11c2f68..eba64e2 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -690,7 +690,7 @@ csum_page(struct page *page, int offset, return csum; } -inline int ip_ufo_append_data(struct sock *sk, +static inline int ip_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index f828fa2..2a3a8c5 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c @@ -771,7 +771,7 @@ static inline int todrop_entry(struct ip * The drop rate array needs tuning for real environments. * Called from timer bh only => no locking */ - static char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; static char todrop_counter[9] = {0}; int i; diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 2d66848..9bdcf31 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c @@ -1909,7 +1909,7 @@ static int ip_vs_set_timeout(struct ip_v #define DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user)) #define MAX_ARG_LEN SVCDEST_ARG_LEN -static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = { +static const unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = { [SET_CMDID(IP_VS_SO_SET_ADD)] = SERVICE_ARG_LEN, [SET_CMDID(IP_VS_SO_SET_EDIT)] = SERVICE_ARG_LEN, [SET_CMDID(IP_VS_SO_SET_DEL)] = SERVICE_ARG_LEN, @@ -2180,7 +2180,7 @@ __ip_vs_get_timeouts(struct ip_vs_timeou #define GET_TIMEOUT_ARG_LEN (sizeof(struct ip_vs_timeout_user)) #define GET_DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user) * 2) -static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = { +static const unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = { [GET_CMDID(IP_VS_SO_GET_VERSION)] = 64, [GET_CMDID(IP_VS_SO_GET_INFO)] = GET_INFO_ARG_LEN, [GET_CMDID(IP_VS_SO_GET_SERVICES)] = GET_SERVICES_ARG_LEN, diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c index c194089..0e878fd 100644 --- a/net/ipv4/ipvs/ip_vs_proto_tcp.c +++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c @@ -251,7 +251,7 @@ tcp_csum_check(struct sk_buff *skb, stru #define TCP_DIR_OUTPUT 4 #define TCP_DIR_INPUT_ONLY 8 -static int tcp_state_off[IP_VS_DIR_LAST] = { +static const int tcp_state_off[IP_VS_DIR_LAST] = { [IP_VS_DIR_INPUT] = TCP_DIR_INPUT, [IP_VS_DIR_OUTPUT] = TCP_DIR_OUTPUT, [IP_VS_DIR_INPUT_ONLY] = TCP_DIR_INPUT_ONLY, diff --git a/net/ipv4/netfilter/ip_conntrack_amanda.c b/net/ipv4/netfilter/ip_conntrack_amanda.c index fa3f914..e52847f 100644 --- a/net/ipv4/netfilter/ip_conntrack_amanda.c +++ b/net/ipv4/netfilter/ip_conntrack_amanda.c @@ -37,7 +37,7 @@ MODULE_LICENSE("GPL"); module_param(master_timeout, int, 0600); MODULE_PARM_DESC(master_timeout, "timeout for the master connection"); -static char *conns[] = { "DATA ", "MESG ", "INDEX " }; +static const char *conns[] = { "DATA ", "MESG ", "INDEX " }; /* This is slow, but it's simple. --RR */ static char *amanda_buffer; diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 422ab68..7a4ecdd 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c @@ -1354,7 +1354,7 @@ static void free_conntrack_hash(struct l get_order(sizeof(struct list_head) * size)); } -void ip_conntrack_flush() +void ip_conntrack_flush(void) { /* This makes sure all current packets have passed through netfilter framework. Roll on, two-stage module @@ -1408,7 +1408,7 @@ static struct list_head *alloc_hashtable return hash; } -int set_hashsize(const char *val, struct kernel_param *kp) +static int set_hashsize(const char *val, struct kernel_param *kp) { int i, bucket, hashsize, vmalloced; int old_vmalloced, old_size; diff --git a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c index 59e12b0..68b173b 100644 --- a/net/ipv4/netfilter/ip_conntrack_ftp.c +++ b/net/ipv4/netfilter/ip_conntrack_ftp.c @@ -55,7 +55,7 @@ static int try_rfc959(const char *, size static int try_eprt(const char *, size_t, u_int32_t [], char); static int try_epsv_response(const char *, size_t, u_int32_t [], char); -static struct ftp_search { +static const struct ftp_search { enum ip_conntrack_dir dir; const char *pattern; size_t plen; diff --git a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c index 2dea1db..d7c4042 100644 --- a/net/ipv4/netfilter/ip_conntrack_irc.c +++ b/net/ipv4/netfilter/ip_conntrack_irc.c @@ -59,7 +59,7 @@ MODULE_PARM_DESC(max_dcc_channels, "max module_param(dcc_timeout, int, 0400); MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels"); -static char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " }; +static const char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " }; #define MINMATCHLEN 5 #if 0 diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c index e4d6b26..5f9925d 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c @@ -51,7 +51,7 @@ static int icmp_invert_tuple(struct ip_c const struct ip_conntrack_tuple *orig) { /* Add 1; spaces filled with 0. */ - static u_int8_t invmap[] + static const u_int8_t invmap[] = { [ICMP_ECHO] = ICMP_ECHOREPLY + 1, [ICMP_ECHOREPLY] = ICMP_ECHO + 1, [ICMP_TIMESTAMP] = ICMP_TIMESTAMPREPLY + 1, @@ -110,7 +110,7 @@ static int icmp_packet(struct ip_conntra return NF_ACCEPT; } -static u_int8_t valid_new[] = { +static const u_int8_t valid_new[] = { [ICMP_ECHO] = 1, [ICMP_TIMESTAMP] = 1, [ICMP_INFO_REQUEST] = 1, diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c index 59a4a01..977fb59 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c @@ -65,7 +65,7 @@ static unsigned long ip_ct_sctp_timeout_ static unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; -static unsigned long * sctp_timeouts[] +static const unsigned long * sctp_timeouts[] = { NULL, /* SCTP_CONNTRACK_NONE */ &ip_ct_sctp_timeout_closed, /* SCTP_CONNTRACK_CLOSED */ &ip_ct_sctp_timeout_cookie_wait, /* SCTP_CONNTRACK_COOKIE_WAIT */ @@ -118,7 +118,7 @@ cookie echoed to closed. */ /* SCTP conntrack state transitions */ -static enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { +static const enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = { { /* ORIGINAL */ /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */ diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c index ee3b7d6..6259816 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c @@ -99,7 +99,7 @@ unsigned long ip_ct_tcp_timeout_close = to ~13-30min depending on RTO. */ unsigned long ip_ct_tcp_timeout_max_retrans = 5 MINS; -static unsigned long * tcp_timeouts[] +static const unsigned long * tcp_timeouts[] = { NULL, /* TCP_CONNTRACK_NONE */ &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ @@ -170,7 +170,7 @@ enum tcp_bit_set { * if they are invalid * or we do not support the request (simultaneous open) */ -static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { +static const enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = { { /* ORIGINAL */ /* sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI */ @@ -817,7 +817,7 @@ void ip_conntrack_tcp_update(struct sk_b #define TH_CWR 0x80 /* table of valid flag combinations - ECE and CWR are always valid */ -static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = +static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] = { [TH_SYN] = 1, [TH_SYN|TH_ACK] = 1, diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c index 762f4d9..c1a6146 100644 --- a/net/ipv4/netfilter/ip_nat_core.c +++ b/net/ipv4/netfilter/ip_nat_core.c @@ -49,7 +49,7 @@ static unsigned int ip_nat_htable_size; static struct list_head *bysource; #define MAX_IP_NAT_PROTO 256 -struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; +static struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; static inline struct ip_nat_protocol * __ip_nat_proto_find(u_int8_t protonum) diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 75c27e9..45886c8 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1892,7 +1892,7 @@ static int ipt_get_matches(char *buffer, return pos; } -static struct { char *name; get_info_t *get_info; } ipt_proc_entry[] = +static const struct { char *name; get_info_t *get_info; } ipt_proc_entry[] = { { "ip_tables_names", ipt_get_tables }, { "ip_tables_targets", ipt_get_targets }, { "ip_tables_matches", ipt_get_matches }, diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index 92ed050..30be0f1 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c @@ -197,7 +197,7 @@ static void dump_packet(const struct nf_ } case IPPROTO_ICMP: { struct icmphdr _icmph, *ich; - static size_t required_len[NR_ICMP_TYPES+1] + static const size_t required_len[NR_ICMP_TYPES+1] = { [ICMP_ECHOREPLY] = 4, [ICMP_DEST_UNREACH] = 8 + sizeof(struct iphdr), @@ -351,7 +351,7 @@ static void dump_packet(const struct nf_ /* maxlen = 230+ 91 + 230 + 252 = 803 */ } -struct nf_loginfo default_loginfo = { +static struct nf_loginfo default_loginfo = { .type = NF_LOG_TYPE_LOG, .u = { .log = { diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index a65e508..0d7dc66 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c @@ -98,7 +98,7 @@ fold_field(void *mib[], int offt) } /* snmp items */ -static struct snmp_mib snmp4_ipstats_list[] = { +static const struct snmp_mib snmp4_ipstats_list[] = { SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES), SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS), SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS), @@ -119,7 +119,7 @@ static struct snmp_mib snmp4_ipstats_lis SNMP_MIB_SENTINEL }; -static struct snmp_mib snmp4_icmp_list[] = { +static const struct snmp_mib snmp4_icmp_list[] = { SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS), SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS), SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS), @@ -149,7 +149,7 @@ static struct snmp_mib snmp4_icmp_list[] SNMP_MIB_SENTINEL }; -static struct snmp_mib snmp4_tcp_list[] = { +static const struct snmp_mib snmp4_tcp_list[] = { SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM), SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN), SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX), @@ -167,7 +167,7 @@ static struct snmp_mib snmp4_tcp_list[] SNMP_MIB_SENTINEL }; -static struct snmp_mib snmp4_udp_list[] = { +static const struct snmp_mib snmp4_udp_list[] = { SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS), SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS), SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS), @@ -175,7 +175,7 @@ static struct snmp_mib snmp4_udp_list[] SNMP_MIB_SENTINEL }; -static struct snmp_mib snmp4_net_list[] = { +static const struct snmp_mib snmp4_net_list[] = { SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT), SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV), SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED), diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 381dd6a..f701a13 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1371,7 +1371,7 @@ out: kfree_skb(skb); * are needed for AMPRnet AX.25 paths. */ -static unsigned short mtu_plateau[] = +static const unsigned short mtu_plateau[] = {32000, 17914, 8166, 4352, 2002, 1492, 576, 296, 216, 128 }; static __inline__ unsigned short guess_mtu(unsigned short old_mtu) @@ -3149,8 +3149,7 @@ int __init ip_rt_init(void) sizeof(struct rt_hash_bucket), rhash_entries, (num_physpages >= 128 * 1024) ? - (27 - PAGE_SHIFT) : - (29 - PAGE_SHIFT), + 15 : 17, HASH_HIGHMEM, &rt_hash_log, &rt_hash_mask, diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9ac7a4f..ef98b14 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1413,7 +1413,7 @@ recv_urg: * closed. */ -static unsigned char new_state[16] = { +static const unsigned char new_state[16] = { /* current state: new state: action: */ /* (Invalid) */ TCP_CLOSE, /* TCP_ESTABLISHED */ TCP_FIN_WAIT1 | TCP_ACTION_FIN, @@ -2065,8 +2065,7 @@ void __init tcp_init(void) sizeof(struct inet_ehash_bucket), thash_entries, (num_physpages >= 128 * 1024) ? - (25 - PAGE_SHIFT) : - (27 - PAGE_SHIFT), + 13 : 15, HASH_HIGHMEM, &tcp_hashinfo.ehash_size, NULL, @@ -2082,8 +2081,7 @@ void __init tcp_init(void) sizeof(struct inet_bind_hashbucket), tcp_hashinfo.ehash_size, (num_physpages >= 128 * 1024) ? - (25 - PAGE_SHIFT) : - (27 - PAGE_SHIFT), + 13 : 15, HASH_HIGHMEM, &tcp_hashinfo.bhash_size, NULL, diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a16064b..76ff9f4 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -985,6 +985,8 @@ int ipv6_dev_get_saddr(struct net_device } /* Rule 4: Prefer home address -- not implemented yet */ + if (hiscore.rule < 4) + hiscore.rule++; /* Rule 5: Prefer outgoing interface */ if (hiscore.rule < 5) { diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 1bdf0fb..34a3322 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -751,7 +751,7 @@ void icmpv6_cleanup(void) inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6); } -static struct icmp6_err { +static const struct icmp6_err { int err; int fatal; } tab_unreach[] = { diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index c1fa693..8523c76 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -774,7 +774,8 @@ out_err_release: *dst = NULL; return err; } -inline int ip6_ufo_append_data(struct sock *sk, + +static inline int ip6_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 25757ad..3620718 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -628,8 +628,8 @@ e_inval: return -EINVAL; } -int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, - char __user *optval, int len) +static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, + char __user *optval, int len) { if (!hdr) return 0; diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 7d49222..95d4692 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1972,7 +1972,7 @@ static int ip6t_get_matches(char *buffer return pos; } -static struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] = +static const struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] = { { "ip6_tables_names", ip6t_get_tables }, { "ip6_tables_targets", ip6t_get_targets }, { "ip6_tables_matches", ip6t_get_matches },