* Return error if any of the vnodes, ignoring the root vnode * and the syncer vnode, have non-zero usecount. * * This function is purely advisory - it can return false positives * and negatives. */
| 1483 | * and negatives. |
| 1484 | */ |
| 1485 | static int |
| 1486 | vfs_check_usecounts(struct mount *mp) |
| 1487 | { |
| 1488 | struct vnode *vp, *mvp; |
| 1489 | |
| 1490 | MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { |
| 1491 | if ((vp->v_vflag & VV_ROOT) == 0 && vp->v_type != VNON && |
| 1492 | vp->v_usecount != 0) { |
| 1493 | VI_UNLOCK(vp); |
| 1494 | MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); |
| 1495 | return (EBUSY); |
| 1496 | } |
| 1497 | VI_UNLOCK(vp); |
| 1498 | } |
| 1499 | |
| 1500 | return (0); |
| 1501 | } |
| 1502 | |
| 1503 | static void |
| 1504 | dounmount_cleanup(struct mount *mp, struct vnode *coveredvp, int mntkflags) |