int wind_dentries_2_4(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt) { struct dentry * d = dentry; struct vfsmount * v = vfsmnt; /* wind the dentries onto the stack pages */ for (;;) { /* deleted ? */ if (!IS_ROOT(d) && list_empty(&d->d_hash)) return 0; /* the root */ if (d == root && v == rootmnt) break; if (d == v->mnt_root || IS_ROOT(d)) { if (v->mnt_parent == v) break; /* cross the mount point */ d = v->mnt_mountpoint; v = v->mnt_parent; } push_dname(&d->d_name); d = d->d_parent; } return 1; }
int wind_dentries_2_2(struct dentry * dentry) { struct dentry * root = current->fs->root; if (dentry->d_parent != dentry && list_empty(&dentry->d_hash)) return 0; for (;;) { struct dentry * parent; if (dentry == root) break; dentry = dentry->d_covers; parent = dentry->d_parent; if (dentry == parent) break; push_dname(&dentry->d_name); dentry = parent; } return 1; }