diff -urN -X dontdiff linux/arch/sparc64/kernel/traps.c linux-kmod-inline/arch/sparc64/kernel/traps.c --- linux/arch/sparc64/kernel/traps.c Tue Dec 21 06:05:52 1999 +++ linux-kmod-inline/arch/sparc64/kernel/traps.c Thu Jan 13 14:15:03 2000 @@ -10,6 +10,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/sched.h> /* for jiffies */ #include <linux/kernel.h> #include <linux/signal.h> @@ -27,9 +28,6 @@ #include <asm/fpumacro.h> #include <asm/lsu.h> #include <asm/psrcompat.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif /* #define SYSCALL_TRACING */ /* #define VERBOSE_SYSCALL_TRACING */ diff -urN -X dontdiff linux/drivers/block/ide.c linux-kmod-inline/drivers/block/ide.c --- linux/drivers/block/ide.c Sun Jan 9 01:41:16 2000 +++ linux-kmod-inline/drivers/block/ide.c Thu Jan 13 14:15:03 2000 @@ -151,9 +151,6 @@ #include "ide_modes.h" -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif /* CONFIG_KMOD */ #ifdef CONFIG_BLK_DEV_VIA82CXXX extern byte fifoconfig; /* defined in via82cxxx.c used by ide_setup() */ @@ -1795,10 +1792,8 @@ module = module->next; } revalidate_drives(); -#ifdef CONFIG_KMOD if (!found && type == IDE_PROBE_MODULE) (void) request_module("ide-probe"); -#endif /* CONFIG_KMOD */ } static int ide_open (struct inode * inode, struct file * filp) @@ -1811,7 +1806,6 @@ MOD_INC_USE_COUNT; if (drive->driver == NULL) ide_init_module(IDE_DRIVER_MODULE); -#ifdef CONFIG_KMOD if (drive->driver == NULL) { if (drive->media == ide_disk) (void) request_module("ide-disk"); @@ -1822,7 +1816,6 @@ if (drive->media == ide_floppy) (void) request_module("ide-floppy"); } -#endif /* CONFIG_KMOD */ while (drive->busy) sleep_on(&drive->wqueue); drive->usage++; diff -urN -X dontdiff linux/drivers/block/md.c linux-kmod-inline/drivers/block/md.c --- linux/drivers/block/md.c Sun Jan 9 01:41:16 2000 +++ linux-kmod-inline/drivers/block/md.c Thu Jan 13 14:15:03 2000 @@ -46,9 +46,6 @@ #include <linux/blkdev.h> #include <linux/genhd.h> #include <linux/smp_lock.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <linux/errno.h> #include <linux/init.h> @@ -406,12 +403,8 @@ } if (!pers[pnum]) { -#ifdef CONFIG_KMOD - char module_name[80]; - sprintf (module_name, "md-personality-%d", pnum); - request_module (module_name); + request_module ("md-personality-%d", pnum); if (!pers[pnum]) -#endif return -EINVAL; } diff -urN -X dontdiff linux/drivers/char/bttv.c linux-kmod-inline/drivers/char/bttv.c --- linux/drivers/char/bttv.c Sat Jan 8 20:54:54 2000 +++ linux-kmod-inline/drivers/char/bttv.c Thu Jan 13 14:15:03 2000 @@ -41,7 +41,6 @@ #include <linux/wrapper.h> #include <linux/interrupt.h> #include <linux/version.h> -#include <linux/kmod.h> #include <linux/vmalloc.h> #include <linux/i2c.h> diff -urN -X dontdiff linux/drivers/char/ftape/zftape/zftape-init.c linux-kmod-inline/drivers/char/ftape/zftape/zftape-init.c --- linux/drivers/char/ftape/zftape/zftape-init.c Tue Nov 23 18:29:15 1999 +++ linux-kmod-inline/drivers/char/ftape/zftape/zftape-init.c Thu Jan 13 14:15:03 2000 @@ -30,9 +30,6 @@ #include <linux/signal.h> #include <linux/major.h> #include <linux/malloc.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <linux/fcntl.h> #include <linux/wrapper.h> @@ -382,7 +379,6 @@ int zft_cmpr_lock(int try_to_load) { if (zft_cmpr_ops == NULL) { -#ifdef CONFIG_KMOD if (try_to_load) { request_module("zft-compressor"); if (zft_cmpr_ops == NULL) { @@ -391,9 +387,6 @@ } else { return -ENOSYS; } -#else - return -ENOSYS; -#endif } (*zft_cmpr_ops->lock)(); return 0; diff -urN -X dontdiff linux/drivers/char/misc.c linux-kmod-inline/drivers/char/misc.c --- linux/drivers/char/misc.c Tue Dec 14 00:26:27 1999 +++ linux-kmod-inline/drivers/char/misc.c Thu Jan 13 14:15:03 2000 @@ -46,7 +46,6 @@ #include <linux/tty.h> #include <linux/selection.h> -#include <linux/kmod.h> #include "busmouse.h" @@ -102,9 +101,9 @@ while ((c != &misc_list) && (c->minor != minor)) c = c->next; if (c == &misc_list) { - char modname[20]; - sprintf(modname, "char-major-%d-%d", MISC_MAJOR, minor); - request_module(modname); + if (request_module("char-major-%d-%d", MISC_MAJOR, minor) != 0) + return -ENODEV; + c = misc_list.next; while ((c != &misc_list) && (c->minor != minor)) c = c->next; diff -urN -X dontdiff linux/drivers/char/tty_io.c linux-kmod-inline/drivers/char/tty_io.c --- linux/drivers/char/tty_io.c Thu Jan 13 14:11:18 2000 +++ linux-kmod-inline/drivers/char/tty_io.c Thu Jan 13 14:15:03 2000 @@ -57,6 +57,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/types.h> #include <linux/major.h> #include <linux/errno.h> @@ -89,8 +90,6 @@ #include <linux/vt_kern.h> #include <linux/selection.h> -#include <linux/kmod.h> - #define CONSOLE_DEV MKDEV(TTY_MAJOR,0) #define TTY_DEV MKDEV(TTYAUX_MAJOR,0) #define SYSCONS_DEV MKDEV(TTYAUX_MAJOR,1) @@ -225,11 +224,8 @@ return -EINVAL; /* Eduardo Blanco <ejbs@cs.cs.com.uy> */ /* Cyrus Durgin <cider@speakeasy.org> */ - if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) { - char modname [20]; - sprintf(modname, "tty-ldisc-%d", ldisc); - request_module (modname); - } + if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) + request_module("tty-ldisc-%d", ldisc); if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) return -EINVAL; diff -urN -X dontdiff linux/drivers/char/videodev.c linux-kmod-inline/drivers/char/videodev.c --- linux/drivers/char/videodev.c Thu Dec 30 01:13:02 1999 +++ linux-kmod-inline/drivers/char/videodev.c Thu Jan 13 14:15:03 2000 @@ -30,9 +30,6 @@ #endif #include <asm/system.h> -#include <linux/kmod.h> - - #define VIDEO_NUM_DEVICES 256 /* @@ -135,10 +132,7 @@ vfl=video_device[minor]; if(vfl==NULL) { - char modname[20]; - - sprintf (modname, "char-major-%d-%d", VIDEO_MAJOR, minor); - request_module(modname); + request_module("char-major-%d-%d", VIDEO_MAJOR, minor); vfl=video_device[minor]; if (vfl==NULL) return -ENODEV; diff -urN -X dontdiff linux/drivers/net/ppp_generic.c linux-kmod-inline/drivers/net/ppp_generic.c --- linux/drivers/net/ppp_generic.c Tue Nov 9 19:50:49 1999 +++ linux-kmod-inline/drivers/net/ppp_generic.c Thu Jan 13 14:15:03 2000 @@ -27,7 +27,6 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> -#include <linux/kmod.h> #include <linux/init.h> #include <linux/list.h> #include <linux/netdevice.h> @@ -1195,9 +1194,6 @@ struct compressor *cp; struct ppp_option_data data; unsigned char ccp_option[CCP_MAX_OPTION_LENGTH]; -#ifdef CONFIG_KMOD - char modname[32]; -#endif err = -EFAULT; if (copy_from_user(&data, (void *) arg, sizeof(data)) @@ -1210,13 +1206,8 @@ goto out; cp = find_compressor(ccp_option[0]); -#ifdef CONFIG_KMOD - if (cp == 0) { - sprintf(modname, "ppp-compress-%d", ccp_option[0]); - request_module(modname); + if (cp == 0 && request_module("ppp-compress-%d", ccp_option[0]) == 0) cp = find_compressor(ccp_option[0]); - } -#endif /* CONFIG_KMOD */ if (cp == 0) goto out; diff -urN -X dontdiff linux/drivers/parport/share.c linux-kmod-inline/drivers/parport/share.c --- linux/drivers/parport/share.c Thu Dec 30 18:11:57 1999 +++ linux-kmod-inline/drivers/parport/share.c Thu Jan 13 14:15:03 2000 @@ -24,7 +24,7 @@ #include <linux/kernel.h> #include <linux/malloc.h> #include <linux/sched.h> -#include <linux/kmod.h> +#include <linux/module.h> #include <linux/spinlock.h> #include <asm/irq.h> diff -urN -X dontdiff linux/drivers/scsi/fcal.c linux-kmod-inline/drivers/scsi/fcal.c --- linux/drivers/scsi/fcal.c Tue Dec 21 06:06:42 1999 +++ linux-kmod-inline/drivers/scsi/fcal.c Thu Jan 13 14:15:03 2000 @@ -14,9 +14,6 @@ #include <linux/stat.h> #include <linux/init.h> #include <linux/config.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <asm/irq.h> @@ -99,7 +96,7 @@ fcalcount++; FCALND(("%d channels online\n", fcalcount)) if (!fcalcount) { -#if defined(MODULE) && defined(CONFIG_FC4_SOCAL_MODULE) && defined(CONFIG_KMOD) +#if defined(MODULE) && defined(CONFIG_FC4_SOCAL_MODULE) request_module("socal"); for_each_online_fc_channel(fc) diff -urN -X dontdiff linux/drivers/scsi/pluto.c linux-kmod-inline/drivers/scsi/pluto.c --- linux/drivers/scsi/pluto.c Tue Dec 21 06:06:42 1999 +++ linux-kmod-inline/drivers/scsi/pluto.c Thu Jan 13 14:15:03 2000 @@ -14,9 +14,6 @@ #include <linux/stat.h> #include <linux/init.h> #include <linux/config.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <asm/irq.h> @@ -101,7 +98,7 @@ } PLND(("%d channels online\n", fcscount)) if (!fcscount) { -#if defined(MODULE) && defined(CONFIG_FC4_SOC_MODULE) && defined(CONFIG_KMOD) +#if defined(MODULE) && defined(CONFIG_FC4_SOC_MODULE) request_module("soc"); for_each_online_fc_channel(fc) { diff -urN -X dontdiff linux/drivers/scsi/scsi.c linux-kmod-inline/drivers/scsi/scsi.c --- linux/drivers/scsi/scsi.c Fri Jan 7 19:55:28 2000 +++ linux-kmod-inline/drivers/scsi/scsi.c Thu Jan 13 14:15:03 2000 @@ -65,10 +65,6 @@ #include "hosts.h" #include "constants.h" -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif - #undef USE_STATIC_SCSI_MEMORY struct proc_dir_entry *proc_scsi = NULL; @@ -3203,10 +3199,8 @@ /* Load upper level device handler of some kind */ case MODULE_SCSI_DEV: -#ifdef CONFIG_KMOD if (scsi_hosts == NULL) request_module("scsi_hostadapter"); -#endif return scsi_register_device_module((struct Scsi_Device_Template *) ptr); /* The rest of these are not yet implemented */ diff -urN -X dontdiff linux/drivers/sound/audio.c linux-kmod-inline/drivers/sound/audio.c --- linux/drivers/sound/audio.c Wed Jun 2 07:25:48 1999 +++ linux-kmod-inline/drivers/sound/audio.c Thu Jan 13 14:15:03 2000 @@ -26,7 +26,7 @@ #include <linux/config.h> #include <linux/stddef.h> #include <linux/string.h> -#include <linux/kmod.h> +#include <linux/module.h> #include "sound_config.h" diff -urN -X dontdiff linux/drivers/sound/midibuf.c linux-kmod-inline/drivers/sound/midibuf.c --- linux/drivers/sound/midibuf.c Wed May 12 07:40:50 1999 +++ linux-kmod-inline/drivers/sound/midibuf.c Thu Jan 13 14:15:03 2000 @@ -15,7 +15,7 @@ */ #include <linux/config.h> #include <linux/stddef.h> -#include <linux/kmod.h> +#include <linux/module.h> #define MIDIBUF_C diff -urN -X dontdiff linux/drivers/sound/sequencer.c linux-kmod-inline/drivers/sound/sequencer.c --- linux/drivers/sound/sequencer.c Wed May 12 07:40:50 1999 +++ linux-kmod-inline/drivers/sound/sequencer.c Thu Jan 13 14:15:03 2000 @@ -15,8 +15,7 @@ * Alan Cox : reformatted and fixed a pair of null pointer bugs */ #include <linux/config.h> - -#include <linux/kmod.h> +#include <linux/module.h> #define SEQUENCER_C diff -urN -X dontdiff linux/drivers/sound/sound_core.c linux-kmod-inline/drivers/sound/sound_core.c --- linux/drivers/sound/sound_core.c Fri Jan 7 19:43:09 2000 +++ linux-kmod-inline/drivers/sound/sound_core.c Thu Jan 13 14:15:03 2000 @@ -42,7 +42,6 @@ #include <linux/fs.h> #include <linux/sound.h> #include <linux/major.h> -#include <linux/kmod.h> struct sound_unit @@ -318,8 +317,6 @@ spin_lock(&sound_loader_lock); s = __look_for_unit(chain, unit); if (s == NULL) { - char mod[32]; - spin_unlock(&sound_loader_lock); /* * Please, don't change this order or code. @@ -328,10 +325,8 @@ * ALSA toplevel modules for soundcards, thus we need * load them at first. [Jaroslav Kysela <perex@jcu.cz>] */ - sprintf(mod, "sound-slot-%i", unit>>4); - request_module(mod); - sprintf(mod, "sound-service-%i-%i", unit>>4, chain); - request_module(mod); + request_module("sound-slot-%i", unit>>4); + request_module("sound-service-%i-%i", unit>>4, chain); spin_lock(&sound_loader_lock); s = __look_for_unit(chain, unit); } diff -urN -X dontdiff linux/drivers/sound/soundcard.c linux-kmod-inline/drivers/sound/soundcard.c --- linux/drivers/sound/soundcard.c Sun Nov 21 19:13:56 1999 +++ linux-kmod-inline/drivers/sound/soundcard.c Thu Jan 13 14:15:03 2000 @@ -20,6 +20,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include "sound_config.h" #include <linux/types.h> @@ -28,7 +29,6 @@ #include <linux/fcntl.h> #include <linux/ctype.h> #include <linux/stddef.h> -#include <linux/kmod.h> #ifdef __KERNEL__ #include <asm/dma.h> #include <asm/io.h> @@ -470,11 +470,8 @@ case SND_DEV_CTL: dev >>= 4; - if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) { - char modname[20]; - sprintf(modname, "mixer%d", dev); - request_module(modname); - } + if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) + request_module("mixer%d", dev); if (dev && (dev >= num_mixers || mixer_devs[dev] == NULL)) return -ENXIO; break; @@ -591,11 +588,8 @@ if (mixdev < 0 || mixdev >= MAX_MIXER_DEV) return -ENXIO; /* Try to load the mixer... */ - if (mixer_devs[mixdev] == NULL) { - char modname[20]; - sprintf(modname, "mixer%d", mixdev); - request_module(modname); - } + if (mixer_devs[mixdev] == NULL) + request_module("mixer%d", mixdev); if (mixdev >= num_mixers || !mixer_devs[mixdev]) return -ENXIO; if (cmd == SOUND_MIXER_INFO) diff -urN -X dontdiff linux/drivers/telephony/phonedev.c linux-kmod-inline/drivers/telephony/phonedev.c --- linux/drivers/telephony/phonedev.c Thu Dec 30 01:13:59 1999 +++ linux-kmod-inline/drivers/telephony/phonedev.c Thu Jan 13 14:15:03 2000 @@ -26,8 +26,6 @@ #include <asm/uaccess.h> #include <asm/system.h> -#include <linux/kmod.h> - #define PHONE_NUM_DEVICES 256 @@ -52,10 +50,7 @@ p = phone_device[minor]; if (p == NULL) { - char modname[32]; - - sprintf(modname, "char-major-%d-%d", PHONE_MAJOR, minor); - request_module(modname); + request_module("char-major-%d-%d", PHONE_MAJOR, minor); p = phone_device[minor]; if (p == NULL) return -ENODEV; diff -urN -X dontdiff linux/drivers/video/fbmem.c linux-kmod-inline/drivers/video/fbmem.c --- linux/drivers/video/fbmem.c Fri Jan 7 20:59:42 2000 +++ linux-kmod-inline/drivers/video/fbmem.c Thu Jan 13 14:15:03 2000 @@ -22,9 +22,6 @@ #include <linux/console.h> #include <linux/init.h> #include <linux/proc_fs.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #if defined(__mc68000__) || defined(CONFIG_APUS) #include <asm/setup.h> @@ -300,16 +297,6 @@ return copy_size; } -#ifdef CONFIG_KMOD -static void try_to_load(int fb) -{ - char modname[16]; - - sprintf(modname, "fb%d", fb); - request_module(modname); -} -#endif /* CONFIG_KMOD */ - static int fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) @@ -378,10 +365,8 @@ return -EINVAL; if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) return -EINVAL; -#ifdef CONFIG_KMOD if (!registered_fb[con2fb.framebuffer]) - try_to_load(con2fb.framebuffer); -#endif /* CONFIG_KMOD */ + request_module("fb%d", con2fb.framebuffer); if (!registered_fb[con2fb.framebuffer]) return -EINVAL; if (con2fb.console != 0) @@ -532,10 +517,8 @@ int fbidx = GET_FB_IDX(inode->i_rdev); struct fb_info *info; -#ifdef CONFIG_KMOD if (!(info = registered_fb[fbidx])) - try_to_load(fbidx); -#endif /* CONFIG_KMOD */ + request_module("fb%d", fbidx); if (!(info = registered_fb[fbidx])) return -ENODEV; return info->fbops->fb_open(info,1); diff -urN -X dontdiff linux/fs/block_dev.c linux-kmod-inline/fs/block_dev.c --- linux/fs/block_dev.c Mon Jan 10 00:51:37 2000 +++ linux-kmod-inline/fs/block_dev.c Thu Jan 13 14:15:03 2000 @@ -5,11 +5,11 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/mm.h> #include <linux/locks.h> #include <linux/fcntl.h> #include <linux/malloc.h> -#include <linux/kmod.h> #include <asm/uaccess.h> @@ -446,13 +446,8 @@ /* major 0 is used for non-device mounts */ if (major && major < MAX_BLKDEV) { -#ifdef CONFIG_KMOD - if (!blkdevs[major].bdops) { - char name[20]; - sprintf(name, "block-major-%d", major); - request_module(name); - } -#endif + if (!blkdevs[major].bdops) + request_module("block-major-%d", major); ret = blkdevs[major].bdops; } return ret; diff -urN -X dontdiff linux/fs/devices.c linux-kmod-inline/fs/devices.c --- linux/fs/devices.c Thu Jan 6 18:14:36 2000 +++ linux-kmod-inline/fs/devices.c Thu Jan 13 14:15:03 2000 @@ -10,6 +10,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/fs.h> #include <linux/major.h> #include <linux/string.h> @@ -17,16 +18,12 @@ #include <linux/stat.h> #include <linux/fcntl.h> #include <linux/errno.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> - #include <linux/tty.h> /* serial module kmod load support */ struct tty_driver *get_tty_driver(kdev_t device); #define isa_tty_dev(ma) (ma == TTY_MAJOR || ma == TTYAUX_MAJOR) #define need_serial(ma,mi) (get_tty_driver(MKDEV(ma,mi)) == NULL) -#endif struct device_struct { const char * name; @@ -68,7 +65,6 @@ struct file_operations *ret = NULL; if (major < maxdev){ -#ifdef CONFIG_KMOD /* * I do get request for device 0. I have no idea why. It happen * at shutdown time for one. Without the following test, the @@ -85,12 +81,8 @@ * as there is no other loadable dev on these majors */ if ((isa_tty_dev(major) && need_serial(major,minor)) || - (major != 0 && !tb[major].fops)) { - char name[20]; - sprintf(name, mangle, major); - request_module(name); - } -#endif + (major != 0 && !tb[major].fops)) + request_module(mangle, major); ret = tb[major].fops; } return ret; diff -urN -X dontdiff linux/fs/exec.c linux-kmod-inline/fs/exec.c --- linux/fs/exec.c Wed Dec 29 19:42:07 1999 +++ linux-kmod-inline/fs/exec.c Thu Jan 13 14:15:03 2000 @@ -23,6 +23,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/slab.h> #include <linux/file.h> #include <linux/mman.h> @@ -38,9 +39,6 @@ #include <asm/pgalloc.h> #include <asm/mmu_context.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif static struct linux_binfmt *formats = (struct linux_binfmt *) NULL; @@ -779,18 +777,14 @@ } if (retval != -ENOEXEC) { break; -#ifdef CONFIG_KMOD }else{ #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) - char modname[20]; if (printable(bprm->buf[0]) && printable(bprm->buf[1]) && printable(bprm->buf[2]) && printable(bprm->buf[3])) break; /* -ENOEXEC */ - sprintf(modname, "binfmt-%04x", *(unsigned short *)(&bprm->buf[2])); - request_module(modname); -#endif + request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2])); } } return retval; diff -urN -X dontdiff linux/fs/fat/cvf.c linux-kmod-inline/fs/fat/cvf.c --- linux/fs/fat/cvf.c Mon Aug 9 19:43:49 1999 +++ linux-kmod-inline/fs/fat/cvf.c Thu Jan 13 14:15:03 2000 @@ -8,16 +8,14 @@ * */ -#include<linux/sched.h> -#include<linux/fs.h> -#include<linux/msdos_fs.h> -#include<linux/msdos_fs_sb.h> -#include<linux/string.h> -#include<linux/fat_cvf.h> -#include<linux/config.h> -#ifdef CONFIG_KMOD -#include<linux/kmod.h> -#endif +#include <linux/module.h> +#include <linux/sched.h> +#include <linux/fs.h> +#include <linux/msdos_fs.h> +#include <linux/msdos_fs_sb.h> +#include <linux/string.h> +#include <linux/fat_cvf.h> +#include <linux/config.h> #define MAX_CVF_FORMATS 3 @@ -181,20 +179,17 @@ if(force) if(strcmp(force,"autoload")==0) { -#ifdef CONFIG_KMOD - request_module("cvf_autoload"); - force=NULL; -#else - printk("cannot autoload CVF modules: kmod support is not compiled into kernel\n"); - return -1; -#endif + if (request_module("cvf_autoload") == 0) + force=NULL; + else { + printk("cannot autoload CVF modules: kmod support is not compiled into kernel\n"); + return -1; + } } -#ifdef CONFIG_KMOD if(force) if(*force) request_module(force); -#endif if(force) { if(*force) diff -urN -X dontdiff linux/fs/filesystems.c linux-kmod-inline/fs/filesystems.c --- linux/fs/filesystems.c Mon Jan 3 20:01:31 2000 +++ linux-kmod-inline/fs/filesystems.c Thu Jan 13 14:15:03 2000 @@ -7,6 +7,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/fs.h> #include <linux/minix_fs.h> @@ -36,9 +37,6 @@ #include <linux/major.h> #include <linux/smp.h> #include <linux/smp_lock.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <linux/lockd/bind.h> #include <linux/lockd/xdr.h> #include <linux/init.h> @@ -188,12 +186,10 @@ ret = do_nfsservctl(cmd, argp, resp); goto out; } -#ifdef CONFIG_KMOD if (request_module ("nfsd") == 0) { if (do_nfsservctl) ret = do_nfsservctl(cmd, argp, resp); } -#endif /* CONFIG_KMOD */ out: unlock_kernel(); return ret; diff -urN -X dontdiff linux/fs/nls/nls_base.c linux-kmod-inline/fs/nls/nls_base.c --- linux/fs/nls/nls_base.c Tue Dec 7 18:21:10 1999 +++ linux-kmod-inline/fs/nls/nls_base.c Thu Jan 13 14:15:36 2000 @@ -14,9 +14,6 @@ #include <linux/config.h> #include <linux/nls.h> #include <linux/malloc.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <asm/byteorder.h> static struct nls_table *tables = (struct nls_table *) NULL; @@ -204,37 +201,23 @@ struct nls_table *load_nls(char *charset) { struct nls_table *nls; -#ifdef CONFIG_KMOD - char buf[40]; - int ret; -#endif nls = find_nls(charset); if (nls) { nls->inc_use_count(); return nls; } - -#ifndef CONFIG_KMOD - return NULL; -#else - if (strlen(charset) > sizeof(buf) - sizeof("nls_")) { - printk("Unable to load NLS charset %s: name too long\n", charset); - return NULL; - } - sprintf(buf, "nls_%s", charset); - ret = request_module(buf); - if (ret != 0) { + if (request_module("nls_%s", charset) != 0) { printk("Unable to load NLS charset %s\n", charset); return NULL; } + nls = find_nls(charset); - if (nls) { + if (nls) nls->inc_use_count(); - } + return nls; -#endif } void unload_nls(struct nls_table *nls) diff -urN -X dontdiff linux/fs/super.c linux-kmod-inline/fs/super.c --- linux/fs/super.c Thu Jan 6 18:14:36 2000 +++ linux-kmod-inline/fs/super.c Thu Jan 13 14:15:03 2000 @@ -18,6 +18,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/malloc.h> #include <linux/locks.h> #include <linux/smp_lock.h> @@ -32,9 +33,6 @@ #include <linux/nfs_fs_sb.h> #include <linux/nfs_mount.h> -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif /* * We use a semaphore to synchronize all mount/umount @@ -394,12 +392,10 @@ return fs; for (fs = file_systems; fs && strcmp(fs->name, name); fs = fs->next) ; -#ifdef CONFIG_KMOD if (!fs && (request_module(name) == 0)) { for (fs = file_systems; fs && strcmp(fs->name, name); fs = fs->next) ; } -#endif return fs; } diff -urN -X dontdiff linux/include/linux/kmod.h linux-kmod-inline/include/linux/kmod.h --- linux/include/linux/kmod.h Tue Jan 11 02:29:09 2000 +++ linux-kmod-inline/include/linux/kmod.h Thu Jan 1 01:00:00 1970 @@ -1,12 +0,0 @@ -/* - kmod header -*/ - -#include <linux/config.h> - -#ifdef CONFIG_KMOD -extern int request_module(const char * name); -#else -#define request_module(x) do {} while(0) -#endif - diff -urN -X dontdiff linux/include/linux/module.h linux-kmod-inline/include/linux/module.h --- linux/include/linux/module.h Thu Jan 13 14:11:19 2000 +++ linux-kmod-inline/include/linux/module.h Thu Jan 13 14:33:16 2000 @@ -9,6 +9,8 @@ #include <linux/config.h> #include <linux/spinlock.h> +#include <linux/errno.h> +#include <stdarg.h> #ifdef __GENKSYMS__ # define _set_ver(sym) sym @@ -295,5 +297,15 @@ #else #define EXPORT_NO_SYMBOLS #endif /* MODULE */ + +#ifdef CONFIG_KMOD +extern int request_module(const char * fmt, ...) + __attribute__ ((format (printf, 1, 2))); +#else +static inline request_module(const char * fmt, ...) +{ + return -EINVAL; +} +#endif #endif /* _LINUX_MODULE_H */ diff -urN -X dontdiff linux/kernel/kmod.c linux-kmod-inline/kernel/kmod.c --- linux/kernel/kmod.c Fri Jan 7 00:17:18 2000 +++ linux-kmod-inline/kernel/kmod.c Thu Jan 13 14:22:46 2000 @@ -11,10 +11,15 @@ Limit the concurrent number of kmod modprobes to catch loops from "modprobe needs a service that is in a module". Keith Owens <kaos@ocs.com.au> December 1999 + + Changed request_module() to take variable number of arguments + Tigran Aivazian <tigran@sco.com>, Jan 2000. */ #define __KERNEL_SYSCALLS__ +#include <linux/config.h> +#include <linux/module.h> #include <linux/sched.h> #include <linux/unistd.h> #include <linux/smp_lock.h> @@ -114,8 +119,9 @@ request_module: the function that everyone calls when they need a module. */ -int request_module(const char * module_name) +int request_module(const char * fmt, ...) { + va_list args; int pid; int waitpid_result; sigset_t tmpsig; @@ -123,6 +129,14 @@ static atomic_t kmod_concurrent = ATOMIC_INIT(0); #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ static int kmod_loop_msg; + char module_name[64]; + + module_name[63] = '\0'; + va_start(args, fmt); + vsprintf(module_name, fmt, args); + va_end(args); + if (module_name[63]!=0) + BUG(); /* Buffer overflow!! */ /* Don't allow request_module() before the root fs is mounted! */ if ( ! current->fs->root ) { diff -urN -X dontdiff linux/kernel/ksyms.c linux-kmod-inline/kernel/ksyms.c --- linux/kernel/ksyms.c Sun Jan 9 01:41:17 2000 +++ linux-kmod-inline/kernel/ksyms.c Thu Jan 13 14:21:31 2000 @@ -46,9 +46,6 @@ #if defined(CONFIG_PROC_FS) #include <linux/proc_fs.h> #endif -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif extern int console_loglevel; extern void set_device_ro(kdev_t dev,int flag); @@ -69,7 +66,6 @@ 1 /* Version version */, "Using_Versions" }; #endif - #ifdef CONFIG_KMOD EXPORT_SYMBOL(request_module); diff -urN -X dontdiff linux/net/core/dev.c linux-kmod-inline/net/core/dev.c --- linux/net/core/dev.c Thu Dec 23 08:08:44 1999 +++ linux-kmod-inline/net/core/dev.c Thu Jan 13 14:15:03 2000 @@ -62,6 +62,7 @@ #include <asm/system.h> #include <asm/bitops.h> #include <linux/config.h> +#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -86,7 +87,6 @@ #include <net/pkt_sched.h> #include <net/profile.h> #include <linux/init.h> -#include <linux/kmod.h> #if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO) #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ #endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */ @@ -400,19 +400,11 @@ * Find and possibly load an interface. */ -#ifdef CONFIG_KMOD - void dev_load(const char *name) { if(!__dev_get_by_name(name) && capable(CAP_SYS_MODULE)) request_module(name); } - -#else - -extern inline void dev_load(const char *unused){;} - -#endif static int default_rebuild_header(struct sk_buff *skb) { diff -urN -X dontdiff linux/net/decnet/dn_dev.c linux-kmod-inline/net/decnet/dn_dev.c --- linux/net/decnet/dn_dev.c Sun Jan 9 05:36:20 2000 +++ linux-kmod-inline/net/decnet/dn_dev.c Thu Jan 13 14:15:03 2000 @@ -459,9 +459,7 @@ return -EFAULT; ifr->ifr_name[IFNAMSIZ-1] = 0; -#ifdef CONFIG_KMOD dev_load(ifr->ifr_name); -#endif switch(cmd) { case SIOCGIFADDR: diff -urN -X dontdiff linux/net/ipv4/af_inet.c linux-kmod-inline/net/ipv4/af_inet.c --- linux/net/ipv4/af_inet.c Sun Jan 9 05:36:20 2000 +++ linux-kmod-inline/net/ipv4/af_inet.c Thu Jan 13 14:15:03 2000 @@ -62,6 +62,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> @@ -106,9 +107,6 @@ #ifdef CONFIG_BRIDGE #include <net/br.h> #endif -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO) #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ #endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */ @@ -868,10 +866,8 @@ #ifdef CONFIG_DLCI_MODULE -#ifdef CONFIG_KMOD if (dlci_ioctl_hook == NULL) request_module("dlci"); -#endif if (dlci_ioctl_hook) { lock_kernel(); diff -urN -X dontdiff linux/net/ipv4/devinet.c linux-kmod-inline/net/ipv4/devinet.c --- linux/net/ipv4/devinet.c Sun Jan 9 05:36:20 2000 +++ linux-kmod-inline/net/ipv4/devinet.c Thu Jan 13 14:15:03 2000 @@ -23,6 +23,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -50,9 +51,6 @@ #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> #endif -#ifdef CONFIG_KMOD -#include <linux/kmod.h> -#endif #include <net/ip.h> #include <net/route.h> @@ -489,9 +487,7 @@ *colon = 0; #endif -#ifdef CONFIG_KMOD dev_load(ifr.ifr_name); -#endif switch(cmd) { case SIOCGIFADDR: /* Get interface address */ diff -urN -X dontdiff linux/net/irda/irda_device.c linux-kmod-inline/net/irda/irda_device.c --- linux/net/irda/irda_device.c Thu Jan 6 22:46:18 2000 +++ linux-kmod-inline/net/irda/irda_device.c Thu Jan 13 14:15:04 2000 @@ -29,6 +29,7 @@ ********************************************************************/ #include <linux/config.h> +#include <linux/module.h> #include <linux/string.h> #include <linux/proc_fs.h> #include <linux/skbuff.h> @@ -38,7 +39,6 @@ #include <linux/netdevice.h> #include <linux/init.h> #include <linux/tty.h> -#include <linux/kmod.h> #include <linux/wireless.h> #include <linux/spinlock.h> @@ -460,16 +460,12 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) { struct dongle_reg *reg; - char modname[32]; dongle_t *dongle; ASSERT(dev != NULL, return NULL;); -#ifdef CONFIG_KMOD /* Try to load the module needed */ - sprintf(modname, "irda-dongle-%d", type); - request_module(modname); -#endif /* CONFIG_KMOD */ + request_module("irda-dongle-%d", type); if (!(reg = hashbin_find(dongles, type, NULL))) { ERROR("IrDA: Unable to find requested dongle\n"); diff -urN -X dontdiff linux/net/irda/irlmp.c linux-kmod-inline/net/irda/irlmp.c --- linux/net/irda/irlmp.c Thu Jan 6 22:46:18 2000 +++ linux-kmod-inline/net/irda/irlmp.c Thu Jan 13 14:15:04 2000 @@ -30,7 +30,6 @@ #include <linux/types.h> #include <linux/proc_fs.h> #include <linux/init.h> -#include <linux/kmod.h> #include <linux/random.h> #include <net/irda/irda.h> diff -urN -X dontdiff linux/net/netsyms.c linux-kmod-inline/net/netsyms.c --- linux/net/netsyms.c Sun Jan 9 05:36:21 2000 +++ linux-kmod-inline/net/netsyms.c Thu Jan 13 14:15:04 2000 @@ -500,9 +500,7 @@ EXPORT_SYMBOL(dev_get); EXPORT_SYMBOL(dev_alloc); EXPORT_SYMBOL(dev_alloc_name); -#ifdef CONFIG_KMOD EXPORT_SYMBOL(dev_load); -#endif EXPORT_SYMBOL(dev_ioctl); EXPORT_SYMBOL(dev_queue_xmit); EXPORT_SYMBOL(netdev_dropping); diff -urN -X dontdiff linux/net/packet/af_packet.c linux-kmod-inline/net/packet/af_packet.c --- linux/net/packet/af_packet.c Thu Dec 23 03:55:38 1999 +++ linux-kmod-inline/net/packet/af_packet.c Thu Jan 13 14:15:04 2000 @@ -52,7 +52,6 @@ #include <linux/netdevice.h> #include <linux/if_packet.h> #include <linux/wireless.h> -#include <linux/kmod.h> #include <net/ip.h> #include <net/protocol.h> #include <linux/skbuff.h> diff -urN -X dontdiff linux/net/sched/cls_api.c linux-kmod-inline/net/sched/cls_api.c --- linux/net/sched/cls_api.c Sat Jan 8 00:57:13 2000 +++ linux-kmod-inline/net/sched/cls_api.c Thu Jan 13 14:15:04 2000 @@ -17,6 +17,7 @@ #include <asm/system.h> #include <asm/bitops.h> #include <linux/config.h> +#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -31,7 +32,6 @@ #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/init.h> -#include <linux/kmod.h> #include <net/sock.h> #include <net/pkt_sched.h> @@ -201,18 +201,13 @@ if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL) goto errout; tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND-1]); -#ifdef CONFIG_KMOD if (tp_ops==NULL && tca[TCA_KIND-1] != NULL) { struct rtattr *kind = tca[TCA_KIND-1]; - char module_name[4 + IFNAMSIZ + 1]; - if (RTA_PAYLOAD(kind) <= IFNAMSIZ) { - sprintf(module_name, "cls_%s", (char*)RTA_DATA(kind)); - request_module (module_name); - tp_ops = tcf_proto_lookup_ops(kind); - } + if (RTA_PAYLOAD(kind) <= IFNAMSIZ) + if (request_module("cls_%s", (char*)RTA_DATA(kind)) == 0) + tp_ops = tcf_proto_lookup_ops(kind); } -#endif if (tp_ops == NULL) { err = -EINVAL; kfree(tp); diff -urN -X dontdiff linux/net/sched/sch_api.c linux-kmod-inline/net/sched/sch_api.c --- linux/net/sched/sch_api.c Sat Jan 8 00:57:13 2000 +++ linux-kmod-inline/net/sched/sch_api.c Thu Jan 13 14:15:04 2000 @@ -16,6 +16,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -31,7 +32,6 @@ #include <linux/rtnetlink.h> #include <linux/init.h> #include <linux/proc_fs.h> -#include <linux/kmod.h> #include <net/sock.h> #include <net/pkt_sched.h> @@ -397,17 +397,11 @@ int size; ops = qdisc_lookup_ops(kind); -#ifdef CONFIG_KMOD if (ops==NULL && tca[TCA_KIND-1] != NULL) { - char module_name[4 + IFNAMSIZ + 1]; - - if (RTA_PAYLOAD(kind) <= IFNAMSIZ) { - sprintf(module_name, "sch_%s", (char*)RTA_DATA(kind)); - request_module (module_name); - ops = qdisc_lookup_ops(kind); - } + if (RTA_PAYLOAD(kind) <= IFNAMSIZ) + if (request_module("sch_%s", (char*)RTA_DATA(kind)) == 0) + ops = qdisc_lookup_ops(kind); } -#endif err = -EINVAL; if (ops == NULL) diff -urN -X dontdiff linux/net/sched/sch_ingress.c linux-kmod-inline/net/sched/sch_ingress.c --- linux/net/sched/sch_ingress.c Sat Jan 8 00:57:13 2000 +++ linux-kmod-inline/net/sched/sch_ingress.c Thu Jan 13 14:15:04 2000 @@ -19,7 +19,6 @@ #include <asm/byteorder.h> #include <asm/uaccess.h> #include <asm/smp.h> -#include <linux/kmod.h> #include <linux/stat.h> #include <linux/interrupt.h> #include <linux/list.h> diff -urN -X dontdiff linux/net/socket.c linux-kmod-inline/net/socket.c --- linux/net/socket.c Thu Jan 13 14:11:19 2000 +++ linux-kmod-inline/net/socket.c Thu Jan 13 14:15:04 2000 @@ -58,6 +58,7 @@ */ #include <linux/config.h> +#include <linux/module.h> #include <linux/mm.h> #include <linux/smp_lock.h> #include <linux/socket.h> @@ -70,10 +71,6 @@ #include <linux/init.h> #include <linux/poll.h> -#if defined(CONFIG_KMOD) && defined(CONFIG_NET) -#include <linux/kmod.h> -#endif - #include <asm/uaccess.h> #include <linux/inet.h> @@ -715,7 +712,7 @@ family = PF_PACKET; } -#if defined(CONFIG_KMOD) && defined(CONFIG_NET) +#if defined(CONFIG_NET) /* Attempt to load a protocol module if the find failed. * * 12/09/1996 Marcin: But! this makes REALLY only sense, if the user @@ -723,11 +720,7 @@ * Otherwise module support will break! */ if (net_families[family]==NULL) - { - char module_name[30]; - sprintf(module_name,"net-pf-%d",family); - request_module(module_name); - } + request_module("net-pf-%d",family); #endif net_family_read_lock();