From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cmirror/src cluster.c functions.c loca ...
Date: 18 Jan 2008 17:11:10 -0000 [thread overview]
Message-ID: <20080118171110.31118.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow at sourceware.org 2008-01-18 17:11:07
Modified files:
cmirror/src : cluster.c functions.c local.c logging.h
rbtree.c
Log message:
- fix compile problems on x86_64
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/cluster.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.8&r2=1.1.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/functions.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.8&r2=1.1.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/local.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.7&r2=1.1.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/logging.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/rbtree.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4
--- cluster/cmirror/src/Attic/cluster.c 2008/01/14 22:52:17 1.1.2.8
+++ cluster/cmirror/src/Attic/cluster.c 2008/01/18 17:11:07 1.1.2.9
@@ -165,7 +165,7 @@
LOG_DBG("Sending response to %u on cluster: [%s/%llu]",
tfr->originator,
RQ_TYPE(tfr->request_type & ~DM_CLOG_RESPONSE),
- tfr->seq);
+ (unsigned long long)tfr->seq);
r = cluster_send(tfr);
if (r)
LOG_ERROR("cluster_send failed");
@@ -624,10 +624,11 @@
LOG_DBG("Response to %u from %u recieved [%s/%llu]",
tfr->originator, nodeid,
RQ_TYPE(tfr->request_type & ~DM_CLOG_RESPONSE),
- tfr->seq);
+ (unsigned long long)tfr->seq);
else
LOG_DBG("Request from %u recieved [%s/%llu]",
- nodeid, RQ_TYPE(tfr->request_type), tfr->seq);
+ nodeid, RQ_TYPE(tfr->request_type),
+ (unsigned long long)tfr->seq);
if (my_cluster_id == 0xDEAD) {
LOG_DBG("Message before init... ignoring.\n");
@@ -757,8 +758,8 @@
LOG_PRINT("*****************************************");
list_for_each_entry_safe(match, tmp, &clog_cpg_list, list) {
- LOG_DBG("Given handle: %llu", handle);
- LOG_DBG(" hanlde: %llu", match->handle);
+ LOG_DBG("Given handle: %llu", (unsigned long long)handle);
+ LOG_DBG(" hanlde: %llu", (unsigned long long)match->handle);
LOG_DBG("Given name : %s", gname->value);
LOG_DBG(" name : %s", match->name.value);
if (match->handle == handle) {
@@ -928,7 +929,7 @@
}
list_add(&new->list, &clog_cpg_list);
- LOG_DBG("New handle: %llu", new->handle);
+ LOG_DBG("New handle: %llu", (unsigned long long)new->handle);
LOG_DBG("New name: %s", new->name.value);
/* FIXME: better variable */
--- cluster/cmirror/src/Attic/functions.c 2008/01/15 22:01:18 1.1.2.8
+++ cluster/cmirror/src/Attic/functions.c 2008/01/18 17:11:07 1.1.2.9
@@ -245,7 +245,8 @@
LOG_ERROR(" magic : %x (expected: %x)",
lh.magic, MIRROR_MAGIC);
LOG_ERROR(" version : %u", lh.version);
- LOG_ERROR(" nr_regions: %llu", lh.nr_regions);
+ LOG_ERROR(" nr_regions: %llu",
+ (unsigned long long)lh.nr_regions);
LOG_ERROR("*** %s ***", strerror(EINVAL));
return -EINVAL;
}
@@ -569,8 +570,9 @@
if (strlen(tfr->data) != tfr->data_size) {
LOG_ERROR("Received constructor request with bad data");
LOG_DBG("strlen(tfr->data)[%d] != tfr->data_size[%d]",
- strlen(tfr->data), tfr->data_size);
- LOG_DBG("tfr->data = '%s' [%d]", tfr->data, strlen(tfr->data));
+ (int)strlen(tfr->data), tfr->data_size);
+ LOG_DBG("tfr->data = '%s' [%d]",
+ tfr->data, (int)strlen(tfr->data));
return -EINVAL;
}
@@ -746,7 +748,8 @@
lc->resume_override = 1000;
lc->sync_count = count_bits32(lc->clean_bits, lc->bitset_uint32_count);
LOG_DBG("[%s] Initial sync_count = %llu",
- SHORT_UUID(lc->uuid), lc->sync_count);
+ SHORT_UUID(lc->uuid),
+ (unsigned long long)lc->sync_count);
goto out;
default:
LOG_ERROR("Error:: multiple loading of bits (%d)", lc->resume_override);
@@ -796,7 +799,7 @@
memcpy(lc->sync_bits, lc->clean_bits, size);
lc->sync_count = count_bits32(lc->clean_bits, lc->bitset_uint32_count);
LOG_DBG("[%s] Initial sync_count = %llu",
- SHORT_UUID(lc->uuid), lc->sync_count);
+ SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count);
lc->sync_search = 0;
/*
@@ -919,10 +922,10 @@
*rtn = log_test_bit(lc->sync_bits, region);
if (*rtn)
LOG_DBG("[%s] Region is in-sync: %llu",
- SHORT_UUID(lc->uuid), region);
+ SHORT_UUID(lc->uuid), (unsigned long long)region);
else
LOG_DBG("[%s] Region is not in-sync: %llu",
- SHORT_UUID(lc->uuid), region);
+ SHORT_UUID(lc->uuid), (unsigned long long)region);
tfr->data_size = sizeof(*rtn);
@@ -987,7 +990,7 @@
new = rbt_alloc_node(&lc->mark_tree);
if (!new) {
LOG_ERROR("Unable to allocate space for mark_entry: %llu/%u",
- region, who);
+ (unsigned long long)region, who);
return -ENOMEM;
}
@@ -1047,7 +1050,7 @@
mark_list = rbt_search_plus(&lc->mark_tree, ®ion, srsm_count, &who);
if (!mark_list || !srsm_count_var) {
LOG_DBG("[%s] Clear issued by %u on region not marked: %llu",
- SHORT_UUID(lc->uuid), who, region);
+ SHORT_UUID(lc->uuid), who, (unsigned long long)region);
goto set_bit;
}
@@ -1142,8 +1145,9 @@
}
if (lc->recovering_region != (uint64_t)-1) {
- LOG_DBG("[%s] Someone is already recovering region %Lu",
- SHORT_UUID(lc->uuid), lc->recovering_region);
+ LOG_DBG("[%s] Someone is already recovering region %llu",
+ SHORT_UUID(lc->uuid),
+ (unsigned long long)lc->recovering_region);
pkg->i = 0;
return 0;
}
@@ -1159,13 +1163,14 @@
if (!log_test_bit(lc->sync_bits, pkg->r)) {
LOG_DBG("[%s] Assigning priority resync work to %u: %llu",
- SHORT_UUID(lc->uuid), tfr->originator, pkg->r);
+ SHORT_UUID(lc->uuid), tfr->originator,
+ (unsigned long long)pkg->r);
#ifdef DEBUG
LOG_DBG("[%s] Priority work remaining:",
SHORT_UUID(lc->uuid));
for (del = lc->recovery_request_list; del; del = del->next)
LOG_DBG("[%s] %llu", SHORT_UUID(lc->uuid),
- del->region);
+ (unsigned long long)del->region);
#endif
pkg->i = 1;
lc->recovering_region = pkg->r;
@@ -1185,7 +1190,8 @@
lc->sync_search = pkg->r + 1;
LOG_DBG("[%s] Assigning resync work to %u: region = %llu\n",
- SHORT_UUID(lc->uuid), tfr->originator, pkg->r);
+ SHORT_UUID(lc->uuid), tfr->originator,
+ (unsigned long long)pkg->r);
pkg->i = 1;
lc->recovering_region = pkg->r;
return 0;
@@ -1208,20 +1214,20 @@
if (pkg->in_sync) {
if (log_test_bit(lc->sync_bits, pkg->region)) {
LOG_PRINT(" Region already in-sync: %llu",
- pkg->region);
+ (unsigned long long)pkg->region);
} else {
log_set_bit(lc, lc->sync_bits, pkg->region);
lc->sync_count++;
LOG_DBG("[%s] sync_count = %llu, Region %llu marked in-sync by %u",
- SHORT_UUID(lc->uuid), lc->sync_count,
- pkg->region, tfr->originator);
+ SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count,
+ (unsigned long long)pkg->region, tfr->originator);
}
} else if (log_test_bit(lc->sync_bits, pkg->region)) {
lc->sync_count--;
log_clear_bit(lc, lc->sync_bits, pkg->region);
LOG_DBG("[%s] sync_count = %llu, Region %llu marked not in-sync by %u",
- SHORT_UUID(lc->uuid), lc->sync_count,
- pkg->region, tfr->originator);
+ SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count,
+ (unsigned long long)pkg->region, tfr->originator);
}
tfr->data_size = 0;
@@ -1368,7 +1374,7 @@
if (lc->recovery_halted) {
LOG_DBG("[%s] Recovery halted... [not remote recovering]: %llu",
- SHORT_UUID(lc->uuid), region);
+ SHORT_UUID(lc->uuid), (unsigned long long)region);
*rtn = 0;
} else {
*rtn = !log_test_bit(lc->sync_bits, region);
@@ -1377,7 +1383,7 @@
(region == lc->recovering_region) ?
"currently remote recovering" :
(*rtn) ? "pending remote recovery" :
- "not remote recovering", region);
+ "not remote recovering", (unsigned long long)region);
}
if (*rtn && (region != lc->recovering_region)) {
@@ -1394,7 +1400,7 @@
goto out;
LOG_DBG("[%s] Adding region to priority list: %llu",
- SHORT_UUID(lc->uuid), region);
+ SHORT_UUID(lc->uuid), (unsigned long long)region);
rr->region = region;
rr->next = lc->recovery_request_list;
lc->recovery_request_list = rr;
--- cluster/cmirror/src/Attic/local.c 2008/01/15 22:01:18 1.1.2.7
+++ cluster/cmirror/src/Attic/local.c 2008/01/18 17:11:07 1.1.2.8
@@ -152,7 +152,8 @@
return r;
LOG_DBG("Request from kernel recieved [%s/%s/%llu]",
- RQ_TYPE(tfr->request_type), SHORT_UUID(tfr->uuid), tfr->seq);
+ RQ_TYPE(tfr->request_type), SHORT_UUID(tfr->uuid),
+ (unsigned long long)tfr->seq);
switch (tfr->request_type) {
case DM_CLOG_CTR:
case DM_CLOG_DTR:
--- cluster/cmirror/src/Attic/logging.h 2008/01/14 22:52:17 1.1.2.3
+++ cluster/cmirror/src/Attic/logging.h 2008/01/18 17:11:07 1.1.2.4
@@ -4,6 +4,30 @@
#include <stdio.h>
#include <syslog.h>
+#if (BITS_PER_LONG == 64)
+#define PRIu64 "lu"
+#define PRId64 "ld"
+#define PRIo64 "lo"
+#define PRIx64 "lx"
+#define PRIX64 "lX"
+#define SCNu64 "lu"
+#define SCNd64 "ld"
+#define SCNo64 "lo"
+#define SCNx64 "lx"
+#define SCNX64 "lX"
+#else
+#define PRIu64 "Lu"
+#define PRId64 "Ld"
+#define PRIo64 "Lo"
+#define PRIx64 "Lx"
+#define PRIX64 "LX"
+#define SCNu64 "Lu"
+#define SCNd64 "Ld"
+#define SCNo64 "Lo"
+#define SCNx64 "Lx"
+#define SCNX64 "LX"
+#endif
+
/* SHORT_UUID - print last 8 chars of a string */
#define SHORT_UUID(x) ((x) + (strlen(x) - 8))
--- cluster/cmirror/src/Attic/rbtree.c 2008/01/14 22:52:17 1.1.2.3
+++ cluster/cmirror/src/Attic/rbtree.c 2008/01/18 17:11:07 1.1.2.4
@@ -57,7 +57,7 @@
}
LOG_DBG("TREE[0x%p]: left_rotate [axis = %llu]",
- t, *((uint64_t *)KEY(axis)));
+ t, (unsigned long long)*((uint64_t *)KEY(axis)));
tmp = RIGHT(axis);
RIGHT(axis) = LEFT(tmp);
if (LEFT(tmp) != NIL(t))
@@ -87,7 +87,7 @@
}
LOG_DBG("TREE[0x%p]: right_rotate [axis = %llu]",
- t, *((uint64_t *)KEY(axis)));
+ t, (unsigned long long)*((uint64_t *)KEY(axis)));
tmp = LEFT(axis);
LEFT(axis) = RIGHT(tmp);
if (RIGHT(tmp) != NIL(t))
@@ -179,7 +179,7 @@
struct rb_node *tmp;
LOG_DBG("TREE[0x%p]: inserting %llu",
- t, *((uint64_t *)KEY(new)));
+ t, (unsigned long long)*((uint64_t *)KEY(new)));
if (!t || !new) {
errno = EINVAL;
return -1;
@@ -320,7 +320,7 @@
struct rb_node *x, *y;
LOG_DBG("TREE[0x%p]: removing %llu",
- t, *((uint64_t *)KEY(del)));
+ t, (unsigned long long)*((uint64_t *)KEY(del)));
if ((LEFT(del) == NIL(t)) || (RIGHT(del) == NIL(t)))
y = del;
else
next reply other threads:[~2008-01-18 17:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 17:11 jbrassow [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-02-04 18:27 [Cluster-devel] cluster/cmirror/src cluster.c functions.c loca jbrassow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080118171110.31118.qmail@sourceware.org \
--to=jbrassow@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).