Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 2019 21:52:06 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353129 - in head/sys: kern sys
Message-ID:  <201910052152.x95Lq6IP021482@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sat Oct  5 21:52:06 2019
New Revision: 353129
URL: https://svnweb.freebsd.org/changeset/base/353129

Log:
  Remove the remnants of SI_CHEAPCLONE
  
  SI_CHEAPCLONE was introduced in r66067 for use with cloned bpfs. It was
  later also used in tty, tun, tap at points. The rough timeline for being
  removed in each of these is as follows:
  
  - r181690: bpf switched to use cdevpriv API by ed@
  - r181905: ed@ rewrote the TTY later to be mpsafe
  - r204464: kib@ removes it from tun/tap, declaring it unused
  
  I've not yet been able to dig up any other consumers in the intervening 9
  years. It is no longer set on any devices in the tree and leaves an
  interesting situation in make_dev_sv where we're ok with the device already
  being set SI_NAMED.

Modified:
  head/sys/kern/kern_conf.c
  head/sys/sys/conf.h

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Sat Oct  5 21:44:18 2019	(r353128)
+++ head/sys/kern/kern_conf.c	Sat Oct  5 21:52:06 2019	(r353129)
@@ -166,12 +166,6 @@ dev_rel(struct cdev *dev)
 	dev->si_refcount--;
 	KASSERT(dev->si_refcount >= 0,
 	    ("dev_rel(%s) gave negative count", devtoname(dev)));
-#if 0
-	if (dev->si_usecount == 0 &&
-	    (dev->si_flags & SI_CHEAPCLONE) && (dev->si_flags & SI_NAMED))
-		;
-	else 
-#endif
 	if (dev->si_devsw == NULL && dev->si_refcount == 0) {
 		LIST_REMOVE(dev, si_list);
 		flag = 1;
@@ -820,17 +814,6 @@ make_dev_sv(struct make_dev_args *args1, struct cdev *
 		dev_refl(dev);
 	if ((args.mda_flags & MAKEDEV_ETERNAL) != 0)
 		dev->si_flags |= SI_ETERNAL;
-	if (dev->si_flags & SI_CHEAPCLONE &&
-	    dev->si_flags & SI_NAMED) {
-		/*
-		 * This is allowed as it removes races and generally
-		 * simplifies cloning devices.
-		 * XXX: still ??
-		 */
-		dev_unlock_and_free();
-		*dres = dev;
-		return (0);
-	}
 	KASSERT(!(dev->si_flags & SI_NAMED),
 	    ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)",
 	    args.mda_devsw->d_name, dev2unit(dev), devtoname(dev)));
@@ -1565,7 +1548,6 @@ DB_SHOW_COMMAND(cdev, db_show_cdev)
 	SI_FLAG(SI_ETERNAL);
 	SI_FLAG(SI_ALIAS);
 	SI_FLAG(SI_NAMED);
-	SI_FLAG(SI_CHEAPCLONE);
 	SI_FLAG(SI_CHILD);
 	SI_FLAG(SI_DUMPDEV);
 	SI_FLAG(SI_CLONELIST);

Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h	Sat Oct  5 21:44:18 2019	(r353128)
+++ head/sys/sys/conf.h	Sat Oct  5 21:52:06 2019	(r353129)
@@ -59,7 +59,7 @@ struct cdev {
 #define	SI_ETERNAL	0x0001	/* never destroyed */
 #define	SI_ALIAS	0x0002	/* carrier of alias name */
 #define	SI_NAMED	0x0004	/* make_dev{_alias} has been called */
-#define	SI_CHEAPCLONE	0x0008	/* can be removed_dev'ed when vnode reclaims */
+#define	SI_UNUSED1	0x0008	/* unused */
 #define	SI_CHILD	0x0010	/* child of another struct cdev **/
 #define	SI_DUMPDEV	0x0080	/* is kernel dumpdev */
 #define	SI_CLONELIST	0x0200	/* on a clone list */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910052152.x95Lq6IP021482>