Staging: comedi: Finish removing ni_private typedef
[pandora-kernel.git] / fs / ext4 / migrate.c
index fe64d9f..313a50b 100644 (file)
@@ -458,6 +458,7 @@ int ext4_ext_migrate(struct inode *inode)
        struct inode *tmp_inode = NULL;
        struct list_blocks_struct lb;
        unsigned long max_entries;
+       __u32 goal;
 
        /*
         * If the filesystem does not support extents, or the inode
@@ -483,9 +484,10 @@ int ext4_ext_migrate(struct inode *inode)
                retval = PTR_ERR(handle);
                return retval;
        }
-       tmp_inode = ext4_new_inode(handle,
-                               inode->i_sb->s_root->d_inode,
-                               S_IFREG);
+       goal = (((inode->i_ino - 1) / EXT4_INODES_PER_GROUP(inode->i_sb)) *
+               EXT4_INODES_PER_GROUP(inode->i_sb)) + 1;
+       tmp_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode,
+                                  S_IFREG, 0, goal);
        if (IS_ERR(tmp_inode)) {
                retval = -ENOMEM;
                ext4_journal_stop(handle);