mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-04 20:57:45 -04:00
NFSv4: pass lease period in seconds to nfs4_set_lease_period()
There's no need to multiply the lease period by HZ at all the call sites of nfs4_set_lease_period() -- it makes more sense to do that only once, inside that function, by passing to it lease period as 32-bit # of seconds instead of 32/64-bit *unsigned long* # of jiffies... Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
committed by
Anna Schumaker
parent
fdc0396b3c
commit
3d57c44e91
@@ -477,8 +477,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *);
|
||||
extern void nfs4_schedule_state_renewal(struct nfs_client *);
|
||||
extern void nfs4_kill_renewd(struct nfs_client *);
|
||||
extern void nfs4_renew_state(struct work_struct *);
|
||||
extern void nfs4_set_lease_period(struct nfs_client *clp, unsigned long lease);
|
||||
|
||||
extern void nfs4_set_lease_period(struct nfs_client *clp, u32 period);
|
||||
|
||||
/* nfs4state.c */
|
||||
extern const nfs4_stateid current_stateid;
|
||||
|
||||
@@ -5487,7 +5487,7 @@ static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, str
|
||||
err = _nfs4_do_fsinfo(server, fhandle, fsinfo);
|
||||
trace_nfs4_fsinfo(server, fhandle, fsinfo->fattr, err);
|
||||
if (err == 0) {
|
||||
nfs4_set_lease_period(server->nfs_client, fsinfo->lease_time * HZ);
|
||||
nfs4_set_lease_period(server->nfs_client, fsinfo->lease_time);
|
||||
break;
|
||||
}
|
||||
err = nfs4_handle_exception(server, err, &exception);
|
||||
|
||||
@@ -137,11 +137,12 @@ nfs4_kill_renewd(struct nfs_client *clp)
|
||||
* nfs4_set_lease_period - Sets the lease period on a nfs_client
|
||||
*
|
||||
* @clp: pointer to nfs_client
|
||||
* @lease: new value for lease period
|
||||
* @period: new value for lease period (in seconds)
|
||||
*/
|
||||
void nfs4_set_lease_period(struct nfs_client *clp,
|
||||
unsigned long lease)
|
||||
void nfs4_set_lease_period(struct nfs_client *clp, u32 period)
|
||||
{
|
||||
unsigned long lease = period * HZ;
|
||||
|
||||
spin_lock(&clp->cl_lock);
|
||||
clp->cl_lease_time = lease;
|
||||
spin_unlock(&clp->cl_lock);
|
||||
|
||||
@@ -104,7 +104,7 @@ static int nfs4_setup_state_renewal(struct nfs_client *clp)
|
||||
|
||||
status = nfs4_proc_get_lease_time(clp, &fsinfo);
|
||||
if (status == 0) {
|
||||
nfs4_set_lease_period(clp, fsinfo.lease_time * HZ);
|
||||
nfs4_set_lease_period(clp, fsinfo.lease_time);
|
||||
nfs4_schedule_state_renewal(clp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user