1111#include <linux/time.h>
1212#include <linux/lockd/lockd.h>
1313#include <linux/lockd/share.h>
14+ #include <linux/sunrpc/svc_xprt.h>
1415
1516#define NLMDBG_FACILITY NLMDBG_CLIENT
1617
@@ -175,13 +176,14 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
175176{
176177 struct nlm_host * host ;
177178 struct nlm_file * file ;
179+ struct net * net = SVC_NET (rqstp );
178180
179181 dprintk ("lockd: CANCEL called\n" );
180182
181183 resp -> cookie = argp -> cookie ;
182184
183185 /* Don't accept requests during grace period */
184- if (locks_in_grace ()) {
186+ if (locks_in_grace (net )) {
185187 resp -> status = nlm_lck_denied_grace_period ;
186188 return rpc_success ;
187189 }
@@ -191,7 +193,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
191193 return resp -> status == nlm_drop_reply ? rpc_drop_reply :rpc_success ;
192194
193195 /* Try to cancel request. */
194- resp -> status = cast_status (nlmsvc_cancel_blocked (file , & argp -> lock ));
196+ resp -> status = cast_status (nlmsvc_cancel_blocked (net , file , & argp -> lock ));
195197
196198 dprintk ("lockd: CANCEL status %d\n" , ntohl (resp -> status ));
197199 nlmsvc_release_host (host );
@@ -208,13 +210,14 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
208210{
209211 struct nlm_host * host ;
210212 struct nlm_file * file ;
213+ struct net * net = SVC_NET (rqstp );
211214
212215 dprintk ("lockd: UNLOCK called\n" );
213216
214217 resp -> cookie = argp -> cookie ;
215218
216219 /* Don't accept new lock requests during grace period */
217- if (locks_in_grace ()) {
220+ if (locks_in_grace (net )) {
218221 resp -> status = nlm_lck_denied_grace_period ;
219222 return rpc_success ;
220223 }
@@ -224,7 +227,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
224227 return resp -> status == nlm_drop_reply ? rpc_drop_reply :rpc_success ;
225228
226229 /* Now try to remove the lock */
227- resp -> status = cast_status (nlmsvc_unlock (file , & argp -> lock ));
230+ resp -> status = cast_status (nlmsvc_unlock (net , file , & argp -> lock ));
228231
229232 dprintk ("lockd: UNLOCK status %d\n" , ntohl (resp -> status ));
230233 nlmsvc_release_host (host );
@@ -361,7 +364,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
361364 resp -> cookie = argp -> cookie ;
362365
363366 /* Don't accept new lock requests during grace period */
364- if (locks_in_grace () && !argp -> reclaim ) {
367+ if (locks_in_grace (SVC_NET ( rqstp ) ) && !argp -> reclaim ) {
365368 resp -> status = nlm_lck_denied_grace_period ;
366369 return rpc_success ;
367370 }
@@ -394,7 +397,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
394397 resp -> cookie = argp -> cookie ;
395398
396399 /* Don't accept requests during grace period */
397- if (locks_in_grace ()) {
400+ if (locks_in_grace (SVC_NET ( rqstp ) )) {
398401 resp -> status = nlm_lck_denied_grace_period ;
399402 return rpc_success ;
400403 }
0 commit comments