usr/src/uts/common/fs/vfs.c
changeset 13832 8e4bcbc31a4a
parent 13178 5f70b43d6386
equal deleted inserted replaced
13831:df991d875843 13832:8e4bcbc31a4a
   933 		vfs_setresource(rootvfs, rootfs.bo_name, 0);
   933 		vfs_setresource(rootvfs, rootfs.bo_name, 0);
   934 		vfs_unlock(rootvfs);
   934 		vfs_unlock(rootvfs);
   935 	}
   935 	}
   936 #endif /* __sparc */
   936 #endif /* __sparc */
   937 
   937 
   938 	/*
   938 	if (strcmp(rootfs.bo_fstype, "zfs") != 0) {
   939 	 * Look up the root device via devfs so that a dv_node is
   939 		/*
   940 	 * created for it. The vnode is never VN_RELE()ed.
   940 		 * Look up the root device via devfs so that a dv_node is
   941 	 * We allocate more than MAXPATHLEN so that the
   941 		 * created for it. The vnode is never VN_RELE()ed.
   942 	 * buffer passed to i_ddi_prompath_to_devfspath() is
   942 		 * We allocate more than MAXPATHLEN so that the
   943 	 * exactly MAXPATHLEN (the function expects a buffer
   943 		 * buffer passed to i_ddi_prompath_to_devfspath() is
   944 	 * of that length).
   944 		 * exactly MAXPATHLEN (the function expects a buffer
   945 	 */
   945 		 * of that length).
   946 	plen = strlen("/devices");
   946 		 */
   947 	path = kmem_alloc(plen + MAXPATHLEN, KM_SLEEP);
   947 		plen = strlen("/devices");
   948 	(void) strcpy(path, "/devices");
   948 		path = kmem_alloc(plen + MAXPATHLEN, KM_SLEEP);
   949 
   949 		(void) strcpy(path, "/devices");
   950 	if (i_ddi_prompath_to_devfspath(rootfs.bo_name, path + plen)
   950 
   951 	    != DDI_SUCCESS ||
   951 		if (i_ddi_prompath_to_devfspath(rootfs.bo_name, path + plen)
   952 	    lookupname(path, UIO_SYSSPACE, FOLLOW, NULLVPP, &rvp)) {
   952 		    != DDI_SUCCESS ||
   953 
   953 		    lookupname(path, UIO_SYSSPACE, FOLLOW, NULLVPP, &rvp)) {
   954 		/* NUL terminate in case "path" has garbage */
   954 
   955 		path[plen + MAXPATHLEN - 1] = '\0';
   955 			/* NUL terminate in case "path" has garbage */
       
   956 			path[plen + MAXPATHLEN - 1] = '\0';
   956 #ifdef	DEBUG
   957 #ifdef	DEBUG
   957 		cmn_err(CE_WARN, "!Cannot lookup root device: %s", path);
   958 			cmn_err(CE_WARN, "!Cannot lookup root device: %s",
       
   959 			    path);
   958 #endif
   960 #endif
   959 	}
   961 		}
   960 	kmem_free(path, plen + MAXPATHLEN);
   962 		kmem_free(path, plen + MAXPATHLEN);
       
   963 	}
       
   964 
   961 	vfs_mnttabvp_setup();
   965 	vfs_mnttabvp_setup();
   962 }
   966 }
   963 
   967 
   964 /*
   968 /*
   965  * Check to see if our "block device" is actually a file.  If so,
   969  * Check to see if our "block device" is actually a file.  If so,