linux-4gb-32bit-file-fix-20050802
authorChas Williams <chas@cmf.nrl.navy.mil>
Tue, 2 Aug 2005 06:08:45 +0000 (06:08 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 2 Aug 2005 06:08:45 +0000 (06:08 +0000)
FIXCES 20560

fix wrapping error on page offset

src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_vnodeops.c

index 33b53d7..c0e4072 100644 (file)
@@ -193,7 +193,7 @@ afs_osi_SleepSig(void *event)
        AFS_GUNLOCK();
        schedule();
 #ifdef AFS_LINUX26_ENV
-#ifdef CONFIG_PF
+#ifdef CONFIG_PM
        if (current->flags & PF_FREEZE)
            refrigerator(PF_FREEZE);
 #endif
@@ -277,7 +277,7 @@ osi_TimedSleep(char *event, afs_int32 ams, int aintok)
     } else
        schedule_timeout(ticks);
 #ifdef AFS_LINUX26_ENV
-#ifdef CONFIG_PF
+#ifdef CONFIG_PM
     if (current->flags & PF_FREEZE)
        refrigerator(PF_FREEZE);
 #endif
index 18f9fbe..fc9fcfc 100644 (file)
@@ -1263,7 +1263,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
     cred_t *credp = crref();
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     char *address;
-    afs_offs_t offset = pp->index << PAGE_CACHE_SHIFT;
+    afs_offs_t offset = page_offset(pp);
 #else
     ulong address = afs_linux_page_address(pp);
     afs_offs_t offset = pageoff(pp);
@@ -1359,7 +1359,7 @@ afs_linux_writepage_sync(struct inode *ip, struct page *pp,
     int f_flags = 0;
 
     buffer = kmap(pp) + offset;
-    base = (pp->index << PAGE_CACHE_SHIFT) + offset;
+    base = page_offset(pp) + offset;
 
     credp = crref();
     lock_kernel();