ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: Tristan Ye <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 3/6] O2info: Add '--cluster-coherent' option for o2info.
Date: Mon, 25 Oct 2010 19:09:47 +0800	[thread overview]
Message-ID: <1288004990-20076-4-git-send-email-tristan.ye@oracle.com> (raw)
In-Reply-To: <1288004990-20076-1-git-send-email-tristan.ye@oracle.com>

Default will be no cluster-in-coherency.

Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
---
 o2info/o2info.1.in |    6 +++++-
 o2info/o2info.c    |   22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/o2info/o2info.1.in b/o2info/o2info.1.in
index fe32d70..d748df8 100644
--- a/o2info/o2info.1.in
+++ b/o2info/o2info.1.in
@@ -2,7 +2,7 @@
 .SH "NAME"
 o2info \- Dump \fIOCFS2\fR file system information on disk.
 .SH "SYNOPSIS"
-\fBo2info\fR <\fBdevice or file\fR>
+\fBo2info\fR [\fB\-C|\-\-cluster\-coherent\fR] <\fBdevice or file\fR>
 
 .SH "DESCRIPTION"
 .PP
@@ -10,6 +10,10 @@ o2info \- Dump \fIOCFS2\fR file system information on disk.
 
 .SH "OPTIONS"
 .TP
+\fB\-C, \-\-cluster\-coherent\fR
+Enable cluster (in)coherency for mounted case, means it will attempt to acquire a global PR lock when querying info from a cluster filesystem, which may degrade the performance, default is none cluster-coherency.
+
+.TP
 \fB\-V, \-\-version\fR
 Show version and exit.
 
diff --git a/o2info/o2info.c b/o2info/o2info.c
index 02058af..3fa4627 100644
--- a/o2info/o2info.c
+++ b/o2info/o2info.c
@@ -51,6 +51,13 @@ static int version_handler(struct o2info_option *opt, char *arg)
 	exit(0);
 }
 
+static int coherency_handler(struct o2info_option *opt, char *arg)
+{
+	cluster_coherent = 1;
+
+	return 0;
+}
+
 static struct o2info_option help_option = {
 	.opt_option	= {
 		.name		= "help",
@@ -77,9 +84,24 @@ static struct o2info_option version_option = {
 	.opt_private = NULL,
 };
 
+static struct o2info_option coherency_option = {
+	.opt_option	= {
+		.name		= "cluster-coherent",
+		.val		= 'C',
+		.has_arg	= 0,
+		.flag		= NULL,
+	},
+	.opt_help	=
+		"-C|--cluster-coherent",
+	.opt_handler	= coherency_handler,
+	.opt_op		= NULL,
+	.opt_private = NULL,
+};
+
 static struct o2info_option *options[] = {
 	&help_option,
 	&version_option,
+	&coherency_option,
 	NULL,
 };
 
-- 
1.5.5

  parent reply	other threads:[~2010-10-25 11:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 11:09 [Ocfs2-devel] [PATCH 0/6] Ocfs2-tools: Add a new tool 'o2info' Tristan Ye
2010-10-25 11:09 ` [Ocfs2-devel] [PATCH 1/6] O2info: Add all structures and commands OCFS2_IOC_INFO needed into ocfs2_ioctl.h Tristan Ye
2010-10-25 11:09 ` [Ocfs2-devel] [PATCH 2/6] O2info: Build a main framework for o2info Tristan Ye
2010-10-25 11:09 ` Tristan Ye [this message]
2010-10-25 11:09 ` [Ocfs2-devel] [PATCH 4/6] O2info: Add running codes for '--fs-features' Tristan Ye
2010-10-25 11:09 ` [Ocfs2-devel] [PATCH 5/6] O2info: Add running codes for '--volinfo' Tristan Ye
2010-10-25 11:09 ` [Ocfs2-devel] [PATCH 6/6] O2info: Add --mkfs support for o2info Tristan Ye
2010-10-25 11:28 ` [Ocfs2-devel] [PATCH 0/6] Ocfs2-tools: Add a new tool 'o2info' tristan

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=1288004990-20076-4-git-send-email-tristan.ye@oracle.com \
    --to=tristan.ye@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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).