From e65b7d9afb0fe96a7e0d0ba200cb9abc4f37d4ea Mon Sep 17 00:00:00 2001 From: antoine Date: Sat, 30 Jan 2010 12:11:21 +0000 Subject: [PATCH 1/3] MFC r201145 to stable/8: (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument. Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) --- ggated/ggated.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggated/ggated.c b/ggated/ggated.c index 52d2428..3b2a0a5 100644 --- a/ggated/ggated.c +++ b/ggated/ggated.c @@ -99,8 +99,8 @@ static TAILQ_HEAD(, ggd_request) outqueue = TAILQ_HEAD_INITIALIZER(outqueue); pthread_mutex_t inqueue_mtx, outqueue_mtx; pthread_cond_t inqueue_cond, outqueue_cond; -static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(&exports); -static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(&connection); +static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(exports); +static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(connections); static void *recv_thread(void *arg); static void *disk_thread(void *arg); From 4ad0ef5e7ca9505e0cd2eefa46ee5b1d7b802bab Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 18 Apr 2010 20:23:08 +0000 Subject: [PATCH 2/3] MFC r204075: Style nits. --- ggated/ggated.c | 2 +- shared/ggate.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ggated/ggated.c b/ggated/ggated.c index 3b2a0a5..2997a9c 100644 --- a/ggated/ggated.c +++ b/ggated/ggated.c @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/shared/ggate.c b/shared/ggate.c index dd40790..cf9b9ca 100644 --- a/shared/ggate.c +++ b/shared/ggate.c @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -159,7 +159,7 @@ g_gate_sectorsize(int fd) g_gate_xlog("fstat(): %s.", strerror(errno)); if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1) { - g_gate_xlog("Can't get sector size: %s.", + g_gate_xlog("Can't get sector size: %s.", strerror(errno)); } } else if (S_ISREG(sb.st_mode)) { @@ -174,7 +174,7 @@ void g_gate_open_device(void) { - g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR, 0); + g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); if (g_gate_devfd == -1) err(EXIT_FAILURE, "open(/dev/%s)", G_GATE_CTL_NAME); } @@ -281,7 +281,7 @@ g_gate_socket_settings(int sfd) /* Socket settings. */ on = 1; if (nagle) { - if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, + if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == -1) { g_gate_xlog("setsockopt() error: %s.", strerror(errno)); } From e13cc14b9176ae98a9c3576d308b0cd80e27b7b9 Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 18 Apr 2010 21:14:49 +0000 Subject: [PATCH 3/3] MFC r204076,r204077,r204083,r205279: r204076: Please welcome HAST - Highly Avalable Storage. HAST allows to transparently store data on two physically separated machines connected over the TCP/IP network. HAST works in Primary-Secondary (Master-Backup, Master-Slave) configuration, which means that only one of the cluster nodes can be active at any given time. Only Primary node is able to handle I/O requests to HAST-managed devices. Currently HAST is limited to two cluster nodes in total. HAST operates on block level - it provides disk-like devices in /dev/hast/ directory for use by file systems and/or applications. Working on block level makes it transparent for file systems and applications. There in no difference between using HAST-provided device and raw disk, partition, etc. All of them are just regular GEOM providers in FreeBSD. For more information please consult hastd(8), hastctl(8) and hast.conf(5) manual pages, as well as http://wiki.FreeBSD.org/HAST. Sponsored by: FreeBSD Foundation Sponsored by: OMCnet Internet Service GmbH Sponsored by: TransIP BV r204077: Remove some lines left over by accident. r204083: Add missing KEYWORD line. Pointed out by: dougb r205279 sys: Simplify loops. --- ggatec/ggatec.c | 2 +- ggatel/ggatel.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ggatec/ggatec.c b/ggatec/ggatec.c index e421614..660bd8a 100644 --- a/ggatec/ggatec.c +++ b/ggatec/ggatec.c @@ -59,7 +59,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static const char *host = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; diff --git a/ggatel/ggatel.c b/ggatel/ggatel.c index 03979c3..6a3f26e 100644 --- a/ggatel/ggatel.c +++ b/ggatel/ggatel.c @@ -50,7 +50,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE;