[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2d08ef090812221151v35995102vc3c14d052fcebb90@mail.gmail.com>
Date: Tue, 23 Dec 2008 01:21:07 +0530
From: "Rohit Sharma" <imreckless@...il.com>
To: Kernelnewbies <kernelnewbies@...linux.org>,
ext4 <linux-ext4@...r.kernel.org>,
maecompprojects@...glegroups.com,
technical_mae_alumini@...glegroups.com
Subject: find_group_orlov()
This is a code snippet from find_group_orlov() in ialloc.c of ext2 fs
I am not able to figure out the percpu counters, why it is used.
if (ndirs == 0)
ndirs = 1; /* percpu_counters are approximate... */
blocks_per_dir = (le32_to_cpu(es->s_blocks_count)-free_blocks) / ndirs;
max_dirs = ndirs / ngroups + inodes_per_group / 16;
// Why 16??
min_inodes = avefreei - inodes_per_group / 4;
// Why 4 ??
min_blocks = avefreeb - EXT2_BLOCKS_PER_GROUP(sb) / 4;
// Why 4 ??
max_debt = EXT2_BLOCKS_PER_GROUP(sb) / max(blocks_per_dir, BLOCK_COST);
if (max_debt * INODE_COST > inodes_per_group)
max_debt = inodes_per_group / INODE_COST;
if (max_debt > 255)
max_debt = 255;
if (max_debt == 0)
max_debt = 1;
What is the use of debts in allocation. ??
Is it done to make efficient use of free disk space ??
--
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