diff options
author | phk <phk@FreeBSD.org> | 1999-07-18 14:30:37 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-07-18 14:30:37 +0000 |
commit | 63c9fe9157d4f9a0b52cd01e5319a26c73681275 (patch) | |
tree | 88e64eaab1bd46507a049b9a4636c10d4e13a344 /sys/kern/vfs_export.c | |
parent | c8095f053ab32212c5dd4d4096d3e45a5e3be47d (diff) | |
download | FreeBSD-src-63c9fe9157d4f9a0b52cd01e5319a26c73681275.zip FreeBSD-src-63c9fe9157d4f9a0b52cd01e5319a26c73681275.tar.gz |
Introduce the vn_todev(struct vnode*) function, which returns the dev_t
corresponding to a VBLK or VCHR node, or NODEV.
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r-- | sys/kern/vfs_export.c | 14 |
1 files changed, 13 insertions, 1 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); +} |