On Thu, 15 Jun 2000, Theodore Ts'o wrote:
> Date: Tue, 13 Jun 2000 13:10:48 -0400 (EDT)
> From: Alexander Viro <[EMAIL PROTECTED]>
>
> Start from taking ext2, UFS and NFS out of ->u. in struct inode. Yup,
> separate allocation and inlined function (ext2_ino(inode)) that would
> return the pointer to private part of inode. I can send you my old (circa
> 2.2.early) patch that does it for ext2 tonight - hope that will help.
>
> Can we please save this for 2.5? If it's not absolutely necessary
> to fix a critical bug, I think we're much better off not making changes
> to core parts of the kernel at this point.
Ted, that can be done by sed script - it's completely trivial.
OK, will you object to
1) adding
static inline struct ext2_inode_info *ext2_ino(struct inode *inode)
{
return &inode->u.ext2_i;
}
2) replacing every foo->u.ext2_i with ext2_ino(foo)
- that _is_ an equivalent transformation, isn't it?
Now, the next step is to
3) add inode->u.generic_ip = kmalloc(sizeof struct ext2_inode_info);
into ext2_new_inode() and in ext2_read_inode() (in the very beginning, as
soon as ->i_sb is set), add
ext2_clear_inode(struct inode *inode)
{
if (ext2_ino(inode))
kfree(ext2_ino(inode));
}
make ext2_ino() return (struct ext2_inode_info*)inode->u.generic_ip, add
ext2_clear_inode() before make_bad_inode() in ext2_read_inode(). Enjoy.
I'm running such kernel for 18 months - works fine. Notice that patch will
consist of two parts - one obviously preserving everything, another -
simple and way below 2Kb.