INN commit: trunk (6 files)

INN Commit Russ_Allbery at isc.org
Fri Feb 9 02:46:39 UTC 2007


    Date: Thursday, February 8, 2007 @ 18:46:39
  Author: eagle
Revision: 7599

Rename msync_page to inn_msync_page and use a #define wrapper with a
different name from the function so that we don't confuse the compiler.

Modified:
  trunk/include/inn/mmap.h
  trunk/innd/icd.c
  trunk/lib/dbz.c
  trunk/lib/mmap.c
  trunk/storage/tradindexed/tdx-data.c
  trunk/storage/tradindexed/tdx-group.c

---------------------------------+
 include/inn/mmap.h              |   11 +++++++----
 innd/icd.c                      |    2 +-
 lib/dbz.c                       |    2 +-
 lib/mmap.c                      |    2 +-
 storage/tradindexed/tdx-data.c  |    2 +-
 storage/tradindexed/tdx-group.c |   36 ++++++++++++++++++------------------
 6 files changed, 29 insertions(+), 26 deletions(-)

Modified: include/inn/mmap.h
===================================================================
--- include/inn/mmap.h	2007-02-09 02:40:51 UTC (rev 7598)
+++ include/inn/mmap.h	2007-02-09 02:46:39 UTC (rev 7599)
@@ -12,15 +12,18 @@
 
 BEGIN_DECLS
 
-/* msync the page containing a section of memory. */
-int msync_page(void *, size_t, int flags);
+/* msync the page containing a section of memory.  This is the internal
+   function, which we wrap with a define below. */
+int inn__msync_page(void *, size_t, int flags);
 
 /* Some platforms only support two arguments to msync.  On those platforms,
    make the third argument to msync_page always be zero, getting rid of
    whatever the caller tried to pass.  This avoids undefined symbols for
    MS_ASYNC and friends on platforms with two-argument msync functions. */
-#ifndef INN_HAVE_MSYNC_3_ARG
-# define msync_page(p, l, f) msync_page((p), (l), 0)
+#ifdef INN_HAVE_MSYNC_3_ARG
+# define inn_msync_page inn__msync_page
+#else
+# define inn_msync_page(p, l, f) inn__msync_page((p), (l), 0)
 #endif
 
 END_DECLS

Modified: innd/icd.c
===================================================================
--- innd/icd.c	2007-02-09 02:40:51 UTC (rev 7598)
+++ innd/icd.c	2007-02-09 02:46:39 UTC (rev 7599)
@@ -493,7 +493,7 @@
 ICDwriteactive(void)
 {
 #ifdef HAVE_MMAP
-    if (msync_page(ICDactpointer, ICDactsize, MS_ASYNC) < 0) {
+    if (inn_msync_page(ICDactpointer, ICDactsize, MS_ASYNC) < 0) {
         syslog(L_FATAL, "%s msync failed %s 0x%lx %d %m", LogName, ICDactpath, (unsigned long) ICDactpointer, ICDactsize);
         exit(1);
     }

Modified: lib/dbz.c
===================================================================
--- lib/dbz.c	2007-02-09 02:40:51 UTC (rev 7598)
+++ lib/dbz.c	2007-02-09 02:46:39 UTC (rev 7599)
@@ -1540,7 +1540,7 @@
 	debug("set: incore");
 	if (tab->incore == INCORE_MMAP) {
 	    if (innconf->nfswriter) {
-		msync_page(where, tab->reclen, MS_ASYNC);
+		inn_msync_page(where, tab->reclen, MS_ASYNC);
 	    }
 	    return true;
 	}

Modified: lib/mmap.c
===================================================================
--- lib/mmap.c	2007-02-09 02:40:51 UTC (rev 7598)
+++ lib/mmap.c	2007-02-09 02:46:39 UTC (rev 7599)
@@ -17,7 +17,7 @@
 **  page.  This routine assumes that all pointers fit into a size_t.
 */
 int
-msync_page(void *p, size_t length, int flags)
+inn__msync_page(void *p, size_t length, int flags)
 {
     int pagesize;
 

Modified: storage/tradindexed/tdx-data.c
===================================================================
--- storage/tradindexed/tdx-data.c	2007-02-09 02:40:51 UTC (rev 7598)
+++ storage/tradindexed/tdx-data.c	2007-02-09 02:46:39 UTC (rev 7599)
@@ -1108,7 +1108,7 @@
     /* All done.  Close things down and flush the data we changed, if
        necessary. */
     if (changed)
-        msync_page(index, sizeof(*index), MS_ASYNC);
+        inn_msync_page(index, sizeof(*index), MS_ASYNC);
 
  end:
     tdx_data_close(data);

Modified: storage/tradindexed/tdx-group.c
===================================================================
--- storage/tradindexed/tdx-group.c	2007-02-09 02:40:51 UTC (rev 7598)
+++ storage/tradindexed/tdx-group.c	2007-02-09 02:46:39 UTC (rev 7599)
@@ -380,7 +380,7 @@
         index->header->freelist.recno = i;
     }
 
-    msync_page(index->header, index_file_size(index->count), MS_ASYNC);
+    inn_msync_page(index->header, index_file_size(index->count), MS_ASYNC);
     return true;
 }
 
@@ -459,7 +459,7 @@
 {
     *parent = entry->next.recno;
     entry->next.recno = -1;
-    msync_page(parent, sizeof(*parent), MS_ASYNC);
+    inn_msync_page(parent, sizeof(*parent), MS_ASYNC);
 }
 
 
@@ -480,8 +480,8 @@
     }
     entry->next.recno = index->header->hash[bucket].recno;
     index->header->hash[bucket].recno = entry_loc(index, entry);
