summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_export.c14
-rw-r--r--sys/kern/vfs_subr.c14
-rw-r--r--sys/sys/vnode.h3
3 files changed, 28 insertions, 3 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 08b0e8a..b9cf55b 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.209 1999/07/17 18:43:45 phk Exp $
+ * $Id: vfs_subr.c,v 1.210 1999/07/17 19:38:00 phk Exp $
*/
/*
@@ -2975,3 +2975,15 @@ sync_print(ap)
printf("\n");
return (0);
}
+
+/*
+ * extract the dev_t from a VBLK or VCHR
+ */
+dev_t
+vn_todev(vp)
+ struct vnode *vp;
+{
+ if (vp->v_type != VBLK && vp->v_type != VCHR)
+ return (NODEV);
+ return (vp->v_rdev);
+}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 08b0e8a..b9cf55b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.209 1999/07/17 18:43:45 phk Exp $
+ * $Id: vfs_subr.c,v 1.210 1999/07/17 19:38:00 phk Exp $
*/
/*
@@ -2975,3 +2975,15 @@ sync_print(ap)
printf("\n");
return (0);
}
+
+/*
+ * extract the dev_t from a VBLK or VCHR
+ */
+dev_t
+vn_todev(vp)
+ struct vnode *vp;
+{
+ if (vp->v_type != VBLK && vp->v_type != VCHR)
+ return (NODEV);
+ return (vp->v_rdev);
+}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 73d42f6..40ffd5a 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
- * $Id: vnode.h,v 1.88 1999/06/15 23:36:59 mckusick Exp $
+ * $Id: vnode.h,v 1.89 1999/06/28 10:35:07 phk Exp $
*/
#ifndef _SYS_VNODE_H_
@@ -521,6 +521,7 @@ int vn_rdwr __P((enum uio_rw rw, struct vnode *vp, caddr_t base,
int len, off_t offset, enum uio_seg segflg, int ioflg,
struct ucred *cred, int *aresid, struct proc *p));
int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
+dev_t vn_todev __P((struct vnode *vp));
int vfs_cache_lookup __P((struct vop_lookup_args *ap));
int vfs_object_create __P((struct vnode *vp, struct proc *p,
struct ucred *cred));
OpenPOWER on IntegriCloud