summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-14 12:11:55 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-14 12:11:55 +0000
commit3106734be3525f0d08bd4a41ddb7b865bdf93c4a (patch)
tree373dad1efd2936b7ac4222f3ed772a2c9d32c62f
parent87ac82944ed219984368224ddd88ce89b9f37443 (diff)
Implement a wrapper round vn_stat that takes the same arguments
as soo_stat and pipe_stat.
-rw-r--r--sys/compat/common/vfs_syscalls_43.c4
-rw-r--r--sys/compat/netbsd/netbsd_stat.c4
-rw-r--r--sys/compat/osf1/osf1_descrip.c4
-rw-r--r--sys/kern/kern_descrip.c4
-rw-r--r--sys/kern/vfs_vnops.c18
-rw-r--r--sys/sys/vnode.h3
6 files changed, 26 insertions, 11 deletions
diff --git a/sys/compat/common/vfs_syscalls_43.c b/sys/compat/common/vfs_syscalls_43.c
index 466dfb3d3cc..0a5aa07e8b6 100644
--- a/sys/compat/common/vfs_syscalls_43.c
+++ b/sys/compat/common/vfs_syscalls_43.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls_43.c,v 1.12 2001/05/14 11:04:04 art Exp $ */
+/* $OpenBSD: vfs_syscalls_43.c,v 1.13 2001/05/14 12:11:53 art Exp $ */
/* $NetBSD: vfs_syscalls_43.c,v 1.4 1996/03/14 19:31:52 christos Exp $ */
/*
@@ -202,7 +202,7 @@ compat_43_sys_fstat(p, v, retval)
switch (fp->f_type) {
case DTYPE_VNODE:
- error = vn_stat((struct vnode *)fp->f_data, &ub, p);
+ error = vn_statfile(fp, &ub, p);
break;
case DTYPE_SOCKET:
diff --git a/sys/compat/netbsd/netbsd_stat.c b/sys/compat/netbsd/netbsd_stat.c
index f2fa2a96b87..a3735bf6a20 100644
--- a/sys/compat/netbsd/netbsd_stat.c
+++ b/sys/compat/netbsd/netbsd_stat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_stat.c,v 1.8 2001/05/14 11:05:38 art Exp $ */
+/* $OpenBSD: netbsd_stat.c,v 1.9 2001/05/14 12:11:53 art Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -198,7 +198,7 @@ netbsd_sys___fstat13(p, v, retval)
switch (fp->f_type) {
case DTYPE_VNODE:
- error = vn_stat((struct vnode *)fp->f_data, &sb, p);
+ error = vn_statfile(fp, &sb, p);
break;
case DTYPE_SOCKET:
diff --git a/sys/compat/osf1/osf1_descrip.c b/sys/compat/osf1/osf1_descrip.c
index 28af892eb87..e5302d41554 100644
--- a/sys/compat/osf1/osf1_descrip.c
+++ b/sys/compat/osf1/osf1_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osf1_descrip.c,v 1.4 2001/05/14 11:04:05 art Exp $ */
+/* $OpenBSD: osf1_descrip.c,v 1.5 2001/05/14 12:11:54 art Exp $ */
/* $NetBSD: osf1_descrip.c,v 1.5 1999/06/26 01:24:41 cgd Exp $ */
/*
@@ -252,7 +252,7 @@ osf1_sys_fstat(p, v, retval)
switch (fp->f_type) {
case DTYPE_VNODE:
- error = vn_stat((struct vnode *)fp->f_data, &ub, p);
+ error = vn_statfile(fp, &ub, p);
break;
case DTYPE_SOCKET:
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index ceac7e51684..ed48ef1171a 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.25 2001/05/14 11:04:04 art Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.26 2001/05/14 12:11:52 art Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -516,7 +516,7 @@ sys_fstat(p, v, retval)
switch (fp->f_type) {
case DTYPE_VNODE:
- error = vn_stat((struct vnode *)fp->f_data, &ub, p);
+ error = vn_statfile(fp, &ub, p);
break;
case DTYPE_SOCKET:
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 9e1b9907a27..db18cb9f875 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.28 2001/03/01 20:54:34 provos Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.29 2001/05/14 12:11:53 art Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -342,7 +342,21 @@ vn_write(fp, poff, uio, cred)
}
/*
- * File table vnode stat routine.
+ * File table wrapper for vn_stat
+ */
+int
+vn_statfile(fp, sb, p)
+ struct file *fp;
+ struct stat *sb;
+ struct proc *p;
+{
+ struct vnode *vp = (struct vnode *)fp->f_data;
+
+ return vn_stat(vp, sb, p);
+}
+
+/*
+ * vnode stat routine.
*/
int
vn_stat(vp, sb, p)
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 21c1130489c..737f74292a6 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.31 2001/02/26 00:24:38 csapuntz Exp $ */
+/* $OpenBSD: vnode.h,v 1.32 2001/05/14 12:11:52 art Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -450,6 +450,7 @@ int vop_generic_unlock __P((void *));
int vop_generic_revoke __P((void *));
int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
+int vn_statfile __P((struct file *fp, struct stat *sb, struct proc *p));
int vn_writechk __P((struct vnode *vp));
void vn_syncer_add_to_worklist __P((struct vnode *vp, int delay));
void sched_sync __P((struct proc *));