kernel: Move GPL'd kernel files to sys/gnu to have them all in one place.
[dragonfly.git] / sys / gnu / vfs / ext2fs / ext2_balloc.c
similarity index 92%
rename from sys/vfs/gnu/ext2fs/ext2_balloc.c
rename to sys/gnu/vfs/ext2fs/ext2_balloc.c
index 66f37a7..e1547a3 100644 (file)
@@ -38,7 +38,6 @@
  *
  *     @(#)ffs_balloc.c        8.4 (Berkeley) 9/23/93
  * $FreeBSD: src/sys/gnu/ext2fs/ext2_balloc.c,v 1.9.2.1 2000/08/03 00:52:57 peter Exp $
- * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_balloc.c,v 1.10 2006/12/23 00:41:29 swildner Exp $
  */
 
 #include <sys/param.h>
@@ -72,7 +71,7 @@ ext2_balloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred,
        daddr_t newb, lbn, *bap, pref;
        int osize, nsize, num, i, error;
 /*
-ext2_debug("ext2_balloc called (%d, %d, %d)\n", 
+ext2_debug("ext2_balloc called (%d, %d, %d)\n",
        ip->i_number, (int)bn, (int)size);
 */
        *bpp = NULL;
@@ -82,8 +81,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
        lbn = bn;
 
        /*
-        * check if this is a sequential block allocation. 
-        * If so, increment next_alloc fields to allow ext2_blkpref 
+        * check if this is a sequential block allocation.
+        * If so, increment next_alloc fields to allow ext2_blkpref
         * to make a good guess
         */
         if (lbn == ip->i_next_alloc_block + 1) {
@@ -99,7 +98,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
                /* no new block is to be allocated, and no need to expand
                   the file */
                if (nb != 0 && ip->i_size >= (bn + 1) * fs->s_blocksize) {
-                       error = bread(vp, lblktodoff(fs, bn), 
+                       error = bread(vp, lblktodoff(fs, bn),
                                      fs->s_blocksize, &bp);
                        if (error) {
                                brelse(bp);
@@ -123,8 +122,8 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
                                }
                        } else {
                        /* Godmar thinks: this shouldn't happen w/o fragments */
-                               kprintf("nsize %d(%d) > osize %d(%d) nb %d\n", 
-                                       (int)nsize, (int)size, (int)osize, 
+                               kprintf("nsize %d(%d) > osize %d(%d) nb %d\n",
+                                       (int)nsize, (int)size, (int)osize,
                                        (int)ip->i_size, (int)nb);
                                panic(
                                    "ext2_balloc: Something is terribly wrong");
@@ -174,16 +173,16 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
 #else
                /* see the comment by ext2_blkpref. What we do here is
                   to pretend that it'd be good for a block holding indirect
-                  pointers to be allocated near its predecessor in terms 
-                  of indirection, or the last direct block. 
+                  pointers to be allocated near its predecessor in terms
+                  of indirection, or the last direct block.
                   We shamelessly exploit the fact that i_ib immediately
-                  follows i_db. 
+                  follows i_db.
                   Godmar thinks it make sense to allocate i_ib[0] immediately
                   after i_db[11], but it's not utterly clear whether this also
                   applies to i_ib[1] and i_ib[0]
                */
 
-               pref = ext2_blkpref(ip, lbn, indirs[0].in_off + 
+               pref = ext2_blkpref(ip, lbn, indirs[0].in_off +
                                             EXT2_NDIR_BLOCKS, &ip->i_db[0], 0);
 #endif
                if ((error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize,
@@ -210,7 +209,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
         */
        for (i = 1;;) {
                error = bread(vp,
-                             lblktodoff(fs, indirs[i].in_lbn), 
+                             lblktodoff(fs, indirs[i].in_lbn),
                              (int)fs->s_blocksize, &bp);
                if (error) {
                        brelse(bp);
@@ -225,7 +224,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
                        brelse(bp);
                        continue;
                }
-               if (pref == 0) 
+               if (pref == 0)
 #if 1
                        /* see the comment above and by ext2_blkpref
                         * I think this implements Linux policy, but
@@ -272,7 +271,7 @@ ext2_debug("ext2_balloc called (%d, %d, %d)\n",
         * Get the data block, allocating if necessary.
         */
        if (nb == 0) {
-               pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], 
+               pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0],
                                lblkno(fs, bp->b_loffset));
                if ((error = ext2_alloc(ip,
                    lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) {