From: Alex Tomas Signed-off-by: Alex Tomas --- --- fs/ext4/writeback.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) Index: linux-2.6.23-rc3/fs/ext4/writeback.c =================================================================== --- linux-2.6.23-rc3.orig/fs/ext4/writeback.c 2007-08-14 16:37:58.000000000 -0700 +++ linux-2.6.23-rc3/fs/ext4/writeback.c 2007-08-14 17:11:33.000000000 -0700 @@ -275,7 +275,8 @@ static int ext4_wb_submit_extent(struct struct inode *inode = wc->mapping->host; int blkbits = inode->i_blkbits; struct page *page; - unsigned long blk, off, len, remain; + ext4_fsblk_t off; + unsigned long blk, len, remain; unsigned long pstart, plen, prev; struct bio *bio = NULL; int nr_pages; @@ -336,6 +337,8 @@ alloc_new_bio: nr_pages = (nr_pages >> (PAGE_CACHE_SHIFT - blkbits)); off = le32_to_cpu(ex->ee_start) + (blk - le32_to_cpu(ex->ee_block)); + off |= (ext4_fsblk_t) + le16_to_cpu(ex->ee_start_hi) << 32; bio = ext4_wb_bio_alloc(inode, off, nr_pages + 2); if (bio == NULL) return -ENOMEM; @@ -383,7 +386,9 @@ ext4_wb_find_goal(struct inode *inode, s /* try to predict block placement */ ex = path[depth].p_ext; if (ex) - return le32_to_cpu(ex->ee_start) + + return (le32_to_cpu(ex->ee_start) | + ((ext4_fsblk_t) + le16_to_cpu(ex->ee_start_hi) << 32)) + (block - le32_to_cpu(ex->ee_block)); /* it looks index is empty @@ -423,7 +428,8 @@ static int ext4_wb_handle_extent(struct (unsigned) ec->ec_block, (unsigned) ec->ec_len, (unsigned) ec->ec_start); - nex.ee_start = cpu_to_le32(ec->ec_start); + nex.ee_start = cpu_to_le32(ec->ec_start & 0xffffffff); + nex.ee_start_hi = cpu_to_le16((ec->ec_start >> 32) & 0xffff); nex.ee_block = cpu_to_le32(ec->ec_block); nex.ee_len = cpu_to_le16(ec->ec_len); err = ext4_wb_submit_extent(wc, NULL, &nex, 0); @@ -497,8 +503,8 @@ static int ext4_wb_handle_extent(struct pblock, count, inode->i_ino, ec->ec_len); /* insert new extent */ - nex.ee_start = cpu_to_le32(pblock); - nex.ee_start_hi = 0; + nex.ee_start = cpu_to_le32(pblock & 0xffffffff); + nex.ee_start_hi = cpu_to_le16((pblock >> 32) & 0xffff); nex.ee_len = cpu_to_le16(count); nex.ee_block = cpu_to_le32(ec->ec_block); err = ext4_ext_insert_extent(handle, inode, path, &nex); @@ -533,7 +539,9 @@ static int ext4_wb_handle_extent(struct * in correspondend buffer_heads to prevent corruptions */ for (i = 0; i < le16_to_cpu(nex.ee_len); i++) unmap_underlying_metadata(sb->s_bdev, - le32_to_cpu(nex.ee_start) + i); + ((ext4_fsblk_t) + le16_to_cpu(nex.ee_start_hi) << 32) + + le32_to_cpu(nex.ee_start) + i); /* correct on-disk inode size */ if (le16_to_cpu(nex.ee_len) > 0) {