int i;
        struct adfs_sb_info *asb = ADFS_SB(sb);
 
+       lock_kernel();
+
        for (i = 0; i < asb->s_map_size; i++)
                brelse(asb->s_map[i].dm_bh);
        kfree(asb->s_map);
        kfree(asb);
        sb->s_fs_info = NULL;
+
+       unlock_kernel();
 }
 
 static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
 
        struct affs_sb_info *sbi = AFFS_SB(sb);
        pr_debug("AFFS: put_super()\n");
 
+       lock_kernel();
+
        if (!(sb->s_flags & MS_RDONLY)) {
                AFFS_ROOT_TAIL(sb, sbi->s_root_bh)->bm_flag = cpu_to_be32(1);
                secs_to_datestamp(get_seconds(),
        affs_brelse(sbi->s_root_bh);
        kfree(sbi);
        sb->s_fs_info = NULL;
-       return;
+
+       unlock_kernel();
 }
 
 static void
 
 
        _enter("");
 
+       lock_kernel();
+
        afs_put_volume(as->volume);
 
+       unlock_kernel();
+
        _leave("");
 }
 
 
 static void
 befs_put_super(struct super_block *sb)
 {
+       lock_kernel();
+
        kfree(BEFS_SB(sb)->mount_opts.iocharset);
        BEFS_SB(sb)->mount_opts.iocharset = NULL;
 
 
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;
-       return;
+
+       unlock_kernel();
 }
 
 /* Allocate private field of the superblock, fill it.
 
        if (!info)
                return;
 
+       lock_kernel();
+
        if (s->s_dirt)
                bfs_write_super(s);
 
        kfree(info->si_imap);
        kfree(info);
        s->s_fs_info = NULL;
+
+       unlock_kernel();
 }
 
 static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 
                cFYI(1, ("Empty cifs superblock info passed to unmount"));
                return;
        }
+
+       lock_kernel();
+
        rc = cifs_umount(sb, cifs_sb);
        if (rc)
                cERROR(1, ("cifs_umount failed with return code %d", rc));
 
        unload_nls(cifs_sb->local_nls);
        kfree(cifs_sb);
-       return;
+
+       unlock_kernel();
 }
 
 static int
 
 #include <linux/mount.h>
 #include <linux/key.h>
 #include <linux/seq_file.h>
+#include <linux/smp_lock.h>
 #include <linux/file.h>
 #include <linux/crypto.h>
 #include "ecryptfs_kernel.h"
 {
        struct ecryptfs_sb_info *sb_info = ecryptfs_superblock_to_private(sb);
 
+       lock_kernel();
+
        ecryptfs_destroy_mount_crypt_stat(&sb_info->mount_crypt_stat);
        kmem_cache_free(ecryptfs_sb_info_cache, sb_info);
        ecryptfs_set_superblock_private(sb, NULL);
+
+       unlock_kernel();
 }
 
 /**
 
        int num_pend;
        struct exofs_sb_info *sbi = sb->s_fs_info;
 
+       lock_kernel();
+
        if (sb->s_dirt)
                exofs_write_super(sb);
 
        osduld_put_device(sbi->s_dev);
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;
+
+       unlock_kernel();
 }
 
 /*
 
        int i;
        struct ext2_sb_info *sbi = EXT2_SB(sb);
 
+       lock_kernel();
+
        if (sb->s_dirt)
                ext2_write_super(sb);
 
        kfree(sbi->s_blockgroup_lock);
        kfree(sbi);
 
-       return;
+       unlock_kernel();
 }
 
 static struct kmem_cache * ext2_inode_cachep;
 
        struct ext3_super_block *es = sbi->s_es;
        int i, err;
 
+       lock_kernel();
+
        ext3_xattr_put_super(sb);
        err = journal_destroy(sbi->s_journal);
        sbi->s_journal = NULL;
        sb->s_fs_info = NULL;
        kfree(sbi->s_blockgroup_lock);
        kfree(sbi);
-       return;
+
+       unlock_kernel();
 }
 
 static struct kmem_cache *ext3_inode_cachep;
 
        int i, err;
 
        lock_super(sb);
+       lock_kernel();
        if (sb->s_dirt)
                ext4_write_super(sb);
 
        unlock_super(sb);
        kobject_put(&sbi->s_kobj);
        wait_for_completion(&sbi->s_kobj_unregister);
-       lock_kernel();
        kfree(sbi->s_blockgroup_lock);
        kfree(sbi);
 }
 
 {
        struct msdos_sb_info *sbi = MSDOS_SB(sb);
 
+       lock_kernel();
+
        if (sb->s_dirt)
                fat_write_super(sb);
 
 
        sb->s_fs_info = NULL;
        kfree(sbi);
+
+       unlock_kernel();
 }
 
 static struct kmem_cache *fat_inode_cachep;
 
 {
        struct vxfs_sb_info     *infp = VXFS_SBI(sbp);
 
+       lock_kernel();
+
        vxfs_put_fake_inode(infp->vsi_fship);
        vxfs_put_fake_inode(infp->vsi_ilist);
        vxfs_put_fake_inode(infp->vsi_stilist);
 
        brelse(infp->vsi_bp);
        kfree(infp);
+
+       unlock_kernel();
 }
 
 /**
 
        int error;
        struct gfs2_jdesc *jd;
 
+       lock_kernel();
+
        /*  Unfreeze the filesystem, if we need to  */
 
        mutex_lock(&sdp->sd_freeze_lock);
 
        /*  At this point, we're through participating in the lockspace  */
        gfs2_sys_fs_del(sdp);
