| .. | .. |
|---|
| 57 | 57 | const struct nfs4_state_maintenance_ops *ops; |
|---|
| 58 | 58 | struct nfs_client *clp = |
|---|
| 59 | 59 | container_of(work, struct nfs_client, cl_renewd.work); |
|---|
| 60 | | - struct rpc_cred *cred; |
|---|
| 60 | + const struct cred *cred; |
|---|
| 61 | 61 | long lease; |
|---|
| 62 | 62 | unsigned long last, now; |
|---|
| 63 | 63 | unsigned renew_flags = 0; |
|---|
| .. | .. |
|---|
| 68 | 68 | if (test_bit(NFS_CS_STOP_RENEW, &clp->cl_res_state)) |
|---|
| 69 | 69 | goto out; |
|---|
| 70 | 70 | |
|---|
| 71 | | - spin_lock(&clp->cl_lock); |
|---|
| 72 | 71 | lease = clp->cl_lease_time; |
|---|
| 73 | 72 | last = clp->cl_last_renewal; |
|---|
| 74 | 73 | now = jiffies; |
|---|
| .. | .. |
|---|
| 79 | 78 | renew_flags |= NFS4_RENEW_DELEGATION_CB; |
|---|
| 80 | 79 | |
|---|
| 81 | 80 | if (renew_flags != 0) { |
|---|
| 82 | | - cred = ops->get_state_renewal_cred_locked(clp); |
|---|
| 83 | | - spin_unlock(&clp->cl_lock); |
|---|
| 81 | + cred = ops->get_state_renewal_cred(clp); |
|---|
| 84 | 82 | if (cred == NULL) { |
|---|
| 85 | 83 | if (!(renew_flags & NFS4_RENEW_DELEGATION_CB)) { |
|---|
| 86 | 84 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); |
|---|
| .. | .. |
|---|
| 92 | 90 | |
|---|
| 93 | 91 | /* Queue an asynchronous RENEW. */ |
|---|
| 94 | 92 | ret = ops->sched_state_renewal(clp, cred, renew_flags); |
|---|
| 95 | | - put_rpccred(cred); |
|---|
| 93 | + put_cred(cred); |
|---|
| 96 | 94 | switch (ret) { |
|---|
| 97 | 95 | default: |
|---|
| 98 | 96 | goto out_exp; |
|---|
| .. | .. |
|---|
| 104 | 102 | } else { |
|---|
| 105 | 103 | dprintk("%s: failed to call renewd. Reason: lease not expired \n", |
|---|
| 106 | 104 | __func__); |
|---|
| 107 | | - spin_unlock(&clp->cl_lock); |
|---|
| 108 | 105 | } |
|---|
| 109 | 106 | nfs4_schedule_state_renewal(clp); |
|---|
| 110 | 107 | out_exp: |
|---|
| .. | .. |
|---|
| 141 | 138 | * |
|---|
| 142 | 139 | * @clp: pointer to nfs_client |
|---|
| 143 | 140 | * @lease: new value for lease period |
|---|
| 144 | | - * @lastrenewed: time at which lease was last renewed |
|---|
| 145 | 141 | */ |
|---|
| 146 | 142 | void nfs4_set_lease_period(struct nfs_client *clp, |
|---|
| 147 | | - unsigned long lease, |
|---|
| 148 | | - unsigned long lastrenewed) |
|---|
| 143 | + unsigned long lease) |
|---|
| 149 | 144 | { |
|---|
| 150 | 145 | spin_lock(&clp->cl_lock); |
|---|
| 151 | 146 | clp->cl_lease_time = lease; |
|---|
| 152 | | - clp->cl_last_renewal = lastrenewed; |
|---|
| 153 | 147 | spin_unlock(&clp->cl_lock); |
|---|
| 154 | 148 | |
|---|
| 155 | 149 | /* Cap maximum reconnect timeout at 1/2 lease period */ |
|---|