]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/nfs4renewd.c
ocfs2: Check for refreshing locks in generic unblock function
[~andy/linux] / fs / nfs / nfs4renewd.c
index f62c2f7a4ffbda8717d037a57f5f3b17cfbbd6c5..7b6df1852e7590043540cf9c65d3dca963826b20 100644 (file)
@@ -61,7 +61,8 @@
 void
 nfs4_renew_state(void *data)
 {
-       struct nfs4_client *clp = (struct nfs4_client *)data;
+       struct nfs_client *clp = (struct nfs_client *)data;
+       struct rpc_cred *cred;
        long lease, timeout;
        unsigned long last, now;
 
@@ -77,7 +78,8 @@ nfs4_renew_state(void *data)
        timeout = (2 * lease) / 3 + (long)last - (long)now;
        /* Are we close to a lease timeout? */
        if (time_after(now, last + lease/3)) {
-               if (list_empty(&clp->cl_state_owners)) {
+               cred = nfs4_get_renew_cred(clp);
+               if (cred == NULL) {
                        set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
                        spin_unlock(&clp->cl_lock);
                        nfs_expire_all_delegations(clp);
@@ -85,7 +87,8 @@ nfs4_renew_state(void *data)
                }
                spin_unlock(&clp->cl_lock);
                /* Queue an asynchronous RENEW. */
-               nfs4_proc_async_renew(clp);
+               nfs4_proc_async_renew(clp, cred);
+               put_rpccred(cred);
                timeout = (2 * lease) / 3;
                spin_lock(&clp->cl_lock);
        } else
@@ -105,7 +108,7 @@ out:
 
 /* Must be called with clp->cl_sem locked for writes */
 void
-nfs4_schedule_state_renewal(struct nfs4_client *clp)
+nfs4_schedule_state_renewal(struct nfs_client *clp)
 {
        long timeout;
 
@@ -118,32 +121,20 @@ nfs4_schedule_state_renewal(struct nfs4_client *clp)
                        __FUNCTION__, (timeout + HZ - 1) / HZ);
        cancel_delayed_work(&clp->cl_renewd);
        schedule_delayed_work(&clp->cl_renewd, timeout);
+       set_bit(NFS_CS_RENEWD, &clp->cl_res_state);
        spin_unlock(&clp->cl_lock);
 }
 
 void
 nfs4_renewd_prepare_shutdown(struct nfs_server *server)
 {
-       struct nfs4_client *clp = server->nfs4_state;
-
-       if (!clp)
-               return;
        flush_scheduled_work();
-       down_write(&clp->cl_sem);
-       if (!list_empty(&server->nfs4_siblings))
-               list_del_init(&server->nfs4_siblings);
-       up_write(&clp->cl_sem);
 }
 
-/* Must be called with clp->cl_sem locked for writes */
 void
-nfs4_kill_renewd(struct nfs4_client *clp)
+nfs4_kill_renewd(struct nfs_client *clp)
 {
        down_read(&clp->cl_sem);
-       if (!list_empty(&clp->cl_superblocks)) {
-               up_read(&clp->cl_sem);
-               return;
-       }
        cancel_delayed_work(&clp->cl_renewd);
        up_read(&clp->cl_sem);
        flush_scheduled_work();