# HG changeset patch # Parent d486395f3c35637230af14c0905d3d22d9f5930e Now remove cn_consume from struct componentname. This change requires a kernel bump. Note though that I'm not going to version the VOP_LOOKUP args structure (or any other args structure) as code that doesn't touch cn_consume doesn't need attention and code that does will fail on it without further intervention. diff -r d486395f3c35 sys/fs/puffs/puffs_vnops.c --- a/sys/fs/puffs/puffs_vnops.c Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/fs/puffs/puffs_vnops.c Sun Apr 17 01:24:29 2016 -0400 @@ -706,9 +706,10 @@ /* XXX */ if ((lookup_msg->pvnr_cn.pkcn_flags & REQUIREDIR) == 0) cnp->cn_flags &= ~REQUIREDIR; - if (lookup_msg->pvnr_cn.pkcn_consume) - cnp->cn_consume = MIN(lookup_msg->pvnr_cn.pkcn_consume, - strlen(cnp->cn_nameptr) - cnp->cn_namelen); + if (lookup_msg->pvnr_cn.pkcn_consume) { + printf("puffs: warning: ignoring cn_consume of %zu chars\n", + lookup_msg->pvnr_cn.pkcn_consume); + } VPTOPP(vp)->pn_nlookup++; diff -r d486395f3c35 sys/fs/union/union_vnops.c --- a/sys/fs/union/union_vnops.c Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/fs/union/union_vnops.c Sun Apr 17 01:24:29 2016 -0400 @@ -357,12 +357,6 @@ if (upperdvp != NULLVP) { uerror = union_lookup1(um->um_uppervp, &upperdvp, &uppervp, cnp); - if (cnp->cn_consume != 0) { - if (uppervp != upperdvp) - VOP_UNLOCK(uppervp); - *ap->a_vpp = uppervp; - return (uerror); - } if (uerror == ENOENT || uerror == EJUSTRETURN) { if (cnp->cn_flags & ISWHITEOUT) { iswhiteout = 1; @@ -414,18 +408,6 @@ if (lowervp != lowerdvp) VOP_UNLOCK(lowerdvp); - - if (cnp->cn_consume != 0) { - if (uppervp != NULLVP) { - if (uppervp == upperdvp) - vrele(uppervp); - else - vput(uppervp); - uppervp = NULLVP; - } - *ap->a_vpp = lowervp; - return (lerror); - } } else { lerror = ENOENT; if ((cnp->cn_flags & ISDOTDOT) && dun->un_pvp != NULLVP) { diff -r d486395f3c35 sys/fs/unionfs/unionfs_subr.c --- a/sys/fs/unionfs/unionfs_subr.c Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/fs/unionfs/unionfs_subr.c Sun Apr 17 01:24:29 2016 -0400 @@ -317,7 +317,6 @@ cn->cn_cred = cnp->cn_cred; cn->cn_nameptr = pnbuf; - cn->cn_consume = cnp->cn_consume; if (nameiop == DELETE) cn->cn_flags |= (cnp->cn_flags & DOWHITEOUT); @@ -629,7 +628,6 @@ cn.cn_flags = (LOCKPARENT | LOCKLEAF | ISLASTCN); cn.cn_cred = cred; cn.cn_nameptr = pnbuf; - cn.cn_consume = 0; vref(udvp); if ((error = relookup(udvp, &vp, &cn, 0)) != 0) @@ -863,7 +861,6 @@ cn.cn_nameiop = LOOKUP; cn.cn_flags = (LOCKPARENT | LOCKLEAF | RDONLY | ISLASTCN); cn.cn_cred = cred; - cn.cn_consume = 0; /* * check entry in lower. diff -r d486395f3c35 sys/kern/vfs_getcwd.c --- a/sys/kern/vfs_getcwd.c Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/kern/vfs_getcwd.c Sun Apr 17 01:24:29 2016 -0400 @@ -130,7 +130,6 @@ cn.cn_cred = cred; cn.cn_nameptr = ".."; cn.cn_namelen = 2; - cn.cn_consume = 0; /* At this point, lvp is locked */ error = VOP_LOOKUP(lvp, uvpp, &cn); diff -r d486395f3c35 sys/kern/vfs_lookup.c --- a/sys/kern/vfs_lookup.c Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/kern/vfs_lookup.c Sun Apr 17 01:24:29 2016 -0400 @@ -821,7 +821,6 @@ * At this point, our only vnode state is that the search dir * is held and locked. */ - cnp->cn_consume = 0; error = VOP_PARSEPATH(searchdir, cnp->cn_nameptr, &cnp->cn_namelen); if (error) { return error; @@ -1038,19 +1037,6 @@ #endif /* NAMEI_DIAGNOSTIC */ /* - * Take into account any additional components consumed by the - * underlying filesystem. This will include any trailing slashes after - * the last component consumed. - */ - if (cnp->cn_consume > 0) { - ndp->ni_pathlen -= cnp->cn_consume - state->slashes; - ndp->ni_next += cnp->cn_consume - state->slashes; - cnp->cn_consume = 0; - if (ndp->ni_next[0] == '\0') - cnp->cn_flags |= ISLASTCN; - } - - /* * "searchdir" is locked and held, "foundobj" is held, * they may be the same vnode. */ @@ -1623,7 +1609,6 @@ state->rdonly = cnp->cn_flags & RDONLY; ndp->ni_dvp = NULL; - cnp->cn_consume = 0; error = VOP_PARSEPATH(startdir, cnp->cn_nameptr, &cnp->cn_namelen); if (error) { return error; diff -r d486395f3c35 sys/sys/namei.src --- a/sys/sys/namei.src Sun Apr 17 01:23:31 2016 -0400 +++ b/sys/sys/namei.src Sun Apr 17 01:24:29 2016 -0400 @@ -93,7 +93,6 @@ */ const char *cn_nameptr; /* pointer to looked up name */ size_t cn_namelen; /* length of looked up comp */ - size_t cn_consume; /* chars to consume in lookup */ }; /*