diff options
| author | cth <none@none> | 2008-02-22 09:02:16 -0800 |
|---|---|---|
| committer | cth <none@none> | 2008-02-22 09:02:16 -0800 |
| commit | e37c6c376a1a22a828db3bb5ab40c86cb08f9c86 (patch) | |
| tree | 4e26a9dc4fb51ae3c275b4a874d16228f566782f /usr/src/cmd/devfsadm/devfsadm.c | |
| parent | 931293416c5362b3d50b217b4390d1c88f7c7500 (diff) | |
| download | illumos-gate-e37c6c376a1a22a828db3bb5ab40c86cb08f9c86.tar.gz | |
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
Diffstat (limited to 'usr/src/cmd/devfsadm/devfsadm.c')
| -rw-r--r-- | usr/src/cmd/devfsadm/devfsadm.c | 25 |
1 files changed, 11 insertions, 14 deletions
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); @@ -8970,6 +8958,15 @@ bad_re: } /* + * 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 */ |
