summaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-14 13:28:24 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-14 13:28:24 +0000
commit995b695f2b06ee188ae993334bc83e25a3bc3fd0 (patch)
tree4e9dd1175963150f3333bc4515116450a9d370b2 /sys/kern/kern_descrip.c
parent21e55531a498e82f6643babf57257f1ebe43fb71 (diff)
use fo_stat in fileops instead of huge switch statements.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index ed48ef1171a..754659f3510 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.26 2001/05/14 12:11:52 art Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.27 2001/05/14 13:28:20 art Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -500,7 +500,7 @@ sys_fstat(p, v, retval)
void *v;
register_t *retval;
{
- register struct sys_fstat_args /* {
+ struct sys_fstat_args /* {
syscallarg(int) fd;
syscallarg(struct stat *) sb;
} */ *uap = v;
@@ -513,26 +513,7 @@ sys_fstat(p, v, retval)
if ((u_int)fd >= fdp->fd_nfiles ||
(fp = fdp->fd_ofiles[fd]) == NULL)
return (EBADF);
- switch (fp->f_type) {
-
- case DTYPE_VNODE:
- error = vn_statfile(fp, &ub, p);
- break;
-
- case DTYPE_SOCKET:
- error = soo_stat(fp, &ub, p);
- break;
-
-#ifndef OLD_PIPE
- case DTYPE_PIPE:
- error = pipe_stat(fp, &ub, p);
- break;
-#endif
-
- default:
- panic("fstat");
- /*NOTREACHED*/
- }
+ error = (*fp->f_ops->fo_stat)(fp, &ub, p);
if (error == 0) {
/* Don't let non-root see generation numbers
(for NFS security) */