public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: pcaulfield@sourceware.org
To: lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvm.h daemons/ ...
Date: Mon, 09 Oct 2006 14:11:00 -0000	[thread overview]
Message-ID: <20061009141158.14822.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-10-09 14:11:57

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvm.h clvmd-cman.c clvmd-command.c 
	                 clvmd-comms.h clvmd-gulm.c clvmd.c 

Log message:
	Add clvmd call to return the cluster name.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.463&r2=1.464
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvm.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-cman.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-comms.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29

--- LVM2/WHATS_NEW	2006/10/08 12:01:12	1.463
+++ LVM2/WHATS_NEW	2006/10/09 14:11:57	1.464
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Add clvmd function to return the cluster name. not used by LVM yet.
   Add cling allocation policy.
   Change _check_contiguous() to use _for_each_pv().
   Extend _for_each_pv() to allow termination without error.
--- LVM2/daemons/clvmd/clvm.h	2006/10/04 08:22:16	1.3
+++ LVM2/daemons/clvmd/clvm.h	2006/10/09 14:11:57	1.4
@@ -65,5 +65,6 @@
 
 /* Misc functions */
 #define CLVMD_CMD_REFRESH	    40
+#define CLVMD_CMD_GET_CLUSTERNAME   41
 
 #endif
--- LVM2/daemons/clvmd/clvmd-cman.c	2006/10/06 10:06:10	1.15
+++ LVM2/daemons/clvmd/clvmd-cman.c	2006/10/09 14:11:57	1.16
@@ -471,6 +471,18 @@
 
 }
 
+static int _get_cluster_name(char *buf, int buflen)
+{
+	cman_cluster_t cluster_info;
+	int status;
+
+	status = cman_get_cluster(c_handle, &cluster_info);
+	if (!status) {
+		strncpy(buf, cluster_info.ci_name, buflen);
+	}
+	return status;
+}
+
 static struct cluster_ops _cluster_cman_ops = {
 	.cluster_init_completed   = _cluster_init_completed,
 	.cluster_send_message     = _cluster_send_message,
@@ -484,6 +496,7 @@
 	.get_our_csid             = _get_our_csid,
 	.add_up_node              = _add_up_node,
 	.cluster_closedown        = _cluster_closedown,
+	.get_cluster_name         = _get_cluster_name,
 	.sync_lock                = _sync_lock,
 	.sync_unlock              = _sync_unlock,
 };
--- LVM2/daemons/clvmd/clvmd-command.c	2006/10/05 13:55:50	1.10
+++ LVM2/daemons/clvmd/clvmd-command.c	2006/10/09 14:11:57	1.11
@@ -75,6 +75,8 @@
 #include "clvmd.h"
 #include "libdlm.h"
 
+extern struct cluster_ops *clops;
+
 /* This is where all the real work happens:
    NOTE: client will be NULL when this is executed on a remote node */
 int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
@@ -126,6 +128,12 @@
 		do_refresh_cache();
 		break;
 
+	case CLVMD_CMD_GET_CLUSTERNAME:
+		status = clops->get_cluster_name(*buf, buflen);
+		if (!status)
+			*retlen = strlen(*buf);
+		break;
+
 	default:
 		/* Won't get here because command is validated in pre_command */
 		break;
@@ -227,6 +235,7 @@
 		break;
 
 	case CLVMD_CMD_REFRESH:
+	case CLVMD_CMD_GET_CLUSTERNAME:
 		break;
 
 	default:
--- LVM2/daemons/clvmd/clvmd-comms.h	2006/03/15 08:36:11	1.5
+++ LVM2/daemons/clvmd/clvmd-comms.h	2006/10/09 14:11:57	1.6
@@ -43,6 +43,8 @@
 	void (*reread_config) (void);
 	void (*cluster_closedown) (void);
 
+	int (*get_cluster_name)(char *buf, int buflen);
+
 	int (*sync_lock) (const char *resource, int mode, int flags, int *lockid);
 	int (*sync_unlock) (const char *resource, int lockid);
 
--- LVM2/daemons/clvmd/clvmd-gulm.c	2005/11/10 08:49:29	1.18
+++ LVM2/daemons/clvmd/clvmd-gulm.c	2006/10/09 14:11:57	1.19
@@ -973,6 +973,12 @@
 	return gulm_cluster_send_message(buf, msglen, csid, errtext);
 }
 
+static int _get_cluster_name(char *buf, int buflen)
+{
+	strncpy(buf, cluster_name, buflen);
+	return 0;
+}
+
 static struct cluster_ops _cluster_gulm_ops = {
 	.cluster_init_completed   = NULL,
 	.cluster_send_message     = _cluster_send_message,
@@ -987,6 +993,7 @@
 	.add_up_node              = gulm_add_up_node,
 	.reread_config            = _reread_config,
 	.cluster_closedown        = _cluster_closedown,
+	.get_cluster_name         = _get_cluster_name,
 	.sync_lock                = _sync_lock,
 	.sync_unlock              = _sync_unlock,
 };
--- LVM2/daemons/clvmd/clvmd.c	2006/10/05 13:55:50	1.28
+++ LVM2/daemons/clvmd/clvmd.c	2006/10/09 14:11:57	1.29
@@ -67,7 +67,7 @@
 
 static unsigned short global_xid = 0;	/* Last transaction ID issued */
 
-static struct cluster_ops *clops = NULL;
+struct cluster_ops *clops = NULL;
 
 static char our_csid[MAX_CSID_LEN];
 static unsigned max_csid_len;


             reply	other threads:[~2006-10-09 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 14:11 pcaulfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-12 20:42 agk
2010-04-20 14:07 ccaulfield
2009-05-19 10:39 mbroz
2007-12-04 15:39 pcaulfield
2005-01-21 11:36 pcaulfield

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=20061009141158.14822.qmail@sourceware.org \
    --to=pcaulfield@sourceware.org \
    --cc=lvm2-cvs@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 read-only IMAP folder(s) and NNTP newsgroup(s).