From e37c6c376a1a22a828db3bb5ab40c86cb08f9c86 Mon Sep 17 00:00:00 2001 From: cth Date: Fri, 22 Feb 2008 09:02:16 -0800 Subject: 6453345 devfs_getattr violates devfs locking rules 6527396 devfsadm -C taking hours after reconfiguration reboot 6661843 i_ddi_di_cache_invalidate() should only use taskq_dispatch on valid->invalid 6662461 reserved_links_exist() should be optimized --- usr/src/cmd/devfsadm/devfsadm.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'usr/src/cmd/devfsadm/devfsadm.c') diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c index c7ccb7826c..a06fac3e02 100644 --- a/usr/src/cmd/devfsadm/devfsadm.c +++ b/usr/src/cmd/devfsadm/devfsadm.c @@ -3153,9 +3153,6 @@ rm_parent_dir_if_empty(char *pathname) { char *ptr, path[PATH_MAX + 1]; char *fcn = "rm_parent_dir_if_empty: "; - finddevhdl_t fhandle; - const char *f; - int rv; vprint(REMOVE_MID, "%schecking %s if empty\n", fcn, pathname); @@ -3173,17 +3170,8 @@ rm_parent_dir_if_empty(char *pathname) *ptr = '\0'; - if ((rv = finddev_readdir(path, &fhandle)) != 0) { - err_print(OPENDIR_FAILED, path, strerror(rv)); - return; - } - - /* - * An empty pathlist implies an empty directory - */ - f = finddev_next(fhandle); - finddev_close(fhandle); - if (f == NULL) { + if (finddev_emptydir(path)) { + /* directory is empty */ if (s_rmdir(path) == 0) { vprint(REMOVE_MID, "%sremoving empty dir %s\n", fcn, path); @@ -8969,6 +8957,15 @@ bad_re: return (DEVFSADM_FAILURE); } +/* + * Return 1 if we have reserved links. + */ +int +devfsadm_have_reserved() +{ + return (enumerate_reserved ? 1 : 0); +} + /* * This functions errs on the side of caution. If there is any error * we assume that the devlink is *not* reserved -- cgit v1.2.3