[OpenAFS-devel] 1.3.86 LINUX largefile-support broken

chas williams - CONTRACTOR chas@cmf.nrl.navy.mil
Tue, 02 Aug 2005 08:31:40 -0400


ok, since page_offset() may or may not exist, lets try:


Index: src/afs/LINUX/osi_vnodeops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
retrieving revision 1.114
diff -u -u -r1.114 osi_vnodeops.c
--- src/afs/LINUX/osi_vnodeops.c	2 Aug 2005 05:11:38 -0000	1.114
+++ src/afs/LINUX/osi_vnodeops.c	2 Aug 2005 12:30:20 -0000
@@ -1263,7 +1263,7 @@
     cred_t *credp = crref();
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     char *address;
-    afs_offs_t offset = page_offset(pp);
+    afs_offs_t offset = ((loff_t) pp->index) << PAGE_CACHE_SHIFT;
 #else
     ulong address = afs_linux_page_address(pp);
     afs_offs_t offset = pageoff(pp);
@@ -1359,7 +1359,7 @@
     int f_flags = 0;
 
     buffer = kmap(pp) + offset;
-    base = page_offset(pp) + offset;
+    base = (((loff_t) pp->index) << PAGE_CACHE_SHIFT)  + offset;
 
     credp = crref();
     lock_kernel();