INN commit: branches/2.4 (5 files)
INN Commit
Russ_Allbery at isc.org
Fri Feb 9 02:40:52 UTC 2007
Date: Thursday, February 8, 2007 @ 18:40:51
Author: eagle
Revision: 7598
Rename mapcntl to inn_mapcntl and avoid having the function and the
wrapper define have the same name. It looks like at least some compilers
don't like this (and reasonably so).
Modified:
branches/2.4/include/inn/mmap.h
branches/2.4/lib/dbz.c
branches/2.4/lib/mmap.c
branches/2.4/storage/tradindexed/tdx-data.c
branches/2.4/storage/tradindexed/tdx-group.c
---------------------------------+
include/inn/mmap.h | 12 +++++++-----
lib/dbz.c | 2 +-
lib/mmap.c | 2 +-
storage/tradindexed/tdx-data.c | 2 +-
storage/tradindexed/tdx-group.c | 36 ++++++++++++++++++------------------
5 files changed, 28 insertions(+), 26 deletions(-)
Modified: include/inn/mmap.h
===================================================================
--- include/inn/mmap.h 2007-01-16 23:11:05 UTC (rev 7597)
+++ include/inn/mmap.h 2007-02-09 02:40:51 UTC (rev 7598)
@@ -14,16 +14,18 @@
BEGIN_DECLS
-/* Figure out what page an address is in and flush those pages
- */
-void mapcntl(void *, size_t, int);
+/* Figure out what page an address is in and flush those pages. This is the
+ internal function, which we wrap with a define below. */
+void inn__mapcntl(void *, size_t, int);
/* Some platforms only support two arguments to msync. On those platforms,
make the third argument to mapcntl 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 mapcntl(p, l, f) mapcntl((p), (l), 0)
+#ifdef INN_HAVE_MSYNC_3_ARG
+# define inn_mapcntl inn__mapcntl
+#else
+# define inn_mapcntl(p, l, f) inn__mapcntl((p), (l), 0)
#endif
END_DECLS
Modified: lib/dbz.c
===================================================================
--- lib/dbz.c 2007-01-16 23:11:05 UTC (rev 7597)
+++ lib/dbz.c 2007-02-09 02:40:51 UTC (rev 7598)
@@ -1540,7 +1540,7 @@
debug("set: incore");
if (tab->incore == INCORE_MMAP) {
if (innconf->nfswriter) {
- mapcntl(where, tab->reclen, MS_ASYNC);
+ inn_mapcntl(where, tab->reclen, MS_ASYNC);
}
return true;
}
Modified: lib/mmap.c
===================================================================
--- lib/mmap.c 2007-01-16 23:11:05 UTC (rev 7597)
+++ lib/mmap.c 2007-02-09 02:40:51 UTC (rev 7598)
@@ -18,7 +18,7 @@
** Figure out what page an address is in and flush those pages
*/
void
-mapcntl(void *p, size_t length, int flags)
+inn__mapcntl(void *p, size_t length, int flags)
{
int pagesize;
Modified: storage/tradindexed/tdx-data.c
===================================================================
--- storage/tradindexed/tdx-data.c 2007-01-16 23:11:05 UTC (rev 7597)
+++ storage/tradindexed/tdx-data.c 2007-02-09 02:40:51 UTC (rev 7598)
@@ -1083,7 +1083,7 @@
/* All done. Close things down and flush the data we changed, if
necessary. */
if (changed)
- mapcntl(index, sizeof(*index), MS_ASYNC);
+ inn_mapcntl(index, sizeof(*index), MS_ASYNC);
end:
tdx_data_close(data);
Modified: storage/tradindexed/tdx-group.c
===================================================================
--- storage/tradindexed/tdx-group.c 2007-01-16 23:11:05 UTC (rev 7597)
+++ storage/tradindexed/tdx-group.c 2007-02-09 02:40:51 UTC (rev 7598)
@@ -380,7 +380,7 @@
index->header->freelist.recno = i;
}
- mapcntl(index->header, index_file_size(index->count), MS_ASYNC);
+ inn_mapcntl(index->header, index_file_size(index->count), MS_ASYNC);
return true;
}
@@ -459,7 +459,7 @@
{
*parent = entry->next.recno;
entry->next.recno = -1;
- mapcntl(parent, sizeof(*parent), MS_ASYNC);
+ inn_mapcntl(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);
- mapcntl(&index->header->hash[bucket], sizeof(struct loc), MS_ASYNC);
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(&index->header->hash[bucket], sizeof(struct loc), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
}
@@ -529,8 +529,8 @@
{
entry->next.recno = index->header->freelist.recno;
index->header->freelist.recno = entry_loc(index, entry);
- mapcntl(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
}
@@ -600,7 +600,7 @@
return NULL;
entry = index->entries + loc;
if (innconf->tradindexedmmap && innconf->nfsreader)
- mapcntl(entry, sizeof *entry, MS_INVALIDATE);
+ inn_mapcntl(entry, sizeof *entry, MS_INVALIDATE);
return entry;
}
@@ -630,7 +630,7 @@
entry = &index->entries[loc];
if (entry->flag != *flag) {
entry->flag = *flag;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(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;
- mapcntl(&index->header->freelist, sizeof(struct loc), MS_ASYNC);
+ inn_mapcntl(&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;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
if (!tdx_data_pack_finish(data)) {
entry->base = old_base;
entry->indexinode = old_inode;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
goto fail;
}
}
@@ -839,7 +839,7 @@
if (entry->high < article->number)
entry->high = article->number;
entry->count++;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(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;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(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;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
tdx_data_close(data);
if (!tdx_data_rebuild_finish(group)) {
entry->base = old_base;
entry->indexinode = old_inode;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
goto fail;
}
@@ -1169,7 +1169,7 @@
if (fix && error) {
*loc = -1;
- mapcntl(loc, sizeof(*loc), MS_ASYNC);
+ inn_mapcntl(loc, sizeof(*loc), MS_ASYNC);
}
}
@@ -1187,7 +1187,7 @@
number);
if (fix) {
HashClear(&entry->hash);
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
}
}
}
@@ -1327,7 +1327,7 @@
} else {
if (entry->flag != group->flag) {
entry->flag = group->flag;
- mapcntl(entry, sizeof(*entry), MS_ASYNC);
+ inn_mapcntl(entry, sizeof(*entry), MS_ASYNC);
}
tdx_data_audit(group->name, entry, fix);
}
More information about the inn-committers
mailing list