aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2005-01-14[PATCH] uml: readd CONFIG_MAGIC_SYSRQ for UMLPaolo \'Blaisorblade\' Giarrusso1-1/+0
This config option was lost during the creation of lib/Kconfig.debug, due to a bad expressed dependency; I also moved the option back to its original place for UML (it is near CONFIG_MCONSOLE since it depends on that). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-12[PATCH] PPC64 can do preempt debug tooPaul Mackerras1-1/+1
This patch enables the DEBUG_PREEMPT config option for PPC64. I have this turned on on my desktop G5 and it isn't finding any problems. (It did find one problem, in flush_tlb_pending(), that I have just sent a patch for.) BTW, do we really need to restrict which architectures the config option is available on? Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-09Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-0/+10
into kroah.com:/home/greg/linux/BK/usb-2.6
2005-01-07[PATCH] remove IN_STRING_CAdrian Bunk1-2/+0
IN_STRING_C was an i386-specific hack by Andi Kleen to provide out-of-line versions of some lib/string.c functions that aren't directly used on i386 (because there are inline assembly versions). This can cause problems if gcc chooses to transparently replace a call to one string function with a call to another string function (the example Andi gave was a replacement of a sprintf call with a strcpy call) which generates a function call to the replacement function. The problems observed by Andi only occur in recent kernels without -fno-unit-at-a-time. With -ffreestanding it can't even cause any problems in case we'd one day drop the -fno-unit-at-a-time since gcc mustn't assume in a freestanding environment that all standard C library functions are available. The effect of this patch is a small space saving in the kernel. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-07[PATCH] DEBUG_BUGVERBOSE for i386Adrian Bunk1-2/+3
The patch below implements CONFIG_DEBUG_BUGVERBOSE for i386 (more exactly, it allows disabling the verbose BUG() reporting). Also, require CONFIG_EMBEDDED for this option: we don't want to make it easy for people to disable useful debug info. (With lots of help from Roman Zippel <zippel@linux-m68k.org>) Signed-off-by: Adrian Bunk <bunk@fs.tum.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-07[PATCH] Lock initializer cleanup (Core)Thomas Gleixner1-1/+1
Kernel core files converted to use the new lock initializers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-07[PATCH] remove the BKL by turning it into a semaphoreIngo Molnar2-2/+150
This is the current remove-BKL patch. I test-booted it on x86 and x64, trying every conceivable combination of SMP, PREEMPT and PREEMPT_BKL. All other architectures should compile as well. (most of the testing was done with the zaphod patch undone but it applies cleanly on vanilla -mm3 as well and should work fine.) this is the debugging-enabled variant of the patch which has two main debugging features: - debug potentially illegal smp_processor_id() use. Has caught a number of real bugs - e.g. look at the printk.c fix in the patch. - make it possible to enable/disable the BKL via a .config. If this goes upstream we dont want this of course, but for now it gives people a chance to find out whether any particular problem was caused by this patch. This patch has one important fix over the previous BKL patch: on PREEMPT kernels if we preempted BKL-using code then the code still auto-dropped the BKL by mistake. This caused a number of breakages for testers, which breakages went away once this bug was fixed. Also the debugging mechanism has been improved alot relative to the previous BKL patch. Would be nice to test-drive this in -mm. There will likely be some more smp_processor_id() false positives but they are 1) harmless 2) easy to fix up. We could as well find more real smp_processor_id() related breakages as well. The most noteworthy fact is that no BKL-using code was found yet that relied on smp_processor_id(), which is promising from a compatibility POV. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-06mergeGreg Kroah-Hartman1-0/+10
2005-01-05Merge shinybook.infradead.org:/home/dwmw2/bk/linus-2.6David Woodhouse1-8/+8
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
2005-01-04[PATCH] prio_tree: move general code from mm/ to lib/Werner Almesberger2-1/+485
Last but not least, move the general prio_tree code from mm/ to lib/. This patch also duplicates some macros, which are used in the VMA code for debugging purposes, so we can't properly separate them yet. Note that this patch conflicts with a patch in 2.6.10-rc3-mm1 (frv-better-mmap-support-in-uclinux.patch), which removes mm/prio_tree in systems without an MMU. Not making that other patch provide a dummy for prio_tree_init should resolve the conflict. (That's just from reading the patch - I haven't actually tried this.) Signed-off-by: Werner Almesberger <werner@almesberger.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-04[PATCH] out-of-line implementation of find_next_bit()David Howells2-0/+56
The attached patch provides an out-of-line implementation of find_next_bit() and rearranges linux/bitops.h to avoid a dependency loop between inline functions in there and in asm/bitops.h trying to include one another. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-12-15debugfs: add debugfsGreg Kroah-Hartman1-0/+10
debugfs is a filesystem that is just for debug data. Start moving stuff out of proc and sysfs now :) Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-12-13Merge shinybook.infradead.org:/home/dwmw2/bk/linus-2.6David Woodhouse1-8/+8
into shinybook.infradead.org:/home/dwmw2/bk/mtd-2.6
2004-12-02[PATCH] Driver Core: restore comment in kobject_uevent.cGreg Kroah-Hartman1-0/+2
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-28Merge dwmw2.baythorne.internal:/inst/bk/linus-2.6David Woodhouse1-8/+8
into dwmw2.baythorne.internal:/inst/bk/mtd-2.6
2004-11-28rslib: Spelling fixes.David Woodhouse1-8/+8
Some of the fixes from Joe Perches <joe@perches.com> got missed out of the last update. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2004-11-18[PATCH] m32r: Kconfig.debug supportHirokazu Takata1-7/+7
This patch updates Kconfig and add Kconfig.debug for m32r. - arch/m32r/Kconfig: Move "Kernel hacking" menu to Kconfig.debug. - arch/m32r/Kconfig.debug: Newly added. - lib/Kconfig.debug: Add m32r arch. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-18[PATCH] fix kobject varargs bugAndrew Morton1-2/+4
From: Gerd Knorr <kraxel@bytesex.org> It uses the varargs list twice in a illegal way. That doesn't harm on i386 by pure luck, but blows things up on amd64 machines. Using var args list twice without calling va_start twice is illegal. Signed-off-by: Gerd Knorr <kraxel@bytesex.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-16RS library spelling fixes.David Woodhouse2-6/+6
Originally from Joe Perches <joe@perches.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2004-11-15[PATCH] radix_tree_delete() fixDave Kleikamp1-2/+4
I was looking through the radix tree code and came across what I think is a bug in radix_tree_delete. for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) { if (pathp[0].node->tags[tag][idx]) { tags[tag] = 1; nr_cleared_tags--; break; } } The above loop should only be executed if tags[tag] is zero. Otherwise, when walking up the tree, we can decrement nr_cleared_tags twice or more for the same value of tag, thus potentially exiting the outer loop too early. Ensure that nr_cleared_tags is only decremented once for each tag. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-13[PATCH] __init for inflate.cAndries E. Brouwer1-18/+22
In do_mounts_rd.c and initramfs.c there are many references from .text to .text.init because of the inclusion of lib/inflate.c. The below adds INIT markup in lib/inflate.c.
2004-11-11[PATCH] print hotplug SEQNUM as unsignedKay Sievers1-3/+3
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-11[PATCH] Add KOBJ_ONLINEAnil Keshavamurthy1-0/+2
I am trying to fix the current ACPI container.ko and processor.ko to use kobject_hotplug() for notification. For this I would be requiring the KOBJ_ONLINE definitions to be added to kobject_action. Signed-off-by: Anil Keshavamurty <anil.s.keshavamurthy@intel.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-10[PATCH] lib/parser: fix %% parsingDomen Puncer1-0/+1
Code looks like it intended to parse "%%" in pattern string as "%". Fix it, so it really does that. Compile and run tested. Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-08[PATCH] kobject: fix double kobject_put() in error path of kobject_add()Greg Kroah-Hartman1-1/+1
This fixes a problem introduced in the previous set of driver model changes that has been seen by a lot of people (most notibly the greater than 256 pty users, but others might also be hitting this without realizing it.) Also add a comment so we don't try to "fix" this again. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-03[PATCH] kobject_uevent: fix init orderingRobert Love1-4/+2
Looks like kobject_uevent_init is executed before netlink_proto_init and consequently always fails. Not cool. Attached patch switches the initialization over from core_initcall (init level 1) to postcore_initcall (init level 2). Netlink's initialization is done in core_initcall, so this should fix the problem. We should be fine waiting until postcore_initcall. Also a couple white space changes mixed in, because I am anal. Signed-Off-By: Robert Love <rml@novell.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-03kevent: fix build error if CONFIG_KOBJECT_UEVENT is not selected.Greg Kroah-Hartman1-1/+1
Thanks to Serge Hallyn <serue@us.ibm.com> for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-03[PATCH] driver-model: kobject_add() error path reference counting fixTejun Heo1-0/+1
df_04_kobject_add_ref_fix.patch In kobject_add(), @kobj wasn't put'd properly on error path. This patch fixes it. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] take me home, hotplug_path[]Kay Sievers1-0/+1
Move hotplug_path[] out of kmod.[ch] to kobject_uevent.[ch] where it belongs now. At some time in the future we should fix the remaining bad hotplug calls (no SEQNUM, no netlink uevent): ./drivers/input/input.c (no DEVPATH on some hotplug events!) ./drivers/pnp/pnpbios/core.c ./drivers/s390/crypto/z90main.c Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] kobject: fix hotplug bug with seqnumKay Sievers1-17/+30
On Sat, Oct 30, 2004 at 04:54:29AM +0200, Kay Sievers wrote: > On Sat, Oct 30, 2004 at 02:25:23AM +0200, Kay Sievers wrote: > > On Sat, Oct 30, 2004 at 02:00:45AM +0200, Kay Sievers wrote: > > > On Fri, Oct 29, 2004 at 06:13:19PM -0500, Greg KH wrote: > > > > On Fri, Oct 29, 2004 at 11:28:56PM +0200, Kay Sievers wrote: > > > > > > But there might still be a problem. With this change, the sequence > > > > > > number is not sent out the kevent message. Kay, do you think this is an > > > > > > issue? I don't think we can get netlink messages out of order, right? > > > > > > > > > > Right, especially not the events with the same DEVPATH, like "remove" > > > > > beating an "add". But I'm not sure if the number isn't useful. Whatever > > > > > we may do with the hotplug over netlink in the future, we will only have > > > > > /sbin/hotplug for the early boot and it may be nice to know, what events > > > > > we have already handled... > > > > > > > > > > > I'll hold off on applying this patch until we figure this out... > > > > > > > > > > How about just reserving 20 bytes for the number (u64 will never be > > > > > more than that), save the pointer to that field, and fill the number in > > > > > later? > > > > > > > > Ah, something like this instead? I like it, it's even smaller than the > > > > previous patch. Compile tested only... > > > > > > I like that. How about the following. It will keep the buffer clean from > > > random chars, cause the kevent does not have the vector and relies on > > > the '\0' to separate the strings from each other. > > > I've tested it. The netlink-hotplug message looks like this: > > > > > > recv(3, "remove@/class/input/mouse2\0ACTION=remove\0DEVPATH=/class/input/mouse2\0SUBSYSTEM=input\0SEQNUM=961 \0", 1024, 0) = 113 > > > > Hmm, these trailing spaces are just bad, sorry. I'll better pass the > > envp array over to send_uevent() and clean up the keys while copying > > the env values into the skb buffer. This will make the event payload > > more safe too. So your first version looks better. > > How about this? We copy over key by key into the skb buffer and the > netlink message can get the envp array without depending on a single > continuous buffer. > > The netlink message looks nice like this now: > > recv(3, " > add@/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0 > HOME=/\0 > PATH=/sbin:/bin:/usr/sbin:/usr/bin\0 > ACTION=add\0 > DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0 > SUBSYSTEM=usb\0 > SEQNUM=991\0 > DEVICE=/proc/bus/usb/003/008\0 > PRODUCT=46d/c03e/2000\0 > TYPE=0/0/0\0 > INTERFACE=3/1/2\0 > ", 1024, 0) = 268 Here is an improved version that uses skb_put() to fill the skb buffer, instead of trimming the buffer to the final size after we've copied over all keys. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] parisc: Kconfig debugging optionsMatthew Wilcox1-2/+2
PA-RISC does have spinlock debugging and doesn't have the frame pointer option. USERMODE had been added twice to spinlock debugging, so remove that. Committed-by: Randolph Chung <tausq@parisc-linux.org> Committed-by: Matthew Wilcox <willy@parisc-linux.org>
2004-10-30Make "atomic_dec_and_lock()" a macro.Linus Torvalds1-2/+2
We rename the actual architecture-specific low-level implementation to have a prepended underscore: "_atomic_dec_and_lock()". This extra macro indirection is so that we can make the macro do the lock context counting. That will be the next patch.
2004-10-27[PATCH] uml: Kconfig.debug updateChris Wedgwood1-3/+3
Update Kconfig.debug so we get SYSRQ back and also the spinlock debugging options. Signed-off-by: Chris Wedgwood <cw@f00f.org> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-27[PATCH] ia64 iomap implementationBjorn Helgaas1-1/+5
This preserves the ioreadX() == inX() semantics (same as i386), since it's not clear that the speedup of omitting the mf.a for port operations is worth the risk of breaking drivers. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-27Merge bk://linux-sam.bkbits.net/kbuildSam Ravnborg1-1/+1
into mars.ravnborg.org:/home/sam/bk/to-linus
2004-10-25[PATCH] idr_remove safety checkingJim Houston1-3/+12
idr_remove() should fail gracefully and warn if the id being removed is not valid. The attached patch should do the job without additional overhead. With the existing code, removing an id which was not allocated could remove a valid id which shares the same lowest layer of the radix tree. I ran a kernel with this patch but have not done any tests to force a failure. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-25Allow BKL re-acquire to fail, causing us to re-schedule.Linus Torvalds1-10/+34
This allows for low-latency BKL contention even with preemption. Previously, since preemption is disabled over context switches, re-acquiring the kernel lock when resuming a process would be non-preemtible.
2004-10-24Un-inline the big kernel lock.Linus Torvalds2-0/+103
Now that spinlocks are uninlined, it is silly to keep the BKL inlined. And this should make it a lot easier for people to play around with variations on the locking (ie Ingo's semaphores etc).
2004-10-22hotplug: prevent skips in sequence number from happeningGreg Kroah-Hartman1-8/+9
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] kobject_uevent warning fixAndrew Morton1-0/+2
lib/kobject_uevent.c:39: warning: `action_to_string' defined but not used Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] remove cpu_run_sbin_hotplug()Andrew Morton1-0/+2
From: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com> Remove cpu_run_sbin_hotplug() - use kobject_hotplug() instead. Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] kobject_hotplug: permit no hotplug_opsAndrew Morton1-7/+12
Make kobject_hotplug() work even if the kobject's kset doesn't implement any hotplug_ops. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-21Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman3-4/+13
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-10-21Shared Reed-Solomon ECC libraryThomas Gleixner6-0/+686
The attached patch contains a shared Reed-Solomon Library analogous to the shared zlib. (N)AND FLASH is gaining popularity and there are a lot of ASIC/SoC/FPGA controllers around which implement hardware support for Reed-Solomon error correction. As usual they use different implementations (polynomials etc.). So it's obvious to use a shared library for the common tasks of error correction. A short scan through the kernel revealed that at least the ftape driver uses Reed-Solomon error correction. It could be easily converted to use the shared library code. The encoder/decoder code is lifted from the GPL'd userspace RS-library written by Phil Karn. I modified/wrapped it to provide the different functions which we need in the MTD/NAND code. The library is tested in extenso under various MTD/NAND configurations. The lib should be usable for other purposes right out of the box. Adjustment for currently not implemented functionality is an easy task. I'm willing to take the maintainership of the library. Signed-Off-By: Thomas Gleixner <tglx@linutronix.de> Signed-Off-By: David Woodhouse <dwmw2@infradead.org> "No objections at all. Just keep the authorship notices." -- Phil Karn
2004-10-20kobject: add CONFIG_DEBUG_KOBJECTGreg Kroah-Hartman3-4/+13
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-19[PATCH] Enable config_schedstats for all archesKenneth W. Chen1-0/+12
Config option CONFIG_SCHEDSTATS is currently enabled via arch specific Kconfig.debug. Only x86 and ppc arches has code to turn it on. Why not put it in generic lib/Kconfig.debug so it is done once to enable everyone? Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-19[PATCH] #include <asm/bitops.h> -> #include <linux/bitops.h>Adrian Bunk1-1/+1
There's no reason to directly #include <asm/bitops.h> since it's available on all architectures and also included by #include <linux/bitops.h>. This patch changes #include <asm/bitops.h> to #include <linux/bitops.h>. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18Trivial Makefile mergeLinus Torvalds1-6/+4
2004-10-18[PATCH] Simplify last lib/idr.c changeUlrich Drepper1-6/+4
The last change to alloc_layer in lib/idr.c unnecessarily complicates the code and depending on the definition of spin_unlock will cause worse code to be generated than necessary. The following patch should improve the situation. Signed-off-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18mergeGreg Kroah-Hartman1-0/+2
2004-10-18Add copyright notice on ppc64 iomap files.Linus Torvalds1-0/+2
Paul cares. I think there's something in the water at IBM that makes people sticklers ;)
2004-10-17kconfig.debug: mention that DEBUG_SLAB can slow down machine quite a bitDenis Vlasenko1-1/+1
I experienced x3 slowdown due to this option being set. Please add this small warning to DEBUG_SLAB help text. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-10-15kevent: add __bitwise kobject_action to help the compiler check for misusagesGreg Kroah-Hartman1-15/+13
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-29[PATCH] kobject: add add_hotplug_env_var()Roland Dreier1-1/+51
Add a (non-inlined) add_hotplug_env_var() function to <linux/kobject.h> and lib/kobject.c. There's a lot of boilerplate code involved in setting environment variables in a hotplug method, so we should have a convenience function to consolidate it (and avoid subtle bugs). Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-24Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman3-131/+303
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-09-23The generic iomap library needs to be linked unconditionally.Linus Torvalds1-1/+1
Otherwise modules that get loaded dynamically will not be able to resolve the iomap functions, if no built-in drivers caused it to be linked in at compile-time.
2004-09-22[PATCH] idr: fix missing spin_unlock()Li Shaohua1-1/+3
Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-22Merge gregkh@kernel.bkbits.net:linux/driver-2.6Greg Kroah-Hartman3-131/+303
into press.kroah.org:/home/greg/linux/BK/driver-2.6
2004-09-15kevent: add block mount and umount supportGreg Kroah-Hartman1-0/+1
Send notification over the new netlink socket to let userspace know that the filesystem code claims/releases the superblock on an blockdevice. This way, userspace can get rid of constantly polling /proc/mounts to watch for filesystem changes. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-14kevent: standardize on the event typesGreg Kroah-Hartman2-10/+40
This prevents any potential typos from happening. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-14Add support for "string" ioread/iowrite.Linus Torvalds1-0/+85
Things like SATA use this for data transfer. Also export the iomap routines on ppc64.
2004-09-13[PATCH] kobject_uevent warning fixAndrew Morton1-1/+1
lib/kobject_uevent.c: In function `kobject_hotplug': lib/kobject_uevent.c:225: warning: long long int format, u64 arg (arg 3) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-13[IOMAP]: Make ioport_map() take unsigned long port argument.David S. Miller1-4/+4
Signed-off-by: David S. Miller <davem@davemloft.net>
2004-09-12Export new PCI iomem access interfaces to modules too.Linus Torvalds1-0/+11
2004-09-12Add skeleton "generic IO mapping" infrastructure.Linus Torvalds2-0/+111
Jeff wants to use this to clean up SATA and some network drivers.
2004-09-12Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman3-129/+270
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-09-10Kobject Userspace Event NotificationGreg Kroah-Hartman3-129/+270
Implemetation of userspace events through a netlink socket. The kernel events layer provides the functionality to raise an event from a given kobject represented by its sysfs-path and a signal string to describe the type of event. Currently, kobject additions and removals are signalized to userspace by forking the /sbin/hotplug helper. This patch moves this special case of userspace-event out of the kobject core to the new kobject_uevent implementation. This makes it possible to send all hotplug messages also through the new netlink transport. Possible new users of the kernel userspace functionality are filesystem mount events (block device claim/release) or simple device state transitions (cpu overheating). To send an event, the user needs to pass the kobject, a optional sysfs-attribute and the signal string to the following function: kobject_uevent(const char *signal, struct kobject *kobj, struct attribute *attr) Example: kobject_uevent("overheating", &cpu->kobj, NULL); The message itself is sent over multicast netlink socket, which makes it possible for userspace to listen with multiple applications for the same messages. Signed-off-by: Robert Love <rml@novell.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-08[PATCH] ksyms: don't implement /sys/kernel/hotplug_seqnum if CONFIG_HOTPLUG ↵Greg Kroah-Hartman1-1/+1
is not enabled. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-08[PATCH] kobject: hotplug_seqnum is not 64 bits on all platforms, so fix it.Greg Kroah-Hartman1-1/+1
Thanks to Kay Sievers for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-07[PATCH] zlib_inflate: Make zlib_inflate_trees_fixed(...) generate the tableTom Rini4-160/+28
The following changes zlib_inflate_trees_fixed(...) from using a statically defined table, to generating this table. This cuts out 4-8kB from inftrees.o (4kB on IBM 440GP, 8kB on PPC 74xx). Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-07[PATCH] zlib_inflate: Move zlib_inflateSync & friendsTom Rini3-142/+149
The following patch moves zlib_inflateSync and friends, which are used by PPP and not a 'normal' gzip, into inflate_sync.c. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-07[PATCH] Convert in-kernel users of EXPORT_SYMBOL_NOVERS() to EXPORT_SYMBOL()Geert Uytterhoeven1-4/+4
Convert all in-kernel users of the deprecated EXPORT_SYMBOL_NOVERS() to EXPORT_SYMBOL(). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-05kobject: fix build error if CONFIG_HOTPLUG is not enabled.Greg Kroah-Hartman1-1/+1
Thanks to Kay Sievers for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-04kobject: adjust hotplug_seqnum increment to keep userspace and kernel agreeing.Greg Kroah-Hartman1-1/+1
2004-09-04[PATCH] export of SEQNUM to userspace (creates /sys/kernel)Kay Sievers1-2/+2
o /sys/kernel/hotplug_seqnum exports the current number o lib/kobject.c's sequence_num is renamed to hotplug_seqnum and exported by include/linux/kobject.h o the source file ksysfs.c in kernel/ creates on init the sybsystem "/sys/kernel/" in sysfs Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-02[PATCH] ppc64: enable DEBUG_SPINLOCK_SLEEPAnton Blanchard1-1/+1
DEBUG_SPINLOCK_SLEEP is useful on ppc64, so allow it to be selected. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-02[PATCH] Remove pointless check in zlibDave Jones1-2/+0
We dereference 'z' a few lines above this check. If it was possible to hit this condition, it wouldve triggered long ago, in the form of a crash. Spotted with the source checker from Coverity.com. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-28Merge bk://linux-voyager.bkbits.net/dma-declare-coherent-memory-2.6Linus Torvalds1-0/+82
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-08-24Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman3-39/+52
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-08-24kobject: convert struct kobject use kref.Greg Kroah-Hartman2-13/+11
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-08-24[PATCH] kobject: fix kobject_set_name comment.Dmitry Torokhov1-1/+1
Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-08-23Merge bk://kernel.bkbits.net/davem/net-2.6Linus Torvalds1-0/+13
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-08-22Merge bk://linux-sam.bkbits.net/kbuildLinus Torvalds2-1/+101
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2004-08-22KREF: make kref_get() return void as it makes sense to do so.Greg Kroah-Hartman1-2/+1
Thanks to Kiran for bugging me to do this. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-08-22[PATCH] idr.c: remove stale commentChristoph Hellwig1-90/+74
The generation counters were removed from the idr code. Update idr.c comments, now uses doc-book style API documentation. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-16kconfig/all archs: Introduce Kconfig.debugSam Ravnborg1-0/+100
Localize Kconfig debug options into one file (lib/Kconfig.debug) for easier maintenance, searching, and menu-building. Updated to 2.6.8. Summary of changes: . localizes the following symbols in lib/Kconfig.debug: DEBUG_KERNEL, MAGIC_SYSRQ, DEBUG_SLAB, DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, DEBUG_HIGHMEM, DEBUG_BUGVERBOSE, DEBUG_INFO and FRAME_POINTER for some instances of it (if it's freely user-selectable) but not for the cases where it's forced or it depends on some other options. . adds DEBUG_KERNEL requirement to some DEBUG_vars; . remove KALLSYMS from S390-specific kernel hacking menu; use KALLSYMS in the EMBEDDED menu instead; . add CRIS and M68KNOMMU symbols for use in lib/Kconfig.debug; . eliminate duplicate "General setup" labels in sparc64 config; . whitespace cleanup; . fixed a few trival typos; Portions of the original patch were also done by Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-08-15[RBTREE]: Add rb_last()Patrick McHardy1-0/+13
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@redhat.com>
2004-08-15Merge mars.ravnborg.org:/home/sam/bk/kbuild-mmSam Ravnborg1-1/+1
into mars.ravnborg.org:/home/sam/bk/kbuild
2004-08-14MergeJames Bottomley1-0/+82
2004-08-14lib/bitmap.c: fix incorrect use of BITS_TO_LONGS()James Bottomley1-3/+9
Bug spotted by: Ian Molton <spyro@f2s.com> BITS_TO_LONGS() can't be used to derive an index into a bitmap array. Also put a BUG_ON() for the pages > BITS_PER_LONG case we don't cope with.
2004-08-11kbuild: Replace host-progs with hostprogs-ySam Ravnborg1-1/+1
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-08-07[PATCH] Teach sscanf about 'hh' and 'll'Alexander Viro1-2/+19
Adds support for 'hh' (store number in char *) and 'll' (proper C99 for long long) modifiers to sscanf().
2004-08-06[PATCH] KOBJECT: add kobject_get_pathRobert Love1-9/+27
Add a new kobject helper, kobject_get_path(), which is the greatest function ever. Signed-Off-By: Robert Love <rml@ximian.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-08-02KREF: shrink the size of struct kref down to just a single atomic_tGreg Kroah-Hartman1-14/+12
This was based on a patch from Kiran, but tweaked further by me. Signed-off-by: Ravikiran Thirumalai <kiran@in.ibm.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-07-28[PATCH] Export all functions in lib/string.cRoland Dreier1-1/+21
Quite a few functions in lib/string.c are not exported. I ran into this trying to use strnchr() in a module. This patch - exports every function defined in lib/string.c - adds some missing __HAVE_ARCH_xxx defines for i386 - gets rid of the exports of functions from lib/string.c in arch/s390 (BTW, why is s390 exporting things NOVERS?) Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-14Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-3/+4
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-07-10[PATCH] fix CRC16 misnamingAndrey Panin3-15/+15
As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12 + x^5 + 1) implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks like we need to rename it accordingly and this patchset does exactly this. Signed-off-by: Andrey Panin <pazke@donpac.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-08[PATCH] Driver core: kset_find_obj should increment refcount of the found objectDmitry Torokhov1-3/+4
kset_find_obj should increment refcount of the found object so users of the function can safely use returned object Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-07-04[PATCH] gcc 3.5 fixes #2Anton Blanchard1-1/+1
gcc 3.5 is warning about unused static variables, add __attribute_unused__ to the 2 places to silence it. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-01[PATCH] 64 bit bug in radix-tree lookup.Martin Schwidefsky1-4/+4
The radix tree functions __lookup and __lookup_tag uses (1 << shift) in their index calculations. On 64 bit systems the shift can be bigger than 32. The shift of an integer by more than 32 bits evaluates to zero which causes the lookup to fail. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-30Add memory region bitmap implementationsJames Bottomley1-0/+76
These APIs deal with bitmaps representing contiguous memory regions. The idea is to set, free and find a contiguous area. For ease of implementation (as well as to conform to the standard requirements), the bitmaps always return n aligned n length regions. The implementation is also limited to BITS_PER_LONG contiguous regions. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2004-06-29sparse: get rid of more integer/pointer confusionLinus Torvalds4-6/+6
Use NULL, not 0, where appropriate.
2004-06-29[PATCH] Combined patch for remaining trivial sparse warnings in allnoconfig ↵Mika Kukkonen2-2/+2
build Well, one of these (fs/block_dev.c) is little non-trivial, but i felt throwing that away would be a shame (and I did add comments ;-). Also almost all of these have been submitted earlier through other channels, but have not been picked up (the only controversial is again the fs/block_dev.c patch, where Linus felt a better job would be done with __ffs(), but I could not convince myself that is does the same thing as original code). Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-26[PATCH] crc: add common CRC16 moduleAndrey Panin3-0/+79
Currently we have 8 copies of CRC16 calculation table in different device drivers, this patch creates common crc16.c module to replace them. Signed-off-by: Andrey Panin <pazke@donpac.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-23[PATCH] cpumask: bitmap inlining and optimizationsAndrew Morton1-44/+47
From: Paul Jackson <pj@sgi.com> These bitmap improvements make it a suitable basis for fully supporting cpumask_t and nodemask_t. Inline macros with compile-time checks enable generating tight code on both small and large systems (large meaning cpumask_t requires more than one unsigned long's worth of bits). The existing bitmap_<op> macros in lib/bitmap.c are renamed to __bitmap_<op>, and wrappers for each bitmap_<op> are exposed in include/linux/bitmap.h This patch _includes_ Bill Irwins rewrite of the bitmap_shift operators to not require a fixed length intermediate bitmap. Improved comments list each available operator for easy browsing. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-23[PATCH] cpumask: bitmap cleanup preparation for cpumask overhaulAndrew Morton1-6/+81
From: Paul Jackson <pj@sgi.com> Document the bitmap bit model and handling of unused bits. Tighten up bitmap so it does not generate nonzero bits in the unused tail if it is not given any on input. Add intersects, subset, xor and andnot operators. Change bitmap_complement to take two operands. Add a couple of missing 'const' qualifiers on bitops test_bit and bitmap_equal args. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-21[PATCH] sparse: zlib stray extern removalAlexander Viro1-1/+1
2004-06-20[PATCH] lindent rwsemNick Piggin2-96/+110
Lindent rwsem.c and rwsem-spinlock.c and fix a few things by hand. Also added a couple of comments for the memory barriers. Added the __sched annotation that was left out of rwsem-spinlock.c. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-18[PATCH] sparse: lib/string.c sparse fixRandy Dunlap1-1/+1
A classic.. lib/string.c:165:19: warning: assignment expression in conditional From: Mika Kukkonen <mika@osdl.org> Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
2004-06-17[PATCH] fix simple_strtoul base 16 handlingChris Wright1-2/+8
I know it's simple_strtoul, but is it meant to be that simple? Fix up for both simple_strtoul and simple_strtoull. simple_strtoul(0x401b, NULL, 0) = 0x401b simple_strtoul(0X401b, NULL, 0) = 0x0 simple_strtoul(0x401b, NULL, 16) = 0x0 simple_strtoul(0X401b, NULL, 16) = 0x0 simple_strtoull(0x401b, NULL, 0) = 0x401b simple_strtoull(0X401b, NULL, 0) = 0x0 simple_strtoull(0x401b, NULL, 16) = 0x0 simple_strtoull(0X401b, NULL, 16) = 0x0 Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-17[PATCH] IDR fixupsCorey Minyard1-14/+31
There were definately some problems in there. I've made some changes and tested with a lot of bounds. I don't have a machine with enough memory to fill it up (it would take ~16GB on a 64-bit machine), but I use the "above" code to simulate a lot of situations. The problems were: * IDR_FULL was not the right value * idr_get_new_above() was not defined in the headers or documented. * idr_alloc() bug-ed if there was a race and not enough memory was allocated. It should have returned NULL. * id will overflow when you go past the end. * There was a "(id >= (1 << (layers*IDR_BITS)))" comparison, but at the top layer it would overflow the id and be zero. * The allocation should return ENOSPC for an "above" value with nothing above it, but it returned EAGAIN. I have not tested on 64-bits (as I don't have a 64-bit machine). I've included the files, a diff from the previous version, and my test programs. For the test programs, idr_test <size> will just attempt to allocate <size> elements, check them, free them, and check them again. idr_test2 <size> <incr> will allocate <size> element with <incr> between them. idr_test3 just tests some bounds and tries all values with just a few in the idr. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-17[PATCH] idr: remove counter bits from id'sAndrew Morton1-16/+3
idr_get_new() currently returns an incrementing counter in the top 8 bits of the counter. Which means that most users have to mask it off again, and we only have a 24-bit range. So remove that counter. Also: - Remove the BITS_PER_INT define due to namespace collision risk. - Make MAX_ID_SHIFT 31, so counters have a 0 to 2G-1 range. - Why is MAX_ID_SHIFT using sizeof(int) and not sizeof(long)? If it's for consistency across 32- and 64-bit machines, why not just make it "31"? - Does this still hold true with the counter removed? /* We can only use half the bits in the top level because there are only four possible bits in the top level (5 bits * 4 levels = 25 bits, but you only use 24 bits in the id). */ If not, what needs to change? Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-17[PATCH] Fixes for idr codeCorey Minyard1-8/+37
* On a 32-bit architecture, the idr code will cease to work if you add more than 2^20 entries. You will not be able to find many of the entries. The problem is that the IDR code uses 5-bit chunks of the number and the lower portion used by IDR is 24 bits, so you have one bit that leaks over into the comparisons that should not be there. The solution is to mask off that bit before doing IDR processing. This actually causes the POSIX timer code to crash if you create that many timers. I have included an idr_test.tar.gz file that demonstrates this with and without the fix, in case you need more evidence :). * When the IDR fills up, it returns -1. However, there was no way to check for this condition. This patch adds the ability to check for the idr being full and fixes all the users. It also fixes a problem in fs/super.c where the idr code wasn't checking for -1. * There was a race condition creating POSIX timers. The timer was added to a task struct for another process then the data for the timer was filled out. The other task could use/destroy time timer as soon as it is in the task's queue and the lock is released. This moves settup up the timer data to before the timer is enqueued or (for some data) into the lock. * Change things so that the caller doesn't need to run idr_full() to find out the reason for an idr_get_new() failure. Just return -ENOSPC if the tree was full, or -EAGAIN if the caller needs to re-run idr_pre_get() and try again. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-07[PATCH] Fix semaphore downgrade_write()David Howells1-15/+20
Stop downgrade_write() from under-adjusting the rwsem counter in optimised rw-semaphores. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-05-22[PATCH] slab: consolidate panic codeAndrew Morton1-3/+1
Many places do: if (kmem_cache_create(...) == NULL) panic(...); We can consolidate all that by passing another flag to kmem_cache_create() which says "panic if it doesn't work".
2004-05-14Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-3/+7
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-05-13[PATCH] sysfs_rename_dir-cleanupManeesh Soni1-3/+7
o The following patch cleans up sysfs_rename_dir(). It now checks the return code of kobject_set_name() and propagates the error code to its callers. Because of this there are changes in the following two APIs. Both return int instead of void. int sysfs_rename_dir(struct kobject * kobj, const char *new_name) int kobject_rename(struct kobject * kobj, char *new_name)
2004-05-10[PATCH] Kill some 'No description found...' warnings. (kernel-api.sgml)Andrew Morton1-2/+2
From: Alexey Dobriyan <adobriyan@mail.ru> Fix various kernel-doc parameters.
2004-05-03Be more careful about waking up rwsem waitersLinus Torvalds2-5/+13
Get a reference count on the the sleeper, so that it can't possibly go away before we've sent it the wakeup event. Noted by Nick Piggin <nickpiggin@yahoo.com.au> David Howells <dhowells@redhat.com>
2004-05-01Be more careful about semaphore contention memory ordering.Linus Torvalds2-15/+28
Don't touch the wakee stack after marking it runnable.
2004-04-27Merge davem@nuts.davemloft.net:/disk1/BK/net-2.6David S. Miller1-2/+1
into kernel.bkbits.net:/home/davem/net-2.6
2004-04-27[LIB]: Use compiler.h's pure attribute macros in crc32.c.Clay Haapala1-11/+5
2004-04-27[LIB]: Add CRC32c (Castagnoli, et al Cyclic Redundancy-Check)Clay Haapala3-0/+210
2004-04-27[PATCH] Fix rwsem contention case on alpha/s390xIvan Kokshaysky1-2/+1
Thanks to Dru <andru@treshna.com>, who provided an easy way to reproduce the problem. What we have in lib/rwsem.c:__rwsem_do_wake(): int woken, loop; ^^^ and several lines below: loop = woken; woken *= RWSEM_ACTIVE_BIAS-RWSEM_WAITING_BIAS; woken -= RWSEM_ACTIVE_BIAS; However, rw_semaphore->count is 64-bit on Alpha, so RWSEM_WAITING_BIAS has been defined as -0x0000000100000000L. Obviously, this blows up in the write contention case.
2004-04-18[PATCH] idr.c: extra features enhancementsAndrew Morton1-75/+115
From: Jim Houston <jim.houston@comcast.net> - Adds idr_get_new_above(), whihc permits us to do a first-fit search from a specified offset rather than always from zero. - Add IDR_INIT() DEFINE_IDR() constructors. Often idr's are singletons and having to cook up an initcall for them is a pain. This is needed by the "Increase number of dynamic inodes in procfs" patch.
2004-04-14Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-3/+3
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-04-14[PATCH] radix-tree comment fixAndrew Morton1-6/+1
Fix various bogons and outright lies.
2004-04-12[PATCH] Rename bitmap_clear to bitmap_zero, remove CLEAR_BITMAPAndrew Morton1-1/+1
From: Rusty Russell <rusty@rustcorp.com.au> clear_bit(n, addr) clears the nth bit. test_and_clear_bit(n, addr) clears the nth bit. cpu_clear(n, cpumask) clears the nth bit (vs. cpus_clear()). bitmap_clear(bitmap, n) clears out all the bits up to n. Moreover, there's a CLEAR_BITMAP() in linux/types.h which bitmap_clear() is a wrapper for. Rename bitmap_clear to bitmap_zero, which is harder to confuse (yes, it bit me), and make everyone use it.
2004-04-11[PATCH] radix-tree tags for selective lookupAndrew Morton1-44/+400
Add radix-tree tagging so we can look up dirty or writeback pages in O(log64(n)) time. Each radix-tree node gains two bits for each slot: one for page dirtiness and one for page writebackness. If a tag bit is set on a leaf node, it indicates that item at the corresponding slot is tagged (say, a dirty page). If a tag bit is set in a non-leaf node it indicates that the same tag bit is set in the subtree which lies under the corresponding slot. ie: "there is a dirty page under here somewhere, but you need to search down further to find it". A gang lookup function is provided which can walk the radix tree in logarithmic time looking for items which are tagged, starting from a specified offset. We use this for in-order searches for dirty or writeback pages. There is a userspace test harness for this code at http://www.zip.com.au/~akpm/linux/patches/stuff/rtth.tar.gz
2004-04-11[PATCH] Remove bitmap_shift_*() bitmap length limitsAndrew Morton1-21/+49
From: William Lee Irwin III <wli@holomorphy.com> Chang bitmap_shift_left()/bitmap_shift_right() to have O(1) stackspace requirements. Given zeroed tail preconditions these implementations satisfy zeroed tail postconditions, which makes them compatible with whatever changes from Paul Jackson one may want to merge in the future. No particular effort was required to ensure this. A small (but hopefully forgiveable) cleanup is a spelling correction: s/bitmap_shift_write/bitmap_shift_right/ in one of the kerneldoc comments. The primary effect of the patch is to remove the MAX_BITMAP_BITS limitation, so restoring the NR_CPUS to be limited only by stackspace and slab allocator maximums. They also look vaguely more efficient than the current code, though as this was not done for performance reasons, no performance testing was done.
2004-04-11[PATCH] Broken bitmap_parse for ncpus > 32Andrew Morton1-1/+23
From: Joe Korty <joe.korty@ccur.com> This patch replaces the call to bitmap_shift_right() in bitmap_parse() with bitmap_shift_left(). I also prepended comments to the bitmap_shift_* functions defining what 'left' and 'right' means. This is under the theory that if I and all the reviewers were bamboozled, others in the future occasionally might be too.
2004-04-11[PATCH] Fix get_wchan() FIXME wrt. order of functionsAndrew Morton1-2/+3
From: William Lee Irwin III <wli@holomorphy.com> This addresses the issue with get_wchan() that the various functions acting as scheduling-related primitives are not, in fact, contiguous in the text segment. It creates an ELF section for scheduling primitives to be placed in, and places currently-detected (i.e. skipped during stack decoding) scheduling primitives and others like io_schedule() and down(), which are currently missed by get_wchan() code, into this section also. The net effects are more reliability of get_wchan()'s results and the new ability, made use of by this code, to arbitrarily place scheduling primitives in the source code without disturbing get_wchan()'s accuracy. Suggestions by Arnd Bergmann and Matthew Wilcox regarding reducing the invasiveness of the patch were incorporated during prior rounds of review. I've at least tried to sweep all arches in this patch.
2004-03-30[PATCH] kobject_set_name() doesn't allocate enough spaceLinda Xie1-3/+3
2004-03-30[PATCH] double semicolon cleanupAlexander Stohr1-1/+1
This cleans up a larger amount of superfluos ";;" statements in current Linux kernel sources by converting them to the regular single ";" statments. It seems to be a common problem that at the end of a line the semicolon key is producing an echo.
2004-03-21[PATCH] Fix missing "noinline" on x86-64Arnd Bergmann1-0/+1
The gcc-3.5 patch broke building on x86_64 and possibly others, because inflate.c does not pull in the definition for noinline.
2004-03-20[PATCH] make inflate use less stack space with gcc3.5Andrew Morton1-4/+8
From: Matt Mackall <mpm@selenic.com> Quick fix to work around gcc3.5's automatic inline and broken stack requirements calculation. Without this, I see stack overflows at boot with 4k stacks.
2004-03-18[PATCH] Hotplug CPUs: Other CPU_DEAD NotifiersRusty Russell1-0/+25
Various files keep per-cpu caches which need to be freed/moved when a CPU goes down. All under CONFIG_HOTPLUG_CPU ifdefs. scsi.c: drain dead cpu's scsi_done_q onto this cpu. buffer.c: brelse the bh_lrus queue for dead cpu. timer.c: migrate timers from dead cpu, being careful of lock order vs __mod_timer. radix_tree.c: free dead cpu's radix_tree_preloads page_alloc.c: empty dead cpu's nr_pagecache_local into nr_pagecache, and free pages on cpu's local cache. slab.c: stop reap_timer for dead cpu, adjust each cache's free limit, and free each slab cache's per-cpu block. swap.c: drain dead cpu's lru_add_pvecs into ours, and empty its committed_space counter into global counter. dev.c: drain device queues from dead cpu into this one. flow.c: drain dead cpu's flow cache.
2004-03-18[PATCH] zlib: use kernel min/maxAndrew Morton1-5/+1
From: "Randy.Dunlap" <rddunlap@osdl.org> From: Michael Veeck <michael.veeck@gmx.net> Remove unnecessary min/max macros and changes calls to use kernel.h macros instead.
2004-03-14kref: add kref structure to kernel tree.Greg Kroah-Hartman2-0/+63
Based on the kobject structure, but much smaller and simpler to use.
2004-03-06[PATCH] fastcall / regparm fixesAndrew Morton2-12/+12
From: Gerd Knorr <kraxel@suse.de> Current gcc's error out if a function's declaration and definition disagree about the register passing convention. The patch adds a new `fastcall' declatation primitive, and uses that in all the FASTCALL functions which we could find. A number of inconsistencies were fixed up along the way.
2004-02-26kobject: clean up kobject_get() convoluted logic.Greg Kroah-Hartman1-5/+2
2004-02-26kobject: fix kobject hotplug debug message to show more needed info.Greg Kroah-Hartman1-2/+2
2004-02-18[PATCH] crc32.c copyright fixAndrew Morton1-9/+8
From: Matt Domsch <Matt_Domsch@dell.com> Patch below applies to both 2.4.25 and 2.6.3, and replaces the public domain statement and non-warranty with the GPL, as is permitted by the code being in the public domain, and is done with legal advice.
2004-02-18[PATCH] remove max_anon limitAndrew Morton1-6/+6
From: Tim Hockin <thockin@sun.com> Remove the max_anon via dynamically allocation. We also change the idr_pre_get() interface to take a gfp mask, which should have always been there.
2004-02-18[PATCH] Rename bitmap_snprintf() and cpumask_snprintf() to *_scnprintf()Andrew Morton1-3/+3
From: Joe Korty <joe.korty@ccur.com> Rename bitmap_snprintf() to bitmap_scnprintf() and cpumask_snprintf() to cpumask_scnprintf(), as these functions now belong to the scnprintf family of functions.
2004-02-18[PATCH] #if versus #ifdef cleanupAndrew Morton1-1/+1
From: Valdis.Kletnieks@vt.edu 15 changes of #if to #ifdef and 2 places CONFIG_FOO should be defined(CONFIG_FOO). This gets rid of spurious warnings if you build with "-Wundef" so you get a warning if you have a preprocessor command like: #if CONFIG_ETRAX_DS1302_RSTBIT == 27 and you'll be told if it's substituting a zero rather than silent weirdness and unexpected code generation.
2004-02-18[PATCH] snprintf fixesAndrew Morton2-14/+75
From: Juergen Quade <quade@hsnr.de> Lots of places in the kernel are using [v]snprintf wrongly: they assume it returns the number of characters copied. It doesn't. It returns the number of characters which _would_ have been copied had the buffer not been filled up. So create new functions vscnprintf() and scnprintf() which have the expected (sane) semaptics, and migrate callers over to using them.
2004-02-08Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-0/+3
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-02-07[PATCH] bitmap_snprintf() optimizationAndrew Morton1-4/+2
From: Joe Korty <joe.korty@ccur.com> Now that bitmap_parse is part of bitmap.[ch], it is allowed to manipulate bits directly as the other bitmap routines do.
2004-02-05[NET]: Support for lots of netdevs -- faster dev_alloc_nameStephen Hemminger1-0/+16
Convert dev_alloc_name from O(n^2) lookup to O(n) by using a page as bitmap to figure out how many devices of that pattern have been allocated. This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other platforms. Correctly handles the boundary cases where number of devices won't fit because name length is limited. Adds strnchr to the string libraries since we need to find the % format character, but only care if it is in the first 15 bytes.
2004-02-05Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman1-0/+3
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-02-05[PATCH] Improper handling of %c in vsscanfAndrew Morton1-1/+1
From: <gb@phonema.ea.univpm.it> The "%c" in sscanf actually reads and writes one extra character (i.e. 2 characters insted of just one), and may thus easily overflow caller's buffer. Also affects 2.4 tree, even if there "%c" seems not to be used at all.
2004-02-05[PATCH] snprintf() commentaryAndrew Morton1-0/+10
From: Paul Jackson <pj@sgi.com> Explain the snprintf() return value.
2004-02-03[PATCH] u_int32_t causes cross-compile problemsAndrew Morton1-6/+6
From: Pratik Solanki <pratik.solanki@timesys.com> I came across this C standards issue while cross-compiling the Linux kernel with gcc on Solaris. The file gen_crc32table.c uses the non-standard type u_int32_t. It's possible that the host machine's sys/types.h does not define u_int32_t. The attached patch replaces u_int32_t with the POSIX standard uint32_t and includes POSIX inttypes.h instead of sys/types.h.
2004-02-03[PATCH] bitmap parsing/printing routines, version 4Andrew Morton3-182/+147
From: Joe Korty <joe.korty@ccur.com> 1) the version in 2.6.1 is broken, doesn't work on 64bit big endian machines at all. This needed fixing. I thought it best to fix by rewriting the printer/parser with an algorithm that is naturally endian & sizeof(long) resistant. 2) I wanted all digits to print, eg, 0000ffff,00000004 not ffff,4. 3) I wanted exactly NR_CPUS bits to print (or whatever the bitmap size is in bits, and not have what is displayed rounded up to the nearest full byte, as the current version did. 4) The bitmap printer and parser should be part of bitmap.[ch] with syntax and semantics to match. The original lib/mask.c versions did not recognize this commonality.
2004-02-03[PATCH] string fixes for gcc 3.4Andrew Morton1-3/+6
From: Andi Kleen <ak@muc.de> gcc 3.4 optimizes sprintf(foo,"%s",string) into strcpy. Unfortunately that isn't seen by the inliner and linux/i386 has no out-of-line strcpy so you end up with a linker error. This patch adds out of line copies for most string functions to avoid this. Actually it doesn't export them to modules yet, that would be the next step. BTW In my opinion we shouldn't use inline string functions at all. The __builtin_str* in modern gcc are better (I used them very successfully on x86-64) and for the bigger functions like strrchr,strtok et.al. it just doesn't make any sense to inline them or even code them in assembler. Also fix the bcopy prototype gcc was complaining about.
2004-02-03[PATCH] Fix more gcc 3.4 warningsAndrew Morton1-4/+12
From: Andi Kleen <ak@muc.de> Just many more warning fixes for a gcc 3.4 snapshot. It warns for a lot of things now, e.g. for ?: and ({ ... }) and casts as lvalues. And for functions marked inline in headers, but no body. Actually there are more warnings, i stopped fixing at some point. Some of the warnings seem to be dubious (e.g. the binfmt_elf.c one, which looks more like a compiler bug to me) I also fixed the _exit() prototype to be void because gcc was complaining about this.
2004-02-02Warn loudly if somebody passes a negative value asLinus Torvalds1-1/+10
the size to "vsnprintf()". That's a pretty clear case of overflow.
2004-02-01[PATCH] Kobject: export some missing symbolsEugene Teo1-0/+3
2004-01-20[PATCH] do not use shared extable code for ia64Andrew Morton1-0/+4
From: Jes Sorensen <jes@trained-monkey.org> The new sort_extable and shared search_extable code doesn't work on ia64. I have introduced two new #defines that archs can define to avoid the common code being built. ARCH_HAS_SEARCH_EXTABLE and ARCH_HAS_SORT_EXTABLE.
2004-01-20[PATCH] exception table search fixAndrew Morton1-7/+9
The exception table search code currently fails if addresses differ by more than 2G. This is only a problem when using the 4g/4g address space split, but it's more robust this way. Also, shuffle the comparison order n there so the least likely case comes last.
2004-01-19[PATCH] sort exception tablesPaul Mackerras2-1/+76
This patch arranges for the exception tables to be sorted on most architectures. It sorts the main kernel exception table on startup and the module exception tables when they get loaded. The main table is sorted reasonably early - just after kmem_cache_init - but that could be moved even earlier if necessary. There is now a lib/extable.c which includes the sort_extable() function from arch/ppc/mm/extable.c and the search_extable() function from arch/i386/mm/extable.c, which had been copied to many architectures. On many architectures, arch/$(ARCH)/mm/extable.c became empty and so I have removed it. There are four architectures which do things differently from i386: alpha, ia64, sparc and sparc64. Alpha and ia64 store the offset from the offset from the exception table entry to the instruction, and sparc and sparc64 have range entries in the table. For those architectures I have added empty sort_extable functions. The maintainers for those architectures can implement something better if they care to. As it is they are no worse off than before. Although it is a moderately sizable patch, it ends up with a net reduction of 377 lines in the size of the kernel source. :) I have tested this on x86 and ppc with a module that uses __get_user in an init function, deliberately laid out to get the exception table out of order, and it works (whereas it oopsed without this patch).
2004-01-19Merge bk://kernel.bkbits.net/gregkh/linux/driver-2.6Linus Torvalds2-1/+143
into home.osdl.org:/home/torvalds/v2.5/linux
2004-01-19[PATCH] work around gcc bug in bitmap.cAndrew Morton1-1/+2
gcc miscompiles this. Scary.
2004-01-19[PATCH] uninline bitmap functionsAndrew Morton2-1/+142
- A couple of them are using alloca (via DECLARE_BITMAP) and this generates a cannot-inline warning with -Winline. - These functions are too big to inline anwyay.
2004-01-19[PATCH] Kobject: prevent oops in kset_find_obj() if kobject_name() is NULLGreg Kroah-Hartman1-1/+1
Thanks to Hollis Blanchard <hollisb@us.ibm.com> for pointing this out.
2004-01-19[PATCH] kobject: make kobject hotplug function publicDmitry Torokhov1-28/+21
make kobject hotplug mechanism public so that others may call it.
2003-12-29[PATCH] lib/inflate.c fixAndrew Morton1-23/+42
From: "H. Peter Anvin" <hpa@zytor.com> This patch fixes the "non-terminating inflate" problem that Russell King complained about on LKML earlier today. I chose to use "goto" much like zlib does, in order to not require setjmp/longjmp inside the kernel. It's a bit ugly, but it also lets each function chose how it needs to be terminated on error, which is a good thing.
2003-12-29[PATCH] new /proc/irq cpumask format; consolidate cpumask display and input codeAndrew Morton2-1/+179
From: Paul Jackson <pj@sgi.com> This patch is a followup to one from Bill Irwin. On Nov 17, he had consolidated the half-dozen chunks of code that displayed cpumasks in /proc/irq/prof_cpu_mask and /proc/irq/<pid>/smp_affinity into a single routine, which he called format_cpumask(). I believe that Andrew Morton has accepted Bill's patch into his 2.6.0-test10-mm1 patch set as the "format_cpumask" patch. I hope that the following patch will replace Bill's patch. I look forward to Bill's feedback on this patch. The following patch carries Bill's work further: 1) It also consolidates the input side (write syscalls). 2) It adapts a new format, same on input and output. 3) The core routines work for any multi-word bitmask, not just cpumasks. 4) The core routines avoid overrunning their output buffers. Note esp. for David Mosberger: The small patch I sent you and the linux-ia64 list yesterday entitled: "check user access ok writing /proc/irq/<pid>/smp_affinity" for arch ia64 only is _separate_ from the following patch. Neither presumes the other. However, they do collide on one line. Last one in is a Monkey's Uncle and will need an updated patch from me (or otherwise need to resolve the one obvious collision). Details of the following patch: Both the display and input of cpumasks on 9 arch's are consolidated into a single pair of routines, which use the same format for input and output, as recommended by Tony Luck. The two common routines work on any multi-word bitmask (array of unsigned longs). A pair of trivial inline wrappers cpumask_snprintf() and cpumask_parse() hide this generality for the common case of cpumask input and output. My real motivation for consolidating this code will become visible later - when I seek to add a nodemask_t that resembles cpumask_t (just a different length). These common underlying routines will be used there as well, following up on a suggestion of Christoph Hellwig that I investigate implementing nodemask_t as an ADT sharing infrastructure with cpumask_t. However, I believe that this patch stands on its own merit, consolidating a couple hundred lines of duplicated code, and making the cpumask display format usable on very large systems. There are two exceptions to the consolidation - the alpha and sparc64 arch's manipulate bare unsigned longs, not cpumask_t's, on input (write syscall), and do stuff that was more funky than I could make sense of. So the input side of these two arch's was left as-is. I'd welcome someone with access to either of these systems to provide additional patches. The new format consists of multiple 32 bit words, separated by commas, displayed and input in hex. The following comment from this patch describes this format further: * The ascii representation of multi-word bit masks displays each * 32bit word in hex (not zero filled), and for masks longer than * one word, uses a comma separator between words. Words are * displayed in big-endian order most significant first. And hex * digits within a word are also in big-endian order, of course. * * Examples: * A mask with just bit 0 set displays as "1". * A mask with just bit 127 set displays as "80000000,0,0,0". * A mask with just bit 64 set displays as "1,0,0". * A mask with bits 0, 1, 2, 4, 8, 16, 32 and 64 set displays * as "1,1,10117". The first "1" is for bit 64, the second * for bit 32, the third for bit 16, and so forth, to the * "7", which is for bits 2, 1 and 0. * A mask with bits 32 through 39 set displays as "ff,0". The essential reason for adding the comma breaks was to make the long masks from our (SGI's) big 512 CPU systems parsable by humans. An unbroken string of 128 hex digits is pretty difficult to read. For those who are compiling systems with CONFIG_NR_CPUS of 32 or less, there should be no visible change in format. There are of course a thousand possible output formats that meet similar criteria. If someone wants to lobby for and seek consensus behind another such format, that's fine. Now that the format is consolidated into a single pair of routines, it should be easy to adapt whatever we choose. Internally, the display routine uses snprintf to track the remaining space in its output buffer, to avoid the risk of overrunning it. A new file, lib/mask.c, is added to the lib directory, to hold the two common routines. I anticipate adding a few more common routines for generic support of multi-word bit masks to lib/mask.c, in subsequent patches that will add a nodemask_t type as an ADT sharing implementation with cpumask_t.
2003-12-29[PATCH] Add lib/parser.c kernel-docAndrew Morton1-0/+79
From: Will Dyson <will_dyson@pobox.com> Add documentation and comments to lib/parser.c and include/linux/parser.h
2003-12-29[PATCH] sqrt() fixesAndrew Morton2-1/+33
It turns out that the int_sqrt() function in oom_kill.c gets it wrong. But fb_sqrt() in fbmon.c gets its math right. Move that function into lib/int_sqrt.c, and consolidate. (oom_kill.c fix from Thomas Schlichter <schlicht@uni-mannheim.de>)
2003-12-10kobject: fix bug where a parent could be deleted before a child device.Greg Kroah-Hartman1-4/+7
2003-11-18[PATCH] fix percpu_counter_mod linkage problemAndrew Morton2-22/+0
If both ext2 and ext3 are built as modules there is nothing to pull percpu_counter_mod() into the kernel build and the ext2 and ext3 modules do not load. So move percpu_counter_mod() out of lib.a.
2003-10-25[PATCH] fix __div64_32 to do division properlyRandolph Chung1-19/+28
This fixes the generic __div64_32() to correctly handle divisions by large 32-bit values (as used by nanosleep() and friends, for example). It's a simple bit-at-a-time implementation with a reduction of the high 32-bits handled manually. Architectures that can do 64/32-bit divisions in hardware should implement their own more efficient versions.
2003-10-21bcopy() doesn't return anything.Linus Torvalds1-3/+1
2003-10-21[PATCH] make printk more robust with "null" pointersAndrew Morton1-1/+1
Expand printk's traditional handling of null pointers so that anything in the first page is considered a null pointer. This gives us better behaviour when someone (acpi..) accidentally prints a string which is embedded in a struct, the pointer to which is null.
2003-10-08Merge kernel.bkbits.net:/home/repos/linux-2.5Patrick Mochel5-2/+31
into kernel.bkbits.net:/home/mochel/linux-2.5-core
2003-10-07o kernel/ksyms.c: move remaining EXPORT_SYMBOLs, remove this file from the treeArnaldo Carvalho de Melo5-2/+31
2003-10-06Merge kernel.bkbits.net:/home/repos/linux-2.5Patrick Mochel1-5/+16
into kernel.bkbits.net:/home/mochel/linux-2.5-core
2003-10-05[PATCH] lib/parser: Not recognize nul string as "%s" (6/6)Hirofumi Ogawa1-1/+3
Current match_token recognize "foo=" as "foo=%s". So this change the nul string does not recognize as "%s".
2003-10-02Merge kernel.bkbits.net:/home/repos/linux-2.5Patrick Mochel1-5/+16
into kernel.bkbits.net:/home/mochel/linux-2.5-core
2003-10-01[PATCH] table-driven filesystems option parsingAndrew Morton2-1/+139
From: "Randy.Dunlap" <rddunlap@osdl.org>, Will Dyson <will_dyson@pobox.com>, me Add generic filesystem options parser (infrastructure) and use it to parse mount options in several filesystems (adfs, affs, autofs, autofs4, ext2, ext3, fat, hfs, hpfs, isofs, jfs, procfs, udf, and ufs). It saves between 128 and 512 bytes per filesystem.
2003-09-29[kobject] Fix memory leak in kobject_set_name().Patrick Mochel1-5/+14
If kobject_set_name() is called when the kobject already has a name that was dynamically allocated (too long for the static array), then we must free that memory. Noticed by Jon Corbet.
2003-09-28Merge osdl.org:/home/mochel/src/kernel/linux-2.5-virginPatrick Mochel1-0/+2
into osdl.org:/home/mochel/src/kernel/linux-2.5-core
2003-09-26[PATCH] select ZLIB_{IN,DE}FLATEAdrian Bunk1-6/+1
Similar to the patch Brian Gerst sent for CRC32, this patch changes ZLIB_{IN,DE}FLATE to be select'ed. The dependencies are much better maintainable that way.
2003-09-26[PATCH] select CRC32Brian Gerst1-6/+0
Use "select CRC32" in Kconfig instead of makefile includes.
2003-09-24[kobject] export kset syms for module usePatrick Mochel1-0/+2
From John Rose <johnrose@austin.ibm.com> The patch below exposes some kset functions for use by modules. In the development of a PPC64 pci hotplug drv, we have found it necessary to use ksets of different types under a single subsystem. After discussing with GregKH, we agreed that this change makes this possible.
2003-09-09[PATCH] tidy up lib/inflate.c error messagesAndrew Morton1-5/+5
From: Andre McCurdy <armcc2000@yahoo.com> There is some inconsistency within lib/inflate.c and its users about whether the error message text or the error() function should provide the '\n'. This patch tries to make everyone consistent - by removing the newline from all message texts, and adding one to the only error() function which did not provide it (in init/do_mounts_rd.c).
2003-09-02[kobject] Don't use kobject->k_name after it's been freed. Patrick Mochel1-3/+3
Bah, stupid mistake. After you call ->release(), you cannot touch the object.
2003-08-28[kobject] Support unlimited name lengths.Patrick Mochel1-10/+65
Add ->k_name pointer which points to the name for a kobject. By default, this points to ->name (the static name array). Users of kobjects may use the helper function kobject_set_name() (and are encouraged to do so in all cases). This function will determined whether or not the name is short enough to fit in ->name. If so, great. Otherwise, a dyanamic string is allocated and the name is stored there. ->k_name will point to that, and will be freed when the kobject is released. kobject_set_name() may take a format string, like: kobject_set_name(kobj,"%s%d",base_name,id); and will behave as expected (will put in ->name, unless it's too long, in which case a new string will be allocated and it will be stored in there).
2003-08-16[PATCH] fast AND correct strncpyAlbert Cahalan1-5/+4
This is Erik Andersen's excellent strncpy. It works like magic. That "if" isn't a jump; gcc uses a few integer instructions to wipe out all jumps except for the loop itself and the function call/return. This has been exhaustively tested against glibc. The existing code has 5 extra branches and is over twice as large. (my gcc, etc.)
2003-08-14[PATCH] Fix strncpy off-by-one errorAndrew Morton1-1/+1
From: Yoshinori Sato <ysato@users.sourceforge.jp> It writes one too many zeroes when nulling out the destination.
2003-08-01Merge davem@nuts.ninka.net:/home/davem/src/BK/sparc-2.5David S. Miller1-3/+5
into kernel.bkbits.net:/home/davem/sparc-2.5
2003-08-01[STRING]: Fix bug in generic strncpy() change.David S. Miller1-3/+5
2003-08-01[PATCH] janitor: don't init statics to 0Randy Dunlap1-1/+1
From: Leann Ogasawara <ogasawara@osdl.org> Uninitialize static variables initialized to 0 so they are pushed to the .bss instead of .data.
2003-07-31[PATCH] fix strncpy on generic user platformsAlan Cox1-3/+3
2003-07-11Fix signedness tests in vsnprintf by making it explicit.Linus Torvalds1-2/+2
It used to depend on us having a signed type (which in turn is incorrect for the later division).
2003-07-11[PATCH] asm-generic/div64.h breakageBernardo Innocenti1-1/+1
- __div64_32(): remove __attribute_pure__ qualifier from the prototype since this function obviously clobbers memory through &(n); - do_div(): add a check to ensure (n) is type-compatible with uint64_t; - as_update_iohist(): Use sector_div() instead of do_div(). (Whether the result of the addition should always be stored in 64bits regardless of CONFIG_LBD is still being discussed, therefore it's unadderessed here); - Fix all places where do_div() was being called with a bad divisor argument.
2003-07-08[PATCH] Fix problem introduced by do_div() patchBernardo Innocenti1-1/+8
- export the __div64_32 symbol for modules; - add likely() to the fast path (divisor>>32 == 0); - add __attribute__((pure)) to __div64_32() prototype so the compiler knows global memory isn't clobbered; - avoid building __div64_32() on 64bit architectures.
2003-07-05[PATCH] Fix do_div() for all architecturesBernardo Innocenti2-1/+46
This offers a generic do_div64() that actually does the right thing, unlike some architectures that "optimized" the 64-by-32 divide into just a 32-bit divide. Both ppc and sh were already providing an assembly optimized __div64_32(). I called my function the same, so that their optimized versions will automatically override mine in lib.a. I've only tested extensively on m68knommu (uClinux) and made sure generated code is reasonably short. Should be ok also on parisc, since it's the same algorithm they were using before. - add generic C implementations of the do_div() for 32bit and 64bit archs in asm-generic/div64.h; - add generic library support function __div64_32() to handle the full 64/32 case on 32bit archs; - kill multiple copies of generic do_div() in architecture specific subdirs. Most copies were either buggy or not doing what they were supposed to do; - ensure all surviving instances of do_div() have their parameters correctly parenthesized to avoid funny side-effects;