+
+       unlock_kernel();
 }
 
 /**
 
  */
 static void hfs_put_super(struct super_block *sb)
 {
+       lock_kernel();
+
        if (sb->s_dirt)
                hfs_write_super(sb);
        hfs_mdb_close(sb);
        /* release the MDB's resources */
        hfs_mdb_put(sb);
+
+       unlock_kernel();
 }
 
 /*
 
        dprint(DBG_SUPER, "hfsplus_put_super\n");
        if (!sb->s_fs_info)
                return;
+
+       lock_kernel();
+
        if (sb->s_dirt)
                hfsplus_write_super(sb);
        if (!(sb->s_flags & MS_RDONLY) && HFSPLUS_SB(sb).s_vhdr) {
                unload_nls(HFSPLUS_SB(sb).nls);
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;
+
+       unlock_kernel();
 }
 
 static int hfsplus_statfs(struct dentry *dentry, struct kstatfs *buf)
 
 static void hpfs_put_super(struct super_block *s)
 {
        struct hpfs_sb_info *sbi = hpfs_sb(s);
+
+       lock_kernel();
+
        kfree(sbi->sb_cp_table);
        kfree(sbi->sb_bmp_dir);
        unmark_dirty(s);
        s->s_fs_info = NULL;
        kfree(sbi);
+
+       unlock_kernel();
 }
 
 unsigned hpfs_count_one_bitmap(struct super_block *s, secno secno)
 
 static void isofs_put_super(struct super_block *sb)
 {
        struct isofs_sb_info *sbi = ISOFS_SB(sb);
+
 #ifdef CONFIG_JOLIET
+       lock_kernel();
+
        if (sbi->s_nls_iocharset) {
                unload_nls(sbi->s_nls_iocharset);
                sbi->s_nls_iocharset = NULL;
        }
+
+       unlock_kernel();
 #endif
 
        kfree(sbi);
 
 
        D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n"));
 
+       lock_kernel();
+
        if (sb->s_dirt)
                jffs2_write_super(sb);
 
        if (c->mtd->sync)
                c->mtd->sync(c->mtd);
 
+       unlock_kernel();
+
        D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
 }
 
 
        int rc;
 
        jfs_info("In jfs_put_super");
+
+       lock_kernel();
+
        rc = jfs_umount(sb);
        if (rc)
                jfs_err("jfs_umount failed with return code %d", rc);
        sbi->direct_inode = NULL;
 
        kfree(sbi);
+
+       unlock_kernel();
 }
 
 enum {
 
        int i;
        struct minix_sb_info *sbi = minix_sb(sb);
 
+       lock_kernel();
+
        if (!(sb->s_flags & MS_RDONLY)) {
                if (sbi->s_version != MINIX_V3)  /* s_state is now out from V3 sb */
                        sbi->s_ms->s_state = sbi->s_mount_state;
        sb->s_fs_info = NULL;
        kfree(sbi);
 
