Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3115
b: refs/heads/master
c: a76b431
h: refs/heads/master
i:
  3113: 9e82b5b
  3111: 50c988e
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 24, 2005
1 parent f1910b7 commit 973eaf8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28ce6054f1de89834e5e9522f9e451cd88a35f85
refs/heads/master: a76b4319ca85b5e3a8098470c623a272d40271cd
24 changes: 13 additions & 11 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
static time_t lease_time = 90; /* default lease time */
static time_t user_lease_time = 90;
time_t boot_time;
static time_t grace_end = 0;
static int in_grace = 1;
static u32 current_clientid = 1;
static u32 current_ownerid = 1;
static u32 current_fileid = 1;
Expand Down Expand Up @@ -1908,6 +1908,13 @@ nfsd4_renew(clientid_t *clid)
return status;
}

static void
end_grace(void)
{
dprintk("NFSD: end of grace period\n");
in_grace = 0;
}

time_t
nfs4_laundromat(void)
{
Expand All @@ -1922,6 +1929,8 @@ nfs4_laundromat(void)
nfs4_lock_state();

dprintk("NFSD: laundromat service - starting\n");
if (in_grace)
end_grace();
list_for_each_safe(pos, next, &client_lru) {
clp = list_entry(pos, struct nfs4_client, cl_lru);
if (time_after((unsigned long)clp->cl_time, (unsigned long)cutoff)) {
Expand Down Expand Up @@ -3223,10 +3232,10 @@ __nfs4_state_start(void)
boot_time = get_seconds();
grace_time = max(user_lease_time, lease_time);
lease_time = user_lease_time;
in_grace = 1;
printk("NFSD: starting %ld-second grace period\n", grace_time);
grace_end = boot_time + grace_time;
laundry_wq = create_singlethread_workqueue("nfsd4");
queue_delayed_work(laundry_wq, &laundromat_work, NFSD_LEASE_TIME*HZ);
queue_delayed_work(laundry_wq, &laundromat_work, grace_time*HZ);
}

int
Expand All @@ -3247,14 +3256,7 @@ nfs4_state_start(void)
int
nfs4_in_grace(void)
{
return get_seconds() < grace_end;
}

void
set_no_grace(void)
{
printk("NFSD: ERROR in reboot recovery. State reclaims will fail.\n");
grace_end = get_seconds();
return in_grace;
}

time_t
Expand Down

0 comments on commit 973eaf8

Please sign in to comment.