Commit f89041f2 authored by Trond Myklebust's avatar Trond Myklebust

NFSv2/v3 locking: Patch by Patrice Dumas to implement nlmsvc_proc_granted_res.

    When a server receives that callback it should deallocate the corresponding blocked
    lock using the nlmsvc_grant_reply function.
parent d2ac640a
...@@ -452,6 +452,24 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, ...@@ -452,6 +452,24 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
return rpc_success; return rpc_success;
} }
/*
* client sent a GRANTED_RES, let's remove the associated block
*/
static int
nlm4svc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res *argp,
void *resp)
{
if (!nlmsvc_ops)
return rpc_success;
dprintk("lockd: GRANTED_RES called\n");
nlmsvc_grant_reply(&argp->cookie, argp->status);
return rpc_success;
}
/* /*
* This is the generic lockd callback for async RPC calls * This is the generic lockd callback for async RPC calls
*/ */
...@@ -515,7 +533,6 @@ nlm4svc_callback_exit(struct rpc_task *task) ...@@ -515,7 +533,6 @@ nlm4svc_callback_exit(struct rpc_task *task)
#define nlm4svc_proc_lock_res nlm4svc_proc_null #define nlm4svc_proc_lock_res nlm4svc_proc_null
#define nlm4svc_proc_cancel_res nlm4svc_proc_null #define nlm4svc_proc_cancel_res nlm4svc_proc_null
#define nlm4svc_proc_unlock_res nlm4svc_proc_null #define nlm4svc_proc_unlock_res nlm4svc_proc_null
#define nlm4svc_proc_granted_res nlm4svc_proc_null
struct nlm_void { int dummy; }; struct nlm_void { int dummy; };
...@@ -548,7 +565,7 @@ struct svc_procedure nlmsvc_procedures4[] = { ...@@ -548,7 +565,7 @@ struct svc_procedure nlmsvc_procedures4[] = {
PROC(lock_res, lockres, norep, res, void, 1), PROC(lock_res, lockres, norep, res, void, 1),
PROC(cancel_res, cancelres, norep, res, void, 1), PROC(cancel_res, cancelres, norep, res, void, 1),
PROC(unlock_res, unlockres, norep, res, void, 1), PROC(unlock_res, unlockres, norep, res, void, 1),
PROC(granted_res, grantedres, norep, res, void, 1), PROC(granted_res, res, norep, res, void, 1),
/* statd callback */ /* statd callback */
PROC(sm_notify, reboot, void, reboot, void, 1), PROC(sm_notify, reboot, void, reboot, void, 1),
PROC(none, void, void, void, void, 0), PROC(none, void, void, void, void, 0),
......
...@@ -478,6 +478,22 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, ...@@ -478,6 +478,22 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
return rpc_success; return rpc_success;
} }
/*
* client sent a GRANTED_RES, let's remove the associated block
*/
static int
nlmsvc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res *argp,
void *resp)
{
if (!nlmsvc_ops)
return rpc_success;
dprintk("lockd: GRANTED_RES called\n");
nlmsvc_grant_reply(&argp->cookie, argp->status);
return rpc_success;
}
/* /*
* This is the generic lockd callback for async RPC calls * This is the generic lockd callback for async RPC calls
*/ */
...@@ -541,7 +557,6 @@ nlmsvc_callback_exit(struct rpc_task *task) ...@@ -541,7 +557,6 @@ nlmsvc_callback_exit(struct rpc_task *task)
#define nlmsvc_proc_lock_res nlmsvc_proc_null #define nlmsvc_proc_lock_res nlmsvc_proc_null
#define nlmsvc_proc_cancel_res nlmsvc_proc_null #define nlmsvc_proc_cancel_res nlmsvc_proc_null
#define nlmsvc_proc_unlock_res nlmsvc_proc_null #define nlmsvc_proc_unlock_res nlmsvc_proc_null
#define nlmsvc_proc_granted_res nlmsvc_proc_null
struct nlm_void { int dummy; }; struct nlm_void { int dummy; };
...@@ -576,7 +591,7 @@ struct svc_procedure nlmsvc_procedures[] = { ...@@ -576,7 +591,7 @@ struct svc_procedure nlmsvc_procedures[] = {
PROC(lock_res, lockres, norep, res, void, 1), PROC(lock_res, lockres, norep, res, void, 1),
PROC(cancel_res, cancelres, norep, res, void, 1), PROC(cancel_res, cancelres, norep, res, void, 1),
PROC(unlock_res, unlockres, norep, res, void, 1), PROC(unlock_res, unlockres, norep, res, void, 1),
PROC(granted_res, grantedres, norep, res, void, 1), PROC(granted_res, res, norep, res, void, 1),
/* statd callback */ /* statd callback */
PROC(sm_notify, reboot, void, reboot, void, 1), PROC(sm_notify, reboot, void, reboot, void, 1),
PROC(none, void, void, void, void, 1), PROC(none, void, void, void, void, 1),
......
...@@ -165,6 +165,7 @@ u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); ...@@ -165,6 +165,7 @@ u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
unsigned long nlmsvc_retry_blocked(void); unsigned long nlmsvc_retry_blocked(void);
int nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, int nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
int action); int action);
void nlmsvc_grant_reply(struct nlm_cookie *cookie, u32 status);
/* /*
* File handling for the server personality * File handling for the server personality
......
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