changeset 6013:fe64a0b9ee89

6627468 The fix for CR# 6274924 has a side-effect such that process_devinfo_tree() takes longer to complete.
author htk
date Thu, 14 Feb 2008 10:00:25 -0800
parents 8151e6fa9ff0
children 305c84c90724
files usr/src/cmd/devfsadm/devfsadm.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/devfsadm/devfsadm.c	Thu Feb 14 06:17:53 2008 -0800
+++ b/usr/src/cmd/devfsadm/devfsadm.c	Thu Feb 14 10:00:25 2008 -0800
@@ -1057,15 +1057,14 @@
  * Called in non-daemon mode to take a snap shot of the devinfo tree.
  * Then it calls the appropriate functions to build /devices and /dev.
  * It also flushes path_to_inst.
- * DINFOCACHE snapshot needs to be updated when devfsadm is run.
- * This will only happen if the flags that devfsadm uses matches the flags
- * that DINFOCACHE uses and that is why flags is set to
- * DI_CACHE_SNAPSHOT_FLAGS.
+ * Except in the devfsadm -i (single driver case), the flags used by devfsadm
+ * needs to match DI_CACHE_SNAPSHOT_FLAGS. That will make DINFOCACHE snapshot
+ * updated.
  */
 void
 process_devinfo_tree()
 {
-	uint_t		flags = DI_CACHE_SNAPSHOT_FLAGS;
+	uint_t		flags;
 	struct dca_impl	dci;
 	char		name[MAXNAMELEN];
 	char		*fcn = "process_devinfo_tree: ";
@@ -1095,6 +1094,7 @@
 		dci.dci_flags |= DCA_LOAD_DRV;
 		(void) snprintf(name, sizeof (name), "%s", driver);
 		dci.dci_driver = name;
+		flags = DINFOCPYALL | DINFOPATH;
 
 	} else if (load_attach_drv == TRUE) {
 		/*
@@ -1107,7 +1107,7 @@
 			vprint(CHATTY_MID, "%susing snapshot cache\n", fcn);
 		} else {
 			vprint(CHATTY_MID, "%sattaching all drivers\n", fcn);
-			flags |= DINFOFORCE;
+			flags = DI_CACHE_SNAPSHOT_FLAGS;
 			if (cleanup) {
 				/*
 				 * remove dangling entries from /etc/devices