summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4renewd.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-08-05 19:13:08 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-08-05 19:13:08 -0400
commitfb10fb67ad2ce43d5e5b8ad22d2ba826844acc56 (patch)
tree064464ced54bf3ba95a85fe2849fa15b94fe2cfc /fs/nfs/nfs4renewd.c
parent3851f1cdb2b8d507b10395fc110d4c37d6121285 (diff)
downloadop-kernel-dev-fb10fb67ad2ce43d5e5b8ad22d2ba826844acc56.zip
op-kernel-dev-fb10fb67ad2ce43d5e5b8ad22d2ba826844acc56.tar.gz
NFSv4: Cleanup the setting of the nfs4 lease period
Make a helper function nfs4_set_lease_period() and have nfs41_setup_state_renewal() and nfs4_do_fsinfo() use it. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4renewd.c')
-rw-r--r--fs/nfs/nfs4renewd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c
index e1ba58c..062029a 100644
--- a/fs/nfs/nfs4renewd.c
+++ b/fs/nfs/nfs4renewd.c
@@ -136,6 +136,23 @@ nfs4_kill_renewd(struct nfs_client *clp)
cancel_delayed_work_sync(&clp->cl_renewd);
}
+/**
+ * nfs4_set_lease_period - Sets the lease period on a nfs_client
+ *
+ * @clp: pointer to nfs_client
+ * @lease: new value for lease period
+ * @lastrenewed: time at which lease was last renewed
+ */
+void nfs4_set_lease_period(struct nfs_client *clp,
+ unsigned long lease,
+ unsigned long lastrenewed)
+{
+ spin_lock(&clp->cl_lock);
+ clp->cl_lease_time = lease;
+ clp->cl_last_renewal = lastrenewed;
+ spin_unlock(&clp->cl_lock);
+}
+
/*
* Local variables:
* c-basic-offset: 8
OpenPOWER on IntegriCloud