diff options
author | dg <dg@FreeBSD.org> | 1995-07-07 13:41:28 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-07-07 13:41:28 +0000 |
commit | 0c5108c02108798fd4fdf4c1d1c5eb4d3912db14 (patch) | |
tree | 56836e9cf97159ec7d229e9961fc2aafca8bb019 /sys/tools | |
parent | e8134f91a6c944496cb20892aa982090785dba10 (diff) | |
download | FreeBSD-src-0c5108c02108798fd4fdf4c1d1c5eb4d3912db14.zip FreeBSD-src-0c5108c02108798fd4fdf4c1d1c5eb4d3912db14.tar.gz |
The generated VCALL always uses the first vp which in the case of /link/
might not be handled by the same FS as the directory (e.g. special device
files)...so it must be special-cased. This bug is seen when doing
"ln /dev/console /dev/foo" or equivilent and first appeared after I fixed
the argument order of VOP_LINK. YUCK! There really needs to be a way of
specifying what vp to use in the VCALL; doing this could fix the strategy
and bwrite special-cases, too.
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/vnode_if.awk | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 339e658..5066a1c 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 -# $Id$ +# $Id: vnode_if.sh,v 1.2 1994/08/02 07:43:34 davidg Exp $ # # Script to produce VFS front-end sugar. @@ -372,6 +372,27 @@ static inline int VOP_BWRITE(bp) a.a_bp = bp; return (VCALL((bp)->b_vp, VOFFSET(vop_bwrite), &a)); } + +struct vop_link_args { + struct vnodeop_desc *a_desc; + struct vnode *a_vp; + struct vnode *a_tdvp; + struct componentname *a_cnp; +}; +extern struct vnodeop_desc vop_link_desc; +static inline int VOP_LINK(vp, tdvp, cnp) + struct vnode *vp; + struct vnode *tdvp; + struct componentname *cnp; +{ + struct vop_link_args a; + + a.a_desc = VDESC(vop_link); + a.a_vp = vp; + a.a_tdvp = tdvp; + a.a_cnp = cnp; + return (VCALL(tdvp, VOFFSET(vop_link), &a)); +} END_OF_SPECIAL_CASES cat << END_OF_SPECIAL_CASES >> $CFILE @@ -403,6 +424,22 @@ struct vnodeop_desc vop_bwrite_desc = { VDESC_NO_OFFSET, NULL, }; +int vop_link_vp_offsets[] = { + VOPARG_OFFSETOF(struct vop_link_args,a_vp), + VOPARG_OFFSETOF(struct vop_link_args,a_tdvp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vop_link_desc = { + 0, + "vop_link", + VDESC_VP1_WILLRELE, + vop_link_vp_offsets, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vop_link_args,a_cnp), + NULL, +}; END_OF_SPECIAL_CASES # Add the vfs_op_descs array to the C file. @@ -412,6 +449,7 @@ $AWK ' printf("\t&vop_default_desc, /* MUST BE FIRST */\n"); printf("\t&vop_strategy_desc, /* XXX: SPECIAL CASE */\n"); printf("\t&vop_bwrite_desc, /* XXX: SPECIAL CASE */\n"); + printf("\t&vop_link_desc, /* XXX: SPECIAL CASE */\n"); } END { printf("\tNULL\n};\n"); |