[DRBD-cvs] svn commit by phil - r2061 - trunk/user - Small patch, big difference!

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Feb 8 16:00:44 CET 2006


drbdmeta could not access 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: phil
Date: 2006-02-08 16:00:42 +0100 (Wed, 08 Feb 2006)
New Revision: 2061

Modified:
   trunk/user/drbdmeta.c
Log:
Small patch, big difference!
drbdmeta could not access internal meta-data on devices bigger
than 2G, since it used mmap() instead of mmap64() .


Modified: trunk/user/drbdmeta.c
===================================================================
--- trunk/user/drbdmeta.c	2006-02-07 21:19:25 UTC (rev 2060)
+++ trunk/user/drbdmeta.c	2006-02-08 15:00:42 UTC (rev 2061)
@@ -337,7 +337,7 @@
 }
 
 void *my_mmap(const char* func, const unsigned int line, const char* what,
-	size_t length, int prot , int flags, int fd, off_t offset)
+	size_t length, int prot , int flags, int fd, __off64_t offset)
 {
     void *p;
     u64 have = bdev_size(fd);
@@ -353,7 +353,7 @@
 	    (unsigned long long)length, (unsigned long long)offset);
     */
     length = PAGE_ALIGN(length) + ((offset & ~PAGE_MASK) ? PAGE_SIZE : 0);
-    p = mmap(NULL, length, prot, flags, fd, offset & PAGE_MASK);
+    p = mmap64(NULL, length, prot, flags, fd, offset & PAGE_MASK);
     // fprintf(stderr,"mmap %s: %p %lu @%lu\n",what, p,(unsigned long)length, (unsigned long) (offset & PAGE_MASK));
     if (p == MAP_FAILED) {
 	PERROR("%s:%u: mmap(%s) failed", func, line, what);



More information about the drbd-cvs mailing list