Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>

---
 drivers/block/loop.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Index: linux-2.6.22-rc4-mm2/drivers/block/loop.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/drivers/block/loop.c      2007-06-19 
20:50:30.000000000 -0700
+++ linux-2.6.22-rc4-mm2/drivers/block/loop.c   2007-06-20 00:34:46.000000000 
-0700
@@ -215,8 +215,8 @@ static int do_lo_send_aops(struct loop_d
        int len, ret;
 
        mutex_lock(&mapping->host->i_mutex);
-       index = pos >> PAGE_CACHE_SHIFT;
-       offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
+       index = page_cache_index(mapping, pos);
+       offset = page_cache_offset(mapping, pos);
        bv_offs = bvec->bv_offset;
        len = bvec->bv_len;
        while (len > 0) {
@@ -226,8 +226,9 @@ static int do_lo_send_aops(struct loop_d
                struct page *page;
                void *fsdata;
 
-               IV = ((sector_t)index << (PAGE_CACHE_SHIFT - 9))+(offset >> 9);
-               size = PAGE_CACHE_SIZE - offset;
+               IV = ((sector_t)index << (page_cache_shift(mapping) - 9))
+                                                       + (offset >> 9);
+               size = page_cache_size(mapping) - offset;
                if (size > len)
                        size = len;
 
@@ -393,7 +394,9 @@ lo_read_actor(read_descriptor_t *desc, s
        struct loop_device *lo = p->lo;
        sector_t IV;
 
-       IV = ((sector_t) page->index << (PAGE_CACHE_SHIFT - 9))+(offset >> 9);
+       IV = ((sector_t) page->index <<
+                       (page_cache_shift(page_mapping(page)) - 9))
+                       + (offset >> 9);
 
        if (size > count)
                size = count;

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to