Commit eb18860e authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

NLM: NLM protocol version numbers are u32

Clean up: RPC protocol version numbers are u32.  Make sure we use an
appropriate type for NLM version numbers when calling nlm_lookup_host().

Eliminates a harmless mixed sign comparison in nlm_host_lookup().
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 90d5b180
...@@ -42,11 +42,12 @@ static struct nsm_handle * nsm_find(const struct sockaddr_in *sin, ...@@ -42,11 +42,12 @@ static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
/* /*
* Common host lookup routine for server & client * Common host lookup routine for server & client
*/ */
static struct nlm_host * static struct nlm_host *nlm_lookup_host(int server,
nlm_lookup_host(int server, const struct sockaddr_in *sin, const struct sockaddr_in *sin,
int proto, int version, const char *hostname, int proto, u32 version,
unsigned int hostname_len, const char *hostname,
const struct sockaddr_in *ssin) unsigned int hostname_len,
const struct sockaddr_in *ssin)
{ {
struct hlist_head *chain; struct hlist_head *chain;
struct hlist_node *pos; struct hlist_node *pos;
...@@ -55,7 +56,7 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin, ...@@ -55,7 +56,7 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin,
int hash; int hash;
dprintk("lockd: nlm_lookup_host("NIPQUAD_FMT"->"NIPQUAD_FMT dprintk("lockd: nlm_lookup_host("NIPQUAD_FMT"->"NIPQUAD_FMT
", p=%d, v=%d, my role=%s, name=%.*s)\n", ", p=%d, v=%u, my role=%s, name=%.*s)\n",
NIPQUAD(ssin->sin_addr.s_addr), NIPQUAD(ssin->sin_addr.s_addr),
NIPQUAD(sin->sin_addr.s_addr), proto, version, NIPQUAD(sin->sin_addr.s_addr), proto, version,
server? "server" : "client", server? "server" : "client",
...@@ -175,9 +176,10 @@ nlm_destroy_host(struct nlm_host *host) ...@@ -175,9 +176,10 @@ nlm_destroy_host(struct nlm_host *host)
/* /*
* Find an NLM server handle in the cache. If there is none, create it. * Find an NLM server handle in the cache. If there is none, create it.
*/ */
struct nlm_host * struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin,
nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version, int proto, u32 version,
const char *hostname, unsigned int hostname_len) const char *hostname,
unsigned int hostname_len)
{ {
struct sockaddr_in ssin = {0}; struct sockaddr_in ssin = {0};
......
...@@ -173,8 +173,10 @@ void nlmclnt_next_cookie(struct nlm_cookie *); ...@@ -173,8 +173,10 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
/* /*
* Host cache * Host cache
*/ */
struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *, int, int, struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin,
const char *, unsigned int); int proto, u32 version,
const char *hostname,
unsigned int hostname_len);
struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *, struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *,
unsigned int); unsigned int);
struct rpc_clnt * nlm_bind_host(struct nlm_host *); struct rpc_clnt * nlm_bind_host(struct nlm_host *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment