update to rc6, and verified pass fsx/dbench
[ext4-patch-queue.git] / ext4-delalloc-extents-48bit.patch
blobb41db1d7771a023a42c86e349942adcf65c7603c
1 Signed-off-by: Alex Tomas <alex@clusterfs.com>
2 ---
3 Index: linux-2.6.22-rc4/fs/ext4/writeback.c
4 ===================================================================
5 --- linux-2.6.22-rc4.orig/fs/ext4/writeback.c 2007-06-13 11:52:29.000000000 -0700
6 +++ linux-2.6.22-rc4/fs/ext4/writeback.c 2007-06-13 11:54:30.000000000 -0700
7 @@ -275,7 +275,8 @@
8 struct inode *inode = wc->mapping->host;
9 int blkbits = inode->i_blkbits;
10 struct page *page;
11 - unsigned long blk, off, len, remain;
12 + ext4_fsblk_t off;
13 + unsigned long blk, len, remain;
14 unsigned long pstart, plen, prev;
15 struct bio *bio = NULL;
16 int nr_pages;
17 @@ -336,6 +337,8 @@
18 nr_pages = (nr_pages >> (PAGE_CACHE_SHIFT - blkbits));
19 off = le32_to_cpu(ex->ee_start) +
20 (blk - le32_to_cpu(ex->ee_block));
21 + off |= (ext4_fsblk_t)
22 + le16_to_cpu(ex->ee_start_hi) << 32;
23 bio = ext4_wb_bio_alloc(inode, off, nr_pages + 2);
24 if (bio == NULL)
25 return -ENOMEM;
26 @@ -383,7 +386,9 @@
27 /* try to predict block placement */
28 ex = path[depth].p_ext;
29 if (ex)
30 - return le32_to_cpu(ex->ee_start) +
31 + return (le32_to_cpu(ex->ee_start) |
32 + ((ext4_fsblk_t)
33 + le16_to_cpu(ex->ee_start_hi) << 32)) +
34 (block - le32_to_cpu(ex->ee_block));
36 /* it looks index is empty
37 @@ -423,7 +428,8 @@
38 (unsigned) ec->ec_block,
39 (unsigned) ec->ec_len,
40 (unsigned) ec->ec_start);
41 - nex.ee_start = cpu_to_le32(ec->ec_start);
42 + nex.ee_start = cpu_to_le32(ec->ec_start & 0xffffffff);
43 + nex.ee_start_hi = cpu_to_le16((ec->ec_start >> 32) & 0xffff);
44 nex.ee_block = cpu_to_le32(ec->ec_block);
45 nex.ee_len = cpu_to_le16(ec->ec_len);
46 err = ext4_wb_submit_extent(wc, NULL, &nex, 0);
47 @@ -497,8 +503,8 @@
48 pblock, count, inode->i_ino, ec->ec_len);
50 /* insert new extent */
51 - nex.ee_start = cpu_to_le32(pblock);
52 - nex.ee_start_hi = 0;
53 + nex.ee_start = cpu_to_le32(pblock & 0xffffffff);
54 + nex.ee_start_hi = cpu_to_le16((pblock >> 32) & 0xffff);
55 nex.ee_len = cpu_to_le16(count);
56 nex.ee_block = cpu_to_le32(ec->ec_block);
57 err = ext4_ext_insert_extent(handle, inode, path, &nex);
58 @@ -533,7 +539,9 @@
59 * in correspondend buffer_heads to prevent corruptions */
60 for (i = 0; i < le16_to_cpu(nex.ee_len); i++)
61 unmap_underlying_metadata(sb->s_bdev,
62 - le32_to_cpu(nex.ee_start) + i);
63 + ((ext4_fsblk_t)
64 + le16_to_cpu(nex.ee_start_hi) << 32) +
65 + le32_to_cpu(nex.ee_start) + i);
67 /* correct on-disk inode size */
68 if (le16_to_cpu(nex.ee_len) > 0) {