git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
fs
/
lockd
/
svc.c
diff --git
a/fs/lockd/svc.c
b/fs/lockd/svc.c
index
b82e470
..
fdb9412
100644
(file)
--- a/
fs/lockd/svc.c
+++ b/
fs/lockd/svc.c
@@
-25,6
+25,7
@@
#include <linux/slab.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
+#include <linux/mutex.h>
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/stats.h>
@@
-43,13
+44,13
@@
static struct svc_program nlmsvc_program;
struct nlmsvc_binding * nlmsvc_ops;
EXPORT_SYMBOL(nlmsvc_ops);
struct nlmsvc_binding * nlmsvc_ops;
EXPORT_SYMBOL(nlmsvc_ops);
-static DE
CLARE_MUTEX(nlmsvc_sema
);
+static DE
FINE_MUTEX(nlmsvc_mutex
);
static unsigned int nlmsvc_users;
static pid_t nlmsvc_pid;
int nlmsvc_grace_period;
unsigned long nlmsvc_timeout;
static unsigned int nlmsvc_users;
static pid_t nlmsvc_pid;
int nlmsvc_grace_period;
unsigned long nlmsvc_timeout;
-static DECLARE_
MUTEX_LOCKED(lockd_start
);
+static DECLARE_
COMPLETION(lockd_start_done
);
static DECLARE_WAIT_QUEUE_HEAD(lockd_exit);
/*
static DECLARE_WAIT_QUEUE_HEAD(lockd_exit);
/*
@@
-112,7
+113,7
@@
lockd(struct svc_rqst *rqstp)
* Let our maker know we're running.
*/
nlmsvc_pid = current->pid;
* Let our maker know we're running.
*/
nlmsvc_pid = current->pid;
-
up(&lockd_start
);
+
complete(&lockd_start_done
);
daemonize("lockd");
daemonize("lockd");
@@
-178,6
+179,8
@@
lockd(struct svc_rqst *rqstp)
}
}
+ flush_signals(current);
+
/*
* Check whether there's a new lockd process before
* shutting down the hosts and clearing the slot.
/*
* Check whether there's a new lockd process before
* shutting down the hosts and clearing the slot.
@@
-191,7
+194,7
@@
lockd(struct svc_rqst *rqstp)
printk(KERN_DEBUG
"lockd: new process, skipping host shutdown\n");
wake_up(&lockd_exit);
printk(KERN_DEBUG
"lockd: new process, skipping host shutdown\n");
wake_up(&lockd_exit);
-
+
/* Exit the RPC thread */
svc_exit_thread(rqstp);
/* Exit the RPC thread */
svc_exit_thread(rqstp);
@@
-213,7
+216,7
@@
lockd_up(void)
struct svc_serv * serv;
int error = 0;
struct svc_serv * serv;
int error = 0;
-
down(&nlmsvc_sema
);
+
mutex_lock(&nlmsvc_mutex
);
/*
* Unconditionally increment the user count ... this is
* the number of clients who _want_ a lockd process.
/*
* Unconditionally increment the user count ... this is
* the number of clients who _want_ a lockd process.
@@
-261,7
+264,7
@@
lockd_up(void)
"lockd_up: create thread failed, error=%d\n", error);
goto destroy_and_out;
}
"lockd_up: create thread failed, error=%d\n", error);
goto destroy_and_out;
}
-
down(&lockd_start
);
+
wait_for_completion(&lockd_start_done
);
/*
* Note: svc_serv structures have an initial use count of 1,
/*
* Note: svc_serv structures have an initial use count of 1,
@@
-270,7
+273,7
@@
lockd_up(void)
destroy_and_out:
svc_destroy(serv);
out:
destroy_and_out:
svc_destroy(serv);
out:
-
up(&nlmsvc_sema
);
+
mutex_unlock(&nlmsvc_mutex
);
return error;
}
EXPORT_SYMBOL(lockd_up);
return error;
}
EXPORT_SYMBOL(lockd_up);
@@
-283,7
+286,7
@@
lockd_down(void)
{
static int warned;
{
static int warned;
-
down(&nlmsvc_sema
);
+
mutex_lock(&nlmsvc_mutex
);
if (nlmsvc_users) {
if (--nlmsvc_users)
goto out;
if (nlmsvc_users) {
if (--nlmsvc_users)
goto out;
@@
-303,7
+306,7
@@
lockd_down(void)
* the lockd semaphore, we can't wait around forever ...
*/
clear_thread_flag(TIF_SIGPENDING);
* the lockd semaphore, we can't wait around forever ...
*/
clear_thread_flag(TIF_SIGPENDING);
-
interruptible_sleep_on_timeout(&lockd_exit
, HZ);
+
wait_event_timeout(lockd_exit, nlmsvc_pid == 0
, HZ);
if (nlmsvc_pid) {
printk(KERN_WARNING
"lockd_down: lockd failed to exit, clearing pid\n");
if (nlmsvc_pid) {
printk(KERN_WARNING
"lockd_down: lockd failed to exit, clearing pid\n");
@@
-313,7
+316,7
@@
lockd_down(void)
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
out:
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
out:
-
up(&nlmsvc_sema
);
+
mutex_unlock(&nlmsvc_mutex
);
}
EXPORT_SYMBOL(lockd_down);
}
EXPORT_SYMBOL(lockd_down);
@@
-329,7
+332,7
@@
static ctl_table nlm_sysctls[] = {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_grace_period",
.data = &nlm_grace_period,
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_grace_period",
.data = &nlm_grace_period,
- .maxlen = sizeof(
int
),
+ .maxlen = sizeof(
unsigned long
),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_grace_period_min,
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_grace_period_min,
@@
-339,7
+342,7
@@
static ctl_table nlm_sysctls[] = {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_timeout",
.data = &nlm_timeout,
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_timeout",
.data = &nlm_timeout,
- .maxlen = sizeof(
int
),
+ .maxlen = sizeof(
unsigned long
),
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_timeout_min,
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_timeout_min,
@@
-507,7
+510,7
@@
static struct svc_version * nlmsvc_version[] = {
static struct svc_stat nlmsvc_stats;
static struct svc_stat nlmsvc_stats;
-#define NLM_NRVERS
(sizeof(nlmsvc_version)/sizeof(nlmsvc_version[0])
)
+#define NLM_NRVERS
ARRAY_SIZE(nlmsvc_version
)
static struct svc_program nlmsvc_program = {
.pg_prog = NLM_PROGRAM, /* program number */
.pg_nvers = NLM_NRVERS, /* number of entries in nlmsvc_version */
static struct svc_program nlmsvc_program = {
.pg_prog = NLM_PROGRAM, /* program number */
.pg_nvers = NLM_NRVERS, /* number of entries in nlmsvc_version */