Matthew Wilcox writes:
> Andi Kleen mentioned that the ext2 part of the inode union was rather large.
> So I wondered if I could chop it down a bit.
> 
>  * i_faddr, i_frag_no, i_frag_size -- we don't support fragments.

Can't remove these, even though we don't _currently_ use these fields.
If, at some point in the future they are put into use, we _need_ to handle
them transparently in older kernels, so we can maintain compatibility.
It may be that they are not fragments (e.g. one or two are used by the
tail packing patch, freeing the rest for other uses), it doesn't matter.
The ext2 COMPAT flags will prevent an older kernel from using the
filesystem IFF they can not be safely loaded/stored to/from disk.

>  * i_osync is only referenced, never set
>  * not_used_1 can clearly be removed.
>  * i_new_inode is set but never referenced.

I thought Al was using this for something, but maybe not.

>  * i_high_size is obsoleted by the VFS support for 64-bit files.

Yes, I sent in a patch about this as well (don't think it is in kernel
yet).  HOWEVER, there is also a bug related to this - for checking
LARGEFILE, we only check raw_inode->i_size_high, and not bit 32 of
inode->i_size.  This was also in my original patch.

> I decided not to remove the ACL entries yet.

Again, you can't just remove them even though they are not currently
used. One of the ext2 compatibility issues is being able to have forwards
compatible features added to the disk, without older kernels breaking them.
There IS an ACL patch for ext2.

> -     inode->u.ext2_i.i_faddr = 0;
> -     inode->u.ext2_i.i_frag_no = 0;
> -     inode->u.ext2_i.i_frag_size = 0;

Nope.

> -     inode->u.ext2_i.i_faddr = le32_to_cpu(raw_inode->i_faddr);
> -     inode->u.ext2_i.i_frag_no = raw_inode->i_frag;
> -     inode->u.ext2_i.i_frag_size = raw_inode->i_fsize;

Nope.

> +     struct super_block *sb = inode->i_sb;

Very nice - I'm surprised it hasn't been done sooner.

> -     raw_inode->i_faddr = cpu_to_le32(inode->u.ext2_i.i_faddr);
> -     raw_inode->i_frag = inode->u.ext2_i.i_frag_no;
> -     raw_inode->i_fsize = inode->u.ext2_i.i_frag_size;
> +     raw_inode->i_frag = 0;
> +     raw_inode->i_fsize = 0;

Nope.

>               raw_inode->i_size_high = cpu_to_le32(inode->i_size >> 32);
>               if (raw_inode->i_size_high) {
> -                     struct super_block *sb = inode->i_sb;
>                       if (!EXT2_HAS_RO_COMPAT_FEATURE(sb,
>                                       EXT2_FEATURE_RO_COMPAT_LARGE_FILE) ||

This is where we need to check bit 32 for LFS:

-               if (raw_inode->i_size_high) {
+               if (raw_inode->i_size_high || inode->i_size & 0x80000000) {

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to