summaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
commitc7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch)
tree3682407a599b8f9f03fc096298134cafba1c9b2f /fs/lockd
parent1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff)
o Merge with Linux 2.1.116.
o New Newport console code. o New G364 console code.
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc.c30
-rw-r--r--fs/lockd/svcsubs.c14
2 files changed, 29 insertions, 15 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index bf17a6955..4f94d8845 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -186,7 +186,8 @@ lockd(struct svc_rqst *rqstp)
nlm_shutdown_hosts();
nlmsvc_pid = 0;
} else
- printk("lockd: new process, skipping host shutdown\n");
+ printk(KERN_DEBUG
+ "lockd: new process, skipping host shutdown\n");
wake_up(&lockd_exit);
/* Exit the RPC thread */
@@ -205,6 +206,7 @@ lockd(struct svc_rqst *rqstp)
int
lockd_up(void)
{
+ static int warned = 0;
struct svc_serv * serv;
int error = 0;
@@ -225,27 +227,32 @@ lockd_up(void)
* we should be the first user ...
*/
if (nlmsvc_users > 1)
- printk("lockd_up: no pid, %d users??\n", nlmsvc_users);
+ printk(KERN_WARNING
+ "lockd_up: no pid, %d users??\n", nlmsvc_users);
error = -ENOMEM;
serv = svc_create(&nlmsvc_program, 0, NLMSVC_XDRSIZE);
if (!serv) {
- printk("lockd_up: create service failed\n");
+ printk(KERN_WARNING "lockd_up: create service failed\n");
goto out;
}
if ((error = svc_makesock(serv, IPPROTO_UDP, 0)) < 0
|| (error = svc_makesock(serv, IPPROTO_TCP, 0)) < 0) {
- printk("lockd_up: makesock failed, error=%d\n", error);
+ if (warned++ == 0)
+ printk(KERN_WARNING
+ "lockd_up: makesock failed, error=%d\n", error);
goto destroy_and_out;
- }
+ }
+ warned = 0;
/*
* Create the kernel thread and wait for it to start.
*/
error = svc_create_thread(lockd, serv);
if (error) {
- printk("lockd_up: create thread failed, error=%d\n", error);
+ printk(KERN_WARNING
+ "lockd_up: create thread failed, error=%d\n", error);
goto destroy_and_out;
}
sleep_on(&lockd_start);
@@ -267,17 +274,21 @@ out:
void
lockd_down(void)
{
+ static int warned = 0;
+
down(&nlmsvc_sema);
if (nlmsvc_users) {
if (--nlmsvc_users)
goto out;
} else
- printk("lockd_down: no users! pid=%d\n", nlmsvc_pid);
+ printk(KERN_WARNING "lockd_down: no users! pid=%d\n", nlmsvc_pid);
if (!nlmsvc_pid) {
- printk("lockd_down: nothing to do!\n");
+ if (warned++ == 0)
+ printk(KERN_WARNING "lockd_down: no lockd running.\n");
goto out;
}
+ warned = 0;
kill_proc(nlmsvc_pid, SIGKILL, 1);
/*
@@ -289,7 +300,8 @@ lockd_down(void)
interruptible_sleep_on(&lockd_exit);
current->timeout = 0;
if (nlmsvc_pid) {
- printk("lockd_down: lockd failed to exit, clearing pid\n");
+ printk(KERN_WARNING
+ "lockd_down: lockd failed to exit, clearing pid\n");
nlmsvc_pid = 0;
}
spin_lock_irq(&current->sigmask_lock);
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index ce405d8d5..3bc3b5ea0 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -48,13 +48,15 @@ u32
nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
struct nfs_fh *f)
{
- struct nlm_file *file;
struct knfs_fh *fh = (struct knfs_fh *) f;
- unsigned int hash = file_hash(fh->fh_dev, fh->fh_ino);
+ struct nlm_file *file;
+ unsigned int hash;
u32 nfserr;
- dprintk("lockd: nlm_file_lookup(%s/%ld)\n",
- kdevname(fh->fh_dev), fh->fh_ino);
+ dprintk("lockd: nlm_file_lookup(%s/%u)\n",
+ kdevname(u32_to_kdev_t(fh->fh_dev)), fh->fh_ino);
+
+ hash = file_hash(u32_to_kdev_t(fh->fh_dev), u32_to_ino_t(fh->fh_ino));
/* Lock file table */
down(&nlm_file_sema);
@@ -65,8 +67,8 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
goto found;
}
- dprintk("lockd: creating file for %s/%ld\n",
- kdevname(fh->fh_dev), fh->fh_ino);
+ dprintk("lockd: creating file for %s/%u\n",
+ kdevname(u32_to_kdev_t(fh->fh_dev)), fh->fh_ino);
nfserr = nlm_lck_denied_nolocks;
file = (struct nlm_file *) kmalloc(sizeof(*file), GFP_KERNEL);
if (!file)