diff options
Diffstat (limited to 'fs/lockd/mon.c')
-rw-r--r-- | fs/lockd/mon.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 3fc683f46b3e..5954dcb497e4 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -109,30 +109,23 @@ nsm_unmonitor(struct nlm_host *host) | |||
109 | static struct rpc_clnt * | 109 | static struct rpc_clnt * |
110 | nsm_create(void) | 110 | nsm_create(void) |
111 | { | 111 | { |
112 | struct rpc_xprt *xprt; | 112 | struct sockaddr_in sin = { |
113 | struct rpc_clnt *clnt; | 113 | .sin_family = AF_INET, |
114 | struct sockaddr_in sin; | 114 | .sin_addr.s_addr = htonl(INADDR_LOOPBACK), |
115 | 115 | .sin_port = 0, | |
116 | sin.sin_family = AF_INET; | 116 | }; |
117 | sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); | 117 | struct rpc_create_args args = { |
118 | sin.sin_port = 0; | 118 | .protocol = IPPROTO_UDP, |
119 | 119 | .address = (struct sockaddr *)&sin, | |
120 | xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL); | 120 | .addrsize = sizeof(sin), |
121 | if (IS_ERR(xprt)) | 121 | .servername = "localhost", |
122 | return (struct rpc_clnt *)xprt; | 122 | .program = &nsm_program, |
123 | xprt->resvport = 1; /* NSM requires a reserved port */ | 123 | .version = SM_VERSION, |
124 | 124 | .authflavor = RPC_AUTH_NULL, | |
125 | clnt = rpc_create_client(xprt, "localhost", | 125 | .flags = (RPC_CLNT_CREATE_ONESHOT), |
126 | &nsm_program, SM_VERSION, | 126 | }; |
127 | RPC_AUTH_NULL); | 127 | |
128 | if (IS_ERR(clnt)) | 128 | return rpc_create(&args); |
129 | goto out_err; | ||
130 | clnt->cl_softrtry = 1; | ||
131 | clnt->cl_oneshot = 1; | ||
132 | return clnt; | ||
133 | |||
134 | out_err: | ||
135 | return clnt; | ||
136 | } | 129 | } |
137 | 130 | ||
138 | /* | 131 | /* |