lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 17 Jan 2017 11:50:13 +0800
From:   yu xing <mdxy2014@...il.com>
To:     linux-ext4@...r.kernel.org
Subject: EXT4: About the method of compute journal blocks

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