EXT4: About the method of compute journal blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

         Currently, I am seeing the the make_ext4fs code of
android,the source code is located at system/extras/ext4_utils

I have some question, as following, can somebody help me to explain
these questions? Thanks a lot!

1. The method of compute journal blocks, why  divide 64 :

          static u32 compute_journal_blocks()
{
    u32 journal_blocks = DIV_ROUND_UP(info.len, info.block_size) / 64;
   // is here, why divide 64 ???
    if (journal_blocks < 1024)
        journal_blocks = 1024;
    if (journal_blocks > 32768)
        journal_blocks = 32768;
    return journal_blocks;
}

2. The method of compute jbg_desc_reserve_blocks , why multiply by 1024:
static u32 compute_bg_desc_reserve_blocks()
{
    u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
    u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);
    u32 bg_desc_blocks = DIV_ROUND_UP(block_groups * sizeof(struct
ext2_group_desc),
            info.block_size);

    u32 bg_desc_reserve_blocks =
            DIV_ROUND_UP(block_groups * 1024 * sizeof(struct
ext2_group_desc),      // is here , why multiply by 1024 ???
                    info.block_size) - bg_desc_blocks;

    if (bg_desc_reserve_blocks > info.block_size / sizeof(u32))
        bg_desc_reserve_blocks = info.block_size / sizeof(u32);

    return bg_desc_reserve_blocks;
}

3. About compute_inodes function , why divide 4 ??
static u32 compute_inodes()
{
    return DIV_ROUND_UP(info.len, info.block_size) / 4;  // is here
why divide 4 ??
}


yu.xing
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux