kernel: Move GPL'd kernel files to sys/gnu to have them all in one place.
[dragonfly.git] / sys / gnu / vfs / ext2fs / ext2_linux_ialloc.c
similarity index 96%
rename from sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c
rename to sys/gnu/vfs/ext2fs/ext2_linux_ialloc.c
index db6e78f..50a32d1 100644 (file)
@@ -5,7 +5,6 @@
  *  University of Utah, Department of Computer Science
  *
  * $FreeBSD: src/sys/gnu/ext2fs/ext2_linux_ialloc.c,v 1.13.2.2 2001/08/14 18:03:19 gallatin Exp $
- * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_linux_ialloc.c,v 1.12 2007/09/23 04:09:55 yanyh Exp $
  */
 /*
  *  linux/fs/ext2/ialloc.c
@@ -15,7 +14,7 @@
  * Laboratoire MASI - Institut Blaise Pascal
  * Universite Pierre et Marie Curie (Paris VI)
  *
- *  BSD ufs-inspired inode and directory allocation by 
+ *  BSD ufs-inspired inode and directory allocation by
  *  Stephen Tweedie (sct@dcs.ed.ac.uk), 1993
  */
 
@@ -62,7 +61,7 @@ mark_buffer_dirty(struct buf *bh)
        crit_enter();
        bh->b_flags |= B_DIRTY;
        crit_exit();
-} 
+}
 
 struct ext2_group_desc *
 get_group_desc(struct mount * mp, unsigned int block_group,
@@ -86,7 +85,7 @@ get_group_desc(struct mount * mp, unsigned int block_group,
                            "Group descriptor not loaded - "
                            "block_group = %d, group_desc = %lu, desc = %lu",
                             block_group, group_desc, desc);
-       gdp = (struct ext2_group_desc *) 
+       gdp = (struct ext2_group_desc *)
                sb->s_group_desc[group_desc]->b_data;
        if (bh)
                *bh = sb->s_group_desc[group_desc];
@@ -103,8 +102,8 @@ read_inode_bitmap(struct mount *mp, unsigned long block_group,
        int     error;
 
        gdp = get_group_desc (mp, block_group, NULL);
-       if ((error = bread (VFSTOEXT2(mp)->um_devvp, 
-                           fsbtodoff(sb, gdp->bg_inode_bitmap), 
+       if ((error = bread (VFSTOEXT2(mp)->um_devvp,
+                           fsbtodoff(sb, gdp->bg_inode_bitmap),
                            sb->s_blocksize, &bh)) != 0)
                panic ( "read_inode_bitmap:"
                            "Cannot read inode bitmap - "
@@ -144,7 +143,7 @@ load_inode_bitmap(struct mount *mp, unsigned int block_group)
                return 0;
        if (sb->s_groups_count <= EXT2_MAX_GROUP_LOADED) {
                if (sb->s_inode_bitmap[block_group]) {
-                       if (sb->s_inode_bitmap_number[block_group] != 
+                       if (sb->s_inode_bitmap_number[block_group] !=
                                block_group)
                                panic ( "load_inode_bitmap:"
                                    "block_group != inode_bitmap_number");
@@ -161,7 +160,7 @@ load_inode_bitmap(struct mount *mp, unsigned int block_group)
             i++)
                ;
        if (i < sb->s_loaded_inode_bitmaps &&
-           sb->s_inode_bitmap_number[i] == block_group) {
+           sb->s_inode_bitmap_number[i] == block_group) {
                inode_bitmap_number = sb->s_inode_bitmap_number[i];
                inode_bitmap = sb->s_inode_bitmap[i];
                for (j = i; j > 0; j--) {
@@ -225,14 +224,14 @@ ext2_free_inode(struct inode *inode)
        bit = (inode->i_number - 1) % EXT2_INODES_PER_GROUP(sb);
        bitmap_nr = load_inode_bitmap (ITOV(inode)->v_mount, block_group);
        bh = sb->s_inode_bitmap[bitmap_nr];
-       if (!clear_bit (bit, bh->b_data))       
+       if (!clear_bit (bit, bh->b_data))
                kprintf ( "ext2_free_inode:"
                      "bit already cleared for inode %lu",
                      (unsigned long)inode->i_number);
        else {
                gdp = get_group_desc (ITOV(inode)->v_mount, block_group, &bh2);
                gdp->bg_free_inodes_count++;
-               if (S_ISDIR(inode->i_mode)) 
+               if (S_ISDIR(inode->i_mode))
                        gdp->bg_used_dirs_count--;
                mark_buffer_dirty(bh2);
                es->s_free_inodes_count++;
@@ -324,7 +323,7 @@ repeat:
                i = dir->u.ext2_i.i_block_group;
                for (j = 0; j < sb->u.ext2_sb.s_groups_count; j++) {
                        tmp = get_group_desc (sb, i, &bh2);
-                       if ((tmp->bg_used_dirs_count << 8) < 
+                       if ((tmp->bg_used_dirs_count << 8) <
                            tmp->bg_free_inodes_count) {
                                gdp = tmp;
                                break;
@@ -338,7 +337,7 @@ repeat:
                                tmp = get_group_desc(ITOV(dir)->v_mount,j,&bh2);
                                if (tmp->bg_free_inodes_count &&
                                        tmp->bg_free_inodes_count >= avefreei) {
-                                       if (!gdp || 
+                                       if (!gdp ||
                                            (tmp->bg_free_blocks_count >
                                             gdp->bg_free_blocks_count)) {
                                                i = j;
@@ -348,7 +347,7 @@ repeat:
                        }
                }
        }
-       else 
+       else
        {
                /*
                 * Try to place the inode in its parent directory