Lines Matching refs:group
31 * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
34 * The file system contains group descriptors which are located after the
66 static void ext2_release_inode(struct super_block *sb, int group, int dir)
71 desc = ext2_get_group_desc(sb, group, &bh);
74 "can't get descriptor for group %d", group);
78 spin_lock(sb_bgl_lock(EXT2_SB(sb), group));
82 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group));
185 * Figure out the offset within the block group inode table
196 * a directory, then a forward search is made for a block group with both
198 * the groups with above-average free space, that group with the fewest
202 * group to find a free inode.
209 int group, best_group = -1;
211 for (group = 0; group < ngroups; group++) {
212 desc = ext2_get_group_desc (sb, group, NULL);
220 best_group = group;
235 * Otherwise we simply return a random group.
239 * It's OK to put directory into a group unless
244 * Parent's group is preferred, if it doesn't satisfy these
246 * of the groups look good we just look for a group with more
247 * free inodes than average (starting at parent's group).
270 int group = -1, i;
285 group = prandom_u32();
286 parent_group = (unsigned)group % ngroups;
288 group = (parent_group + i) % ngroups;
289 desc = ext2_get_group_desc (sb, group, NULL);
298 best_group = group;
304 group = best_group;
328 group = (parent_group + i) % ngroups;
329 desc = ext2_get_group_desc (sb, group, NULL);
332 if (sbi->s_debts[group] >= max_debt)
345 group = (parent_group + i) % ngroups;
346 desc = ext2_get_group_desc (sb, group, NULL);
365 return group;
373 int group, i;
378 group = parent_group;
379 desc = ext2_get_group_desc (sb, group, NULL);
393 group = (group + parent->i_ino) % ngroups;
396 * Use a quadratic hash to find a group with a free inode and some
400 group += i;
401 if (group >= ngroups)
402 group -= ngroups;
403 desc = ext2_get_group_desc (sb, group, NULL);
410 * That failed: try linear search for a free inode, even if that group
413 group = parent_group;
415 if (++group >= ngroups)
416 group = 0;
417 desc = ext2_get_group_desc (sb, group, NULL);
425 return group;
434 int group, i;
453 group = find_group_dir(sb, dir);
455 group = find_group_orlov(sb, dir);
457 group = find_group_other(sb, dir);
459 if (group == -1) {
465 gdp = ext2_get_group_desc(sb, group, &bh2);
467 if (++group == sbi->s_groups_count)
468 group = 0;
472 bitmap_bh = read_inode_bitmap(sb, group);
485 * free inodes in this group, but by the time we tried
489 * next block group.
491 if (++group == sbi->s_groups_count)
492 group = 0;
495 if (ext2_set_bit_atomic(sb_bgl_lock(sbi, group),
499 /* this group is exhausted, try next group */
500 if (++group == sbi->s_groups_count)
501 group = 0;
504 /* try to find free inode in the same group */
522 ino += group * EXT2_INODES_PER_GROUP(sb) + 1;
526 "block_group = %d,inode=%lu", group,
536 spin_lock(sb_bgl_lock(sbi, group));
539 if (sbi->s_debts[group] < 255)
540 sbi->s_debts[group]++;
543 if (sbi->s_debts[group])
544 sbi->s_debts[group]--;
546 spin_unlock(sb_bgl_lock(sbi, group));
569 ei->i_block_group = group;
646 printk("group %d: stored = %d, counted = %u\n",