diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/lockd.c | 1 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 16 |
2 files changed, 13 insertions, 4 deletions
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c index 221acd1f11f6..9e4a568a5013 100644 --- a/fs/nfsd/lockd.c +++ b/fs/nfsd/lockd.c | |||
@@ -65,6 +65,7 @@ nlm_fclose(struct file *filp) | |||
65 | static struct nlmsvc_binding nfsd_nlm_ops = { | 65 | static struct nlmsvc_binding nfsd_nlm_ops = { |
66 | .fopen = nlm_fopen, /* open file for locking */ | 66 | .fopen = nlm_fopen, /* open file for locking */ |
67 | .fclose = nlm_fclose, /* close file */ | 67 | .fclose = nlm_fclose, /* close file */ |
68 | .get_grace_period = get_nfs4_grace_period, | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | void | 71 | void |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8c52913d7cb6..9cc31eaf3857 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/namei.h> | 51 | #include <linux/namei.h> |
52 | #include <linux/mutex.h> | 52 | #include <linux/mutex.h> |
53 | #include <linux/lockd/bind.h> | 53 | #include <linux/lockd/bind.h> |
54 | #include <linux/module.h> | ||
54 | 55 | ||
55 | #define NFSDDBG_FACILITY NFSDDBG_PROC | 56 | #define NFSDDBG_FACILITY NFSDDBG_PROC |
56 | 57 | ||
@@ -3190,20 +3191,27 @@ nfsd4_load_reboot_recovery_data(void) | |||
3190 | printk("NFSD: Failure reading reboot recovery data\n"); | 3191 | printk("NFSD: Failure reading reboot recovery data\n"); |
3191 | } | 3192 | } |
3192 | 3193 | ||
3194 | unsigned long | ||
3195 | get_nfs4_grace_period(void) | ||
3196 | { | ||
3197 | return max(user_lease_time, lease_time) * HZ; | ||
3198 | } | ||
3199 | |||
3193 | /* initialization to perform when the nfsd service is started: */ | 3200 | /* initialization to perform when the nfsd service is started: */ |
3194 | 3201 | ||
3195 | static void | 3202 | static void |
3196 | __nfs4_state_start(void) | 3203 | __nfs4_state_start(void) |
3197 | { | 3204 | { |
3198 | time_t grace_time; | 3205 | unsigned long grace_time; |
3199 | 3206 | ||
3200 | boot_time = get_seconds(); | 3207 | boot_time = get_seconds(); |
3201 | grace_time = max(user_lease_time, lease_time); | 3208 | grace_time = get_nfs_grace_period(); |
3202 | lease_time = user_lease_time; | 3209 | lease_time = user_lease_time; |
3203 | in_grace = 1; | 3210 | in_grace = 1; |
3204 | printk("NFSD: starting %ld-second grace period\n", grace_time); | 3211 | printk(KERN_INFO "NFSD: starting %ld-second grace period\n", |
3212 | grace_time/HZ); | ||
3205 | laundry_wq = create_singlethread_workqueue("nfsd4"); | 3213 | laundry_wq = create_singlethread_workqueue("nfsd4"); |
3206 | queue_delayed_work(laundry_wq, &laundromat_work, grace_time*HZ); | 3214 | queue_delayed_work(laundry_wq, &laundromat_work, grace_time); |
3207 | } | 3215 | } |
3208 | 3216 | ||
3209 | int | 3217 | int |