-#ifdef EXT3_PREALLOCATE
-#ifdef EXT3FS_DEBUG
- static unsigned long alloc_hits, alloc_attempts;
-#endif
- struct ext3_inode_info *ei = EXT3_I(inode);
- /* Writer: ->i_prealloc* */
- if (ei->i_prealloc_count &&
- (goal == ei->i_prealloc_block ||
- goal + 1 == ei->i_prealloc_block))
- {
- result = ei->i_prealloc_block++;
- ei->i_prealloc_count--;
- /* Writer: end */
- ext3_debug ("preallocation hit (%lu/%lu).\n",
- ++alloc_hits, ++alloc_attempts);
- } else {
- ext3_discard_prealloc (inode);
- ext3_debug ("preallocation miss (%lu/%lu).\n",
- alloc_hits, ++alloc_attempts);
- if (S_ISREG(inode->i_mode))
- result = ext3_new_block (inode, goal,
- &ei->i_prealloc_count,
- &ei->i_prealloc_block, err);
- else
- result = ext3_new_block(inode, goal, NULL, NULL, err);
- /*
- * AKPM: this is somewhat sticky. I'm not surprised it was
- * disabled in 2.2's ext3. Need to integrate b_committed_data
- * guarding with preallocation, if indeed preallocation is
- * effective.
- */
- }
-#else
- result = ext3_new_block(handle, inode, goal, NULL, NULL, err);
-#endif