From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/qdisk disk.c main.c mkqdisk.c
Date: 4 Dec 2007 21:09:17 -0000 [thread overview]
Message-ID: <20071204210917.23391.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-12-04 21:09:17
Modified files:
cman/qdisk : disk.c main.c mkqdisk.c
Log message:
Changes per fabbione's comments
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/disk.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.4.2&r2=1.4.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.8&r2=1.4.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/mkqdisk.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.4.2&r2=1.3.4.3
--- cluster/cman/qdisk/disk.c 2007/12/04 20:24:43 1.4.4.2
+++ cluster/cman/qdisk/disk.c 2007/12/04 21:09:17 1.4.4.3
@@ -225,13 +225,11 @@
if (disk->d_fd < 0)
return disk->d_fd;
- disk->d_blksz = 512;
ret = ioctl(disk->d_fd, BLKSSZGET, &ssz);
- if (ret < 0)
+ if (ret < 0) {
perror("qdisk_open: ioctl(BLKSSZGET)");
- else
- /* Sorry, no sector sizes >4GB please */
- disk->d_blksz = (uint32_t)ssz;
+ return -1;
+ }
disk->d_pagesz = sysconf(_SC_PAGESIZE);
--- cluster/cman/qdisk/main.c 2007/12/04 20:26:51 1.4.2.8
+++ cluster/cman/qdisk/main.c 2007/12/04 21:09:17 1.4.2.9
@@ -454,10 +454,6 @@
quorum_init(qd_ctx *ctx, node_info_t *ni, int max, struct h_data *h, int maxh)
{
int x = 0, score, maxscore, score_req;
- char buf[64];
-#if 0
- struct sockaddr_un sun;
-#endif
clulog(LOG_INFO, "Quorum Daemon Initializing\n");
@@ -474,20 +470,6 @@
return -1;
}
- if (strlen(ctx->qc_device) > 15 && !(ctx->qc_flags & RF_CMAN_LABEL)) {
- if (ctx->qc_label && strlen(ctx->qc_label) <= 15) {
- ctx->qc_cman_label = strdup(ctx->qc_label);
- } else {
- snprintf(buf, sizeof(buf), "QDisk[%d]",
- (int)strlen(ctx->qc_device));
- ctx->qc_cman_label = strdup(buf);
- }
-
- ctx->qc_flags |= RF_CMAN_LABEL;
- clulog(LOG_DEBUG, "Device too long! Setting CMAN label to: %s\n",
- ctx->qc_cman_label);
- }
-
clulog(LOG_DEBUG, "I/O Size: %d Page Size: %d\n",
ctx->qc_disk.d_blksz, ctx->qc_disk.d_pagesz);
@@ -1301,7 +1283,7 @@
/* Get cman_label */
snprintf(query, sizeof(query), "/cluster/quorumd/@cman_label");
if (ccs_get(ccsfd, query, &val) == 0) {
- if (strlen(val) > 0 && strlen(val) <= 15) {
+ if (strlen(val) > 0) {
ctx->qc_flags |= RF_CMAN_LABEL;
ctx->qc_cman_label = val;
}
@@ -1406,9 +1388,6 @@
{
cman_node_t me;
int cfh, rv, forked = 0, nfd = -1, ret = -1;
-#if 0
- int status_run = 0;
-#endif
qd_ctx ctx;
cman_handle_t ch = NULL;
node_info_t ni[MAX_NODES_DISK];
@@ -1443,10 +1422,6 @@
dup2(nfd, 2);
close(nfd);
break;
-#if 0
- case 's':
- status_run = 1;
-#endif
default:
break;
}
--- cluster/cman/qdisk/mkqdisk.c 2007/12/04 20:24:43 1.3.4.2
+++ cluster/cman/qdisk/mkqdisk.c 2007/12/04 21:09:17 1.3.4.3
@@ -37,26 +37,26 @@
{
char device[128];
char *newdev = NULL, *newlabel = NULL;
- int rv, debug_level = 1;
+ int rv, verbose_level = 1;
printf("mkqdisk v0.5.2\n");
while ((rv = getopt(argc, argv, "Ldf:c:l:h")) != EOF) {
switch (rv) {
case 'd':
- ++debug_level;
+ ++verbose_level;
break;
case 'L':
/* List */
close(2);
return find_partitions("/proc/partitions",
- NULL, NULL, 0, debug_level);
+ NULL, NULL, 0, verbose_level);
break;
case 'f':
close(2);
return find_partitions("/proc/partitions",
optarg, device,
- sizeof(device), debug_level);
+ sizeof(device), verbose_level);
case 'c':
newdev = optarg;
break;
reply other threads:[~2007-12-04 21:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20071204210917.23391.qmail@sourceware.org \
--to=lhh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.