diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1998-09-06 01:48:59 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1998-09-06 01:48:59 +0000 |
commit | d26c937ecb3896ff85d968b4abb1cd16a3e39f7e (patch) | |
tree | 410b54ee363426317304c37ae011a9fe8b7f8096 | |
parent | fb090325ce4af869fe7c650047c28a23cf1867ef (diff) |
* reorganize some includes
* start using the VT_XFS tag on vnodes
* be more paranoid about closed channel when going to sleep.
-rw-r--r-- | sys/xfs/xfs_dev.c | 17 | ||||
-rw-r--r-- | sys/xfs/xfs_message.c | 4 | ||||
-rw-r--r-- | sys/xfs/xfs_node.c | 5 | ||||
-rw-r--r-- | sys/xfs/xfs_node.h | 4 | ||||
-rw-r--r-- | sys/xfs/xfs_syscalls.c | 7 | ||||
-rw-r--r-- | sys/xfs/xfs_vfsops.c | 13 | ||||
-rw-r--r-- | sys/xfs/xfs_vnodeops.c | 3 |
7 files changed, 33 insertions, 20 deletions
diff --git a/sys/xfs/xfs_dev.c b/sys/xfs/xfs_dev.c index 2e772181ecc..ed3e425340f 100644 --- a/sys/xfs/xfs_dev.c +++ b/sys/xfs/xfs_dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_dev.c,v 1.2 1998/08/31 05:13:14 art Exp $ */ +/* $OpenBSD: xfs_dev.c,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -47,6 +47,7 @@ #include <sys/proc.h> #include <sys/mount.h> #include <sys/fcntl.h> +#include <sys/vnode.h> #include <xfs/xfs_common.h> #include <xfs/xfs_message.h> @@ -342,7 +343,6 @@ xfs_devpoll(dev_t dev, int events, struct proc *p) return xfs_realselect(dev, p); } - #endif #ifdef USE_SELECT @@ -356,7 +356,6 @@ xfs_devselect(dev_t dev, int which, struct proc *p) return xfs_realselect(dev, p); } - #endif /* @@ -431,6 +430,7 @@ xfs_message_rpc(int fd, struct xfs_message_header *message, u_int size) return ENOMEM; } #endif + msg = xfs_alloc(size); bcopy(message, msg, size); @@ -442,7 +442,7 @@ xfs_message_rpc(int fd, struct xfs_message_header *message, u_int size) xfs_appendq(&chan->messageq, this_message); xfs_appendq(&chan->sleepq, this_process); if (chan->selecting_proc != 0 - && chan->selecting_proc->p_wchan == (caddr_t) & selwait) { + && chan->selecting_proc->p_wchan == (caddr_t) &selwait) { struct selinfo selinfo; #if defined(__NetBSD__) || defined(__FreeBSD__) @@ -457,10 +457,17 @@ xfs_message_rpc(int fd, struct xfs_message_header *message, u_int size) } this_process->error_or_size = 0; - if (tsleep((caddr_t) this_process, (PZERO + 1) | PCATCH, "xfs", 0)) { + /* + * We have to check if we have a receiver here too because the + * daemon could have terminated before we sleep. This seems to + * happen sometimes when rebooting. + */ + if (!(chan->status & CHANNEL_OPENED) || + tsleep((caddr_t) this_process, (PZERO + 1) | PCATCH, "xfs", 0)) { XFSDEB(XDEBMSG, ("caught signal\n")); this_process->error_or_size = EINTR; } + /* * Caught signal, got reply message or device was closed. * Need to clean up both messageq and sleepq. diff --git a/sys/xfs/xfs_message.c b/sys/xfs/xfs_message.c index aa554861d99..2a3086611d9 100644 --- a/sys/xfs/xfs_message.c +++ b/sys/xfs/xfs_message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_message.c,v 1.2 1998/08/31 05:13:15 art Exp $ */ +/* $OpenBSD: xfs_message.c,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -41,6 +41,8 @@ #include <sys/uio.h> #include <sys/namei.h> #include <sys/systm.h> +#include <sys/time.h> +#include <sys/vnode.h> #include <xfs/xfs_common.h> #include <xfs/xfs_deb.h> diff --git a/sys/xfs/xfs_node.c b/sys/xfs/xfs_node.c index a0ad87b616d..324fddc880c 100644 --- a/sys/xfs/xfs_node.c +++ b/sys/xfs/xfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_node.c,v 1.2 1998/08/31 05:13:16 art Exp $ */ +/* $OpenBSD: xfs_node.c,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -44,6 +44,7 @@ #include <sys/systm.h> #include <sys/dirent.h> #include <sys/mount.h> +#include <sys/vnode.h> #include <xfs/xfs_common.h> #include <xfs/xfs_fs.h> @@ -93,7 +94,7 @@ new_xfs_node(struct xfs *xfsp, struct xfs_msg_node *node, bzero(result, sizeof(*result)); - error = getnewvnode(VT_AFS, XFS_TO_VFS(xfsp), xfs_vnodeop_p, + error = getnewvnode(VT_XFS, XFS_TO_VFS(xfsp), xfs_vnodeop_p, &v); if (error) { xfs_free(result, sizeof(*result)); diff --git a/sys/xfs/xfs_node.h b/sys/xfs/xfs_node.h index e6d3bea0eec..6e64c14b657 100644 --- a/sys/xfs/xfs_node.h +++ b/sys/xfs/xfs_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_node.h,v 1.2 1998/08/31 05:13:28 art Exp $ */ +/* $OpenBSD: xfs_node.h,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -42,9 +42,11 @@ #ifndef _XFS_XFS_NODE_H_ #define _XFS_XFS_NODE_H_ +#if 0 #include <sys/types.h> #include <sys/time.h> #include <sys/vnode.h> +#endif #include <xfs/xfs_attr.h> #include <xfs/xfs_message.h> diff --git a/sys/xfs/xfs_syscalls.c b/sys/xfs/xfs_syscalls.c index 323eb0ea95c..1c2f837c912 100644 --- a/sys/xfs/xfs_syscalls.c +++ b/sys/xfs/xfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_syscalls.c,v 1.3 1998/08/31 05:13:17 art Exp $ */ +/* $OpenBSD: xfs_syscalls.c,v 1.4 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -47,6 +47,7 @@ #include <sys/syscall.h> #include <sys/systm.h> #include <sys/proc.h> +#include <sys/vnode.h> #include <xfs/xfs_common.h> @@ -246,8 +247,8 @@ xfs_pioctl_call(struct proc *p, void *v, int *i) vp = nd.ni_vp; - if (vp->v_tag != VT_AFS) { - XFSDEB(XDEBSYS, ("xfs_syscall: %s not in afs\n", + if (vp->v_tag != VT_XFS) { + XFSDEB(XDEBSYS, ("xfs_syscall: %s not in xfs\n", path)); vrele(vp); return EINVAL; diff --git a/sys/xfs/xfs_vfsops.c b/sys/xfs/xfs_vfsops.c index 55d9c59ec5f..22874d6430e 100644 --- a/sys/xfs/xfs_vfsops.c +++ b/sys/xfs/xfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_vfsops.c,v 1.2 1998/08/31 05:13:19 art Exp $ */ +/* $OpenBSD: xfs_vfsops.c,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -45,8 +45,13 @@ #include <sys/namei.h> #include <sys/conf.h> #include <sys/proc.h> +#include <sys/vnode.h> #include <xfs/xfs_common.h> +#include <xfs/xfs_message.h> +#include <xfs/xfs_dev.h> +#include <xfs/xfs_fs.h> +#include <xfs/xfs_deb.h> RCSID("$KTH: xfs_vfsops.c,v 1.22 1998/08/13 01:38:49 art Exp $"); @@ -54,12 +59,6 @@ RCSID("$KTH: xfs_vfsops.c,v 1.22 1998/08/13 01:38:49 art Exp $"); * XFS vfs operations. */ -#include <xfs/xfs_common.h> -#include <xfs/xfs_message.h> -#include <xfs/xfs_dev.h> -#include <xfs/xfs_fs.h> -#include <xfs/xfs_deb.h> - static struct vnode *make_dead_vnode(struct mount *mp); struct xfs xfs[NXFS]; diff --git a/sys/xfs/xfs_vnodeops.c b/sys/xfs/xfs_vnodeops.c index aeef10d1a0c..f401dd444e5 100644 --- a/sys/xfs/xfs_vnodeops.c +++ b/sys/xfs/xfs_vnodeops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xfs_vnodeops.c,v 1.2 1998/08/31 05:13:20 art Exp $ */ +/* $OpenBSD: xfs_vnodeops.c,v 1.3 1998/09/06 01:48:58 art Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -49,6 +49,7 @@ #include <sys/systm.h> #include <sys/mount.h> #include <sys/fcntl.h> +#include <sys/vnode.h> #include <xfs/xfs_message.h> #include <xfs/xfs_dev.h> |