X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Flockd%2Fsvc.c;h=82e2192a0d5c873a72b867702c511b0c8872f6a7;hb=1fb69e7817296da8a6824804bb206ca1e7f31425;hp=26809325469cdc73bafa76dec33e52cfa046f548;hpb=b91cba52e9b7b3f1c0037908a192d93a869ca9e5;p=powerpc.git diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 2680932546..82e2192a0d 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -75,18 +76,31 @@ static const int nlm_port_min = 0, nlm_port_max = 65535; static struct ctl_table_header * nlm_sysctl_table; -static unsigned long set_grace_period(void) +static unsigned long get_lockd_grace_period(void) { - unsigned long grace_period; - /* Note: nlm_timeout should always be nonzero */ if (nlm_grace_period) - grace_period = ((nlm_grace_period + nlm_timeout - 1) - / nlm_timeout) * nlm_timeout * HZ; + return roundup(nlm_grace_period, nlm_timeout) * HZ; else - grace_period = nlm_timeout * 5 * HZ; + return nlm_timeout * 5 * HZ; +} + +unsigned long get_nfs_grace_period(void) +{ + unsigned long lockdgrace = get_lockd_grace_period(); + unsigned long nfsdgrace = 0; + + if (nlmsvc_ops) + nfsdgrace = nlmsvc_ops->get_grace_period(); + + return max(lockdgrace, nfsdgrace); +} +EXPORT_SYMBOL(get_nfs_grace_period); + +static unsigned long set_grace_period(void) +{ nlmsvc_grace_period = 1; - return grace_period + jiffies; + return get_nfs_grace_period() + jiffies; } static inline void clear_grace_period(void) @@ -119,6 +133,7 @@ lockd(struct svc_rqst *rqstp) complete(&lockd_start_done); daemonize("lockd"); + set_freezable(); /* Process request with signals blocked, but allow SIGKILL. */ allow_signal(SIGKILL);