]> err.no Git - linux-2.6/blobdiff - fs/ext3/ialloc.c
Merge branch 'async-tx-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop...
[linux-2.6] / fs / ext3 / ialloc.c
index 5e288368499bd43f6296586d9e0183d9cf3ed245..1bc8cd89c51d33b7f57607003d06b3fe4036a1ce 100644 (file)
@@ -202,16 +202,15 @@ error_return:
 static int find_group_dir(struct super_block *sb, struct inode *parent)
 {
        int ngroups = EXT3_SB(sb)->s_groups_count;
-       int freei, avefreei;
+       unsigned int freei, avefreei;
        struct ext3_group_desc *desc, *best_desc = NULL;
-       struct buffer_head *bh;
        int group, best_group = -1;
 
        freei = percpu_counter_read_positive(&EXT3_SB(sb)->s_freeinodes_counter);
        avefreei = freei / ngroups;
 
        for (group = 0; group < ngroups; group++) {
-               desc = ext3_get_group_desc (sb, group, &bh);
+               desc = ext3_get_group_desc (sb, group, NULL);
                if (!desc || !desc->bg_free_inodes_count)
                        continue;
                if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei)
@@ -261,15 +260,14 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
        struct ext3_super_block *es = sbi->s_es;
        int ngroups = sbi->s_groups_count;
        int inodes_per_group = EXT3_INODES_PER_GROUP(sb);
-       int freei, avefreei;
+       unsigned int freei, avefreei;
        ext3_fsblk_t freeb, avefreeb;
        ext3_fsblk_t blocks_per_dir;
-       int ndirs;
+       unsigned int ndirs;
        int max_debt, max_dirs, min_inodes;
        ext3_grpblk_t min_blocks;
        int group = -1, i;
        struct ext3_group_desc *desc;
-       struct buffer_head *bh;
 
        freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter);
        avefreei = freei / ngroups;
@@ -286,7 +284,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
                parent_group = (unsigned)group % ngroups;
                for (i = 0; i < ngroups; i++) {
                        group = (parent_group + i) % ngroups;
-                       desc = ext3_get_group_desc (sb, group, &bh);
+                       desc = ext3_get_group_desc (sb, group, NULL);
                        if (!desc || !desc->bg_free_inodes_count)
                                continue;
                        if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir)
@@ -319,7 +317,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
 
        for (i = 0; i < ngroups; i++) {
                group = (parent_group + i) % ngroups;
-               desc = ext3_get_group_desc (sb, group, &bh);
+               desc = ext3_get_group_desc (sb, group, NULL);
                if (!desc || !desc->bg_free_inodes_count)
                        continue;
                if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs)
@@ -334,7 +332,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
 fallback:
        for (i = 0; i < ngroups; i++) {
                group = (parent_group + i) % ngroups;
-               desc = ext3_get_group_desc (sb, group, &bh);
+               desc = ext3_get_group_desc (sb, group, NULL);
                if (!desc || !desc->bg_free_inodes_count)
                        continue;
                if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei)
@@ -358,14 +356,13 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
        int parent_group = EXT3_I(parent)->i_block_group;
        int ngroups = EXT3_SB(sb)->s_groups_count;
        struct ext3_group_desc *desc;
-       struct buffer_head *bh;
        int group, i;
 
        /*
         * Try to place the inode in its parent directory
         */
        group = parent_group;
-       desc = ext3_get_group_desc (sb, group, &bh);
+       desc = ext3_get_group_desc (sb, group, NULL);
        if (desc && le16_to_cpu(desc->bg_free_inodes_count) &&
                        le16_to_cpu(desc->bg_free_blocks_count))
                return group;
@@ -389,7 +386,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
                group += i;
                if (group >= ngroups)
                        group -= ngroups;
-               desc = ext3_get_group_desc (sb, group, &bh);
+               desc = ext3_get_group_desc (sb, group, NULL);
                if (desc && le16_to_cpu(desc->bg_free_inodes_count) &&
                                le16_to_cpu(desc->bg_free_blocks_count))
                        return group;
@@ -403,7 +400,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
        for (i = 0; i < ngroups; i++) {
                if (++group >= ngroups)
                        group = 0;
-               desc = ext3_get_group_desc (sb, group, &bh);
+               desc = ext3_get_group_desc (sb, group, NULL);
                if (desc && le16_to_cpu(desc->bg_free_inodes_count))
                        return group;
        }
@@ -559,7 +556,6 @@ got:
 
        inode->i_ino = ino;
        /* This is the optimal IO size (for stat), not the fs block size */
-       inode->i_blksize = PAGE_SIZE;
        inode->i_blocks = 0;
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;