1 Index: linux-2.6.18.8/include/linux/ext3_fs_i.h
2 ===================================================================
3 --- linux-2.6.18.8.orig/include/linux/ext3_fs_i.h 2007-07-17 09:18:14.000000000 +0200
4 +++ linux-2.6.18.8/include/linux/ext3_fs_i.h 2007-07-17 09:18:53.000000000 +0200
5 @@ -154,6 +154,10 @@ struct ext3_inode_info {
6 struct inode vfs_inode;
8 struct ext3_ext_cache i_cached_extent;
11 + struct list_head i_prealloc_list;
12 + spinlock_t i_prealloc_lock;
15 #endif /* _LINUX_EXT3_FS_I */
16 Index: linux-2.6.18.8/include/linux/ext3_fs_sb.h
17 ===================================================================
18 --- linux-2.6.18.8.orig/include/linux/ext3_fs_sb.h 2007-07-17 09:18:14.000000000 +0200
19 +++ linux-2.6.18.8/include/linux/ext3_fs_sb.h 2007-07-17 09:18:53.000000000 +0200
21 #include <linux/wait.h>
22 #include <linux/blockgroup_lock.h>
23 #include <linux/percpu_counter.h>
24 +#include <linux/list.h>
26 #include <linux/rbtree.h>
27 +#include <linux/proc_fs.h>
29 +struct ext3_buddy_group_blocks;
30 +struct ext3_locality_group;
31 +struct ext3_mb_history;
32 +#define EXT3_BB_MAX_BLOCKS
35 * third extended-fs super-block data in memory
36 Index: linux-2.6.18.8/include/linux/ext3_fs.h
37 ===================================================================
38 --- linux-2.6.18.8.orig/include/linux/ext3_fs.h 2007-07-17 09:18:14.000000000 +0200
39 +++ linux-2.6.18.8/include/linux/ext3_fs.h 2007-07-17 09:18:53.000000000 +0200
41 #define _LINUX_EXT3_FS_H
43 #include <linux/types.h>
44 +#include <linux/ext3_fs_i.h>
47 * The second extended filesystem constants/structures
50 struct ext3_allocation_request {
51 struct inode *inode; /* target inode for block we're allocating */
52 - unsigned long logical; /* logical block in target inode */
53 - unsigned long goal; /* phys. target (a hint) */
54 - unsigned long lleft; /* the closest logical allocated block to the left */
55 - unsigned long pleft; /* phys. block for ^^^ */
56 - unsigned long lright; /* the closest logical allocated block to the right */
57 - unsigned long pright; /* phys. block for ^^^ */
58 + ext3_fsblk_t logical; /* logical block in target inode */
59 + ext3_fsblk_t goal; /* phys. target (a hint) */
60 + ext3_fsblk_t lleft; /* the closest logical allocated block to the left */
61 + ext3_fsblk_t pleft; /* phys. block for ^^^ */
62 + ext3_fsblk_t lright; /* the closest logical allocated block to the right */
63 + ext3_fsblk_t pright; /* phys. block for ^^^ */
64 unsigned long len; /* how many blocks we want to allocate */
65 unsigned long flags; /* flags. see above EXT3_MB_HINT_* */
67 @@ -400,6 +401,7 @@ struct ext3_inode {
68 #define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
69 #define EXT3_MOUNT_EXTENTS 0x2000000/* Extents support */
70 #define EXT3_MOUNT_EXTDEBUG 0x4000000/* Extents debug */
71 +#define EXT3_MOUNT_MBALLOC 0x8000000/* Buddy allocation support */
73 /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
75 @@ -787,12 +789,12 @@ ext3_group_first_block_no(struct super_b
77 extern int ext3_bg_has_super(struct super_block *sb, int group);
78 extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
79 -extern ext3_fsblk_t ext3_new_block (handle_t *handle, struct inode *inode,
80 +extern ext3_fsblk_t ext3_new_block_old (handle_t *handle, struct inode *inode,
81 ext3_fsblk_t goal, int *errp);
82 -extern ext3_fsblk_t ext3_new_blocks (handle_t *handle, struct inode *inode,
83 +extern ext3_fsblk_t ext3_new_blocks_old (handle_t *handle, struct inode *inode,
84 ext3_fsblk_t goal, unsigned long *count, int *errp);
85 extern void ext3_free_blocks (handle_t *handle, struct inode *inode,
86 - ext3_fsblk_t block, unsigned long count);
87 + ext3_fsblk_t block, unsigned long count, int metadata);
88 extern void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb,
89 ext3_fsblk_t block, unsigned long count,
90 unsigned long *pdquot_freed_blocks);
91 @@ -836,15 +838,45 @@ extern long ext3_mb_stats;
92 extern long ext3_mb_max_to_scan;
93 extern int ext3_mb_init(struct super_block *, int);
94 extern int ext3_mb_release(struct super_block *);
95 -extern unsigned long ext3_mb_new_blocks(handle_t *, struct ext3_allocation_request *, int *);
96 +extern ext3_fsblk_t ext3_new_block(handle_t *handle, struct inode *inode,
97 + ext3_fsblk_t goal, int *errp);
98 +extern ext3_fsblk_t ext3_mb_new_blocks(handle_t *,
99 + struct ext3_allocation_request *, int *);
100 extern int ext3_mb_reserve_blocks(struct super_block *, int);
101 extern void ext3_mb_release_blocks(struct super_block *, int);
102 extern void ext3_mb_release_blocks(struct super_block *, int);
103 extern void ext3_mb_discard_inode_preallocations(struct inode *);
104 extern int __init init_ext3_proc(void);
105 extern void exit_ext3_proc(void);
106 -extern void ext3_mb_free_blocks(handle_t *, struct inode *, unsigned long, unsigned long, int, int *);
107 +extern void ext3_mb_free_blocks(handle_t *, struct inode *, unsigned long,
108 + unsigned long, int, unsigned long *);
110 +static inline ext3_fsblk_t ext3_new_blocks(handle_t *handle,
111 + struct inode *inode,
113 + unsigned long *count, int *errp)
115 + struct ext3_allocation_request ar;
118 + if (!test_opt(inode->i_sb, MBALLOC)) {
119 + ret = ext3_new_blocks_old(handle, inode, goal, count, errp);
132 + ret = ext3_mb_new_blocks(handle, &ar, errp);
138 int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
139 Index: linux-2.6.18.8/fs/ext3/super.c
140 ===================================================================
141 --- linux-2.6.18.8.orig/fs/ext3/super.c 2007-07-17 09:18:14.000000000 +0200
142 +++ linux-2.6.18.8/fs/ext3/super.c 2007-07-17 09:18:53.000000000 +0200
143 @@ -688,6 +688,7 @@ enum {
144 Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
146 Opt_extents, Opt_noextents, Opt_extdebug,
147 + Opt_mballoc, Opt_nomballoc, Opt_stripe,
150 static match_table_t tokens = {
151 @@ -743,6 +744,9 @@ static match_table_t tokens = {
152 {Opt_extents, "extents"},
153 {Opt_noextents, "noextents"},
154 {Opt_extdebug, "extdebug"},
155 + {Opt_mballoc, "mballoc"},
156 + {Opt_nomballoc, "nomballoc"},
157 + {Opt_stripe, "stripe=%u"},
159 {Opt_resize, "resize"},
161 @@ -1096,6 +1100,19 @@ clear_qf_name:
163 set_opt (sbi->s_mount_opt, EXTDEBUG);
166 + set_opt(sbi->s_mount_opt, MBALLOC);
168 + case Opt_nomballoc:
169 + clear_opt(sbi->s_mount_opt, MBALLOC);
172 + if (match_int(&args[0], &option))
176 + sbi->s_stripe = option;
180 "EXT3-fs: Unrecognized mount option \"%s\" "
181 @@ -1826,6 +1843,7 @@ static int ext3_fill_super (struct super
185 + ext3_mb_init(sb, needs_recovery);
189 Index: linux-2.6.18.8/fs/ext3/extents.c
190 ===================================================================
191 --- linux-2.6.18.8.orig/fs/ext3/extents.c 2007-07-17 09:18:14.000000000 +0200
192 +++ linux-2.6.18.8/fs/ext3/extents.c 2007-07-17 09:18:53.000000000 +0200
193 @@ -795,7 +795,7 @@ cleanup:
194 for (i = 0; i < depth; i++) {
197 - ext3_free_blocks(handle, inode, ablocks[i], 1);
198 + ext3_free_blocks(handle, inode, ablocks[i], 1, 1);
202 @@ -1613,7 +1613,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
203 ext_debug(inode, "index is empty, remove it, free block %lu\n", leaf);
204 bh = sb_find_get_block(inode->i_sb, leaf);
205 ext3_forget(handle, 1, inode, bh, leaf);
206 - ext3_free_blocks(handle, inode, leaf, 1);
207 + ext3_free_blocks(handle, inode, leaf, 1, 1);
211 @@ -1672,7 +1672,7 @@ static int ext3_remove_blocks(handle_t *
212 unsigned long from, unsigned long to)
214 struct buffer_head *bh;
216 + int i, metadata = 0;
220 @@ -1690,6 +1690,8 @@ static int ext3_remove_blocks(handle_t *
221 spin_unlock(&sbi->s_ext_stats_lock);
224 + if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))
226 if (from >= le32_to_cpu(ex->ee_block)
227 && to == le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
229 @@ -1701,7 +1703,7 @@ static int ext3_remove_blocks(handle_t *
230 bh = sb_find_get_block(inode->i_sb, start + i);
231 ext3_forget(handle, 0, inode, bh, start + i);
233 - ext3_free_blocks(handle, inode, start, num);
234 + ext3_free_blocks(handle, inode, start, num, metadata);
235 } else if (from == le32_to_cpu(ex->ee_block)
236 && to <= le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
237 printk("strange request: removal %lu-%lu from %u:%u\n",
238 @@ -2034,7 +2036,7 @@ int ext3_ext_get_blocks(handle_t *handle
239 struct ext3_extent newex, *ex;
240 int goal, newblock, err = 0, depth;
241 unsigned long allocated = 0;
242 - unsigned long next;
243 + struct ext3_allocation_request ar;
245 __clear_bit(BH_New, &bh_result->b_state);
246 ext_debug(inode, "blocks %d/%lu requested for inode %u\n", (int) iblock,
247 @@ -2116,18 +2118,33 @@ int ext3_ext_get_blocks(handle_t *handle
248 if (S_ISREG(inode->i_mode) && (!EXT3_I(inode)->i_block_alloc_info))
249 ext3_init_block_alloc_info(inode);
251 + /* find neighbour allocated blocks */
253 + err = ext3_ext_search_left(inode, path, &ar.lleft, &ar.pleft);
256 + ar.lright = iblock;
257 + err = ext3_ext_search_right(inode, path, &ar.lright, &ar.pright);
261 /* find next allocated block so that we know how many
262 * blocks we can allocate without ovelapping next extent */
263 - BUG_ON(iblock < le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len));
264 - next = ext3_ext_next_allocated_block(path);
265 - BUG_ON(next <= iblock);
266 - allocated = next - iblock;
267 + BUG_ON(ar.pright != 0 && ar.lright <= iblock);
268 + if (ar.pright == 0)
269 + allocated = EXT_MAX_BLOCK - iblock;
271 + allocated = ar.lright - iblock;
272 if (allocated > max_blocks)
273 allocated = max_blocks;
275 /* allocate new block */
276 - goal = ext3_ext_find_goal(inode, path, iblock);
277 - newblock = ext3_new_blocks(handle, inode, goal, &allocated, &err);
279 + ar.goal = ext3_ext_find_goal(inode, path, iblock);
280 + ar.logical = iblock;
281 + ar.len = allocated;
282 + ar.flags = EXT3_MB_HINT_DATA;
283 + newblock = ext3_mb_new_blocks(handle, &ar, &err);
286 ext_debug(inode, "allocate new block: goal %d, found %d/%lu\n",
287 @@ -2137,12 +2154,16 @@ int ext3_ext_get_blocks(handle_t *handle
288 newex.ee_block = cpu_to_le32(iblock);
289 newex.ee_start = cpu_to_le32(newblock);
290 newex.ee_start_hi = 0;
291 - newex.ee_len = cpu_to_le16(allocated);
292 + newex.ee_len = cpu_to_le16(ar.len);
293 err = ext3_ext_insert_extent(handle, inode, path, &newex);
295 /* free data blocks we just allocated */
296 - ext3_free_blocks(handle, inode, le32_to_cpu(newex.ee_start),
297 - le16_to_cpu(newex.ee_len));
298 + /* not a good idea to call discard here directly,
299 + * but otherwise we'd need to call it every free() */
300 + ext3_mb_discard_inode_preallocations(inode);
301 + ext3_free_blocks(handle, inode, newex.ee_start,
307 @@ -2151,6 +2172,7 @@ int ext3_ext_get_blocks(handle_t *handle
309 /* previous routine could use block we allocated */
310 newblock = le32_to_cpu(newex.ee_start);
311 + allocated = le16_to_cpu(newex.ee_len);
312 __set_bit(BH_New, &bh_result->b_state);
314 ext3_ext_put_in_cache(inode, iblock, allocated, newblock,
315 @@ -2202,6 +2224,9 @@ void ext3_ext_truncate(struct inode * in
316 mutex_lock(&EXT3_I(inode)->truncate_mutex);
317 ext3_ext_invalidate_cache(inode);
319 + /* it's important to discard preallocations under truncate_mutex */
320 + ext3_mb_discard_inode_preallocations(inode);
323 * TODO: optimization is possible here
324 * probably we need not scaning at all,
325 Index: linux-2.6.18.8/fs/ext3/Makefile
326 ===================================================================
327 --- linux-2.6.18.8.orig/fs/ext3/Makefile 2007-07-17 09:18:14.000000000 +0200
328 +++ linux-2.6.18.8/fs/ext3/Makefile 2007-07-17 09:18:53.000000000 +0200
330 obj-$(CONFIG_EXT3_FS) += ext3.o
332 ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
333 - ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o
334 + ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o mballoc.o
336 ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
337 ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
338 Index: linux-2.6.18.8/fs/ext3/xattr.c
339 ===================================================================
340 --- linux-2.6.18.8.orig/fs/ext3/xattr.c 2007-02-24 00:52:30.000000000 +0100
341 +++ linux-2.6.18.8/fs/ext3/xattr.c 2007-07-17 09:18:53.000000000 +0200
342 @@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
343 ea_bdebug(bh, "refcount now=0; freeing");
345 mb_cache_entry_free(ce);
346 - ext3_free_blocks(handle, inode, bh->b_blocknr, 1);
347 + ext3_free_blocks(handle, inode, bh->b_blocknr, 1, 1);
349 ext3_forget(handle, 1, inode, bh, bh->b_blocknr);
351 @@ -805,7 +805,7 @@ inserted:
352 new_bh = sb_getblk(sb, block);
355 - ext3_free_blocks(handle, inode, block, 1);
356 + ext3_free_blocks(handle, inode, block, 1, 1);
360 Index: linux-2.6.18.8/fs/ext3/balloc.c
361 ===================================================================
362 --- linux-2.6.18.8.orig/fs/ext3/balloc.c 2007-02-24 00:52:30.000000000 +0100
363 +++ linux-2.6.18.8/fs/ext3/balloc.c 2007-07-17 09:18:53.000000000 +0200
364 @@ -79,7 +79,7 @@ struct ext3_group_desc * ext3_get_group_
366 * Return buffer_head on success or NULL in case of failure.
368 -static struct buffer_head *
369 +struct buffer_head *
370 read_block_bitmap(struct super_block *sb, unsigned int block_group)
372 struct ext3_group_desc * desc;
373 @@ -294,6 +294,8 @@ void ext3_discard_reservation(struct ino
374 struct ext3_reserve_window_node *rsv;
375 spinlock_t *rsv_lock = &EXT3_SB(inode->i_sb)->s_rsv_window_lock;
377 + ext3_mb_discard_inode_preallocations(inode);
382 @@ -490,21 +492,25 @@ error_return:
386 -/* Free given blocks, update quota and i_blocks field */
387 void ext3_free_blocks(handle_t *handle, struct inode *inode,
388 - ext3_fsblk_t block, unsigned long count)
389 + ext3_fsblk_t block, unsigned long count, int metadata)
391 - struct super_block * sb;
392 - unsigned long dquot_freed_blocks;
393 + struct super_block *sb;
394 + unsigned long freed;
396 + /* this isn't the right place to decide whether block is metadata
397 + * inode.c/extents.c knows better, but for safety ... */
398 + if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode) ||
399 + ext3_should_journal_data(inode))
404 - printk ("ext3_free_blocks: nonexistent device");
407 - ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
408 - if (dquot_freed_blocks)
409 - DQUOT_FREE_BLOCK(inode, dquot_freed_blocks);
410 + if (!test_opt(sb, MBALLOC) || !EXT3_SB(sb)->s_group_info)
411 + ext3_free_blocks_sb(handle, sb, block, count, &freed);
413 + ext3_mb_free_blocks(handle, inode, block, count, metadata, &freed);
415 + DQUOT_FREE_BLOCK(inode, freed);
419 @@ -1199,7 +1205,7 @@ int ext3_should_retry_alloc(struct super
420 * bitmap, and then for any free bit if that fails.
421 * This function also updates quota and i_blocks field.
423 -ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
424 +ext3_fsblk_t ext3_new_blocks_old(handle_t *handle, struct inode *inode,
425 ext3_fsblk_t goal, unsigned long *count, int *errp)
427 struct buffer_head *bitmap_bh = NULL;
428 @@ -1463,7 +1469,7 @@ out:
432 -ext3_fsblk_t ext3_new_block(handle_t *handle, struct inode *inode,
433 +ext3_fsblk_t ext3_new_block_old(handle_t *handle, struct inode *inode,
434 ext3_fsblk_t goal, int *errp)
436 unsigned long count = 1;
437 Index: linux-2.6.18.8/fs/ext3/inode.c
438 ===================================================================
439 --- linux-2.6.18.8.orig/fs/ext3/inode.c 2007-07-17 09:18:14.000000000 +0200
440 +++ linux-2.6.18.8/fs/ext3/inode.c 2007-07-17 09:18:53.000000000 +0200
441 @@ -560,7 +560,7 @@ static int ext3_alloc_blocks(handle_t *h
444 for (i = 0; i <index; i++)
445 - ext3_free_blocks(handle, inode, new_blocks[i], 1);
446 + ext3_free_blocks(handle, inode, new_blocks[i], 1, 0);
450 @@ -659,9 +659,9 @@ failed:
451 ext3_journal_forget(handle, branch[i].bh);
453 for (i = 0; i <indirect_blks; i++)
454 - ext3_free_blocks(handle, inode, new_blocks[i], 1);
455 + ext3_free_blocks(handle, inode, new_blocks[i], 1, 0);
457 - ext3_free_blocks(handle, inode, new_blocks[i], num);
458 + ext3_free_blocks(handle, inode, new_blocks[i], num, 0);
462 @@ -758,9 +758,10 @@ err_out:
463 for (i = 1; i <= num; i++) {
464 BUFFER_TRACE(where[i].bh, "call journal_forget");
465 ext3_journal_forget(handle, where[i].bh);
466 - ext3_free_blocks(handle,inode,le32_to_cpu(where[i-1].key),1);
467 + ext3_free_blocks(handle,inode,le32_to_cpu(where[i-1].key), 1,
470 - ext3_free_blocks(handle, inode, le32_to_cpu(where[num].key), blks);
471 + ext3_free_blocks(handle, inode, le32_to_cpu(where[num].key), blks, 0);
475 @@ -1996,7 +1997,7 @@ static void ext3_clear_blocks(handle_t *
479 - ext3_free_blocks(handle, inode, block_to_free, count);
480 + ext3_free_blocks(handle, inode, block_to_free, count, 0);
484 @@ -2169,7 +2170,7 @@ static void ext3_free_branches(handle_t
485 ext3_journal_test_restart(handle, inode);
488 - ext3_free_blocks(handle, inode, nr, 1);
489 + ext3_free_blocks(handle, inode, nr, 1, 1);
493 Index: linux-2.6.18.8/fs/ext3/mballoc.c
494 ===================================================================
495 --- linux-2.6.18.8.orig/fs/ext3/mballoc.c 2007-07-17 09:18:14.000000000 +0200
496 +++ linux-2.6.18.8/fs/ext3/mballoc.c 2007-07-17 09:23:56.000000000 +0200
497 @@ -350,8 +350,8 @@ struct ext3_prealloc_space {
501 - unsigned long pa_pstart; /* phys. block */
502 - unsigned long pa_lstart; /* log. block */
503 + ext3_fsblk_t pa_pstart; /* phys. block */
504 + ext3_fsblk_t pa_lstart; /* log. block */
505 unsigned short pa_len; /* len of preallocated chunk */
506 unsigned short pa_free; /* how many blocks are free */
507 unsigned short pa_linear; /* consumed in one direction
508 @@ -460,8 +460,8 @@ static struct proc_dir_entry *proc_root_
510 int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
511 struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
512 -unsigned long ext3_new_blocks_old(handle_t *handle, struct inode *inode,
513 - unsigned long goal, unsigned long *count, int *errp);
514 +ext3_fsblk_t ext3_new_blocks_old(handle_t *handle, struct inode *inode,
515 + ext3_fsblk_t goal, unsigned long *count, int *errp);
516 void ext3_mb_release_blocks(struct super_block *, int);
517 void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
518 void ext3_mb_free_committed_blocks(struct super_block *);
519 @@ -479,7 +479,7 @@ int ext3_mb_destroy_per_dev_proc(struct
520 * Calculate the block group number and offset, given a block number
522 static void ext3_get_group_no_and_offset(struct super_block *sb,
523 - unsigned long blocknr,
524 + ext3_fsblk_t blocknr,
525 unsigned long *blockgrpp,
526 unsigned long *offsetp)
528 @@ -517,12 +517,12 @@ ext3_is_group_locked(struct super_block
529 &EXT3_GROUP_INFO(sb, group)->bb_state);
532 -unsigned long ext3_grp_offs_to_block(struct super_block *sb,
533 +ext3_fsblk_t ext3_grp_offs_to_block(struct super_block *sb,
534 struct ext3_free_extent *fex)
536 - unsigned long block;
537 + ext3_fsblk_t block;
539 - block = (unsigned long) fex->fe_group * EXT3_BLOCKS_PER_GROUP(sb)
540 + block = (ext3_fsblk_t) fex->fe_group * EXT3_BLOCKS_PER_GROUP(sb)
542 + le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
544 @@ -3174,7 +3174,7 @@ void ext3_mb_collect_stats(struct ext3_a
545 void ext3_mb_use_inode_pa(struct ext3_allocation_context *ac,
546 struct ext3_prealloc_space *pa)
548 - unsigned long start, len;
549 + ext3_fsblk_t start, len;
551 /* found preallocated blocks, use them */
552 start = pa->pa_pstart + (ac->ac_o_ex.fe_logical - pa->pa_lstart);
553 @@ -4027,13 +4027,13 @@ int ext3_mb_discard_preallocations(struc
554 * it tries to use preallocation first, then falls back
555 * to usual allocation
557 -unsigned long ext3_mb_new_blocks(handle_t *handle,
558 +ext3_fsblk_t ext3_mb_new_blocks(handle_t *handle,
559 struct ext3_allocation_request *ar, int *errp)
561 struct ext3_allocation_context ac;
562 struct ext3_sb_info *sbi;
563 struct super_block *sb;
564 - unsigned long block = 0;
565 + ext3_fsblk_t block = 0;
568 sb = ar->inode->i_sb;
569 @@ -4044,8 +4044,8 @@ unsigned long ext3_mb_new_blocks(handle_
570 if (ext3_mballoc_warning++ == 0)
571 printk(KERN_ERR "EXT3-fs: multiblock request with "
572 "mballoc disabled!\n");
574 - block = ext3_new_block_old(handle, ar->inode, ar->goal, errp);
575 + block = ext3_new_blocks_old(handle, ar->inode, ar->goal,
580 @@ -4109,11 +4109,11 @@ out:
582 EXPORT_SYMBOL(ext3_mb_new_blocks);
584 -int ext3_new_block(handle_t *handle, struct inode *inode,
585 - unsigned long goal, int *errp)
586 +ext3_fsblk_t ext3_new_block(handle_t *handle, struct inode *inode,
587 + ext3_fsblk_t goal, int *errp)
589 struct ext3_allocation_request ar;
593 if (!test_opt(inode->i_sb, MBALLOC)) {
594 ret = ext3_new_block_old(handle, inode, goal, errp);
595 @@ -4228,8 +4228,8 @@ int ext3_mb_free_metadata(handle_t *hand
596 * Main entry point into mballoc to free blocks
598 void ext3_mb_free_blocks(handle_t *handle, struct inode *inode,
599 - unsigned long block, unsigned long count,
600 - int metadata, int *freed)
601 + ext3_fsblk_t block, unsigned long count,
602 + int metadata, unsigned long *freed)
604 struct buffer_head *bitmap_bh = NULL;
605 struct super_block *sb = inode->i_sb;