- struct proc *p = current_proc();
- struct vnode *vp, *nvp;
- int ret = 1;
-
-loop:
- simple_lock(&mntvnode_slock);
- for (vp = mp->mnt_vnodelist.lh_first; vp; vp = nvp) {
- if (vp->v_mount != mp) {
- simple_unlock(&mntvnode_slock);
- goto loop;
- }
- nvp = vp->v_mntvnodes.le_next;
- simple_unlock(&mntvnode_slock);
- if (UBCINFOEXISTS(vp)) {
-
- /*
- * Must get a valid reference on the vnode
- * before callig UBC functions
- */
- if (vget(vp, 0, p)) {
- ret = 0;
- simple_lock(&mntvnode_slock);
- continue; /* move on to the next vnode */
- }
- ret &= ubc_clean(vp, 0); /* do not invalidate */
- ret &= ubc_uncache(vp);
- vrele(vp);
- }
- simple_lock(&mntvnode_slock);
- }
- simple_unlock(&mntvnode_slock);
- return (ret);
+ vnode_iterate(mp, 0, ubc_umcallback, 0);
+ return(0);