-    msync_page(&index->header->hash[bucket], sizeof(struct loc), MS_ASYNC);
-    msync_page(entry, sizeof(*entry), MS_ASYNC);
+    inn_msync_page(&index->header->hash[bucket], sizeof(struct loc), MS_ASYNC);
+    inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
 }
 
 
@@ -529,8 +529,8 @@
 {
     entry->next.recno = index->header->freelist.recno;
     index->header->freelist.recno = entry_loc(index, entry);
-    msync_page(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
-    msync_page(entry, sizeof(*entry), MS_ASYNC);
+    inn_msync_page(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
+    inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
 }
 
 
@@ -600,7 +600,7 @@
         return NULL;
     entry = index->entries + loc;
     if (innconf->tradindexedmmap && innconf->nfsreader)
-	msync_page(entry, sizeof *entry, MS_INVALIDATE);
+	inn_msync_page(entry, sizeof *entry, MS_INVALIDATE);
     return entry;
 }
 
@@ -630,7 +630,7 @@
         entry = &index->entries[loc];
         if (entry->flag != *flag) {
             entry->flag = *flag;
-            msync_page(entry, sizeof(*entry), MS_ASYNC);
+            inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
         }
         return true;
     }
@@ -645,7 +645,7 @@
         }
     loc = index->header->freelist.recno;
     index->header->freelist.recno = index->entries[loc].next.recno;
-    msync_page(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
+    inn_msync_page(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
 
     /* Initialize the entry. */
     entry = &index->entries[loc];
@@ -820,11 +820,11 @@
         old_base = entry->base;
         entry->indexinode = data->indexinode;
         entry->base = data->base;
-        msync_page(entry, sizeof(*entry), MS_ASYNC);
+        inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
         if (!tdx_data_pack_finish(data)) {
             entry->base = old_base;
             entry->indexinode = old_inode;
-            msync_page(entry, sizeof(*entry), MS_ASYNC);
+            inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
             goto fail;
         }
     }
@@ -839,7 +839,7 @@
     if (entry->high < article->number)
         entry->high = article->number;
     entry->count++;
-    msync_page(entry, sizeof(*entry), MS_ASYNC);
+    inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
     index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
     return true;
 
@@ -880,7 +880,7 @@
     *entry = *new;
     entry->indexinode = new_inode;
     new->indexinode = new_inode;
-    msync_page(entry, sizeof(*entry), MS_ASYNC);
+    inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
     offset = entry - index->entries;
     index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
     return true;
@@ -930,12 +930,12 @@
     old_base = entry->base;
     entry->indexinode = new_entry.indexinode;
     entry->base = new_entry.base;
-    msync_page(entry, sizeof(*entry), MS_ASYNC);
+    inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
     tdx_data_close(data);
     if (!tdx_data_rebuild_finish(group)) {
         entry->base = old_base;
         entry->indexinode = old_inode;
-        msync_page(entry, sizeof(*entry), MS_ASYNC);
+        inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
         goto fail;
     }
 
@@ -1169,7 +1169,7 @@
 
     if (fix && error) {
         *loc = -1;
-        msync_page(loc, sizeof(*loc), MS_ASYNC);
+        inn_msync_page(loc, sizeof(*loc), MS_ASYNC);
     }
 }
 
@@ -1187,7 +1187,7 @@
              number);
         if (fix) {
             HashClear(&entry->hash);
-            msync_page(entry, sizeof(*entry), MS_ASYNC);
+            inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
         }
     }
 }
@@ -1327,7 +1327,7 @@
     } else {
         if (entry->flag != group->flag) {
             entry->flag = group->flag;
-            msync_page(entry, sizeof(*entry), MS_ASYNC);
+            inn_msync_page(entry, sizeof(*entry), MS_ASYNC);
         }
         tdx_data_audit(group->name, entry, fix);
     }



More information about the inn-committers mailing list