Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2012 18:39:09 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242088 - head/sys/dev/filemon
Message-ID:  <201210251839.q9PId9We021258@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Thu Oct 25 18:39:09 2012
New Revision: 242088
URL: http://svn.freebsd.org/changeset/base/242088

Log:
  Desupport pre-FreeBSD 7.1.

Modified:
  head/sys/dev/filemon/filemon.c

Modified: head/sys/dev/filemon/filemon.c
==============================================================================
--- head/sys/dev/filemon/filemon.c	Thu Oct 25 18:11:04 2012	(r242087)
+++ head/sys/dev/filemon/filemon.c	Thu Oct 25 18:39:09 2012	(r242088)
@@ -103,47 +103,11 @@ static struct cv access_cv;
 static struct thread *access_owner = NULL;
 static struct thread *access_requester = NULL;
 
-#if __FreeBSD_version < 701000
-static struct clonedevs *filemon_clones;
-static eventhandler_tag	eh_tag;
-#else
 static struct cdev *filemon_dev;
-#endif
 
 #include "filemon_lock.c"
 #include "filemon_wrapper.c"
 
-#if __FreeBSD_version < 701000
-static void
-filemon_clone(void *arg, struct ucred *cred, char *name, int namelen,
-    struct cdev **dev)
-{
-	int u = -1;
-	size_t len;
-
-	if (*dev != NULL)
-		return;
-
-	len = strlen(name);
-
-	if (len != 7)
-		return;
-
-	if (bcmp(name,"filemon", 7) != 0)
-		return;
-
-	/* Clone the device to the new minor number. */
-	if (clone_create(&filemon_clones, &filemon_cdevsw, &u, dev, 0) != 0)
-		/* Create the /dev/filemonNN entry. */
-		*dev = make_dev_cred(&filemon_cdevsw, u, cred, UID_ROOT,
-		    GID_WHEEL, 0666, "filemon%d", u);
-	if (*dev != NULL) {
-		dev_ref(*dev);
-		(*dev)->si_flags |= SI_CHEAPCLONE;
-	}
-}
-#endif
-
 static void
 filemon_dtr(void *data)
 {
@@ -179,11 +143,7 @@ filemon_ioctl(struct cdev *dev, u_long c
 	int error = 0;
 	struct filemon *filemon;
 
-#if __FreeBSD_version < 701000
-	filemon = dev->si_drv1;
-#else
 	devfs_get_cdevpriv((void **) &filemon);
-#endif
 
 	switch (cmd) {
 	/* Set the output file descriptor. */
@@ -238,11 +198,7 @@ filemon_open(struct cdev *dev, int oflag
 
 	filemon->pid = curproc->p_pid;
 
-#if __FreeBSD_version < 701000
-	dev->si_drv1 = filemon;
-#else
 	devfs_set_cdevpriv(filemon, filemon_dtr);
-#endif
 
 	/* Get exclusive write access. */
 	filemon_lock_write();
@@ -260,14 +216,6 @@ static int
 filemon_close(struct cdev *dev __unused, int flag __unused, int fmt __unused,
     struct thread *td __unused)
 {
-#if __FreeBSD_version < 701000
-	filemon_dtr(dev->si_drv1);
-
-	dev->si_drv1 = NULL;
-
-	/* Schedule this cloned device to be destroyed. */
-	destroy_dev_sched(dev);
-#endif
 
 	return (0);
 }
@@ -281,16 +229,8 @@ filemon_load(void *dummy __unused)
 	/* Install the syscall wrappers. */
 	filemon_wrapper_install();
 
-#if __FreeBSD_version < 701000
-	/* Enable device cloning. */
-	clone_setup(&filemon_clones);
-
-	/* Setup device cloning events. */
-	eh_tag = EVENTHANDLER_REGISTER(dev_clone, filemon_clone, 0, 1000);
-#else
 	filemon_dev = make_dev(&filemon_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666,
 	    "filemon");
-#endif
 }
 
 static int
@@ -305,9 +245,7 @@ filemon_unload(void)
 	if (TAILQ_FIRST(&filemons_inuse) != NULL)
 		error = EBUSY;
 	else {
-#if __FreeBSD_version >= 701000
 		destroy_dev(filemon_dev);
-#endif
 
 		/* Deinstall the syscall wrappers. */
 		filemon_wrapper_deinstall();
@@ -317,19 +255,6 @@ filemon_unload(void)
 	filemon_unlock_write();
 
 	if (error == 0) {
-#if __FreeBSD_version < 701000
-		/*
-		 * Check if there is still an event handler callback registered.
-		*/
-		if (eh_tag != 0) {
-			/* De-register the device cloning event handler. */
-			EVENTHANDLER_DEREGISTER(dev_clone, eh_tag);
-			eh_tag = 0;
-
-			/* Stop device cloning. */
-			clone_cleanup(&filemon_clones);
-		}
-#endif
 		/* free() filemon structs free list. */
 		filemon_lock_write();
 		while ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) {



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