diff -r ce9001c93fec -r a42d76e8d7dc sys/coda/coda_vnops.c --- a/sys/coda/coda_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/coda/coda_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -100,6 +100,7 @@ static int coda_lockdebug = 0; const struct vnodeopv_entry_desc coda_vnodeop_entries[] = { { &vop_default_desc, coda_vop_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, coda_lookup }, /* lookup */ { &vop_create_desc, coda_create }, /* create */ { &vop_mknod_desc, coda_vop_error }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/adosfs/advnops.c --- a/sys/fs/adosfs/advnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/adosfs/advnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -95,6 +95,7 @@ int adosfs_pathconf(void *); const struct vnodeopv_entry_desc adosfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, adosfs_lookup }, /* lookup */ { &vop_create_desc, adosfs_create }, /* create */ { &vop_mknod_desc, adosfs_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/cd9660/cd9660_vnops.c --- a/sys/fs/cd9660/cd9660_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/cd9660/cd9660_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -849,6 +849,7 @@ cd9660_setattr(void *v) int (**cd9660_vnodeop_p)(void *); const struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, cd9660_lookup }, /* lookup */ { &vop_create_desc, cd9660_create }, /* create */ { &vop_mknod_desc, cd9660_mknod }, /* mknod */ @@ -901,6 +902,7 @@ const struct vnodeopv_desc cd9660_vnodeo int (**cd9660_specop_p)(void *); const struct vnodeopv_entry_desc cd9660_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -951,6 +953,7 @@ const struct vnodeopv_desc cd9660_specop int (**cd9660_fifoop_p)(void *); const struct vnodeopv_entry_desc cd9660_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/efs/efs_vnops.c --- a/sys/fs/efs/efs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/efs/efs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -783,6 +783,7 @@ efs_advlock(void *v) int (**efs_vnodeop_p)(void *); const struct vnodeopv_entry_desc efs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error}, /* error handler */ + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, efs_lookup }, /* lookup */ { &vop_create_desc, genfs_eopnotsupp}, /* create */ { &vop_mknod_desc, genfs_eopnotsupp}, /* mknod */ @@ -841,6 +842,7 @@ const struct vnodeopv_desc efs_vnodeop_o int (**efs_specop_p)(void *); const struct vnodeopv_entry_desc efs_specop_entries[] = { { &vop_default_desc, vn_default_error}, /* error handler */ + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -899,6 +901,7 @@ const struct vnodeopv_desc efs_specop_op int (**efs_fifoop_p)(void *); const struct vnodeopv_entry_desc efs_fifoop_entries[] = { { &vop_default_desc, vn_default_error}, /* error handler */ + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/filecorefs/filecore_vnops.c --- a/sys/fs/filecorefs/filecore_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/filecorefs/filecore_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -554,6 +554,7 @@ filecore_pathconf(void *v) int (**filecore_vnodeop_p)(void *); const struct vnodeopv_entry_desc filecore_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, filecore_lookup }, /* lookup */ { &vop_create_desc, filecore_create }, /* create */ { &vop_mknod_desc, filecore_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/hfs/hfs_vnops.c --- a/sys/fs/hfs/hfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/hfs/hfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -132,6 +132,7 @@ #include +int hfs_vop_parsepath(void *); int hfs_vop_lookup(void *); int hfs_vop_open(void *); int hfs_vop_close(void *); @@ -155,6 +156,7 @@ int hfs_vop_print(void *); int (**hfs_vnodeop_p) (void *); const struct vnodeopv_entry_desc hfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, hfs_vop_lookup }, /* lookup */ { &vop_create_desc, genfs_eopnotsupp }, /* create */ { &vop_whiteout_desc, genfs_eopnotsupp }, /* whiteout */ @@ -212,6 +214,7 @@ const struct vnodeopv_desc hfs_vnodeop_o int (**hfs_specop_p) (void *); const struct vnodeopv_entry_desc hfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -270,6 +273,7 @@ const struct vnodeopv_desc hfs_specop_op int (**hfs_fifoop_p) (void *); const struct vnodeopv_entry_desc hfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ @@ -325,6 +329,29 @@ const struct vnodeopv_desc hfs_fifoop_op { &hfs_fifoop_p, hfs_fifoop_entries }; int +hfs_vop_parsepath(void *v) +{ + struct vop_parsepath_args /* { + struct vnode *a_dvp; + const char *a_name; + size_t *a_retval; + } */ *ap = v; + size_t len; + int error; + + error = genfs_parsepath(v); + if (error) { + return error; + } + + len = *ap->a_retval; + if (!strcmp(ap->a_name + len, "/rsrc")) { + *ap->a_retval += 5; + } + return 0; +} + +int hfs_vop_lookup(void *v) { struct vop_lookup_v2_args /* { @@ -340,6 +367,8 @@ hfs_vop_lookup(void *v) struct vnode *vdp; /* vnode for directory being searched */ hfs_catalog_key_t key; /* hfs+ catalog search key for requested child */ hfs_catalog_keyed_record_t rec; /* catalog record of requested child */ + size_t namelen; + int use_resource_fork = 0; unichar_t* unicn; /* name of component, in Unicode */ const char *pname; int error; @@ -414,12 +443,18 @@ hfs_vop_lookup(void *v) hfslib_init_cbargs(&cbargs); + namelen = cnp->cn_namelen; + if (namelen > 5 && + !strcmp(cnp->cn_nameptr + namelen - 5, "/rsrc")) { + namelen -= 5; + use_resource_fork = 1; + } + /* XXX: when decomposing, string could grow and we have to handle overflow */ - unicn = malloc(cnp->cn_namelen * sizeof(unicn[0]), - M_TEMP, M_WAITOK); - len = utf8_to_utf16(unicn, cnp->cn_namelen, - cnp->cn_nameptr, cnp->cn_namelen, 0, NULL); + unicn = malloc(namelen * sizeof(unicn[0]), M_TEMP, M_WAITOK); + len = utf8_to_utf16(unicn, namelen, + cnp->cn_nameptr, namelen, 0, NULL); for (ni = 0; ni < len; ni++) if (unicn[ni] == (unichar_t)':') unicn[ni] = (unichar_t)'/'; @@ -456,13 +491,11 @@ hfs_vop_lookup(void *v) } if (rec.type == HFS_REC_FILE - && strcmp(cnp->cn_nameptr+cnp->cn_namelen, "/rsrc") == 0 + && use_resource_fork && rec.file.rsrc_fork.logical_size > 0) { - /* advance namei next pointer to end of stirng */ - cnp->cn_consume = 5; - cnp->cn_flags &= ~REQUIREDIR; /* XXX: needed? */ - error = hfs_vget_internal(vdp->v_mount, rec.file.cnid, - HFS_RSRCFORK, &tdp); + /* advance namei next pointer to end of string */ + error = hfs_vget_internal(vdp->v_mount, rec.file.cnid, + HFS_RSRCFORK, &tdp); } else error = hfs_vget_internal(vdp->v_mount, rec.file.cnid, HFS_DATAFORK, &tdp); diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/msdosfs/msdosfs_vnops.c --- a/sys/fs/msdosfs/msdosfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/msdosfs/msdosfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -1878,6 +1878,7 @@ msdosfs_detimes(struct denode *dep, cons int (**msdosfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, msdosfs_lookup }, /* lookup */ { &vop_create_desc, msdosfs_create }, /* create */ { &vop_mknod_desc, genfs_eopnotsupp }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/nilfs/nilfs_vnops.c --- a/sys/fs/nilfs/nilfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/nilfs/nilfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -1554,6 +1554,7 @@ int (**nilfs_vnodeop_p) __P((void *)); const struct vnodeopv_entry_desc nilfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, nilfs_lookup }, /* lookup */ { &vop_create_desc, nilfs_create }, /* create */ { &vop_mknod_desc, nilfs_mknod }, /* mknod */ /* TODO */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/ntfs/ntfs_vnops.c --- a/sys/fs/ntfs/ntfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/ntfs/ntfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -814,6 +814,7 @@ vop_t **ntfs_vnodeop_p; const struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) ntfs_bypass }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, (vop_t *) ntfs_lookup }, /* lookup */ { &vop_create_desc, genfs_eopnotsupp }, /* create */ { &vop_mknod_desc, genfs_eopnotsupp }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/ptyfs/ptyfs_vnops.c --- a/sys/fs/ptyfs/ptyfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/ptyfs/ptyfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -166,6 +166,7 @@ static int atoi(const char *, size_t); int (**ptyfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc ptyfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, ptyfs_lookup }, /* lookup */ { &vop_create_desc, ptyfs_create }, /* create */ { &vop_mknod_desc, ptyfs_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/puffs/puffs_vnops.c --- a/sys/fs/puffs/puffs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/puffs/puffs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -105,6 +105,7 @@ int puffs_vnop_checkop(void *); int (**puffs_vnodeop_p)(void *); const struct vnodeopv_entry_desc puffs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, puffs_vnop_lookup }, /* REAL lookup */ { &vop_create_desc, puffs_vnop_checkop }, /* create */ { &vop_mknod_desc, puffs_vnop_checkop }, /* mknod */ @@ -162,6 +163,7 @@ const struct vnodeopv_desc puffs_vnodeop int (**puffs_specop_p)(void *); const struct vnodeopv_entry_desc puffs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup, ENOTDIR */ { &vop_create_desc, spec_create }, /* genfs_badop */ { &vop_mknod_desc, spec_mknod }, /* genfs_badop */ @@ -221,6 +223,7 @@ const struct vnodeopv_desc puffs_specop_ int (**puffs_fifoop_p)(void *); const struct vnodeopv_entry_desc puffs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup, ENOTDIR */ { &vop_create_desc, vn_fifo_bypass }, /* genfs_badop */ { &vop_mknod_desc, vn_fifo_bypass }, /* genfs_badop */ @@ -703,9 +706,10 @@ puffs_vnop_lookup(void *v) /* 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 ce9001c93fec -r a42d76e8d7dc sys/fs/smbfs/smbfs_vnops.c --- a/sys/fs/smbfs/smbfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/smbfs/smbfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -137,6 +137,7 @@ static struct vnodeopv_entry_desc smbfs_ { &vop_islocked_desc, genfs_islocked }, { &vop_link_desc, smbfs_link }, { &vop_lock_desc, genfs_lock }, + { &vop_parsepath_desc, genfs_parsepath }, { &vop_lookup_desc, smbfs_lookup }, { &vop_mkdir_desc, smbfs_mkdir }, { &vop_mknod_desc, genfs_eopnotsupp }, diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/sysvbfs/sysvbfs.c --- a/sys/fs/sysvbfs/sysvbfs.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/sysvbfs/sysvbfs.c Sun Apr 17 01:24:46 2016 -0400 @@ -49,6 +49,7 @@ int (**sysvbfs_vnodeop_p)(void *); /* fi const struct vnodeopv_entry_desc sysvbfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, sysvbfs_lookup }, /* lookup */ { &vop_create_desc, sysvbfs_create }, /* create */ { &vop_mknod_desc, genfs_eopnotsupp }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/tmpfs/tmpfs_fifoops.c --- a/sys/fs/tmpfs/tmpfs_fifoops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/tmpfs/tmpfs_fifoops.c Sun Apr 17 01:24:46 2016 -0400 @@ -49,6 +49,7 @@ int (**tmpfs_fifoop_p)(void *); const struct vnodeopv_entry_desc tmpfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, { &vop_lookup_desc, tmpfs_fifo_lookup }, { &vop_create_desc, tmpfs_fifo_create }, { &vop_mknod_desc, tmpfs_fifo_mknod }, diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/tmpfs/tmpfs_specops.c --- a/sys/fs/tmpfs/tmpfs_specops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/tmpfs/tmpfs_specops.c Sun Apr 17 01:24:46 2016 -0400 @@ -52,6 +52,7 @@ int (**tmpfs_specop_p)(void *); const struct vnodeopv_entry_desc tmpfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, { &vop_lookup_desc, tmpfs_spec_lookup }, { &vop_create_desc, tmpfs_spec_create }, { &vop_mknod_desc, tmpfs_spec_mknod }, diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/tmpfs/tmpfs_vnops.c --- a/sys/fs/tmpfs/tmpfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/tmpfs/tmpfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -64,6 +64,7 @@ int (**tmpfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc tmpfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, { &vop_lookup_desc, tmpfs_lookup }, { &vop_create_desc, tmpfs_create }, { &vop_mknod_desc, tmpfs_mknod }, diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/udf/udf_vnops.c --- a/sys/fs/udf/udf_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/udf/udf_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -2185,6 +2185,7 @@ int (**udf_vnodeop_p)(void *); const struct vnodeopv_entry_desc udf_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, udf_lookup }, /* lookup */ { &vop_create_desc, udf_create }, /* create */ { &vop_mknod_desc, udf_mknod }, /* mknod */ /* TODO */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/union/union_vnops.c --- a/sys/fs/union/union_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/union/union_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -93,6 +93,7 @@ #include #include +int union_parsepath(void *); int union_lookup(void *); int union_create(void *); int union_whiteout(void *); @@ -144,6 +145,7 @@ static int union_lookup1(struct vnode *, int (**union_vnodeop_p)(void *); const struct vnodeopv_entry_desc union_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, union_parsepath }, /* parsepath */ { &vop_lookup_desc, union_lookup }, /* lookup */ { &vop_create_desc, union_create }, /* create */ { &vop_whiteout_desc, union_whiteout }, /* whiteout */ @@ -195,6 +197,40 @@ const struct vnodeopv_desc union_vnodeop ((vp)->v_type == VBLK || (vp)->v_type == VCHR || \ (vp)->v_type == VSOCK || (vp)->v_type == VFIFO) +int +union_parsepath(void *v) +{ + struct vop_parsepath_args /* { + struct vnode *a_dvp; + const char *a_name; + size_t *a_retval; + } */ *ap = v; + struct vnode *upperdvp, *lowerdvp; + size_t upper, lower; + int error; + + upperdvp = UPPERVP(ap->a_dvp); + lowerdvp = LOWERVP(ap->a_dvp); + + error = VOP_PARSEPATH(upperdvp, ap->a_name, &upper); + if (error) { + return error; + } + + error = VOP_PARSEPATH(lowerdvp, ap->a_name, &lower); + if (error) { + return error; + } + + /* + * If they're different, use the larger one. This is not a + * comprehensive solution, but it's sufficient for the + * non-default cases of parsepath that currently exist. + */ + *ap->a_retval = MAX(upper, lower); + return 0; +} + static int union_lookup1(struct vnode *udvp, struct vnode **dvpp, struct vnode **vpp, struct componentname *cnp) @@ -321,12 +357,6 @@ start: 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; @@ -378,18 +408,6 @@ start: 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 ce9001c93fec -r a42d76e8d7dc sys/fs/unionfs/unionfs_subr.c --- a/sys/fs/unionfs/unionfs_subr.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/unionfs/unionfs_subr.c Sun Apr 17 01:24:46 2016 -0400 @@ -317,7 +317,6 @@ unionfs_relookup(struct vnode *dvp, stru 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 @@ unionfs_vn_create_on_upper(struct vnode 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 @@ unionfs_check_rmdir(struct vnode *vp, ka 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 ce9001c93fec -r a42d76e8d7dc sys/fs/unionfs/unionfs_vnops.c --- a/sys/fs/unionfs/unionfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/unionfs/unionfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -65,6 +65,42 @@ #endif static int +unionfs_parsepath(void *v) +{ + struct vop_parsepath_args /* { + struct vnode *a_dvp; + const char *a_name; + size_t *a_retval; + } */ *ap = v; + struct unionfs_node *dunp; + struct vnode *upperdvp, *lowerdvp; + size_t upper, lower; + int error; + + dunp = VTOUNIONFS(ap->a_dvp); + upperdvp = dunp->un_uppervp; + lowerdvp = dunp->un_lowervp; + + error = VOP_PARSEPATH(upperdvp, ap->a_name, &upper); + if (error) { + return error; + } + + error = VOP_PARSEPATH(lowerdvp, ap->a_name, &lower); + if (error) { + return error; + } + + /* + * If they're different, use the larger one. This is not a + * comprehensive solution, but it's sufficient for the + * non-default cases of parsepath that currently exist. + */ + *ap->a_retval = MAX(upper, lower); + return 0; +} + +static int unionfs_lookup(void *v) { struct vop_lookup_args *ap = v; @@ -1809,6 +1845,7 @@ unionfs_revoke(void *v) int (**unionfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc unionfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, unionfs_parsepath }, /* parsepath */ { &vop_lookup_desc, unionfs_lookup }, /* lookup */ { &vop_create_desc, unionfs_create }, /* create */ { &vop_whiteout_desc, unionfs_whiteout }, /* whiteout */ diff -r ce9001c93fec -r a42d76e8d7dc sys/fs/v7fs/v7fs_extern.c --- a/sys/fs/v7fs/v7fs_extern.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/fs/v7fs/v7fs_extern.c Sun Apr 17 01:24:46 2016 -0400 @@ -55,6 +55,7 @@ int (**v7fs_vnodeop_p)(void *); /* fille const struct vnodeopv_entry_desc v7fs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, v7fs_lookup }, /* lookup */ { &vop_create_desc, v7fs_create }, /* create */ { &vop_mknod_desc, v7fs_mknod }, /* mknod */ @@ -104,6 +105,7 @@ const struct vnodeopv_entry_desc v7fs_vn int (**v7fs_specop_p)(void *); const struct vnodeopv_entry_desc v7fs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create xxx*/ { &vop_mknod_desc, spec_mknod }, /* mknod xxx*/ @@ -152,6 +154,7 @@ const struct vnodeopv_entry_desc v7fs_sp int (**v7fs_fifoop_p)(void *); const struct vnodeopv_entry_desc v7fs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/kern/vfs_getcwd.c --- a/sys/kern/vfs_getcwd.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/kern/vfs_getcwd.c Sun Apr 17 01:24:46 2016 -0400 @@ -130,7 +130,6 @@ getcwd_scandir(struct vnode **lvpp, stru 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 ce9001c93fec -r a42d76e8d7dc sys/kern/vfs_lookup.c --- a/sys/kern/vfs_lookup.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/kern/vfs_lookup.c Sun Apr 17 01:24:46 2016 -0400 @@ -224,22 +224,6 @@ namei_hash(const char *name, const char return (hash + (hash >> 5)); } -/* - * Find the end of the first path component in NAME and return its - * length. - */ -static size_t -namei_getcomponent(const char *name) -{ - size_t pos; - - pos = 0; - while (name[pos] != '\0' && name[pos] != '/') { - pos++; - } - return pos; -} - //////////////////////////////////////////////////////////// /* @@ -816,9 +800,10 @@ namei_follow(struct namei_state *state, * Inspect the leading path component and update the state accordingly. */ static int -lookup_parsepath(struct namei_state *state) +lookup_parsepath(struct namei_state *state, struct vnode *searchdir) { const char *cp; /* pointer into pathname argument */ + int error; struct componentname *cnp = state->cnp; struct nameidata *ndp = state->ndp; @@ -836,8 +821,10 @@ lookup_parsepath(struct namei_state *sta * At this point, our only vnode state is that the search dir * is held and locked. */ - cnp->cn_consume = 0; - cnp->cn_namelen = namei_getcomponent(cnp->cn_nameptr); + error = VOP_PARSEPATH(searchdir, cnp->cn_nameptr, &cnp->cn_namelen); + if (error) { + return error; + } cp = cnp->cn_nameptr + cnp->cn_namelen; if (cnp->cn_namelen > KERNEL_NAME_MAX) { return ENAMETOOLONG; @@ -1050,19 +1037,6 @@ unionlookup: #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. */ @@ -1222,7 +1196,7 @@ namei_oneroot(struct namei_state *state, /* and we shouldn't have looped around if we were done */ KASSERT(cnp->cn_nameptr[0] != '\0'); - error = lookup_parsepath(state); + error = lookup_parsepath(state, searchdir); if (error) { vput(searchdir); ndp->ni_dvp = NULL; @@ -1618,7 +1592,7 @@ lookup_for_nfsd(struct nameidata *ndp, s static int do_lookup_for_nfsd_index(struct namei_state *state) { - int error = 0; + int error; struct componentname *cnp = state->cnp; struct nameidata *ndp = state->ndp; @@ -1635,8 +1609,11 @@ do_lookup_for_nfsd_index(struct namei_st state->rdonly = cnp->cn_flags & RDONLY; ndp->ni_dvp = NULL; - cnp->cn_consume = 0; - cnp->cn_namelen = namei_getcomponent(cnp->cn_nameptr); + error = VOP_PARSEPATH(startdir, cnp->cn_nameptr, &cnp->cn_namelen); + if (error) { + return error; + } + cp = cnp->cn_nameptr + cnp->cn_namelen; KASSERT(cnp->cn_namelen <= KERNEL_NAME_MAX); ndp->ni_pathlen -= cnp->cn_namelen; @@ -1760,7 +1737,10 @@ relookup(struct vnode *dvp, struct vnode if ((uint32_t)newhash != (uint32_t)cnp->cn_hash) panic("relookup: bad hash"); #endif - newlen = namei_getcomponent(cnp->cn_nameptr); + error = VOP_PARSEPATH(dvp, cnp->cn_nameptr, &newlen); + if (error) { + panic("relookup: parsepath failed with error %d", error); + } if (cnp->cn_namelen != newlen) panic("relookup: bad len"); cp = cnp->cn_nameptr + cnp->cn_namelen; diff -r ce9001c93fec -r a42d76e8d7dc sys/kern/vnode_if.c --- a/sys/kern/vnode_if.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/kern/vnode_if.c Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: vnode_if.c,v 1.96 2016/01/26 23:30:10 pooka Exp $ */ +/* $NetBSD$ */ /* * Warning: DO NOT EDIT! This file is automatically generated! @@ -7,7 +7,7 @@ * Created from the file: * NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp * by the script: - * NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp + * NetBSD: vnode_if.sh,v 1.61 2016/01/26 23:28:06 pooka Exp */ /* @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.96 2016/01/26 23:30:10 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -89,6 +89,38 @@ VOP_BWRITE(struct vnode *vp, return error; } +const int vop_parsepath_vp_offsets[] = { + VOPARG_OFFSETOF(struct vop_parsepath_args,a_dvp), + VDESC_NO_OFFSET +}; +const struct vnodeop_desc vop_parsepath_desc = { + VOP_PARSEPATH_DESCOFFSET, + "vop_parsepath", + 0, + vop_parsepath_vp_offsets, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, +}; +int +VOP_PARSEPATH(struct vnode *dvp, + const char *name, + size_t *retval) +{ + int error; + bool mpsafe; + struct vop_parsepath_args a; + a.a_desc = VDESC(vop_parsepath); + a.a_dvp = dvp; + a.a_name = name; + a.a_retval = retval; + mpsafe = (dvp->v_vflag & VV_MPSAFE); + if (!mpsafe) { KERNEL_LOCK(1, curlwp); } + error = (VCALL(dvp, VOFFSET(vop_parsepath), &a)); + if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); } + return error; +} + const int vop_lookup_vp_offsets[] = { VOPARG_OFFSETOF(struct vop_lookup_v2_args,a_dvp), VDESC_NO_OFFSET @@ -1706,6 +1738,7 @@ const struct vnodeop_desc * const vfs_op &vop_default_desc, /* MUST BE FIRST */ &vop_bwrite_desc, + &vop_parsepath_desc, &vop_lookup_desc, &vop_create_desc, &vop_mknod_desc, diff -r ce9001c93fec -r a42d76e8d7dc sys/kern/vnode_if.src --- a/sys/kern/vnode_if.src Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/kern/vnode_if.src Sun Apr 17 01:24:46 2016 -0400 @@ -58,6 +58,15 @@ vop_bwrite { IN struct vnode *vp; IN struct buf *bp; }; + +# +#% parsepath dvp L L L +# +vop_parsepath { + IN struct vnode *dvp; + IN const char *name; + OUT size_t *retval; +}; # #% lookup dvp L L L diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/deadfs/dead_vnops.c --- a/sys/miscfs/deadfs/dead_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/deadfs/dead_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -82,6 +82,7 @@ int (**dead_vnodeop_p)(void *); const struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_default_desc, dead_default_error }, { &vop_bwrite_desc, dead_bwrite }, /* bwrite */ + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, dead_lookup }, /* lookup */ { &vop_open_desc, dead_open }, /* open */ { &vop_close_desc, dead_close }, /* close */ diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/fdesc/fdesc_vnops.c --- a/sys/miscfs/fdesc/fdesc_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/fdesc/fdesc_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -120,6 +120,7 @@ static int fdesc_attr(int, struct vattr int (**fdesc_vnodeop_p)(void *); const struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, fdesc_lookup }, /* lookup */ { &vop_create_desc, fdesc_create }, /* create */ { &vop_mknod_desc, fdesc_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/fifofs/fifo_vnops.c --- a/sys/miscfs/fifofs/fifo_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/fifofs/fifo_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -623,6 +623,7 @@ fifo_kqfilter(void *v) int (**fifo_vnodeop_p)(void *); const struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, fifo_lookup }, /* lookup */ { &vop_create_desc, genfs_badop }, /* create */ { &vop_mknod_desc, genfs_badop }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/genfs/genfs.h --- a/sys/miscfs/genfs/genfs.h Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/genfs/genfs.h Sun Apr 17 01:24:46 2016 -0400 @@ -24,6 +24,7 @@ int genfs_deadlock(void *); #define genfs_deadislocked genfs_islocked int genfs_deadunlock(void *); +int genfs_parsepath(void *); int genfs_poll(void *); int genfs_kqfilter(void *); int genfs_fcntl(void *); diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/genfs/genfs_vnops.c --- a/sys/miscfs/genfs/genfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/genfs/genfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -86,6 +86,31 @@ static void filt_genfsdetach(struct knot static int filt_genfsread(struct knote *, long); static int filt_genfsvnode(struct knote *, long); +/* + * Find the end of the first path component in NAME and return its + * length. + */ +int +genfs_parsepath(void *v) +{ + struct vop_parsepath_args /* { + struct vnode *a_dvp; + const char *a_name; + size_t *a_ret; + } */ *ap = v; + const char *name = ap->a_name; + size_t pos; + + (void)ap->a_dvp; + + pos = 0; + while (name[pos] != '\0' && name[pos] != '/') { + pos++; + } + *ap->a_retval = pos; + return 0; +} + int genfs_poll(void *v) { diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/kernfs/kernfs_vnops.c --- a/sys/miscfs/kernfs/kernfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/kernfs/kernfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -181,6 +181,7 @@ static int kernfs_xwrite(const struct ke int (**kernfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, kernfs_lookup }, /* lookup */ { &vop_create_desc, kernfs_create }, /* create */ { &vop_mknod_desc, kernfs_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/procfs/procfs_vnops.c --- a/sys/miscfs/procfs/procfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/procfs/procfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -249,6 +249,7 @@ static int atoi(const char *, size_t); int (**procfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, procfs_lookup }, /* lookup */ { &vop_create_desc, procfs_create }, /* create */ { &vop_mknod_desc, procfs_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/miscfs/specfs/spec_vnops.c --- a/sys/miscfs/specfs/spec_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/miscfs/specfs/spec_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -114,6 +114,7 @@ extern struct mount *dead_rootmount; int (**spec_vnodeop_p)(void *); const struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/nfs/nfs_vnops.c --- a/sys/nfs/nfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/nfs/nfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -97,6 +97,7 @@ int (**nfsv2_vnodeop_p)(void *); const struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, nfs_lookup }, /* lookup */ { &vop_create_desc, nfs_create }, /* create */ { &vop_mknod_desc, nfs_mknod }, /* mknod */ @@ -150,6 +151,7 @@ const struct vnodeopv_desc nfsv2_vnodeop int (**spec_nfsv2nodeop_p)(void *); const struct vnodeopv_entry_desc spec_nfsv2nodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -200,6 +202,7 @@ const struct vnodeopv_desc spec_nfsv2nod int (**fifo_nfsv2nodeop_p)(void *); const struct vnodeopv_entry_desc fifo_nfsv2nodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/rump/include/rump/rump_namei.h --- a/sys/rump/include/rump/rump_namei.h Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/rump/include/rump/rump_namei.h Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_namei.h,v 1.27 2015/04/21 03:19:03 riastradh Exp $ */ +/* $NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp $ */ /* diff -r ce9001c93fec -r a42d76e8d7dc sys/rump/include/rump/rumpvnode_if.h --- a/sys/rump/include/rump/rumpvnode_if.h Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/rump/include/rump/rumpvnode_if.h Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpvnode_if.h,v 1.20 2016/01/26 23:30:10 pooka Exp $ */ +/* $NetBSD$ */ /* * Warning: DO NOT EDIT! This file is automatically generated! @@ -7,7 +7,7 @@ * Created from the file: * NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp * by the script: - * NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp + * NetBSD: vnode_if.sh,v 1.61 2016/01/26 23:28:06 pooka Exp */ /* @@ -52,6 +52,7 @@ struct vm_page; #endif int RUMP_VOP_BWRITE(struct vnode *, struct buf *); +int RUMP_VOP_PARSEPATH(struct vnode *, const char *, size_t *); int RUMP_VOP_LOOKUP(struct vnode *, struct vnode **, struct componentname *); int RUMP_VOP_CREATE(struct vnode *, struct vnode **, struct componentname *, struct vattr *); diff -r ce9001c93fec -r a42d76e8d7dc sys/rump/librump/rumpvfs/rumpfs.c --- a/sys/rump/librump/rumpvfs/rumpfs.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/rump/librump/rumpvfs/rumpfs.c Sun Apr 17 01:24:46 2016 -0400 @@ -61,6 +61,7 @@ #include #include +static int rump_vop_parsepath(void *); static int rump_vop_lookup(void *); static int rump_vop_getattr(void *); static int rump_vop_setattr(void *); @@ -99,6 +100,7 @@ const struct vnodeopv_desc fifo_vnodeop_ int (**rump_vnodeop_p)(void *); const struct vnodeopv_entry_desc rump_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, rump_vop_parsepath }, { &vop_lookup_desc, rump_vop_lookup }, { &vop_getattr_desc, rump_vop_getattr }, { &vop_setattr_desc, rump_vop_setattr }, @@ -610,6 +612,33 @@ freedir(struct rumpfs_node *rnd, struct } /* + * parsepath for rump file systems - check for etfs entries. + */ +static int +rump_vop_parsepath(void *v) +{ + struct vop_parsepath_args /* { + struct vnode *a_dvp; + const char *a_name; + size_t *a_retval; + }; */ *ap = v; + struct etfs *et; + bool found; + + /* check for etfs */ + if (ap->a_dvp == rootvnode) { + mutex_enter(&etfs_lock); + found = etfs_find(ap->a_name, &et, false); + mutex_exit(&etfs_lock); + if (found) { + *ap->a_retval = et->et_keylen; + return 0; + } + } + return genfs_parsepath(v); +} + +/* * Simple lookup for rump file systems. * * uhm, this is twisted. C F C C, hope of C C F C looming @@ -630,7 +659,6 @@ rump_vop_lookup(void *v) struct etfs *et; bool dotdot = (cnp->cn_flags & ISDOTDOT) != 0; int rv = 0; - const char *cp; *vpp = NULL; @@ -663,19 +691,18 @@ rump_vop_lookup(void *v) mutex_exit(&etfs_lock); if (found) { + if (et->et_keylen != cnp->cn_namelen) { + /* + * This can theoretically happen if an + * etfs entry is added or removed + * while lookups are being done as we + * don't hold etfs_lock across here + * and parsepath. Won't ordinarily be + * the case. No biggie, just retry. + */ + return ERESTART; + } rn = et->et_rn; - cnp->cn_consume += et->et_keylen - cnp->cn_namelen; - /* - * consume trailing slashes if any and clear - * REQUIREDIR if we consumed the full path. - */ - cp = &cnp->cn_nameptr[cnp->cn_namelen]; - cp += cnp->cn_consume; - KASSERT(*cp == '\0' || *cp == '/'); - if (*cp == '\0' && rn->rn_va.va_type != VDIR) - cnp->cn_flags &= ~REQUIREDIR; - while (*cp++ == '/') - cnp->cn_consume++; goto getvnode; } } diff -r ce9001c93fec -r a42d76e8d7dc sys/rump/librump/rumpvfs/rumpvnode_if.c --- a/sys/rump/librump/rumpvfs/rumpvnode_if.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/rump/librump/rumpvfs/rumpvnode_if.c Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpvnode_if.c,v 1.20 2016/01/26 23:30:10 pooka Exp $ */ +/* $NetBSD$ */ /* * Warning: DO NOT EDIT! This file is automatically generated! @@ -7,7 +7,7 @@ * Created from the file: * NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp * by the script: - * NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp + * NetBSD: vnode_if.sh,v 1.61 2016/01/26 23:28:06 pooka Exp */ /* @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.20 2016/01/26 23:30:10 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD$"); #include #include @@ -64,6 +64,20 @@ RUMP_VOP_BWRITE(struct vnode *vp, } int +RUMP_VOP_PARSEPATH(struct vnode *dvp, + const char *name, + size_t *retval) +{ + int error; + + rump_schedule(); + error = VOP_PARSEPATH(dvp, name, retval); + rump_unschedule(); + + return error; +} + +int RUMP_VOP_LOOKUP(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) diff -r ce9001c93fec -r a42d76e8d7dc sys/sys/namei.h --- a/sys/sys/namei.h Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/sys/namei.h Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: namei.h,v 1.93 2015/04/21 03:19:03 riastradh Exp $ */ +/* $NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp $ */ /* @@ -101,7 +101,6 @@ struct componentname { */ 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 */ }; /* diff -r ce9001c93fec -r a42d76e8d7dc sys/sys/namei.src --- a/sys/sys/namei.src Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/sys/namei.src Sun Apr 17 01:24:46 2016 -0400 @@ -93,7 +93,6 @@ struct componentname { */ 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 */ }; /* diff -r ce9001c93fec -r a42d76e8d7dc sys/sys/vnode_if.h --- a/sys/sys/vnode_if.h Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/sys/vnode_if.h Sun Apr 17 01:24:46 2016 -0400 @@ -1,4 +1,4 @@ -/* $NetBSD: vnode_if.h,v 1.91 2016/01/26 23:30:10 pooka Exp $ */ +/* $NetBSD$ */ /* * Warning: DO NOT EDIT! This file is automatically generated! @@ -7,7 +7,7 @@ * Created from the file: * NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp * by the script: - * NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp + * NetBSD: vnode_if.sh,v 1.61 2016/01/26 23:28:06 pooka Exp */ /* @@ -59,7 +59,17 @@ struct vop_bwrite_args { extern const struct vnodeop_desc vop_bwrite_desc; int VOP_BWRITE(struct vnode *, struct buf *); -#define VOP_LOOKUP_DESCOFFSET 2 +#define VOP_PARSEPATH_DESCOFFSET 2 +struct vop_parsepath_args { + const struct vnodeop_desc *a_desc; + struct vnode *a_dvp; + const char *a_name; + size_t *a_retval; +}; +extern const struct vnodeop_desc vop_parsepath_desc; +int VOP_PARSEPATH(struct vnode *, const char *, size_t *); + +#define VOP_LOOKUP_DESCOFFSET 3 struct vop_lookup_v2_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -69,7 +79,7 @@ struct vop_lookup_v2_args { extern const struct vnodeop_desc vop_lookup_desc; int VOP_LOOKUP(struct vnode *, struct vnode **, struct componentname *); -#define VOP_CREATE_DESCOFFSET 3 +#define VOP_CREATE_DESCOFFSET 4 struct vop_create_v3_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -81,7 +91,7 @@ extern const struct vnodeop_desc vop_cre int VOP_CREATE(struct vnode *, struct vnode **, struct componentname *, struct vattr *); -#define VOP_MKNOD_DESCOFFSET 4 +#define VOP_MKNOD_DESCOFFSET 5 struct vop_mknod_v3_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -93,7 +103,7 @@ extern const struct vnodeop_desc vop_mkn int VOP_MKNOD(struct vnode *, struct vnode **, struct componentname *, struct vattr *); -#define VOP_OPEN_DESCOFFSET 5 +#define VOP_OPEN_DESCOFFSET 6 struct vop_open_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -103,7 +113,7 @@ struct vop_open_args { extern const struct vnodeop_desc vop_open_desc; int VOP_OPEN(struct vnode *, int, kauth_cred_t); -#define VOP_CLOSE_DESCOFFSET 6 +#define VOP_CLOSE_DESCOFFSET 7 struct vop_close_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -113,7 +123,7 @@ struct vop_close_args { extern const struct vnodeop_desc vop_close_desc; int VOP_CLOSE(struct vnode *, int, kauth_cred_t); -#define VOP_ACCESS_DESCOFFSET 7 +#define VOP_ACCESS_DESCOFFSET 8 struct vop_access_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -123,7 +133,7 @@ struct vop_access_args { extern const struct vnodeop_desc vop_access_desc; int VOP_ACCESS(struct vnode *, int, kauth_cred_t); -#define VOP_GETATTR_DESCOFFSET 8 +#define VOP_GETATTR_DESCOFFSET 9 struct vop_getattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -133,7 +143,7 @@ struct vop_getattr_args { extern const struct vnodeop_desc vop_getattr_desc; int VOP_GETATTR(struct vnode *, struct vattr *, kauth_cred_t); -#define VOP_SETATTR_DESCOFFSET 9 +#define VOP_SETATTR_DESCOFFSET 10 struct vop_setattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -143,7 +153,7 @@ struct vop_setattr_args { extern const struct vnodeop_desc vop_setattr_desc; int VOP_SETATTR(struct vnode *, struct vattr *, kauth_cred_t); -#define VOP_READ_DESCOFFSET 10 +#define VOP_READ_DESCOFFSET 11 struct vop_read_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -154,7 +164,7 @@ struct vop_read_args { extern const struct vnodeop_desc vop_read_desc; int VOP_READ(struct vnode *, struct uio *, int, kauth_cred_t); -#define VOP_WRITE_DESCOFFSET 11 +#define VOP_WRITE_DESCOFFSET 12 struct vop_write_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -165,7 +175,7 @@ struct vop_write_args { extern const struct vnodeop_desc vop_write_desc; int VOP_WRITE(struct vnode *, struct uio *, int, kauth_cred_t); -#define VOP_FALLOCATE_DESCOFFSET 12 +#define VOP_FALLOCATE_DESCOFFSET 13 struct vop_fallocate_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -175,7 +185,7 @@ struct vop_fallocate_args { extern const struct vnodeop_desc vop_fallocate_desc; int VOP_FALLOCATE(struct vnode *, off_t, off_t); -#define VOP_FDISCARD_DESCOFFSET 13 +#define VOP_FDISCARD_DESCOFFSET 14 struct vop_fdiscard_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -185,7 +195,7 @@ struct vop_fdiscard_args { extern const struct vnodeop_desc vop_fdiscard_desc; int VOP_FDISCARD(struct vnode *, off_t, off_t); -#define VOP_IOCTL_DESCOFFSET 14 +#define VOP_IOCTL_DESCOFFSET 15 struct vop_ioctl_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -197,7 +207,7 @@ struct vop_ioctl_args { extern const struct vnodeop_desc vop_ioctl_desc; int VOP_IOCTL(struct vnode *, u_long, void *, int, kauth_cred_t); -#define VOP_FCNTL_DESCOFFSET 15 +#define VOP_FCNTL_DESCOFFSET 16 struct vop_fcntl_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -209,7 +219,7 @@ struct vop_fcntl_args { extern const struct vnodeop_desc vop_fcntl_desc; int VOP_FCNTL(struct vnode *, u_int, void *, int, kauth_cred_t); -#define VOP_POLL_DESCOFFSET 16 +#define VOP_POLL_DESCOFFSET 17 struct vop_poll_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -218,7 +228,7 @@ struct vop_poll_args { extern const struct vnodeop_desc vop_poll_desc; int VOP_POLL(struct vnode *, int); -#define VOP_KQFILTER_DESCOFFSET 17 +#define VOP_KQFILTER_DESCOFFSET 18 struct vop_kqfilter_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -227,7 +237,7 @@ struct vop_kqfilter_args { extern const struct vnodeop_desc vop_kqfilter_desc; int VOP_KQFILTER(struct vnode *, struct knote *); -#define VOP_REVOKE_DESCOFFSET 18 +#define VOP_REVOKE_DESCOFFSET 19 struct vop_revoke_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -236,7 +246,7 @@ struct vop_revoke_args { extern const struct vnodeop_desc vop_revoke_desc; int VOP_REVOKE(struct vnode *, int); -#define VOP_MMAP_DESCOFFSET 19 +#define VOP_MMAP_DESCOFFSET 20 struct vop_mmap_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -246,7 +256,7 @@ struct vop_mmap_args { extern const struct vnodeop_desc vop_mmap_desc; int VOP_MMAP(struct vnode *, vm_prot_t, kauth_cred_t); -#define VOP_FSYNC_DESCOFFSET 20 +#define VOP_FSYNC_DESCOFFSET 21 struct vop_fsync_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -258,7 +268,7 @@ struct vop_fsync_args { extern const struct vnodeop_desc vop_fsync_desc; int VOP_FSYNC(struct vnode *, kauth_cred_t, int, off_t, off_t); -#define VOP_SEEK_DESCOFFSET 21 +#define VOP_SEEK_DESCOFFSET 22 struct vop_seek_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -269,7 +279,7 @@ struct vop_seek_args { extern const struct vnodeop_desc vop_seek_desc; int VOP_SEEK(struct vnode *, off_t, off_t, kauth_cred_t); -#define VOP_REMOVE_DESCOFFSET 22 +#define VOP_REMOVE_DESCOFFSET 23 struct vop_remove_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -279,7 +289,7 @@ struct vop_remove_args { extern const struct vnodeop_desc vop_remove_desc; int VOP_REMOVE(struct vnode *, struct vnode *, struct componentname *); -#define VOP_LINK_DESCOFFSET 23 +#define VOP_LINK_DESCOFFSET 24 struct vop_link_v2_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -289,7 +299,7 @@ struct vop_link_v2_args { extern const struct vnodeop_desc vop_link_desc; int VOP_LINK(struct vnode *, struct vnode *, struct componentname *); -#define VOP_RENAME_DESCOFFSET 24 +#define VOP_RENAME_DESCOFFSET 25 struct vop_rename_args { const struct vnodeop_desc *a_desc; struct vnode *a_fdvp; @@ -303,7 +313,7 @@ extern const struct vnodeop_desc vop_ren int VOP_RENAME(struct vnode *, struct vnode *, struct componentname *, struct vnode *, struct vnode *, struct componentname *); -#define VOP_MKDIR_DESCOFFSET 25 +#define VOP_MKDIR_DESCOFFSET 26 struct vop_mkdir_v3_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -315,7 +325,7 @@ extern const struct vnodeop_desc vop_mkd int VOP_MKDIR(struct vnode *, struct vnode **, struct componentname *, struct vattr *); -#define VOP_RMDIR_DESCOFFSET 26 +#define VOP_RMDIR_DESCOFFSET 27 struct vop_rmdir_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -325,7 +335,7 @@ struct vop_rmdir_args { extern const struct vnodeop_desc vop_rmdir_desc; int VOP_RMDIR(struct vnode *, struct vnode *, struct componentname *); -#define VOP_SYMLINK_DESCOFFSET 27 +#define VOP_SYMLINK_DESCOFFSET 28 struct vop_symlink_v3_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -338,7 +348,7 @@ extern const struct vnodeop_desc vop_sym int VOP_SYMLINK(struct vnode *, struct vnode **, struct componentname *, struct vattr *, char *); -#define VOP_READDIR_DESCOFFSET 28 +#define VOP_READDIR_DESCOFFSET 29 struct vop_readdir_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -352,7 +362,7 @@ extern const struct vnodeop_desc vop_rea int VOP_READDIR(struct vnode *, struct uio *, kauth_cred_t, int *, off_t **, int *); -#define VOP_READLINK_DESCOFFSET 29 +#define VOP_READLINK_DESCOFFSET 30 struct vop_readlink_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -362,7 +372,7 @@ struct vop_readlink_args { extern const struct vnodeop_desc vop_readlink_desc; int VOP_READLINK(struct vnode *, struct uio *, kauth_cred_t); -#define VOP_ABORTOP_DESCOFFSET 30 +#define VOP_ABORTOP_DESCOFFSET 31 struct vop_abortop_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -371,7 +381,7 @@ struct vop_abortop_args { extern const struct vnodeop_desc vop_abortop_desc; int VOP_ABORTOP(struct vnode *, struct componentname *); -#define VOP_INACTIVE_DESCOFFSET 31 +#define VOP_INACTIVE_DESCOFFSET 32 struct vop_inactive_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -380,7 +390,7 @@ struct vop_inactive_args { extern const struct vnodeop_desc vop_inactive_desc; int VOP_INACTIVE(struct vnode *, bool *); -#define VOP_RECLAIM_DESCOFFSET 32 +#define VOP_RECLAIM_DESCOFFSET 33 struct vop_reclaim_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -388,7 +398,7 @@ struct vop_reclaim_args { extern const struct vnodeop_desc vop_reclaim_desc; int VOP_RECLAIM(struct vnode *); -#define VOP_LOCK_DESCOFFSET 33 +#define VOP_LOCK_DESCOFFSET 34 struct vop_lock_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -397,7 +407,7 @@ struct vop_lock_args { extern const struct vnodeop_desc vop_lock_desc; int VOP_LOCK(struct vnode *, int); -#define VOP_UNLOCK_DESCOFFSET 34 +#define VOP_UNLOCK_DESCOFFSET 35 struct vop_unlock_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -405,7 +415,7 @@ struct vop_unlock_args { extern const struct vnodeop_desc vop_unlock_desc; int VOP_UNLOCK(struct vnode *); -#define VOP_BMAP_DESCOFFSET 35 +#define VOP_BMAP_DESCOFFSET 36 struct vop_bmap_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -417,7 +427,7 @@ struct vop_bmap_args { extern const struct vnodeop_desc vop_bmap_desc; int VOP_BMAP(struct vnode *, daddr_t, struct vnode **, daddr_t *, int *); -#define VOP_STRATEGY_DESCOFFSET 36 +#define VOP_STRATEGY_DESCOFFSET 37 struct vop_strategy_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -426,7 +436,7 @@ struct vop_strategy_args { extern const struct vnodeop_desc vop_strategy_desc; int VOP_STRATEGY(struct vnode *, struct buf *); -#define VOP_PRINT_DESCOFFSET 37 +#define VOP_PRINT_DESCOFFSET 38 struct vop_print_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -434,7 +444,7 @@ struct vop_print_args { extern const struct vnodeop_desc vop_print_desc; int VOP_PRINT(struct vnode *); -#define VOP_ISLOCKED_DESCOFFSET 38 +#define VOP_ISLOCKED_DESCOFFSET 39 struct vop_islocked_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -442,7 +452,7 @@ struct vop_islocked_args { extern const struct vnodeop_desc vop_islocked_desc; int VOP_ISLOCKED(struct vnode *); -#define VOP_PATHCONF_DESCOFFSET 39 +#define VOP_PATHCONF_DESCOFFSET 40 struct vop_pathconf_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -452,7 +462,7 @@ struct vop_pathconf_args { extern const struct vnodeop_desc vop_pathconf_desc; int VOP_PATHCONF(struct vnode *, int, register_t *); -#define VOP_ADVLOCK_DESCOFFSET 40 +#define VOP_ADVLOCK_DESCOFFSET 41 struct vop_advlock_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -464,7 +474,7 @@ struct vop_advlock_args { extern const struct vnodeop_desc vop_advlock_desc; int VOP_ADVLOCK(struct vnode *, void *, int, struct flock *, int); -#define VOP_WHITEOUT_DESCOFFSET 41 +#define VOP_WHITEOUT_DESCOFFSET 42 struct vop_whiteout_args { const struct vnodeop_desc *a_desc; struct vnode *a_dvp; @@ -474,7 +484,7 @@ struct vop_whiteout_args { extern const struct vnodeop_desc vop_whiteout_desc; int VOP_WHITEOUT(struct vnode *, struct componentname *, int); -#define VOP_GETPAGES_DESCOFFSET 42 +#define VOP_GETPAGES_DESCOFFSET 43 struct vop_getpages_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -490,7 +500,7 @@ extern const struct vnodeop_desc vop_get int VOP_GETPAGES(struct vnode *, voff_t, struct vm_page **, int *, int, vm_prot_t, int, int); -#define VOP_PUTPAGES_DESCOFFSET 43 +#define VOP_PUTPAGES_DESCOFFSET 44 struct vop_putpages_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -501,7 +511,7 @@ struct vop_putpages_args { extern const struct vnodeop_desc vop_putpages_desc; int VOP_PUTPAGES(struct vnode *, voff_t, voff_t, int); -#define VOP_CLOSEEXTATTR_DESCOFFSET 44 +#define VOP_CLOSEEXTATTR_DESCOFFSET 45 struct vop_closeextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -511,7 +521,7 @@ struct vop_closeextattr_args { extern const struct vnodeop_desc vop_closeextattr_desc; int VOP_CLOSEEXTATTR(struct vnode *, int, kauth_cred_t); -#define VOP_GETEXTATTR_DESCOFFSET 45 +#define VOP_GETEXTATTR_DESCOFFSET 46 struct vop_getextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -525,7 +535,7 @@ extern const struct vnodeop_desc vop_get int VOP_GETEXTATTR(struct vnode *, int, const char *, struct uio *, size_t *, kauth_cred_t); -#define VOP_LISTEXTATTR_DESCOFFSET 46 +#define VOP_LISTEXTATTR_DESCOFFSET 47 struct vop_listextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -539,7 +549,7 @@ extern const struct vnodeop_desc vop_lis int VOP_LISTEXTATTR(struct vnode *, int, struct uio *, size_t *, int, kauth_cred_t); -#define VOP_OPENEXTATTR_DESCOFFSET 47 +#define VOP_OPENEXTATTR_DESCOFFSET 48 struct vop_openextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -548,7 +558,7 @@ struct vop_openextattr_args { extern const struct vnodeop_desc vop_openextattr_desc; int VOP_OPENEXTATTR(struct vnode *, kauth_cred_t); -#define VOP_DELETEEXTATTR_DESCOFFSET 48 +#define VOP_DELETEEXTATTR_DESCOFFSET 49 struct vop_deleteextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -559,7 +569,7 @@ struct vop_deleteextattr_args { extern const struct vnodeop_desc vop_deleteextattr_desc; int VOP_DELETEEXTATTR(struct vnode *, int, const char *, kauth_cred_t); -#define VOP_SETEXTATTR_DESCOFFSET 49 +#define VOP_SETEXTATTR_DESCOFFSET 50 struct vop_setextattr_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -572,6 +582,6 @@ extern const struct vnodeop_desc vop_set int VOP_SETEXTATTR(struct vnode *, int, const char *, struct uio *, kauth_cred_t); -#define VNODE_OPS_COUNT 50 +#define VNODE_OPS_COUNT 51 #endif /* !_SYS_VNODE_IF_H_ */ diff -r ce9001c93fec -r a42d76e8d7dc sys/ufs/chfs/chfs_vnops.c --- a/sys/ufs/chfs/chfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/ufs/chfs/chfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -1603,6 +1603,7 @@ int const struct vnodeopv_entry_desc chfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, chfs_lookup }, { &vop_create_desc, chfs_create }, { &vop_mknod_desc, chfs_mknod }, @@ -1661,6 +1662,7 @@ int const struct vnodeopv_entry_desc chfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, { &vop_create_desc, spec_create }, { &vop_mknod_desc, spec_mknod }, @@ -1717,6 +1719,7 @@ int const struct vnodeopv_entry_desc chfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, { &vop_lookup_desc, vn_fifo_bypass }, { &vop_create_desc, vn_fifo_bypass }, { &vop_mknod_desc, vn_fifo_bypass }, diff -r ce9001c93fec -r a42d76e8d7dc sys/ufs/ext2fs/ext2fs_vnops.c --- a/sys/ufs/ext2fs/ext2fs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/ufs/ext2fs/ext2fs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -1130,6 +1130,7 @@ ext2fs_reclaim(void *v) int (**ext2fs_vnodeop_p)(void *); const struct vnodeopv_entry_desc ext2fs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, ext2fs_lookup }, /* lookup */ { &vop_create_desc, ext2fs_create }, /* create */ { &vop_mknod_desc, ext2fs_mknod }, /* mknod */ @@ -1180,6 +1181,7 @@ const struct vnodeopv_desc ext2fs_vnodeo int (**ext2fs_specop_p)(void *); const struct vnodeopv_entry_desc ext2fs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -1230,6 +1232,7 @@ const struct vnodeopv_desc ext2fs_specop int (**ext2fs_fifoop_p)(void *); const struct vnodeopv_entry_desc ext2fs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/ufs/ffs/ffs_vnops.c --- a/sys/ufs/ffs/ffs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/ufs/ffs/ffs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -104,6 +104,7 @@ int (**ffs_vnodeop_p)(void *); const struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, ufs_lookup }, /* lookup */ { &vop_create_desc, ufs_create }, /* create */ { &vop_whiteout_desc, ufs_whiteout }, /* whiteout */ @@ -161,6 +162,7 @@ const struct vnodeopv_desc ffs_vnodeop_o int (**ffs_specop_p)(void *); const struct vnodeopv_entry_desc ffs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -217,6 +219,7 @@ const struct vnodeopv_desc ffs_specop_op int (**ffs_fifoop_p)(void *); const struct vnodeopv_entry_desc ffs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/ufs/lfs/lfs_vnops.c --- a/sys/ufs/lfs/lfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/ufs/lfs/lfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -182,6 +182,7 @@ static int lfs_deleteextattr(void *v); int (**lfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, ulfs_lookup }, /* lookup */ { &vop_create_desc, lfs_create }, /* create */ { &vop_whiteout_desc, ulfs_whiteout }, /* whiteout */ @@ -239,6 +240,7 @@ const struct vnodeopv_desc lfs_vnodeop_o int (**lfs_specop_p)(void *); const struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, spec_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ @@ -295,6 +297,7 @@ const struct vnodeopv_desc lfs_specop_op int (**lfs_fifoop_p)(void *); const struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ { &vop_create_desc, vn_fifo_bypass }, /* create */ { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ diff -r ce9001c93fec -r a42d76e8d7dc sys/ufs/mfs/mfs_vnops.c --- a/sys/ufs/mfs/mfs_vnops.c Tue Apr 12 00:03:06 2016 -0400 +++ b/sys/ufs/mfs/mfs_vnops.c Sun Apr 17 01:24:46 2016 -0400 @@ -58,6 +58,7 @@ int (**mfs_vnodeop_p)(void *); const struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, + { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */ { &vop_lookup_desc, mfs_lookup }, /* lookup */ { &vop_create_desc, mfs_create }, /* create */ { &vop_mknod_desc, mfs_mknod }, /* mknod */