diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-11-09 23:03:34 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-11-09 23:03:34 +0000 |
commit | e207b52afade9903764b81404bfeffc670280a2a (patch) | |
tree | 241e3a99465662490349630f8b41ae28c39f4d4b | |
parent | b797084e48d42006545e11a5917e7d5dbeef0e09 (diff) | |
download | src-e207b52afade9903764b81404bfeffc670280a2a.tar.gz src-e207b52afade9903764b81404bfeffc670280a2a.zip |
Make getdiskbyname() static to vfs_mount.c.
Eliminate use of vn_todev() while here.
Notes
Notes:
svn path=/head/; revision=137484
-rw-r--r-- | sys/kern/vfs_mount.c | 8 | ||||
-rw-r--r-- | sys/sys/conf.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index b892b03b1723..32686b493d54 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -98,6 +98,7 @@ __FBSDID("$FreeBSD$"); #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) static void checkdirs(struct vnode *olddp, struct vnode *newdp); +static struct cdev *getdiskbyname(char *_name); static void gets(char *cp); static int vfs_domount(struct thread *td, const char *fstype, char *fspath, int fsflags, void *fsdata, int compat); @@ -1449,7 +1450,7 @@ gets(char *cp) * we cannot use the vnode directly (because we unmount the DEVFS again) * so the filesystems still have to do the bdevvp() stunt. */ -struct cdev * +static struct cdev * getdiskbyname(char *name) { char *cp = name; @@ -1490,7 +1491,10 @@ getdiskbyname(char *name) error = lookup(&nid); if (error) break; - dev = vn_todev (nid.ni_vp); + if (nid.ni_vp->v_type != VCHR) + dev = NULL; + else + dev = nid.ni_vp->v_rdev; NDFREE(&nid, 0); } while (0); diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 25366fd45e67..d7ecddc3b84b 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -267,7 +267,6 @@ void dev_lock(void); void dev_unlock(void); int unit2minor(int _unit); void setconf(void); -struct cdev *getdiskbyname(char *_name); void devfs_create(struct cdev *dev); void devfs_destroy(struct cdev *dev); |