cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm 1/3] dlm_controld: add support for unsigned int values
Date: Tue, 16 Jun 2020 13:07:11 -0400	[thread overview]
Message-ID: <20200616170713.32210-2-aahringo@redhat.com> (raw)
In-Reply-To: <20200616170713.32210-1-aahringo@redhat.com>

This patch adds support for setting a unsigned integer value.
---
 dlm_controld/dlm_daemon.h | 4 ++++
 dlm_controld/main.c       | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 5b9a52da..9fe56df2 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -86,6 +86,7 @@ enum {
         req_arg_bool = 1,
         req_arg_int = 2,
         req_arg_str = 3,
+        req_arg_uint = 4,
 };
 
 enum {
@@ -125,6 +126,7 @@ struct dlm_option {
 
 	int use_int;
 	char *use_str;
+	unsigned int use_uint;
 
 	int default_int;
 	const char *default_str;
@@ -132,6 +134,7 @@ struct dlm_option {
 	int cli_set;
 	int cli_int;
 	char *cli_str;
+	unsigned int cli_uint;
 
 	int file_set;
 	int file_int;
@@ -141,6 +144,7 @@ struct dlm_option {
 EXTERN struct dlm_option dlm_options[dlm_options_max];
 #define opt(x) dlm_options[x].use_int
 #define opts(x) dlm_options[x].use_str
+#define optu(x) dlm_options[x].use_uint
 
 
 /* DLM_LOCKSPACE_LEN: maximum lockspace name length, from linux/dlmconstants.h.
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 8be6a4bc..b4f4ffb8 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1972,6 +1972,9 @@ static void set_opt_cli(int argc, char **argv)
 		} else if (o->req_arg == req_arg_bool) {
 			o->cli_int = atoi(arg_str) ? 1 : 0;
 			o->use_int = o->cli_int;
+		} else if (o->req_arg == req_arg_uint) {
+			o->cli_uint = strtoul(arg_str, NULL, 0);
+			o->use_uint = o->cli_uint;
 		}
 	}
 
-- 
2.26.2



  reply	other threads:[~2020-06-16 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 17:07 [Cluster-devel] [PATCH dlm 0/3] dlm_controld: add support for mark per node configuration Alexander Aring
2020-06-16 17:07 ` Alexander Aring [this message]
2020-06-16 17:07 ` [Cluster-devel] [PATCH dlm 2/3] dlm_controld: set listen skb mark setting Alexander Aring
2020-06-16 17:07 ` [Cluster-devel] [PATCH dlm 3/3] dlm_controld: add support for per nodeid configuration Alexander Aring
2020-06-24 15:36   ` Alexander Ahring Oder Aring

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=20200616170713.32210-2-aahringo@redhat.com \
    --to=aahringo@redhat.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).