diff options
author | Dai Ngo <dai.ngo@oracle.com> | 2022-07-15 16:54:51 -0700 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-07-29 20:16:56 -0400 |
commit | 6867137ebcf4155fe25f2ecf7c29b9fb90a76d1d (patch) | |
tree | 6a8783ea3c699c7fd7c97cc21b44ece5000b72a1 /fs/nfsd/nfs4state.c | |
parent | 427f5f83a3191cbf024c5aea6e5b601cdf88d895 (diff) |
NFSD: refactoring v4 specific code to a helper in nfs4state.c
This patch moves the v4 specific code from nfsd_init_net() to
nfsd4_init_leases_net() helper in nfs4state.c
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 994bd11bafe0..8676f4c71fa4 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4330,6 +4330,18 @@ out: return -ENOMEM; } +void nfsd4_init_leases_net(struct nfsd_net *nn) +{ + nn->nfsd4_lease = 90; /* default lease time */ + nn->nfsd4_grace = 90; + nn->somebody_reclaimed = false; + nn->track_reclaim_completes = false; + nn->clverifier_counter = prandom_u32(); + nn->clientid_base = prandom_u32(); + nn->clientid_counter = nn->clientid_base + 1; + nn->s2s_cp_cl_id = nn->clientid_counter++; +} + static void init_nfs4_replay(struct nfs4_replay *rp) { rp->rp_status = nfserr_serverfault; |