Re: [Re: How to add ntfs support]

From: David Woodhouse (dwmw2@infradead.org)
Date: Sat May 26 2001 - 04:25:01 EST


blessonpaul@usa.net said:
> So you are constructing a improved NTFS file driver. So
> when you have to check your written codes of file driver, will u
> recompile the whole kernel ? . That is what I am asking. I am in a way
> to build a new file system.

In general, it is not necessary to rebuild the kernel when you enable and
compile (or indeed write) a new module.

Places where the code in the kernel itself actually depends on the value of
CONFIG_blah_MODULE are thankfully relatively rare, although this ugliness
does happen at times. The filesystem code is fairly sane in this respect,
though, so you shouldn't have problems.

The main thing you have to watch when loading a new filesystem is the size
of the inode and superblock unions. If you are adding your
shinynewfs_inode_info to the inode union, and it's _larger_ than the
previous size of the inode union, then you would have to recompile the
kernel (or allocate it separately, which you're probably going to have to
do in 2.5 anyway).

Note that this isn't particularly likely to be a problem - the inode union
has space for _all_ the filesystems, not just the ones you said 'y' or 'm'
to, and some of them are quite large. But it's worth checking.

Most of the JFFS2 development was done without recompiling kernels. I
didn't even touch the kernel build tree - just
        make -C /usr/src/linux SUBDIRS=`pwd` modules

For safety, I put the following in the module init routine during development:

#ifdef JFFS2_OUT_OF_KERNEL
        /* sanity checks. Could we do these at compile time? */
        if (sizeof(struct jffs2_sb_info) > sizeof (((struct super_block *)NULL)->u)) {
                printk(KERN_ERR "JFFS2 error: struct jffs2_sb_info (%d bytes) doesn't fit in the super_block union (%d bytes)\n",
                       sizeof(struct jffs2_sb_info), sizeof (((struct super_block *)NULL)->u));
                return -EIO;
        }

        if (sizeof(struct jffs2_inode_info) > sizeof (((struct inode *)NULL)->u)) {
                printk(KERN_ERR "JFFS2 error: struct jffs2_inode_info (%d bytes) doesn't fit in the inode union (%d bytes)\n",
                       sizeof(struct jffs2_inode_info), sizeof (((struct inode *)NULL)->u));
                return -EIO;
        }
#endif

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 31 2001 - 21:00:27 EST