diff options
Diffstat (limited to 'fs')
75 files changed, 481 insertions, 1494 deletions
diff --git a/fs/Config.in b/fs/Config.in index ff031ab44..e9eb8099c 100644 --- a/fs/Config.in +++ b/fs/Config.in @@ -9,7 +9,10 @@ tristate 'Kernel automounter support' CONFIG_AUTOFS_FS tristate 'Kernel automounter version 4 support (also supports v3)' CONFIG_AUTOFS4_FS -dep_tristate 'ADFS file system support (read only) (EXPERIMENTAL)' CONFIG_ADFS_FS $CONFIG_EXPERIMENTAL +dep_tristate 'ADFS file system support' CONFIG_ADFS_FS $CONFIG_EXPERIMENTAL +if [ "$CONFIG_ADFS_FS" != "n" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool ' ADFS write support (DANGEROUS)' CONFIG_ADFS_FS_RW +fi tristate 'Amiga FFS file system support' CONFIG_AFFS_FS diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 794097871..c9226513e 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -1,10 +1,11 @@ /* * linux/fs/adfs/dir.c * - * Copyright (C) 1999 Russell King + * Copyright (C) 1999-2000 Russell King * * Common directory handling for ADFS */ +#include <linux/config.h> #include <linux/version.h> #include <linux/errno.h> #include <linux/fs.h> @@ -33,13 +34,16 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) struct adfs_dir_ops *ops = sb->u.adfs_sb.s_dir; struct object_info obj; struct adfs_dir dir; - int ret; + int ret = 0; + + if (filp->f_pos >> 32) + goto out; ret = ops->read(sb, inode->i_ino, inode->i_size, &dir); if (ret) goto out; - switch (filp->f_pos) { + switch ((unsigned long)filp->f_pos) { case 0: if (filldir(dirent, ".", 1, 0, inode->i_ino) < 0) goto free_out; @@ -79,13 +83,14 @@ out: int adfs_dir_update(struct super_block *sb, struct object_info *obj) { + int ret = -EINVAL; +#ifdef CONFIG_ADFS_FS_RW struct adfs_dir_ops *ops = sb->u.adfs_sb.s_dir; struct adfs_dir dir; - int ret = -EINVAL; printk(KERN_INFO "adfs_dir_update: object %06X in dir %06X\n", obj->file_id, obj->parent_id); -#if 0 + if (!ops->update) { ret = -EINVAL; goto out; diff --git a/fs/affs/super.c b/fs/affs/super.c index 5f2387bde..46c11a8e2 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -672,24 +672,17 @@ affs_statfs(struct super_block *sb, struct statfs *buf) static DECLARE_FSTYPE_DEV(affs_fs_type, "affs", affs_read_super); -int __init init_affs_fs(void) +static int __init init_affs_fs(void) { return register_filesystem(&affs_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int -init_module(void) -{ - return register_filesystem(&affs_fs_type); -} - -void -cleanup_module(void) +static void __exit exit_affs_fs(void) { unregister_filesystem(&affs_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_affs_fs) +module_exit(exit_affs_fs) diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 2c38ccafe..6f3765399 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -322,16 +322,15 @@ out: static DECLARE_FSTYPE_DEV( bfs_fs_type, "bfs", bfs_read_super); -#ifdef MODULE -#define init_bfs_fs init_module - -void cleanup_module(void) +static int __init init_bfs_fs(void) { - unregister_filesystem(&bfs_fs_type); + return register_filesystem(&bfs_fs_type); } -#endif -int __init init_bfs_fs(void) +static void __exit exit_bfs_fs(void) { - return register_filesystem(&bfs_fs_type); + unregister_filesystem(&bfs_fs_type); } + +module_init(init_bfs_fs) +module_exit(exit_bfs_fs) diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 41138e3fd..5aa2f1b35 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c @@ -78,8 +78,7 @@ if (file->f_op->llseek) { \ * dumping of the process results in another error.. */ -static inline int -do_aout_core_dump(long signr, struct pt_regs * regs, struct file *file) +static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file) { mm_segment_t fs; int has_dumped = 0; @@ -183,17 +182,6 @@ end_coredump: return has_dumped; } -static int -aout_core_dump(long signr, struct pt_regs * regs, struct file *file) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_aout_core_dump(signr, regs, file); - MOD_DEC_USE_COUNT; - return retval; -} - /* * create_aout_tables() parses the env- and arg-strings in new user * memory and creates the pointer tables from them, and puts their @@ -261,7 +249,7 @@ static unsigned long * create_aout_tables(char * p, struct linux_binprm * bprm) * libraries. There is no binary dependent code anywhere else. */ -static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) +static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct exec ex; struct file * file; @@ -398,14 +386,11 @@ static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs } } beyond_if: - if (current->exec_domain && current->exec_domain->module) - __MOD_DEC_USE_COUNT(current->exec_domain->module); + put_exec_domain(current->exec_domain); if (current->binfmt && current->binfmt->module) __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); current->binfmt = &aout_format; - if (current->exec_domain && current->exec_domain->module) - __MOD_INC_USE_COUNT(current->exec_domain->module); if (current->binfmt && current->binfmt->module) __MOD_INC_USE_COUNT(current->binfmt->module); @@ -429,20 +414,7 @@ beyond_if: return 0; } - -static int -load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - -static inline int -do_load_aout_library(int fd) +static int load_aout_library(int fd) { struct file * file; struct inode * inode; @@ -529,18 +501,6 @@ out: return retval; } -static int -load_aout_library(int fd) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_aout_library(fd); - MOD_DEC_USE_COUNT; - return retval; -} - - static int __init init_aout_binfmt(void) { return register_binfmt(&aout_format); @@ -555,4 +515,3 @@ EXPORT_NO_SYMBOLS; module_init(init_aout_binfmt); module_exit(exit_aout_binfmt); - diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 96190fed2..877d9e6d7 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -35,8 +35,6 @@ #include <asm/uaccess.h> #include <asm/pgalloc.h> -#include <linux/config.h> - #define DLINFO_ITEMS 13 #include <linux/elf.h> @@ -383,8 +381,7 @@ out: #define INTERPRETER_ELF 2 -static inline int -do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) +static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct file * file; struct dentry *interpreter_dentry = NULL; /* to shut gcc up */ @@ -703,14 +700,11 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) if (interpreter_type != INTERPRETER_AOUT) sys_close(elf_exec_fileno); - if (current->exec_domain && current->exec_domain->module) - __MOD_DEC_USE_COUNT(current->exec_domain->module); + put_exec_domain(current->exec_domain); if (current->binfmt && current->binfmt->module) __MOD_DEC_USE_COUNT(current->binfmt->module); current->exec_domain = lookup_exec_domain(current->personality); current->binfmt = &elf_format; - if (current->exec_domain && current->exec_domain->module) - __MOD_INC_USE_COUNT(current->exec_domain->module); if (current->binfmt && current->binfmt->module) __MOD_INC_USE_COUNT(current->binfmt->module); @@ -800,22 +794,10 @@ out_free_ph: goto out; } -static int -load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_elf_binary(bprm, regs); - MOD_DEC_USE_COUNT; - return retval; -} - /* This is really simpleminded and specialized - we are loading an a.out library that is given an ELF header. */ -static inline int -do_load_elf_library(int fd) +static int load_elf_library(int fd) { struct file * file; struct dentry * dentry; @@ -907,16 +889,6 @@ out: return error; } -static int load_elf_library(int fd) -{ - int retval; - - MOD_INC_USE_COUNT; - retval = do_load_elf_library(fd); - MOD_DEC_USE_COUNT; - return retval; -} - /* * Note that some platforms still use traditional core dumps and not * the ELF core dump. Each platform can select it as appropriate. @@ -1069,10 +1041,6 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) elf_fpregset_t fpu; /* NT_PRFPREG */ struct elf_prpsinfo psinfo; /* NT_PRPSINFO */ -#ifndef CONFIG_BINFMT_ELF - MOD_INC_USE_COUNT; -#endif - /* Count what's needed to dump, up to the limit of coredump size */ segs = 0; size = 0; @@ -1302,9 +1270,6 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) end_coredump: set_fs(fs); -#ifndef CONFIG_BINFMT_ELF - MOD_DEC_USE_COUNT; -#endif return has_dumped; } #endif /* USE_ELF_CORE_DUMP */ diff --git a/fs/binfmt_em86.c b/fs/binfmt_em86.c index d89bd9ca8..189d130ca 100644 --- a/fs/binfmt_em86.c +++ b/fs/binfmt_em86.c @@ -20,7 +20,7 @@ #define EM86_INTERP "/usr/bin/em86" #define EM86_I_NAME "em86" -static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) { char *interp, *i_name, *i_arg; struct dentry * dentry; @@ -95,15 +95,6 @@ static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs) return search_binary_handler(bprm, regs); } -static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_em86(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - struct linux_binfmt em86_format = { NULL, THIS_MODULE, load_em86, NULL, NULL, 0 }; diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 5d5d17bc4..c530a6ff2 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -185,7 +185,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) char *iname_addr = iname; int retval; - MOD_INC_USE_COUNT; retval = -ENOEXEC; if (!enabled) goto _ret; @@ -224,7 +223,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) if (retval >= 0) retval = search_binary_handler(bprm, regs); _ret: - MOD_DEC_USE_COUNT; return retval; } diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index 8c71ec4a9..84dbf11b0 100644 --- a/fs/binfmt_script.c +++ b/fs/binfmt_script.c @@ -13,7 +13,7 @@ #include <linux/init.h> #include <linux/smp_lock.h> -static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs) +static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) { char *cp, *i_name, *i_arg; struct dentry * dentry; @@ -94,15 +94,6 @@ static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs) return search_binary_handler(bprm,regs); } -static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) -{ - int retval; - MOD_INC_USE_COUNT; - retval = do_load_script(bprm,regs); - MOD_DEC_USE_COUNT; - return retval; -} - struct linux_binfmt script_format = { NULL, THIS_MODULE, load_script, NULL, NULL, 0 }; diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index c00a6945c..cc12ccaef 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -260,7 +260,6 @@ static int coda_psdev_open(struct inode * inode, struct file * file) } vcp->vc_inuse++; - MOD_INC_USE_COUNT; if ( file->f_flags == O_RDWR ) { vcp->vc_pid = current->pid; @@ -290,7 +289,6 @@ static int coda_psdev_release(struct inode * inode, struct file * file) } vcp->vc_inuse--; - MOD_DEC_USE_COUNT; CDEBUG(D_PSDEV, "inuse: %d, vc_pid %d, caller %d\n", vcp->vc_inuse, vcp->vc_pid, current->pid); diff --git a/fs/efs/super.c b/fs/efs/super.c index 092c2f0a7..7917bef5c 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -17,26 +17,22 @@ static DECLARE_FSTYPE_DEV(efs_fs_type, "efs", efs_read_super); static struct super_operations efs_superblock_operations = { read_inode: efs_read_inode, - put_super: efs_put_super, statfs: efs_statfs, }; -int __init init_efs_fs(void) { - return register_filesystem(&efs_fs_type); -} - -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) { +static int __init init_efs_fs(void) { printk("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); - return init_efs_fs(); + return register_filesystem(&efs_fs_type); } -void cleanup_module(void) { +static void __exit exit_efs_fs(void) { unregister_filesystem(&efs_fs_type); } -#endif + +EXPORT_NO_SYMBOLS; + +module_init(init_efs_fs) +module_exit(exit_efs_fs) static efs_block_t efs_validate_vh(struct volume_header *vh) { int i; @@ -209,9 +205,6 @@ out_no_fs: return(NULL); } -void efs_put_super(struct super_block *s) { -} - int efs_statfs(struct super_block *s, struct statfs *buf) { struct efs_sb_info *sb = SUPER_INFO(s); @@ -33,6 +33,9 @@ #include <linux/init.h> #include <linux/pagemap.h> #include <linux/highmem.h> +#include <linux/spinlock.h> +#define __NO_VERSION__ +#include <linux/module.h> #include <asm/uaccess.h> #include <asm/pgalloc.h> @@ -43,6 +46,7 @@ #endif static struct linux_binfmt *formats = (struct linux_binfmt *) NULL; +static spinlock_t binfmt_lock = SPIN_LOCK_UNLOCKED; int register_binfmt(struct linux_binfmt * fmt) { @@ -52,13 +56,17 @@ int register_binfmt(struct linux_binfmt * fmt) return -EINVAL; if (fmt->next) return -EBUSY; + spin_lock(&binfmt_lock); while (*tmp) { - if (fmt == *tmp) + if (fmt == *tmp) { + spin_unlock(&binfmt_lock); return -EBUSY; + } tmp = &(*tmp)->next; } fmt->next = formats; formats = fmt; + spin_unlock(&binfmt_lock); return 0; } @@ -66,16 +74,25 @@ int unregister_binfmt(struct linux_binfmt * fmt) { struct linux_binfmt ** tmp = &formats; + spin_lock(&binfmt_lock); while (*tmp) { if (fmt == *tmp) { *tmp = fmt->next; + spin_unlock(&binfmt_lock); return 0; } tmp = &(*tmp)->next; } + spin_unlock(&binfmt_lock); return -EINVAL; } +static inline void put_binfmt(struct linux_binfmt * fmt) +{ + if (fmt->module) + __MOD_DEC_USE_COUNT(fmt->module); +} + /* N.B. Error returns must be < 0 */ int open_dentry(struct dentry * dentry, int mode) { @@ -146,15 +163,22 @@ asmlinkage long sys_uselib(const char * library) file = fget(fd); retval = -ENOEXEC; if (file && file->f_dentry && file->f_op && file->f_op->read) { + spin_lock(&binfmt_lock); for (fmt = formats ; fmt ; fmt = fmt->next) { int (*fn)(int) = fmt->load_shlib; if (!fn) continue; + if (!try_inc_mod_count(fmt->module)) + continue; + spin_unlock(&binfmt_lock); /* N.B. Should use file instead of fd */ retval = fn(fd); + spin_lock(&binfmt_lock); + put_binfmt(fmt); if (retval != -ENOEXEC) break; } + spin_unlock(&binfmt_lock); } fput(file); sys_close(fd); @@ -767,12 +791,17 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) } #endif for (try=0; try<2; try++) { + spin_lock(&binfmt_lock); for (fmt = formats ; fmt ; fmt = fmt->next) { int (*fn)(struct linux_binprm *, struct pt_regs *) = fmt->load_binary; if (!fn) continue; + if (!try_inc_mod_count(fmt->module)) + continue; + spin_unlock(&binfmt_lock); retval = fn(bprm, regs); if (retval >= 0) { + put_binfmt(fmt); if (bprm->dentry) { lock_kernel(); dput(bprm->dentry); @@ -782,11 +811,16 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) current->did_exec = 1; return retval; } + spin_lock(&binfmt_lock); + put_binfmt(fmt); if (retval != -ENOEXEC) break; - if (!bprm->dentry) /* We don't have the dentry anymore */ + if (!bprm->dentry) { + spin_unlock(&binfmt_lock); return retval; + } } + spin_unlock(&binfmt_lock); if (retval != -ENOEXEC) { break; #ifdef CONFIG_KMOD diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 29753ba9e..67dedf6d6 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -151,14 +151,14 @@ revalidate: * not the directory has been modified * during the copy operation. */ - unsigned long version = inode->i_version; + unsigned long version = filp->f_version; error = filldir(dirent, de->name, de->name_len, filp->f_pos, le32_to_cpu(de->inode)); if (error) break; - if (version != inode->i_version) + if (version != filp->f_version) goto revalidate; stored ++; } diff --git a/fs/fat/fatfs_syms.c b/fs/fat/fatfs_syms.c index 3a2e4ea82..22ce56b68 100644 --- a/fs/fat/fatfs_syms.c +++ b/fs/fat/fatfs_syms.c @@ -7,6 +7,7 @@ #define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) #include <linux/version.h> #include <linux/module.h> +#include <linux/init.h> #include <linux/mm.h> #include <linux/msdos_fs.h> @@ -54,8 +55,10 @@ EXPORT_SYMBOL(fat_add_entries); EXPORT_SYMBOL(fat_dir_empty); EXPORT_SYMBOL(fat_truncate); -int init_fat_fs(void) +static int __init init_fat_fs(void) { fat_hash_init(); return 0; } + +module_init(init_fat_fs) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index f95adc0fd..cedd3ba2b 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -920,19 +920,3 @@ int fat_notify_change(struct dentry * dentry, struct iattr * attr) ~MSDOS_SB(sb)->options.fs_umask; return 0; } - - -#ifdef MODULE -int init_module(void) -{ - return init_fat_fs(); -} - - -void cleanup_module(void) -{ - /* Nothing to be done, really! */ - return; -} -#endif - diff --git a/fs/filesystems.c b/fs/filesystems.c index 807f8306d..6ad3ec407 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -9,30 +9,10 @@ #include <linux/config.h> #include <linux/fs.h> -#include <linux/minix_fs.h> -#include <linux/ext2_fs.h> -#include <linux/msdos_fs.h> -#include <linux/umsdos_fs.h> -#include <linux/proc_fs.h> #include <linux/devfs_fs_kernel.h> #include <linux/nfs_fs.h> -#include <linux/iso_fs.h> -#include <linux/sysv_fs.h> -#include <linux/hpfs_fs.h> -#include <linux/smb_fs.h> -#include <linux/ncp_fs.h> -#include <linux/affs_fs.h> -#include <linux/ufs_fs.h> -#include <linux/efs_fs.h> -#include <linux/romfs_fs.h> #include <linux/auto_fs.h> -#include <linux/qnx4_fs.h> -#include <linux/udf_fs.h> -#include <linux/ntfs_fs.h> -#include <linux/hfs_fs.h> #include <linux/devpts_fs.h> -#include <linux/bfs_fs.h> -#include <linux/openprom_fs.h> #include <linux/major.h> #include <linux/smp.h> #include <linux/smp_lock.h> @@ -42,7 +22,6 @@ #include <linux/lockd/bind.h> #include <linux/lockd/xdr.h> #include <linux/init.h> -#include <linux/nls.h> #ifdef CONFIG_CODA_FS extern int init_coda(void); @@ -52,40 +31,8 @@ extern int init_coda(void); extern int init_devpts_fs(void); #endif -#ifdef CONFIG_SUN_OPENPROMFS -extern int init_openprom_fs(void); -#endif - void __init filesystem_setup(void) { -#ifdef CONFIG_MINIX_FS - init_minix_fs(); -#endif - -#ifdef CONFIG_ROMFS_FS - init_romfs_fs(); -#endif - -#ifdef CONFIG_UMSDOS_FS - init_umsdos_fs(); -#endif - -#ifdef CONFIG_FAT_FS - init_fat_fs(); -#endif - -#ifdef CONFIG_MSDOS_FS - init_msdos_fs(); -#endif - -#ifdef CONFIG_VFAT_FS - init_vfat_fs(); -#endif - -#ifdef CONFIG_PROC_FS - init_proc_fs(); -#endif - init_devfs_fs(); /* Header file may make this empty */ #ifdef CONFIG_NFS_FS @@ -96,69 +43,9 @@ void __init filesystem_setup(void) init_coda(); #endif -#ifdef CONFIG_SMB_FS - init_smb_fs(); -#endif - -#ifdef CONFIG_NCP_FS - init_ncp_fs(); -#endif - -#ifdef CONFIG_ISO9660_FS - init_iso9660_fs(); -#endif - -#ifdef CONFIG_SYSV_FS - init_sysv_fs(); -#endif - -#ifdef CONFIG_HPFS_FS - init_hpfs_fs(); -#endif - -#ifdef CONFIG_NTFS_FS - init_ntfs_fs(); -#endif - -#ifdef CONFIG_HFS_FS - init_hfs_fs(); -#endif - -#ifdef CONFIG_AFFS_FS - init_affs_fs(); -#endif - -#ifdef CONFIG_UFS_FS - init_ufs_fs(); -#endif - -#ifdef CONFIG_EFS_FS - init_efs_fs(); -#endif - #ifdef CONFIG_DEVPTS_FS init_devpts_fs(); #endif - -#ifdef CONFIG_QNX4FS_FS - init_qnx4_fs(); -#endif - -#ifdef CONFIG_UDF_FS - init_udf_fs(); -#endif - -#ifdef CONFIG_BFS_FS - init_bfs_fs(); -#endif - -#ifdef CONFIG_SUN_OPENPROMFS - init_openprom_fs(); -#endif - -#ifdef CONFIG_NLS - init_nls(); -#endif } #ifndef CONFIG_NFSD diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 251690dc8..8c91758d6 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -472,38 +472,19 @@ bail3: return NULL; } -int __init init_hfs_fs(void) +static int __init init_hfs_fs(void) { hfs_cat_init(); return register_filesystem(&hfs_fs); } -#ifdef MODULE -int init_module(void) { - int error; - -#if defined(DEBUG_SIZES) || defined(DEBUG_ALL) - hfs_warn("HFS inode: %d bytes available\n", - sizeof(struct ext2_inode_info)-sizeof(struct hfs_inode_info)); - hfs_warn("HFS super_block: %d bytes available\n", - sizeof(struct ext2_sb_info)-sizeof(struct hfs_sb_info)); - if ((sizeof(struct hfs_inode_info)>sizeof(struct ext2_inode_info)) || - (sizeof(struct hfs_sb_info)>sizeof(struct ext2_sb_info))) { - return -ENOMEM; /* well sort of */ - } -#endif - error = init_hfs_fs(); - if (!error) { - /* register_symtab(NULL); */ - } - return error; -} - -void cleanup_module(void) { +static void __exit exit_hfs_fs(void) { hfs_cat_free(); unregister_filesystem(&hfs_fs); } -#endif + +module_init(init_hfs_fs) +module_exit(exit_hfs_fs) #if defined(DEBUG_ALL) || defined(DEBUG_MEM) long int hfs_alloc = 0; diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c index 8bcbf28fc..dc9ccf624 100644 --- a/fs/hpfs/buffer.c +++ b/fs/hpfs/buffer.c @@ -125,7 +125,8 @@ void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head kdev_t dev = s->s_dev; struct buffer_head *bh; - if (!ahead || secno + ahead >= s->s_hpfs_fs_size) + /* vvvv - workaround for the breada bug */ + if (!ahead || secno + ahead + (read_ahead[MAJOR(dev)] >> 9) >= s->s_hpfs_fs_size) *bhp = bh = bread(dev, secno, 512); else *bhp = bh = breada(dev, secno, 512, 0, (ahead + 1) << 9); if (bh != NULL) @@ -144,6 +145,7 @@ void *hpfs_get_sector(struct super_block *s, unsigned secno, struct buffer_head /*return hpfs_map_sector(s, secno, bhp, 0);*/ if ((*bhp = bh = getblk(s->s_dev, secno, 512)) != NULL) { + if (!buffer_uptodate(bh)) wait_on_buffer(bh); mark_buffer_uptodate(bh, 1); return bh->b_data; } else { @@ -172,8 +174,9 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe goto bail; } - if (!ahead || secno + 4 + ahead > s->s_hpfs_fs_size) - qbh->bh[0] = bh = breada(dev, secno, 512, 0, 2048); + /* vvvv - workaround for the breada bug */ + if (!ahead || secno + 4 + ahead + (read_ahead[MAJOR(dev)] >> 9) > s->s_hpfs_fs_size) + qbh->bh[0] = bh = bread(dev, secno, 512); else qbh->bh[0] = bh = breada(dev, secno, 512, 0, (ahead + 4) << 9); if (!bh) goto bail0; diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index 677fda52c..5071782b0 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h @@ -312,6 +312,5 @@ int hpfs_remount_fs(struct super_block *, int *, char *); void hpfs_put_super(struct super_block *); unsigned hpfs_count_one_bitmap(struct super_block *, secno); int hpfs_statfs(struct super_block *, struct statfs *); -struct super_block *hpfs_read_super(struct super_block *, void *, int); extern struct address_space_operations hpfs_aops; diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index c8283c672..69303cb9e 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -314,4 +314,5 @@ void hpfs_write_if_changed(struct inode *inode) void hpfs_delete_inode(struct inode *inode) { hpfs_remove_fnode(inode->i_sb, inode->i_ino); + clear_inode(inode); } diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index d29f6e574..04cd6428d 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -9,6 +9,7 @@ #include <linux/string.h> #include "hpfs_fn.h" #include <linux/module.h> +#include <linux/init.h> /* Mark the filesystem dirty, so that chkdsk checks it when os/2 booted */ @@ -557,26 +558,17 @@ bail0: DECLARE_FSTYPE_DEV(hpfs_fs_type, "hpfs", hpfs_read_super); -int init_hpfs_fs(void) +static int __init init_hpfs_fs(void) { return register_filesystem(&hpfs_fs_type); } -#ifdef MODULE - -/*int register_symtab_from(struct symbol_table *, long *);*/ - -int init_module(void) -{ - /*int status; - if (!(status = init_hpfs_fs())) register_symtab(NULL); - return status;*/ - return init_hpfs_fs(); -} - -void cleanup_module(void) +static void __exit exit_hpfs_fs(void) { unregister_filesystem(&hpfs_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_hpfs_fs) +module_exit(exit_hpfs_fs) diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index b13ee0285..4ecd72cd2 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -994,16 +994,20 @@ static struct address_space_operations isofs_aops = { bmap: _isofs_bmap }; -static void test_and_set_uid(uid_t *p, uid_t value) +static inline void test_and_set_uid(uid_t *p, uid_t value) { if(value) { *p = value; -#if 0 - printk("Resetting to %d\n", value); -#endif } } +static inline void test_and_set_gid(gid_t *p, gid_t value) +{ + if(value) { + *p = value; + } +} + static int isofs_read_level3_size(struct inode * inode) { unsigned long ino = inode->i_ino; @@ -1207,6 +1211,7 @@ static void isofs_read_inode(struct inode * inode) parse_rock_ridge_inode(raw_inode, inode); /* hmm..if we want uid or gid set, override the rock ridge setting */ test_and_set_uid(&inode->i_uid, inode->i_sb->u.isofs_sb.s_uid); + test_and_set_gid(&inode->i_gid, inode->i_sb->u.isofs_sb.s_gid); } #ifdef DEBUG @@ -1431,22 +1436,17 @@ void leak_check_brelse(struct buffer_head * bh){ static DECLARE_FSTYPE_DEV(iso9660_fs_type, "iso9660", isofs_read_super); -int __init init_iso9660_fs(void) +static int __init init_iso9660_fs(void) { return register_filesystem(&iso9660_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) +static void __exit exit_iso9660_fs(void) { - return init_iso9660_fs(); + unregister_filesystem(&iso9660_fs_type); } -void cleanup_module(void) -{ - unregister_filesystem(&iso9660_fs_type); -} +EXPORT_NO_SYMBOLS; -#endif +module_init(init_iso9660_fs) +module_exit(exit_iso9660_fs) diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 31d4c99c7..4c9fa16a3 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -1267,22 +1267,17 @@ int minix_sync_inode(struct inode * inode) static DECLARE_FSTYPE_DEV(minix_fs_type,"minix",minix_read_super); -int __init init_minix_fs(void) +static int __init init_minix_fs(void) { return register_filesystem(&minix_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) +static void __exit exit_minix_fs(void) { - return init_minix_fs(); + unregister_filesystem(&minix_fs_type); } -void cleanup_module(void) -{ - unregister_filesystem(&minix_fs_type); -} +EXPORT_NO_SYMBOLS; -#endif +module_init(init_minix_fs) +module_exit(exit_minix_fs) diff --git a/fs/msdos/msdosfs_syms.c b/fs/msdos/msdosfs_syms.c index 8e9897f2f..7b578f00f 100644 --- a/fs/msdos/msdosfs_syms.c +++ b/fs/msdos/msdosfs_syms.c @@ -26,10 +26,17 @@ EXPORT_SYMBOL(msdos_unlink); EXPORT_SYMBOL(msdos_read_super); EXPORT_SYMBOL(msdos_put_super); +static DECLARE_FSTYPE_DEV(msdos_fs_type, "msdos", msdos_read_super); -DECLARE_FSTYPE_DEV(msdos_fs_type, "msdos", msdos_read_super); - -int __init init_msdos_fs(void) +static int __init init_msdos_fs(void) { return register_filesystem(&msdos_fs_type); } + +static void __exit exit_msdos_fs(void) +{ + unregister_filesystem(&msdos_fs_type); +} + +module_init(init_msdos_fs) +module_exit(exit_msdos_fs) diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c index 7febeaa8b..495df7cd1 100644 --- a/fs/msdos/namei.c +++ b/fs/msdos/namei.c @@ -599,28 +599,7 @@ struct super_block *msdos_read_super(struct super_block *sb,void *data, int sile MSDOS_SB(sb)->options.isvfat = 0; res = fat_read_super(sb, data, silent, &msdos_dir_inode_operations); - if (res == NULL) - goto out_fail; - sb->s_root->d_op = &msdos_dentry_operations; + if (res) + sb->s_root->d_op = &msdos_dentry_operations; return res; - -out_fail: - return NULL; -} - - - -#ifdef MODULE -int init_module(void) -{ - return init_msdos_fs(); } - - -void cleanup_module(void) -{ - unregister_filesystem(&msdos_fs_type); -} - -#endif - diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 349eec589..f6ff5e420 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -698,15 +698,7 @@ int ncp_current_malloced; static DECLARE_FSTYPE(ncp_fs_type, "ncpfs", ncp_read_super, 0); -int __init init_ncp_fs(void) -{ - return register_filesystem(&ncp_fs_type); -} - -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) +static int __init init_ncp_fs(void) { DPRINTK("ncpfs: init_module called\n"); @@ -714,10 +706,10 @@ int init_module(void) ncp_malloced = 0; ncp_current_malloced = 0; #endif - return init_ncp_fs(); + return register_filesystem(&ncp_fs_type); } -void cleanup_module(void) +static void __exit exit_ncp_fs(void) { DPRINTK("ncpfs: cleanup_module called\n"); unregister_filesystem(&ncp_fs_type); @@ -727,4 +719,7 @@ void cleanup_module(void) #endif } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_ncp_fs) +module_exit(exit_ncp_fs) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 37a8715cf..717d12bbb 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -161,7 +161,7 @@ nfs_readpage_result(struct rpc_task *task) } kunmap(page); UnlockPage(page); - free_page(address); + __free_page(page); rpc_release_task(task); kfree(req); diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 4a7e63dcb..7baab32d9 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -8,6 +8,7 @@ * Extensive rewrite by Neil Brown <neilb@cse.unsw.edu.au> Southern-Spring 1999 */ +#include <linux/config.h> #include <linux/sched.h> #include <linux/malloc.h> #include <linux/fs.h> diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index c1ea11ff8..1a0893b7e 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -17,9 +17,11 @@ #ifdef CONFIG_KMOD #include <linux/kmod.h> #endif +#include <linux/spinlock.h> #include <asm/byteorder.h> static struct nls_table *tables = (struct nls_table *) NULL; +static spinlock_t nls_lock = SPIN_LOCK_UNLOCKED; /* * Sample implementation from Unicode home page. @@ -165,14 +167,18 @@ int register_nls(struct nls_table * nls) return -EINVAL; if (nls->next) return -EBUSY; + + spin_lock(&nls_lock); while (*tmp) { if (nls == *tmp) { + spin_unlock(&nls_lock); return -EBUSY; } tmp = &(*tmp)->next; } nls->next = tables; tables = nls; + spin_unlock(&nls_lock); return 0; } @@ -180,25 +186,30 @@ int unregister_nls(struct nls_table * nls) { struct nls_table ** tmp = &tables; + spin_lock(&nls_lock); while (*tmp) { if (nls == *tmp) { *tmp = nls->next; + spin_unlock(&nls_lock); return 0; } tmp = &(*tmp)->next; } + spin_unlock(&nls_lock); return -EINVAL; } -struct nls_table *find_nls(char *charset) +static struct nls_table *find_nls(char *charset) { - struct nls_table *nls = tables; - while (nls) { + struct nls_table *nls; + spin_lock(&nls_lock); + for (nls = tables; nls; nls = nls->next) if (! strcmp(nls->charset, charset)) - return nls; - nls = nls->next; - } - return NULL; + break; + if (nls && !try_inc_mod_count(nls->owner)) + nls = NULL; + spin_unlock(&nls_lock); + return nls; } struct nls_table *load_nls(char *charset) @@ -210,16 +221,13 @@ struct nls_table *load_nls(char *charset) #endif nls = find_nls(charset); - if (nls) { - nls->inc_use_count(); + if (nls) return nls; - } -#ifndef CONFIG_KMOD - return NULL; -#else +#ifdef CONFIG_KMOD if (strlen(charset) > sizeof(buf) - sizeof("nls_")) { - printk("Unable to load NLS charset %s: name too long\n", charset); + printk("Unable to load NLS charset %s: name too long\n", + charset); return NULL; } @@ -230,16 +238,14 @@ struct nls_table *load_nls(char *charset) return NULL; } nls = find_nls(charset); - if (nls) { - nls->inc_use_count(); - } - return nls; #endif + return nls; } void unload_nls(struct nls_table *nls) { - nls->dec_use_count(); + if (nls->owner) + __MOD_DEC_USE_COUNT(nls->owner); } struct nls_unicode charset2uni[256] = { @@ -437,28 +443,15 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -void inc_use_count(void) -{ -} - -void dec_use_count(void) -{ -} - static struct nls_table default_table = { "default", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + NULL, }; - - /* Returns a simple default translation table */ struct nls_table *load_nls_default(void) { @@ -468,111 +461,9 @@ struct nls_table *load_nls_default(void) EXPORT_SYMBOL(register_nls); EXPORT_SYMBOL(unregister_nls); EXPORT_SYMBOL(unload_nls); -EXPORT_SYMBOL(find_nls); EXPORT_SYMBOL(load_nls); EXPORT_SYMBOL(load_nls_default); EXPORT_SYMBOL(utf8_mbtowc); EXPORT_SYMBOL(utf8_mbstowcs); EXPORT_SYMBOL(utf8_wctomb); EXPORT_SYMBOL(utf8_wcstombs); - -int init_nls(void) -{ -#ifdef CONFIG_NLS_ISO8859_1 - init_nls_iso8859_1(); -#endif -#ifdef CONFIG_NLS_ISO8859_2 - init_nls_iso8859_2(); -#endif -#ifdef CONFIG_NLS_ISO8859_3 - init_nls_iso8859_3(); -#endif -#ifdef CONFIG_NLS_ISO8859_4 - init_nls_iso8859_4(); -#endif -#ifdef CONFIG_NLS_ISO8859_5 - init_nls_iso8859_5(); -#endif -#ifdef CONFIG_NLS_ISO8859_6 - init_nls_iso8859_6(); -#endif -#ifdef CONFIG_NLS_ISO8859_7 - init_nls_iso8859_7(); -#endif -#ifdef CONFIG_NLS_ISO8859_8 - init_nls_iso8859_8(); -#endif -#ifdef CONFIG_NLS_ISO8859_9 - init_nls_iso8859_9(); -#endif -#ifdef CONFIG_NLS_ISO8859_14 - init_nls_iso8859_14(); -#endif -#ifdef CONFIG_NLS_ISO8859_15 - init_nls_iso8859_15(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_437 - init_nls_cp437(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_737 - init_nls_cp737(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_775 - init_nls_cp775(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_850 - init_nls_cp850(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_852 - init_nls_cp852(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_855 - init_nls_cp855(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_857 - init_nls_cp857(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_860 - init_nls_cp860(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_861 - init_nls_cp861(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_862 - init_nls_cp862(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_863 - init_nls_cp863(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_864 - init_nls_cp864(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_865 - init_nls_cp865(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_866 - init_nls_cp866(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_869 - init_nls_cp869(); -#endif -#ifdef CONFIG_NLS_CODEPAGE_874 - init_nls_cp874(); -#endif -#ifdef CONFIG_NLS_KOI8_R - init_nls_koi8_r(); -#endif - return 0; -} - -#ifdef MODULE -int init_module(void) -{ - return init_nls(); -} - - -void cleanup_module(void) -{ -} -#endif /* ifdef MODULE */ diff --git a/fs/nls/nls_cp437.c b/fs/nls/nls_cp437.c index a64a12d4b..dc664e484 100644 --- a/fs/nls/nls_cp437.c +++ b/fs/nls/nls_cp437.c @@ -427,46 +427,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp437", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp437(void) +static int __init init_nls_cp437(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp437(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp437(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp437) +module_exit(exit_nls_cp437) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp737.c b/fs/nls/nls_cp737.c index 0ae5575e0..30879b749 100644 --- a/fs/nls/nls_cp737.c +++ b/fs/nls/nls_cp737.c @@ -355,46 +355,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp737", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp737(void) +static int __init init_nls_cp737(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp737(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp737(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp737) +module_exit(exit_nls_cp737) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp775.c b/fs/nls/nls_cp775.c index d740adbba..a2efcba1a 100644 --- a/fs/nls/nls_cp775.c +++ b/fs/nls/nls_cp775.c @@ -355,46 +355,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp775", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp775(void) +static int __init init_nls_cp775(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp775(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp775(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp775) +module_exit(exit_nls_cp775) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp850.c b/fs/nls/nls_cp850.c index d15cfd893..38f0b86af 100644 --- a/fs/nls/nls_cp850.c +++ b/fs/nls/nls_cp850.c @@ -319,46 +319,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp850", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp850(void) +static int __init init_nls_cp850(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp850(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp850(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp850) +module_exit(exit_nls_cp850) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp852.c b/fs/nls/nls_cp852.c index f270943ff..c57b77bc7 100644 --- a/fs/nls/nls_cp852.c +++ b/fs/nls/nls_cp852.c @@ -319,46 +319,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xeb, 0xfc, 0xfc, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp852", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp852(void) +static int __init init_nls_cp852(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp852(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp852(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp852) +module_exit(exit_nls_cp852) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp855.c b/fs/nls/nls_cp855.c index c0b6eb7fc..e8a9fa2c2 100644 --- a/fs/nls/nls_cp855.c +++ b/fs/nls/nls_cp855.c @@ -319,46 +319,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xfa, 0xfa, 0xfc, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp855", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp855(void) +static int __init init_nls_cp855(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp855(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp855(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp855) +module_exit(exit_nls_cp855) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp857.c b/fs/nls/nls_cp857.c index 8125401f1..857fa04e2 100644 --- a/fs/nls/nls_cp857.c +++ b/fs/nls/nls_cp857.c @@ -283,46 +283,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp857", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp857(void) +static int __init init_nls_cp857(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp857(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp857(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp857) +module_exit(exit_nls_cp857) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp860.c b/fs/nls/nls_cp860.c index 187187f24..cbc8d0494 100644 --- a/fs/nls/nls_cp860.c +++ b/fs/nls/nls_cp860.c @@ -391,46 +391,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp860", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp860(void) +static int __init init_nls_cp860(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp860(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp860(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp860) +module_exit(exit_nls_cp860) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp861.c b/fs/nls/nls_cp861.c index d42259d0a..697a19d07 100644 --- a/fs/nls/nls_cp861.c +++ b/fs/nls/nls_cp861.c @@ -427,46 +427,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp861", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp861(void) +static int __init init_nls_cp861(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp861(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp861(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp861) +module_exit(exit_nls_cp861) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp862.c b/fs/nls/nls_cp862.c index 6a86e5ef5..710382d39 100644 --- a/fs/nls/nls_cp862.c +++ b/fs/nls/nls_cp862.c @@ -463,46 +463,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp862", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp862(void) +static int __init init_nls_cp862(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp862(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp862(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp862) +module_exit(exit_nls_cp862) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp863.c b/fs/nls/nls_cp863.c index 06e5361bc..ded7b89ee 100644 --- a/fs/nls/nls_cp863.c +++ b/fs/nls/nls_cp863.c @@ -427,46 +427,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp863", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp863(void) +static int __init init_nls_cp863(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp863(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp863(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp863) +module_exit(exit_nls_cp863) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp864.c b/fs/nls/nls_cp864.c index 6f3182aec..f6e6fae5d 100644 --- a/fs/nls/nls_cp864.c +++ b/fs/nls/nls_cp864.c @@ -418,46 +418,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp864", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp864(void) +static int __init init_nls_cp864(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp864(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp864(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp864) +module_exit(exit_nls_cp864) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp865.c b/fs/nls/nls_cp865.c index 24dd1dabb..c77ba51f7 100644 --- a/fs/nls/nls_cp865.c +++ b/fs/nls/nls_cp865.c @@ -427,46 +427,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp865", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp865(void) +static int __init init_nls_cp865(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp865(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp865(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp865) +module_exit(exit_nls_cp865) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp866.c b/fs/nls/nls_cp866.c index b78dd5148..54d5a2ad1 100644 --- a/fs/nls/nls_cp866.c +++ b/fs/nls/nls_cp866.c @@ -355,46 +355,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp866", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp866(void) +static int __init init_nls_cp866(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp866(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp866(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp866) +module_exit(exit_nls_cp866) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp869.c b/fs/nls/nls_cp869.c index 76a693299..eb119e546 100644 --- a/fs/nls/nls_cp869.c +++ b/fs/nls/nls_cp869.c @@ -319,46 +319,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xd5, 0x96, 0xfc, 0x98, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp869", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp869(void) +static int __init init_nls_cp869(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp869(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp869(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp869) +module_exit(exit_nls_cp869) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_cp874.c b/fs/nls/nls_cp874.c index 108a7045e..a40b6b07b 100644 --- a/fs/nls/nls_cp874.c +++ b/fs/nls/nls_cp874.c @@ -283,46 +283,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "cp874", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_cp874(void) +static int __init init_nls_cp874(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_cp874(); -} - - -void cleanup_module(void) +static void __exit exit_nls_cp874(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_cp874) +module_exit(exit_nls_cp874) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-1.c b/fs/nls/nls_iso8859-1.c index 070d97920..4b0bb644f 100644 --- a/fs/nls/nls_iso8859-1.c +++ b/fs/nls/nls_iso8859-1.c @@ -207,46 +207,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-1", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_1(void) +static int __init init_nls_iso8859_1(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_1(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_1(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_1) +module_exit(exit_nls_iso8859_1) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-14.c b/fs/nls/nls_iso8859-14.c index 7cbd8c316..7c7afe7f9 100644 --- a/fs/nls/nls_iso8859-14.c +++ b/fs/nls/nls_iso8859-14.c @@ -291,46 +291,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xaf, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-14", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_14(void) +static int __init init_nls_iso8859_14(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) +static void __exit exit_nls_iso8859_14(void) { - return init_nls_iso8859_14(); -} - - -void cleanup_module(void) -{ unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_14) +module_exit(exit_nls_iso8859_14) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-15.c b/fs/nls/nls_iso8859-15.c index 1376d1f4a..694576f64 100644 --- a/fs/nls/nls_iso8859-15.c +++ b/fs/nls/nls_iso8859-15.c @@ -284,46 +284,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xbe, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-15", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_15(void) +static int __init init_nls_iso8859_15(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_15(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_15(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_15) +module_exit(exit_nls_iso8859_15) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-2.c b/fs/nls/nls_iso8859-2.c index 274a717c9..5ba62da11 100644 --- a/fs/nls/nls_iso8859-2.c +++ b/fs/nls/nls_iso8859-2.c @@ -279,46 +279,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-2", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_2(void) +static int __init init_nls_iso8859_2(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_2(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_2(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_2) +module_exit(exit_nls_iso8859_2) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-3.c b/fs/nls/nls_iso8859-3.c index 34eebad93..7e469c8fe 100644 --- a/fs/nls/nls_iso8859-3.c +++ b/fs/nls/nls_iso8859-3.c @@ -279,46 +279,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-3", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_3(void) +static int __init init_nls_iso8859_3(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_3(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_3(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_3) +module_exit(exit_nls_iso8859_3) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-4.c b/fs/nls/nls_iso8859-4.c index 18ef00e49..63a105d7e 100644 --- a/fs/nls/nls_iso8859-4.c +++ b/fs/nls/nls_iso8859-4.c @@ -279,46 +279,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-4", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_4(void) +static int __init init_nls_iso8859_4(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_4(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_4(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_4) +module_exit(exit_nls_iso8859_4) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-5.c b/fs/nls/nls_iso8859-5.c index 2ba940d78..7ca56a3da 100644 --- a/fs/nls/nls_iso8859-5.c +++ b/fs/nls/nls_iso8859-5.c @@ -283,46 +283,27 @@ static unsigned char charset2upper[256] = { 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xfd, 0xae, 0xaf, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-5", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_5(void) +static int __init init_nls_iso8859_5(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_5(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_5(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_5) +module_exit(exit_nls_iso8859_5) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-6.c b/fs/nls/nls_iso8859-6.c index 78b0203cf..877fde7cc 100644 --- a/fs/nls/nls_iso8859-6.c +++ b/fs/nls/nls_iso8859-6.c @@ -243,46 +243,27 @@ static unsigned char charset2upper[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-6", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_6(void) +static int __init init_nls_iso8859_6(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_6(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_6(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_6) +module_exit(exit_nls_iso8859_6) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-7.c b/fs/nls/nls_iso8859-7.c index a21a56d03..44a709cb5 100644 --- a/fs/nls/nls_iso8859-7.c +++ b/fs/nls/nls_iso8859-7.c @@ -319,46 +319,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xbc, 0xbe, 0xbf, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-7", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_7(void) +static int __init init_nls_iso8859_7(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_7(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_7(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_7) +module_exit(exit_nls_iso8859_7) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-8.c b/fs/nls/nls_iso8859-8.c index c8282dad3..f22994d4b 100644 --- a/fs/nls/nls_iso8859-8.c +++ b/fs/nls/nls_iso8859-8.c @@ -283,46 +283,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-8", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_8(void) +static int __init init_nls_iso8859_8(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_8(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_8(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_8) +module_exit(exit_nls_iso8859_8) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_iso8859-9.c b/fs/nls/nls_iso8859-9.c index 74baa761e..d2f531ad2 100644 --- a/fs/nls/nls_iso8859-9.c +++ b/fs/nls/nls_iso8859-9.c @@ -243,46 +243,27 @@ static unsigned char charset2upper[256] = { 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x49, 0xde, 0x00, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "iso8859-9", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_iso8859_9(void) +static int __init init_nls_iso8859_9(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_iso8859_9(); -} - - -void cleanup_module(void) +static void __exit exit_nls_iso8859_9(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_iso8859_9) +module_exit(exit_nls_iso8859_9) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/nls/nls_koi8-r.c b/fs/nls/nls_koi8-r.c index 3dc3effaa..59bb2a40a 100644 --- a/fs/nls/nls_koi8-r.c +++ b/fs/nls/nls_koi8-r.c @@ -355,46 +355,27 @@ static unsigned char charset2upper[256] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; - -static void inc_use_count(void) -{ - MOD_INC_USE_COUNT; -} - -static void dec_use_count(void) -{ - MOD_DEC_USE_COUNT; -} - static struct nls_table table = { "koi8-r", page_uni2charset, charset2uni, charset2lower, charset2upper, - inc_use_count, - dec_use_count, - NULL + THIS_MODULE, }; -int init_nls_koi8_r(void) +static int __init init_nls_koi8_r(void) { return register_nls(&table); } -#ifdef MODULE -int init_module(void) -{ - return init_nls_koi8_r(); -} - - -void cleanup_module(void) +static void __exit exit_nls_koi8_r(void) { unregister_nls(&table); - return; } -#endif + +module_init(init_nls_koi8_r) +module_exit(exit_nls_koi8_r) /* * Overrides for Emacs so that we follow Linus's tabbing style. diff --git a/fs/ntfs/fs.c b/fs/ntfs/fs.c index a24faac65..e95a36179 100644 --- a/fs/ntfs/fs.c +++ b/fs/ntfs/fs.c @@ -921,13 +921,7 @@ ntfs_read_super_dec: */ static DECLARE_FSTYPE_DEV(ntfs_fs_type, "ntfs", ntfs_read_super); -/* When this code is not compiled as a module, this is the main entry point, - * called by do_sys_setup() in fs/filesystems.c - * - * NOTE : __init is a macro used to remove this function from memory - * once initialization is done - */ -int __init init_ntfs_fs(void) +static int __init init_ntfs_fs(void) { /* Comment this if you trust klogd. There are reasons not to trust it */ @@ -942,44 +936,21 @@ int __init init_ntfs_fs(void) return register_filesystem(&ntfs_fs_type); } -#ifdef MODULE -/* A module is a piece of code which can be inserted in and removed - * from the running kernel whenever you want using lsmod, or on demand using - * kmod - */ +static __exit void exit_ntfs_fs(void) +{ + SYSCTL(0); + ntfs_debug(DEBUG_OTHER, "unregistering %s\n",ntfs_fs_type.name); + unregister_filesystem(&ntfs_fs_type); +} -/* No function of this module is needed by another module */ EXPORT_NO_SYMBOLS; -/* Only used for documentation purposes at the moment, - * see include/linux/module.h - */ MODULE_AUTHOR("Martin von Löwis"); MODULE_DESCRIPTION("NTFS driver"); -/* no MODULE_SUPPORTED_DEVICE() */ -/* Load-time parameter */ MODULE_PARM(ntdebug, "i"); MODULE_PARM_DESC(ntdebug, "Debug level"); -/* When this code is compiled as a module, if you use mount -t ntfs when no - * ntfs filesystem is registered (see /proc/filesystems), get_fs_type() in - * fs/super.c asks kmod to load the module named ntfs in memory. - * - * Therefore, this function is the main entry point in this case - */ -int init_module(void) -{ - return init_ntfs_fs(); -} - -/* Called by kmod just before the kernel removes the module from memory */ -void cleanup_module(void) -{ - SYSCTL(0); - ntfs_debug(DEBUG_OTHER, "unregistering %s\n",ntfs_fs_type.name); - unregister_filesystem(&ntfs_fs_type); -} -#endif - +module_init(init_ntfs_fs) +module_exit(exit_ntfs_fs) /* * Local variables: * c-file-style: "linux" diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index a95ad1acd..27b4be8cb 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -1,4 +1,4 @@ -/* $Id: inode.c,v 1.7 2000/03/10 04:45:50 davem Exp $ +/* $Id: inode.c,v 1.9 2000/03/13 21:59:43 davem Exp $ * openpromfs.c: /proc/openprom handling routines * * Copyright (C) 1996-1999 Jakub Jelinek (jakub@redhat.com) @@ -1026,7 +1026,7 @@ out_no_root: static DECLARE_FSTYPE(openprom_fs_type, "openpromfs", openprom_read_super, 0); -int init_openprom_fs(void) +static int __init init_openprom_fs(void) { nodes = (openpromfs_node *)__get_free_pages(GFP_KERNEL, 0); if (!nodes) { @@ -1041,25 +1041,7 @@ int init_openprom_fs(void) return register_filesystem(&openprom_fs_type); } -#ifdef MODULE - -EXPORT_NO_SYMBOLS; - -int init_module (void) -{ - return init_openprom_fs(); -} - -#else - -void __init openpromfs_init (void) -{ - init_openprom_fs(); -} -#endif - -#ifdef MODULE -void cleanup_module (void) +static void __exit exit_openprom_fs(void) { int i; unregister_filesystem(&openprom_fs_type); @@ -1069,4 +1051,8 @@ void cleanup_module (void) kfree (alias_names [i]); nodes = NULL; } -#endif + +EXPORT_NO_SYMBOLS; + +module_init(init_openprom_fs) +module_exit(exit_openprom_fs) diff --git a/fs/partitions/acorn.c b/fs/partitions/acorn.c index 4ffc43b0b..856cc30aa 100644 --- a/fs/partitions/acorn.c +++ b/fs/partitions/acorn.c @@ -17,8 +17,6 @@ #include "check.h" #include "acorn.h" -extern void add_gd_partition(struct gendisk *hd, int minor, int start, int size); - static void adfspart_setgeometry(kdev_t dev, unsigned int secspertrack, unsigned int heads, unsigned long totalblocks) @@ -41,21 +39,22 @@ struct linux_part { unsigned long nr_sects; }; -static struct disc_record *adfs_partition(struct gendisk *hd, char *name, char *data, +static struct adfs_discrecord *adfs_partition(struct gendisk *hd, char *name, char *data, unsigned long first_sector, unsigned int minor) { - struct disc_record *dr; + struct adfs_discrecord *dr; unsigned int nr_sects; if (adfs_checkbblk(data)) return NULL; - dr = (struct disc_record *)(data + 0x1c0); + dr = (struct adfs_discrecord *)(data + 0x1c0); if (dr->disc_size == 0 && dr->disc_size_high == 0) return NULL; - nr_sects = (dr->disc_size_high << 23) | (dr->disc_size >> 9); + nr_sects = (le32_to_cpu(dr->disc_size_high) << 23) | + (le32_to_cpu(dr->disc_size) >> 9); if (name) printk(" [%s]", name); @@ -93,8 +92,8 @@ static int riscix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_ if (rr->part[part].one && memcmp(rr->part[part].name, "All\0", 4)) { add_gd_partition(hd, minor++, - rr->part[part].start, - rr->part[part].length); + le32_to_cpu(rr->part[part].start), + le32_to_cpu(rr->part[part].length)); printk("(%s)", rr->part[part].name); } } @@ -131,11 +130,13 @@ static int linux_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s linuxp = (struct linux_part *)bh->b_data; printk(" <"); - while (linuxp->magic == LINUX_NATIVE_MAGIC || linuxp->magic == LINUX_SWAP_MAGIC) { + while (linuxp->magic == cpu_to_le32(LINUX_NATIVE_MAGIC) || + linuxp->magic == cpu_to_le32(LINUX_SWAP_MAGIC)) { if (!(minor & mask)) break; - add_gd_partition(hd, minor++, first_sect + linuxp->start_sect, - linuxp->nr_sects); + add_gd_partition(hd, minor++, first_sect + + le32_to_cpu(linuxp->start_sect), + le32_to_cpu(linuxp->nr_sects)); linuxp ++; } printk(" >"); @@ -174,7 +175,7 @@ static int adfspart_check_CUMANA(struct gendisk *hd, kdev_t dev, unsigned long f * Hence it is totally untested. */ do { - struct disc_record *dr; + struct adfs_discrecord *dr; unsigned int nr_sects; if (!(minor & mask)) @@ -189,7 +190,8 @@ static int adfspart_check_CUMANA(struct gendisk *hd, kdev_t dev, unsigned long f name = NULL; nr_sects = (bh->b_data[0x1fd] + (bh->b_data[0x1fe] << 8)) * - (dr->heads + (dr->lowsector & 0x40 ? 1 : 0)) * dr->secspertrack; + (dr->heads + (dr->lowsector & 0x40 ? 1 : 0)) * + dr->secspertrack; if (!nr_sects) break; @@ -244,7 +246,7 @@ static int adfspart_check_ADFS(struct gendisk *hd, kdev_t dev, unsigned long fir { unsigned long start_sect, nr_sects, sectscyl, heads; struct buffer_head *bh; - struct disc_record *dr; + struct adfs_discrecord *dr; if(get_ptable_blocksize(dev)!=1024) return 0; @@ -300,9 +302,6 @@ static int adfspart_check_ICSLinux(kdev_t dev, unsigned long block) unsigned int offset = block & 1 ? 512 : 0; int result = 0; - if(get_ptable_blocksize(dev)!=1024) - return 0; - bh = bread(dev, block >> 1, 1024); if (bh != NULL) { @@ -350,7 +349,8 @@ static int adfspart_check_ICS(struct gendisk *hd, kdev_t dev, unsigned long firs for (i = 0, sum = 0x50617274; i < 508; i++) sum += bh->b_data[i]; - if (sum != *(unsigned long *)(&bh->b_data[508])) { + sum -= le32_to_cpu(*(unsigned long *)(&bh->b_data[508])); + if (sum) { brelse(bh); return 0; /* not ICS partition table */ } @@ -358,19 +358,32 @@ static int adfspart_check_ICS(struct gendisk *hd, kdev_t dev, unsigned long firs printk(" [ICS]"); for (p = (struct ics_part *)bh->b_data; p->size; p++) { + unsigned long start; + long size; + if ((minor & mask) == 0) break; - if (p->size < 0 && adfspart_check_ICSLinux(dev, p->start)) { + start = le32_to_cpu(p->start); + size = le32_to_cpu(p->size); + + if (size < 0) { + size = -size; + /* * We use the first sector to identify what type * this partition is... */ - if (-p->size > 1) - add_gd_partition(hd, minor, first_sector + p->start + 1, -p->size - 1); - } else - add_gd_partition(hd, minor, first_sector + p->start, p->size); - minor++; + if (size > 1 && adfspart_check_ICSLinux(dev, start)) { + start += 1; + size -= 1; + } + } + + if (size) { + add_gd_partition(hd, minor, first_sector + start, size); + minor++; + } } brelse(bh); @@ -422,8 +435,15 @@ static int adfspart_check_POWERTEC(struct gendisk *hd, kdev_t dev, unsigned long printk(" [POWERTEC]"); for (i = 0, p = (struct ptec_partition *)bh->b_data; i < 12; i++, p++) { - if (p->size) - add_gd_partition(hd, minor, first_sector + p->start, p->size); + unsigned long start; + unsigned long size; + + start = le32_to_cpu(p->start); + size = le32_to_cpu(p->size); + + if (size) + add_gd_partition(hd, minor, first_sector + start, + size); minor++; } diff --git a/fs/partitions/acorn.h b/fs/partitions/acorn.h index 932c305e6..748c7c83f 100644 --- a/fs/partitions/acorn.h +++ b/fs/partitions/acorn.h @@ -6,42 +6,6 @@ #include <linux/adfs_fs.h> /* - * Offset in bytes of the boot block on the disk. - */ -#define BOOT_SECTOR_ADDRESS 0xc00 - -/* - * Disc record size - */ -#define RECSIZE 60 - -/* - * Disc record - */ -struct disc_record { - unsigned char log2secsize; - unsigned char secspertrack; - unsigned char heads; - unsigned char density; - unsigned char idlen; - unsigned char log2bpmb; - unsigned char skew; - unsigned char bootoption; - unsigned char lowsector; - unsigned char nzones; - unsigned short zone_spare; - unsigned long root; - unsigned long disc_size; - unsigned short disc_id; - unsigned char disc_name[10]; - unsigned long disc_type; - unsigned long disc_size_high; - unsigned char log2sharesize:4; - unsigned char unused:4; - unsigned char big_flag:1; -}; - -/* * Partition types. (Oh for reusability) */ #define PARTITION_RISCIX_MFM 1 diff --git a/fs/partitions/atari.c b/fs/partitions/atari.c index be7028e14..a94f8f5fc 100644 --- a/fs/partitions/atari.c +++ b/fs/partitions/atari.c @@ -34,9 +34,9 @@ be32_to_cpu((pi)->st) + be32_to_cpu((pi)->siz) <= (hdsiz)) int atari_partition (struct gendisk *hd, kdev_t dev, - unsigned long first_sector, int first_part_minor) + unsigned long first_sector, int minor) { - int minor = first_part_minor, m_lim = first_part_minor + hd->max_p; + int m_lim = minor + hd->max_p; struct buffer_head *bh; struct rootsector *rs; struct partition_info *pi; diff --git a/fs/partitions/sgi.c b/fs/partitions/sgi.c index 8027abda9..3806b5f31 100644 --- a/fs/partitions/sgi.c +++ b/fs/partitions/sgi.c @@ -17,9 +17,9 @@ #include "check.h" #include "sgi.h" -int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, int first_part_minor) +int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, int current_minor) { - int i, csum, magic, current_minor = first_part_minor; + int i, csum, magic; unsigned int *ui, start, blocks, cs; struct buffer_head *bh; struct sgi_disklabel { diff --git a/fs/proc/procfs_syms.c b/fs/proc/procfs_syms.c index 0203b9776..097e83468 100644 --- a/fs/proc/procfs_syms.c +++ b/fs/proc/procfs_syms.c @@ -22,7 +22,15 @@ EXPORT_SYMBOL(proc_root_driver); static DECLARE_FSTYPE(proc_fs_type, "proc", proc_read_super, 0); -int __init init_proc_fs(void) +static int __init init_proc_fs(void) { - return register_filesystem(&proc_fs_type) == 0; + return register_filesystem(&proc_fs_type); } + +static void __exit exit_proc_fs(void) +{ + unregister_filesystem(&proc_fs_type); +} + +module_init(init_proc_fs) +module_exit(exit_proc_fs) diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index b85483d3d..9e78119c9 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -491,23 +491,18 @@ static void qnx4_read_inode(struct inode *inode) static DECLARE_FSTYPE_DEV(qnx4_fs_type, "qnx4", qnx4_read_super); -int __init init_qnx4_fs(void) +static int __init init_qnx4_fs(void) { printk("QNX4 filesystem 0.2.2 registered.\n"); return register_filesystem(&qnx4_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) -{ - return init_qnx4_fs(); -} - -void cleanup_module(void) +static void __exit exit_qnx4_fs(void) { unregister_filesystem(&qnx4_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_qnx4_fs) +module_exit(exit_qnx4_fs) diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index 15e80519f..7f5f2dee6 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c @@ -532,26 +532,19 @@ static struct super_operations romfs_ops = { static DECLARE_FSTYPE_DEV(romfs_fs_type, "romfs", romfs_read_super); -int __init init_romfs_fs(void) +static int __init init_romfs_fs(void) { return register_filesystem(&romfs_fs_type); } -#ifdef MODULE +static void __exit exit_romfs_fs(void) +{ + unregister_filesystem(&romfs_fs_type); +} /* Yes, works even as a module... :) */ EXPORT_NO_SYMBOLS; -int -init_module(void) -{ - return init_romfs_fs(); -} - -void -cleanup_module(void) -{ - unregister_filesystem(&romfs_fs_type); -} -#endif +module_init(init_romfs_fs) +module_exit(exit_romfs_fs) diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c index 94923fbad..cef1e93cf 100644 --- a/fs/smbfs/inode.c +++ b/fs/smbfs/inode.c @@ -536,16 +536,7 @@ int smb_current_vmalloced; static DECLARE_FSTYPE( smb_fs_type, "smbfs", smb_read_super, 0); -int __init init_smb_fs(void) -{ - return register_filesystem(&smb_fs_type); -} - -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int -init_module(void) +static int __init init_smb_fs(void) { pr_debug("smbfs: init_module called\n"); @@ -558,8 +549,7 @@ init_module(void) return init_smb_fs(); } -void -cleanup_module(void) +static void __exit exit_smb_fs(void) { pr_debug("smbfs: cleanup_module called\n"); unregister_filesystem(&smb_fs_type); @@ -570,4 +560,7 @@ cleanup_module(void) #endif } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_smb_fs) +module_exit(exit_smb_fs) diff --git a/fs/super.c b/fs/super.c index c365c556c..8aed9ce90 100644 --- a/fs/super.c +++ b/fs/super.c @@ -966,10 +966,10 @@ bdput_and_out: sb->s_bdev = NULL; sb->s_dev = 0; sb->s_type = NULL; -fsput_and_out: - put_filesystem(fs_type); if (bdev) bdput(bdev); +fsput_and_out: + put_filesystem(fs_type); dput_and_out: dput(dir_d); up(&mount_sem); @@ -1134,7 +1134,7 @@ asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type, dentry = namei(dev_name); retval = PTR_ERR(dentry); if (IS_ERR(dentry)) - goto out; + goto fs_out; inode = dentry->d_inode; retval = -ENOTBLK; @@ -1163,6 +1163,8 @@ asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type, dput_and_out: dput(dentry); +fs_out: + put_filesystem(fstype); out: unlock_kernel(); return retval; diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index c1b95f28d..3367c02ef 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -1188,22 +1188,17 @@ int sysv_sync_inode(struct inode * inode) static DECLARE_FSTYPE_DEV(sysv_fs_type, "sysv", sysv_read_super); -int __init init_sysv_fs(void) +static int __init init_sysv_fs(void) { return register_filesystem(&sysv_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) -{ - return init_sysv_fs(); -} - -void cleanup_module(void) +static void __exit exit_sysv_fs(void) { unregister_filesystem(&sysv_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_sysv_fs) +module_exit(exit_sysv_fs) diff --git a/fs/udf/super.c b/fs/udf/super.c index 761cdcb6c..81f59e9a3 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -127,62 +127,22 @@ struct udf_options uid_t uid; }; -#if defined(MODULE) - -/* - * cleanup_module - * - * PURPOSE - * Unregister the UDF filesystem type. - * - * DESCRIPTION - * Clean-up before the module is unloaded. - * This routine only applies when compiled as a module. - * - * HISTORY - * July 1, 1997 - Andrew E. Mileski - * Written, tested, and released. - */ -int -cleanup_module(void) -{ - printk(KERN_NOTICE "udf: unregistering filesystem\n"); - return unregister_filesystem(&udf_fstype); -} -/* - * init_module / init_udf_fs - * - * PURPOSE - * Register the UDF filesystem type. - * - * HISTORY - * July 1, 1997 - Andrew E. Mileski - * Written, tested, and released. - */ -int init_module(void) -#else /* if !defined(MODULE) */ -int __init init_udf_fs(void) -#endif +static int __init init_udf_fs(void) { printk(KERN_NOTICE "udf: registering filesystem\n"); - { - struct super_block sb; - int size; - - size = sizeof(struct super_block) + - (long)&sb.u - (long)&sb; - if ( size < sizeof(struct udf_sb_info) ) - { - printk(KERN_ERR "udf: Danger! Kernel was compiled without enough room for udf_sb_info\n"); - printk(KERN_ERR "udf: Kernel has room for %u bytes, udf needs %lu\n", - size, (unsigned long)sizeof(struct udf_sb_info)); - return 0; - } - } return register_filesystem(&udf_fstype); } +static void __exit exit_udf_fs(void) +{ + printk(KERN_NOTICE "udf: unregistering filesystem\n"); + unregister_filesystem(&udf_fstype); +} + +module_init(init_udf_fs) +module_exit(exit_udf_fs) + /* * udf_parse_options * diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index 28798e294..c1fb13c31 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c @@ -121,7 +121,7 @@ revalidate: * version stamp to detect whether or * not the directory has been modified * during the copy operation. */ - unsigned long version = inode->i_version; + unsigned long version = filp->f_version; UFSD(("filldir(%s,%u)\n", de->d_name, SWAB32(de->d_ino))) UFSD(("namlen %u\n", ufs_get_de_namlen(de))) @@ -129,7 +129,7 @@ revalidate: filp->f_pos, SWAB32(de->d_ino)); if (error) break; - if (version != inode->i_version) + if (version != filp->f_version) goto revalidate; stored ++; } diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 1fe9de9bd..d9620a1c6 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -951,22 +951,17 @@ static struct super_operations ufs_super_ops = { static DECLARE_FSTYPE_DEV(ufs_fs_type, "ufs", ufs_read_super); -int __init init_ufs_fs(void) +static int __init init_ufs_fs(void) { return register_filesystem(&ufs_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module(void) -{ - return init_ufs_fs(); -} - -void cleanup_module(void) +static void __exit exit_ufs_fs(void) { unregister_filesystem(&ufs_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_ufs_fs) +module_exit(exit_ufs_fs) diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c index 61c832ed4..649ce16d4 100644 --- a/fs/umsdos/inode.c +++ b/fs/umsdos/inode.c @@ -435,22 +435,17 @@ out_noroot: static DECLARE_FSTYPE_DEV(umsdos_fs_type, "umsdos", UMSDOS_read_super); -int __init init_umsdos_fs (void) +static int __init init_umsdos_fs (void) { return register_filesystem (&umsdos_fs_type); } -#ifdef MODULE -EXPORT_NO_SYMBOLS; - -int init_module (void) -{ - return init_umsdos_fs (); -} - -void cleanup_module (void) +static void __exit exit_umsdos_fs (void) { unregister_filesystem (&umsdos_fs_type); } -#endif +EXPORT_NO_SYMBOLS; + +module_init(init_umsdos_fs) +module_exit(exit_umsdos_fs) diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c index 212494142..1f7c788f5 100644 --- a/fs/vfat/namei.c +++ b/fs/vfat/namei.c @@ -1292,16 +1292,3 @@ struct super_block *vfat_read_super(struct super_block *sb,void *data, return res; } - -#ifdef MODULE -int init_module(void) -{ - return init_vfat_fs(); -} - -void cleanup_module(void) -{ - unregister_filesystem(&vfat_fs_type); -} - -#endif /* ifdef MODULE */ diff --git a/fs/vfat/vfatfs_syms.c b/fs/vfat/vfatfs_syms.c index d57d153ed..6f1a121e0 100644 --- a/fs/vfat/vfatfs_syms.c +++ b/fs/vfat/vfatfs_syms.c @@ -8,6 +8,7 @@ #define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) #include <linux/version.h> #include <linux/module.h> +#include <linux/init.h> #include <linux/mm.h> #include <linux/msdos_fs.h> @@ -22,8 +23,15 @@ EXPORT_SYMBOL(vfat_rename); EXPORT_SYMBOL(vfat_read_super); EXPORT_SYMBOL(vfat_lookup); -int init_vfat_fs(void) +static int __init init_vfat_fs(void) { return register_filesystem(&vfat_fs_type); } +static void __exit exit_vfat_fs(void) +{ + unregister_filesystem(&vfat_fs_type); +} + +module_init(init_vfat_fs) +module_exit(exit_vfat_fs) |