summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* module: fix sysfs cleanup for !CONFIG_SYSFSRusty Russell2010-08-051-7/+6
| | | | | | | | | | | Restore the stub module_remove_modinfo_attrs, remove the now-unused !CONFIG_SYSFS module_sysfs_init. Also, rename mod_kobject_remove() to mod_sysfs_teardown() as it is the logical counterpart to mod_sysfs_setup now. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: sysfs cleanupRusty Russell2010-08-051-43/+34
| | | | | | | | | We change the sysfs functions to take struct load_info, and call them all in mod_sysfs_setup(). We also clean up the #ifdefs a little. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: layout_and_allocateRusty Russell2010-08-051-99/+125
| | | | | | | | | | | | | | | | layout_and_allocate() does everything up to and including the final struct module placement inside the allocated module memory. We have to store the symbol layout information in our struct load_info though. This avoids the nasty code we had before where 'mod' pointed first to the version inside the temporary allocation containing the entire file, then later was moved to point to the real struct module: now the main code only ever sees the final module address. (Includes fix for the Tony Luck-found Linus-diagnosed failure path error). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: fix crash in get_ksymbol() when oopsing in module initRusty Russell2010-08-051-1/+2
| | | | | | | | | | | | | | | | | | Andrew had the sole pleasure of tickling this bug in linux-next; when we set up "info->strtab" it's pointing into the temporary copy of the module. For most uses that is fine, but kallsyms keeps a pointer around during module load (inside mod->strtab). If we oops for some reason inside a module's init function, kallsyms will use the mod->strtab pointer into the now-freed temporary module copy. (Later oopses work fine: after init we overwrite mod->strtab to point to a compacted core-only strtab). Reported-by: Andrew "Grumpy" Morton <akpm@linux-foundation.org> Signed-off-by: Rusty "Buggy" Russell <rusty@rustcorp.com.au> Tested-by: Andrew "Happy" Morton <akpm@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: kallsyms functions take struct load_infoRusty Russell2010-08-051-39/+29
| | | | | | Simple refactor causes us to lift struct definition to top of file. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor out section header rewriting: FIX modversionsRusty Russell2010-08-051-6/+6
| | | | | | | We can't do the find_sec after removing the SHF_ALLOC flags; it won't find the sections. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor out section header rewritingRusty Russell2010-08-051-25/+45
| | | | | | | | | Put all the "rewrite and check section headers" in one place. This adds another iteration over the sections, but it's far clearer. We iterate once for every find_section() so we already iterate over many times. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: add load_infoLinus Torvalds2010-08-051-103/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Btw, here's a patch that _looks_ large, but it really pretty trivial, and sets things up so that it would be way easier to split off pieces of the module loading. The reason it looks large is that it creates a "module_info" structure that contains all the module state that we're building up while loading, instead of having individual variables for all the indices etc. So the patch ends up being large, because every "symindex" access instead becomes "info.index.sym" etc. That may be a few characters longer, but it then means that we can just pass a pointer to that "info" structure around. and let all the pieces fill it in very naturally. As an example of that, the patch also moves the initialization of all those convenience variables into a "setup_module_info()" function. And at this point it really does become very natural to start to peel off some of the error labels and move them into the helper functions - now the "truncated" case is gone, and is handled inside that setup function instead. So maybe you don't like this approach, and it does make the variable accesses a bit longer, but I don't think unreadably so. And the patch really does look big and scary, but there really should be absolutely no semantic changes - most of it was a trivial and mindless rename. In fact, it was so mindless that I on purpose kept the existing helper functions looking like this: - err = check_modinfo(mod, sechdrs, infoindex, versindex); + err = check_modinfo(mod, info.sechdrs, info.index.info, info.index.vers); rather than changing them to just take the "info" pointer. IOW, a second phase (if you think the approach is ok) would change that calling convention to just do err = check_modinfo(mod, &info); (and same for "layout_sections()", "layout_symtabs()" etc.) Similarly, while right now it makes things _look_ bigger, with things like this: versindex = find_sec(hdr, sechdrs, secstrings, "__versions"); becoming info->index.vers = find_sec(info->hdr, info->sechdrs, info->secstrings, "__versions"); in the new "setup_module_info()" function, that's again just a result of it being a search-and-replace patch. By using the 'info' pointer, we could just change the 'find_sec()' interface so that it ends up being info->index.vers = find_sec(info, "__versions"); instead, and then we'd actually have a shorter and more readable line. So for a lot of those mindless variable name expansions there's would be room for separate cleanups. I didn't move quite everything in there - if we do this to layout_symtabs, for example, we'd want to move the percpu, symoffs, stroffs, *strmap variables to be fields in that module_info structure too. But that's a much smaller patch, I moved just the really core stuff that is currently being set up and used in various parts. But even in this rough form, it removes close to 70 lines from that function (but adds 22 lines overall, of course - the structure definition, the helper function declarations and call-sites etc etc). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: reduce stack usage for each_symbol()Linus Torvalds2010-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And now that I'm looking at that call-chain (to see if it would make sense to use some other more specific lock - doesn't look like it: all the readers are using RCU and this is the only writer), I also give you this trivial one-liner. It changes each_symbol() to not put that constant array on the stack, resulting in changing movq $C.388.31095, %rsi #, tmp85 subq $376, %rsp #, movq %rdi, %rbx # fn, fn leaq -208(%rbp), %rdi #, tmp84 movq %rbx, %rdx # fn, rep movsl xorl %esi, %esi # leaq -208(%rbp), %rdi #, tmp87 movq %r12, %rcx # data, call each_symbol_in_section.clone.0 # into xorl %esi, %esi # subq $216, %rsp #, movq %rdi, %rbx # fn, fn movq $arr.31078, %rdi #, call each_symbol_in_section.clone.0 # which is not so much about being obviously shorter and simpler because we don't unnecessarily copy that constant array around onto the stack, but also about having a much smaller stack footprint (376 vs 216 bytes - see the update of 'rsp'). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor load_module part 5Rusty Russell2010-08-051-76/+106
| | | | | | | | | | 1) Extract out the relocation loop into apply_relocations 2) Extract license and version checks into check_module_license_and_versions 3) Extract icache flushing into flush_module_icache 4) Move __obsparm warning into find_module_sections 5) Move license setting into check_modinfo. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor load_module part 4Rusty Russell2010-08-051-17/+15
| | | | | | | | | | | Allocate references inside module_unload_init(), clean up inside module_unload_free(). This version fixed to do allocation before __this_cpu_write, thanks to bug reports from linux-next from Dave Young <hidave.darkstar@gmail.com> and Stephen Rothwell <sfr@canb.auug.org.au>. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor load_module part 3Rusty Russell2010-08-051-47/+75
| | | | | | | Extract out the allocation and copying in from userspace, and the first set of modinfo checks. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor load_module part 2Linus Torvalds2010-08-051-57/+72
| | | | | | | | | | Here's a second one. It's slightly less trivial - since we now have error cases - and equally untested so it may well be totally broken. But it also cleans up a bit more, and avoids one of the goto targets, because the "move_module()" helper now does both allocations or none. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: refactor load_moduleLinus Torvalds2010-08-051-61/+69
| | | | | | | | | | I'd start from the trivial stuff. There's a fair amount of straight-line code that just makes the function hard to read just because you have to page up and down so far. Some of it is trivial to just create a helper function for. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* module: module_unload_init() cleanupEric Dumazet2010-08-051-6/+0
| | | | | | | | No need to clear mod->refptr in module_unload_init(), since alloc_percpu() already clears allocated chunks. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (removed unused var)
* Merge branch 'for-next' of ↵Linus Torvalds2010-08-04310-574/+461
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits) Documentation: update broken web addresses. fix comment typo "choosed" -> "chosen" hostap:hostap_hw.c Fix typo in comment Fix spelling contorller -> controller in comments Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault fs/Kconfig: Fix typo Userpace -> Userspace Removing dead MACH_U300_BS26 drivers/infiniband: Remove unnecessary casts of private_data fs/ocfs2: Remove unnecessary casts of private_data libfc: use ARRAY_SIZE scsi: bfa: use ARRAY_SIZE drm: i915: use ARRAY_SIZE drm: drm_edid: use ARRAY_SIZE synclink: use ARRAY_SIZE block: cciss: use ARRAY_SIZE comment typo fixes: charater => character fix comment typos concerning "challenge" arm: plat-spear: fix typo in kerneldoc reiserfs: typo comment fix update email address ...
| * Documentation: update broken web addresses.Justin P. Mattock2010-08-04138-330/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Below you will find an updated version from the original series bunching all patches into one big patch updating broken web addresses that are located in Documentation/* Some of the addresses date as far far back as 1995 etc... so searching became a bit difficult, the best way to deal with these is to use web.archive.org to locate these addresses that are outdated. Now there are also some addresses pointing to .spec files some are located, but some(after searching on the companies site)where still no where to be found. In this case I just changed the address to the company site this way the users can contact the company and they can locate them for the users. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Thomas Weber <weber@corscience.de> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Cc: Paulo Marques <pmarques@grupopie.com> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Michael Neuling <mikey@neuling.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * Merge branch 'master' into for-nextJiri Kosina2010-08-041744-212841/+34722
| |\
| * | fix comment typo "choosed" -> "chosen"Uwe Kleine-König2010-08-041-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | hostap:hostap_hw.c Fix typo in commentJustin P. Mattock2010-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | The patch below fixes a typo in a comment. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Fix spelling contorller -> controller in commentsStefan Weil2010-08-042-2/+2
| | | | | | | | | | | | | | | | | | | | | Cc: Jiri Kosina <trivial@kernel.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> FaultTakuya Yoshikawa2010-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | The last 't' of 'fault' is missing in the description of FAIL_IO_TIMEOUT. Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fs/Kconfig: Fix typo Userpace -> UserspaceStephen Boyd2010-07-201-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Removing dead MACH_U300_BS26Christoph Egger2010-07-201-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | MACH_U300_BS26 doesn't exist in Kconfig, therefore removing all references for it from the source code. Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | drivers/infiniband: Remove unnecessary casts of private_dataJoe Perches2010-07-201-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fs/ocfs2: Remove unnecessary casts of private_dataJoe Perches2010-07-203-7/+6
| | | | | | | | | | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | libfc: use ARRAY_SIZEKulikov Vasiliy2010-07-201-3/+1
| | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | scsi: bfa: use ARRAY_SIZEKulikov Vasiliy2010-07-202-7/+5
| | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | drm: i915: use ARRAY_SIZEKulikov Vasiliy2010-07-202-3/+3
| | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | drm: drm_edid: use ARRAY_SIZEKulikov Vasiliy2010-07-201-5/+2
| | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | synclink: use ARRAY_SIZEKulikov Vasiliy2010-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | block: cciss: use ARRAY_SIZEKulikov Vasiliy2010-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | comment typo fixes: charater => characterThomas Weber2010-07-193-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix typo in comments. Replace charater with character. Characteristics too. Signed-off-by: Thomas Weber <weber@corscience.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fix comment typos concerning "challenge"Uwe Kleine-König2010-07-192-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | arm: plat-spear: fix typo in kerneldocDavidlohr Bueso2010-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Trivial fix in a typo (enalbed for enabled). Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | reiserfs: typo comment fixDavidlohr Bueso2010-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix trivial typo in code comment (change adn for and), also change comment style for proper coding style. Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | update email addressPavel Machek2010-07-1927-28/+28
| | | | | | | | | | | | | | | | | | | | | pavel@suse.cz no longer works, replace it with working address. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Kconfig: fixo typo in "Xilinx'"Michael Witten2010-07-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Michael Witten <mfwitten@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fix comnment/printk typos concerning "empty"Uwe Kleine-König2010-07-125-5/+5
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | trivial: no changes to ov511 driverJiri Kosina2010-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of 421f91d21ad6f799dc7b489bb33cc560ccc56f98 ("fix typos concerning "initiali[zs]e"") for ov511 driver, as it is going to be completely removed in the next release anyway. Fixes conflict in linux-next. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | remove a duplicated comment lineUwe Kleine-König2010-07-111-1/+0
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fscache: fix missing kerneldoc annotationSuresh Jayaraman2010-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | .. and make kerneldoc scripts happy. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fscache: fix a trivial typo in the commentSuresh Jayaraman2010-07-111-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Documentation: pci.txt: fix typoKulikov Vasiliy2010-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | Doubled 'not'. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | lib/devres.c: fix comment typoKulikov Vasiliy2010-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 'Unamp' should be 'Unmap'. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Documentation update broken web addressesJustin P. Mattock2010-07-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've found some web addresses not responding, giving the cannot connect error when trying to load them. The below patch updates the addresses that are not connecting with the best that I can find, and also fixes a couple of addresses, so people can either choose an older version of the package and/or a newer version(i.e. ppp). Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fix comment/printk typos concerning "already"Uwe Kleine-König2010-07-1115-16/+16
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fix comment typos concerning "sequential"Uwe Kleine-König2010-07-112-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | fix #warning about using kernel headers in userpsaceJustin P. Mattock2010-07-112-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the preprocessor #warning message: warning: #warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders from kernel.h to types.h. And also fixe the #warning message due to the preprocessor not being able to read the web address due to it thinking it was the start of a comment. also remove the extra #ifndef _KERNEL_ since it's already there. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Revert "Remove dead CONFIG_SIBYTE_BCM1480_PROF"Jiri Kosina2010-06-301-0/+11
| | | | | | | | | | | | | | | This reverts commit 22c1d8b4f8f04882046ebe592f9a9eaea443cb45. It has been nacked by MIPS maintainer Ralf Baechle.
OpenPOWER on IntegriCloud