Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1540037

[PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Jia He <hejianet@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32
Date Sun, 11 Dec 2016 16:40:01 +0100
Message-ID <sNeoh-OU-17@gated-at.bofh.it> (permalink)
References <sNeoh-OU-19@gated-at.bofh.it>
X-Original-To linux-nfs@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D8KPPQ3o/7EQpQj/c91vxVcAPcAj7BR67RSsp1r1LZA=; b=Pjp52SOvPNQJmY4s4TpDP5Bx/U3KPLmmBM0CdGc2M7aLqBy/uQaMR76D3eM9afxQq3 H3n57oCWV8HOxDDyQtdNN99UHIL0D6oaaP7lYFg0T8FVs+Q7WOPSZK/VsaBp+rj6/+Bc W6shDjZ9fpkmT8xAAZRnF5k9vLPIa23GY5Ttlv1AeRLLWRC35R96UUfFmLXXMlQfEfK3 /VVtVXOHWiNbtj5sW9GXx9ecVrVbSAQJur69OHPx4ihlYfRlPrPjeEpRwTzYN88YQUwJ ZH9W08Ks64txedC0XraxWG7c3nfpKGSqzv7HVvUfSyX0yasAzBsVF6pAfpyFLA3aiCLb 98yA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D8KPPQ3o/7EQpQj/c91vxVcAPcAj7BR67RSsp1r1LZA=; b=R5GB+3ASxIZeOMjf3fv6vqRTKW/Mb4j1mZw2pmtstjhxhqQI9SUzRHWYxW3hSutPBU XhIjLG0fkbT/Qbm1IPFKDJpcm0+UTN9M8MybqdzAD6Z34y3Dmw41IPdH7CPAs4FwPVaM Zw6sg1ZKXL+Ag05sVABACe7ViVhpvF0N325YuqN/gMtya5g0Twalg0Jttj6TQTTLqXHX 1oPBSxI1EKl39OuJ1v+rurlufQQzonO2J8v2+o6RflyqANd43EMHOZQ77z2NBsdGfR3Q f8pXkfuwXz8pysCTTYS2RqnDeQb6lmogFaDigbMGdp9sLdQjKgEZQOe9Sf60fHGTWqgn T+RQ==
X-Gm-Message-State AKaTC00IX3Co5Iam3OksThV4S3vaFtJlRboniOxqO0f7BtbeBCtSDD5Ok392oRQQVYR/3g==
X-Received by 10.55.154.200 with SMTP id c191mr77711041qke.117.1481470613088; Sun, 11 Dec 2016 07:36:53 -0800 (PST)
X-Mailer git-send-email 2.5.5
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 57
Organization linux.* mail to news gateway
X-Original-Cc "J. Bruce Fields" <bfields@fieldses.org>, Jeff Layton <jlayton@poochiereds.net>, Trond Myklebust <trond.myklebust@primarydata.com>, Anna Schumaker <anna.schumaker@netapp.com>, linux-kernel@vger.kernel.org, Jia He <hejianet@gmail.com>
X-Original-Date Sun, 11 Dec 2016 23:36:49 +0800
X-Original-Message-ID <1481470609-31488-2-git-send-email-hejianet@gmail.com>
X-Original-References <1481470609-31488-1-git-send-email-hejianet@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1540037

Show key headers only | View raw


nsm_use_hostnames is a module paramter and it will be exported to sysctl
procfs. This is to let user sometimes change it from userspace. But the
minimal unit for sysctl procfs read/write it sizeof(int).
In big endian system, the converting from/to  bool to/from int will cause
error for proc items.

This patch changes the type definition of nsm_use_hostnames.

V2: Changes extern type in lockd.h
Signed-off-by: Jia He <hejianet@gmail.com>
---
 fs/lockd/mon.c              | 2 +-
 fs/lockd/svc.c              | 2 +-
 include/linux/lockd/lockd.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 19166d4..3e7ff4d 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -57,7 +57,7 @@ static				DEFINE_SPINLOCK(nsm_lock);
  * Local NSM state
  */
 u32	__read_mostly		nsm_local_state;
-bool	__read_mostly		nsm_use_hostnames;
+u32	__read_mostly		nsm_use_hostnames;
 
 static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
 {
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index fc4084e..308033d 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -658,7 +658,7 @@ module_param_call(nlm_udpport, param_set_port, param_get_int,
 		  &nlm_udpport, 0644);
 module_param_call(nlm_tcpport, param_set_port, param_get_int,
 		  &nlm_tcpport, 0644);
-module_param(nsm_use_hostnames, bool, 0644);
+module_param(nsm_use_hostnames, u32, 0644);
 module_param(nlm_max_connections, uint, 0644);
 
 static int lockd_init_net(struct net *net)
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index c153738..db52152 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -196,7 +196,7 @@ extern struct svc_procedure	nlmsvc_procedures4[];
 #endif
 extern int			nlmsvc_grace_period;
 extern unsigned long		nlmsvc_timeout;
-extern bool			nsm_use_hostnames;
+extern u32			nsm_use_hostnames;
 extern u32			nsm_local_state;
 
 /*
-- 
2.5.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32 Jia He <hejianet@gmail.com> - 2016-12-11 16:40 +0100
  Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32 Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-12-11 18:50 +0100
    Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32 Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-12-11 19:10 +0100
    Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32 hejianet <hejianet@gmail.com> - 2016-12-12 03:50 +0100
  Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32 kbuild test robot <lkp@intel.com> - 2016-12-12 14:00 +0100

csiph-web