lkml.org 
[lkml]   [2001]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Ext2-devel] ext2/ialloc.c cleanup
On Nov 08, 2001  17:16 -0500, Alexander Viro wrote:
> + get_random_bytes(&group, sizeof(group));
> + goto fallback;

Little chance that 0 <= group < ngroups. Even so, value is unused, AFAICS.

> +fallback:
> + for (i = 0; i < ngroups; i++) {
> + group = (parent_cg + i) % ngroups;
> + cg = ext2_get_group_desc (sb, group, &bh);
> + if (!cg || !cg->bg_free_inodes_count)
> + continue;
> + if (le16_to_cpu(cg->bg_free_inodes_count) >= avefreei)
> + goto found;
> + }
> +
> + return -1;


> diff -urN S14/include/linux/ext2_fs_sb.h S14-ext2/include/linux/ext2_fs_sb.h
> --- S14/include/linux/ext2_fs_sb.h Fri Feb 16 21:29:52 2001
> +++ S14-ext2/include/linux/ext2_fs_sb.h Thu Nov 8 15:28:34 2001
> @@ -56,6 +56,8 @@
> int s_desc_per_block_bits;
> int s_inode_size;
> int s_first_ino;
> + unsigned long s_dir_count;
> + u8 *debts;
> };

I had thought a couple of times it may be useful to have an in-memory list
of group descriptors, each with a pointer to the on-disk struct, like
ext2_sb points to s_es.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.092 / U:2.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site