-       return;
+       unlock_kernel();
 }
 
 static struct kmem_cache * minix_inode_cachep;
 
 {
        struct ncp_server *server = NCP_SBP(sb);
 
+       lock_kernel();
+
        ncp_lock_server(server);
        ncp_disconnect(server);
        ncp_unlock_server(server);
        vfree(server->packet);
        sb->s_fs_info = NULL;
        kfree(server);
+
+       unlock_kernel();
 }
 
 static int ncp_statfs(struct dentry *dentry, struct kstatfs *buf)
 
        struct nilfs_sb_info *sbi = NILFS_SB(sb);
        struct the_nilfs *nilfs = sbi->s_nilfs;
 
+       lock_kernel();
+
        if (sb->s_dirt)
                nilfs_write_super(sb);
 
        sbi->s_super = NULL;
        sb->s_fs_info = NULL;
        kfree(sbi);
+
+       unlock_kernel();
 }
 
 /**
 
        ntfs_volume *vol = NTFS_SB(sb);
 
        ntfs_debug("Entering.");
+
+       lock_kernel();
+
 #ifdef NTFS_RW
        /*
         * Commit all inodes while they are still open in case some of them
        }
        sb->s_fs_info = NULL;
        kfree(vol);
-       return;
+
+       unlock_kernel();
 }
 
 /**
 
 {
        mlog_entry("(0x%p)\n", sb);
 
+       lock_kernel();
+
        ocfs2_sync_blockdev(sb);
        ocfs2_dismount_volume(sb, 0);
 
+       unlock_kernel();
+
        mlog_exit_void();
 }
 
 
        struct reiserfs_transaction_handle th;
        th.t_trans_id = 0;
 
+       lock_kernel();
+
        if (s->s_dirt)
                reiserfs_write_super(s);
 
        kfree(s->s_fs_info);
        s->s_fs_info = NULL;
 
-       return;
+       unlock_kernel();
 }
 
 static struct kmem_cache *reiserfs_inode_cachep;
 
 {
        struct smb_sb_info *server = SMB_SB(sb);
 
+       lock_kernel();
+
        smb_lock_server(server);
        server->state = CONN_INVALID;
        smbiod_unregister_server(server);
        smb_unlock_server(server);
        put_pid(server->conn_pid);
        kfree(server);
+
+       unlock_kernel();
 }
 
 static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
 
 
 static void squashfs_put_super(struct super_block *sb)
 {
+       lock_kernel();
+
        if (sb->s_fs_info) {
                struct squashfs_sb_info *sbi = sb->s_fs_info;
                squashfs_cache_delete(sbi->block_cache);
                kfree(sb->s_fs_info);
                sb->s_fs_info = NULL;
        }
+
+       unlock_kernel();
 }
 
 
 
 
                /* bad name - it should be evict_inodes() */
                invalidate_inodes(sb);
-               lock_kernel();
 
                if (sop->put_super)
                        sop->put_super(sb);
                           "Self-destruct in 5 seconds.  Have a nice day...\n",
                           sb->s_id);
                }
-
-               unlock_kernel();
                put_fs_excl();
        }
        spin_lock(&sb_lock);
 
 {
        struct sysv_sb_info *sbi = SYSV_SB(sb);
 
+       lock_kernel();
+
        if (sb->s_dirt)
                sysv_write_super(sb);
 
                brelse(sbi->s_bh2);
 
        kfree(sbi);
+
+       unlock_kernel();
 }
 
 static int sysv_statfs(struct dentry *dentry, struct kstatfs *buf)
 
 
        ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num,
                  c->vi.vol_id);
+
+       lock_kernel();
+
        /*
         * The following asserts are only valid if there has not been a failure
         * of the media. For example, there will be dirty inodes if we failed
        ubi_close_volume(c->ubi);
        mutex_unlock(&c->umount_mutex);
        kfree(c);
+
+       unlock_kernel();
 }
 
 static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
 
        struct udf_sb_info *sbi;
 
        sbi = UDF_SB(sb);
+
+       lock_kernel();
+
        if (sbi->s_vat_inode)
                iput(sbi->s_vat_inode);
        if (sbi->s_partitions)
        kfree(sbi->s_partmaps);
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;
+
+       unlock_kernel();
 }
 
 static int udf_sync_fs(struct super_block *sb, int wait)
 
 
        
        UFSD("ENTER\n");
+
+       lock_kernel();
+
        ufs_put_cstotal(sb);
        size = uspi->s_cssize;
        blks = (size + uspi->s_fsize - 1) >> uspi->s_fshift;
                brelse (sbi->s_ucg[i]);
        kfree (sbi->s_ucg);
        kfree (base);
+
+       unlock_kernel();
+
        UFSD("EXIT\n");
 }