Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Drop now unused dk_lookup function.



details:   https://anonhg.NetBSD.org/src/rev/254389ab070e
branches:  trunk
changeset: 847051:254389ab070e
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Dec 08 12:15:24 2019 +0000

description:
Drop now unused dk_lookup function.

diffstat:

 sys/dev/dksubr.c |  64 +------------------------------------------------------
 sys/dev/dkvar.h  |   4 +--
 2 files changed, 3 insertions(+), 65 deletions(-)

diffs (101 lines):

diff -r 0bcdfe3fa916 -r 254389ab070e sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sun Dec 08 12:14:40 2019 +0000
+++ b/sys/dev/dksubr.c  Sun Dec 08 12:15:24 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.110 2019/10/05 05:28:44 mlelstv Exp $ */
+/* $NetBSD: dksubr.c,v 1.111 2019/12/08 12:15:24 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.110 2019/10/05 05:28:44 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.111 2019/12/08 12:15:24 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -999,66 +999,6 @@
        lp->d_checksum = dkcksum(lp);
 }
 
-/* This function is taken from ccd.c:1.76  --rcd */
-
-/*
- * XXX this function looks too generic for dksubr.c, shouldn't we
- *     put it somewhere better?
- */
-
-/*
- * Lookup the provided name in the filesystem.  If the file exists,
- * is a valid block device, and isn't being used by anyone else,
- * set *vpp to the file's vnode.
- */
-int
-dk_lookup(struct pathbuf *pb, struct lwp *l, struct vnode **vpp)
-{
-       struct nameidata nd;
-       struct vnode *vp;
-       int     error;
-
-       if (l == NULL)
-               return ESRCH;   /* Is ESRCH the best choice? */
-
-       NDINIT(&nd, LOOKUP, FOLLOW, pb);
-       if ((error = vn_open(&nd, FREAD | FWRITE, 0)) != 0) {
-               DPRINTF((DKDB_FOLLOW|DKDB_INIT),
-                   ("%s: vn_open error = %d\n", __func__, error));
-               return error;
-       }
-
-       vp = nd.ni_vp;
-       if (vp->v_type != VBLK) {
-               error = ENOTBLK;
-               goto out;
-       }
-
-       /* Reopen as anonymous vnode to protect against forced unmount. */
-       if ((error = bdevvp(vp->v_rdev, vpp)) != 0)
-               goto out;
-       VOP_UNLOCK(vp);
-       if ((error = vn_close(vp, FREAD | FWRITE, l->l_cred)) != 0) {
-               vrele(*vpp);
-               return error;
-       }
-       if ((error = VOP_OPEN(*vpp, FREAD | FWRITE, l->l_cred)) != 0) {
-               vrele(*vpp);
-               return error;
-       }
-       mutex_enter((*vpp)->v_interlock);
-       (*vpp)->v_writecount++;
-       mutex_exit((*vpp)->v_interlock);
-
-       IFDEBUG(DKDB_VNODE, vprint("dk_lookup: vnode info", *vpp));
-
-       return 0;
-out:
-       VOP_UNLOCK(vp);
-       (void) vn_close(vp, FREAD | FWRITE, l->l_cred);
-       return error;
-}
-
 MODULE(MODULE_CLASS_MISC, dk_subr, NULL);
 
 static int
diff -r 0bcdfe3fa916 -r 254389ab070e sys/dev/dkvar.h
--- a/sys/dev/dkvar.h   Sun Dec 08 12:14:40 2019 +0000
+++ b/sys/dev/dkvar.h   Sun Dec 08 12:15:24 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkvar.h,v 1.30 2017/11/01 19:15:31 mlelstv Exp $ */
+/* $NetBSD: dkvar.h,v 1.31 2019/12/08 12:15:24 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -110,6 +110,4 @@
 void   dk_getdisklabel(struct dk_softc *, dev_t);
 void   dk_getdefaultlabel(struct dk_softc *, struct disklabel *);
 
-int    dk_lookup(struct pathbuf *, struct lwp *, struct vnode **);
-
 #endif /* ! _DEV_DKVAR_H_ */   



Home | Main Index | Thread Index | Old Index