Rebase patch series to 2.6.22-rc4
[ext4-patch-queue.git] / ext4-delalloc-extents-48bit.patch
blob03aa9c9b0616aad0ccd6d87392e93d2f025e1a6d
1 ---
2 Index: linux-2.6.22-rc1/fs/ext4/writeback.c
3 ===================================================================
4 --- linux-2.6.22-rc1.orig/fs/ext4/writeback.c 2007-05-15 16:26:07.000000000 -0700
5 +++ linux-2.6.22-rc1/fs/ext4/writeback.c 2007-05-15 16:26:10.000000000 -0700
6 @@ -274,7 +274,8 @@
7 struct inode *inode = wc->mapping->host;
8 int blkbits = inode->i_blkbits;
9 struct page *page;
10 - unsigned long blk, off, len, remain;
11 + ext4_fsblk_t off;
12 + unsigned long blk, len, remain;
13 unsigned long pstart, plen, prev;
14 struct bio *bio = NULL;
15 int nr_pages;
16 @@ -335,6 +336,8 @@
17 nr_pages = (nr_pages >> (PAGE_CACHE_SHIFT - blkbits));
18 off = le32_to_cpu(ex->ee_start) +
19 (blk - le32_to_cpu(ex->ee_block));
20 + off |= (ext4_fsblk_t)
21 + le16_to_cpu(ex->ee_start_hi) << 32;
22 bio = ext4_wb_bio_alloc(inode, off, nr_pages + 2);
23 if (bio == NULL)
24 return -ENOMEM;
25 @@ -380,7 +383,9 @@
27 /* try to predict block placement */
28 if ((ex = path[depth].p_ext))
29 - return le32_to_cpu(ex->ee_start) +
30 + return (le32_to_cpu(ex->ee_start) |
31 + ((ext4_fsblk_t)
32 + le16_to_cpu(ex->ee_start_hi) << 32)) +
33 (block - le32_to_cpu(ex->ee_block));
35 /* it looks index is empty
36 @@ -420,7 +425,8 @@
37 (unsigned) ec->ec_block,
38 (unsigned) ec->ec_len,
39 (unsigned) ec->ec_start);
40 - nex.ee_start = cpu_to_le32(ec->ec_start);
41 + nex.ee_start = cpu_to_le32(ec->ec_start & 0xffffffff);
42 + nex.ee_start_hi = cpu_to_le16((ec->ec_start >> 32) & 0xffff);
43 nex.ee_block = cpu_to_le32(ec->ec_block);
44 nex.ee_len = cpu_to_le16(ec->ec_len);
45 err = ext4_wb_submit_extent(wc, NULL, &nex, 0);
46 @@ -493,8 +499,8 @@
47 pblock, count, inode->i_ino, ec->ec_len);
49 /* insert new extent */
50 - nex.ee_start = cpu_to_le32(pblock);
51 - nex.ee_start_hi = 0;
52 + nex.ee_start = cpu_to_le32(pblock & 0xffffffff);
53 + nex.ee_start_hi = cpu_to_le16((pblock >> 32) & 0xffff);
54 nex.ee_len = cpu_to_le16(count);
55 nex.ee_block = cpu_to_le32(ec->ec_block);
56 err = ext4_ext_insert_extent(handle, inode, path, &nex);
57 @@ -529,7 +535,9 @@
58 * in correspondend buffer_heads to prevent corruptions */
59 for (i = 0; i < le16_to_cpu(nex.ee_len); i++)
60 unmap_underlying_metadata(sb->s_bdev,
61 - le32_to_cpu(nex.ee_start) + i);
62 + ((ext4_fsblk_t)
63 + le16_to_cpu(nex.ee_start_hi) << 32) +
64 + le32_to_cpu(nex.ee_start) + i);
66 /* correct on-disk inode size */
67 if (le16_to_cpu(nex.ee_len) > 0) {