diff --git a/share/man/man9/VOP_CREATE.9 b/share/man/man9/VOP_CREATE.9 index b86a88dce119..7553ef015ffa 100644 --- a/share/man/man9/VOP_CREATE.9 +++ b/share/man/man9/VOP_CREATE.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd November 2, 2018 .Dt VOP_CREATE 9 .Os .Sh NAME @@ -48,7 +48,7 @@ .Ft int .Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" .Ft int -.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "char *target" +.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "const char *target" .Sh DESCRIPTION These entry points create a new file, socket, fifo, device, directory or symlink in a given directory. diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 9515ab8b2509..4f8dd84f4d3d 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -5314,7 +5314,7 @@ zfs_freebsd_symlink(ap) vattr_init_mask(vap); return (zfs_symlink(ap->a_dvp, ap->a_vpp, cnp->cn_nameptr, vap, - ap->a_target, cnp->cn_cred, cnp->cn_thread)); + __DECONST(char *, ap->a_target), cnp->cn_cred, cnp->cn_thread)); } static int diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index e55910aa0d7d..0286d90a9341 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -1521,8 +1521,8 @@ ext2_symlink(struct vop_symlink_args *ap) ip->i_size = len; ip->i_flag |= IN_CHANGE | IN_UPDATE; } else - error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, vp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 88bb39dd8fc9..7d26166e5970 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1708,7 +1708,7 @@ fuse_vnop_symlink(struct vop_symlink_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - char *target = ap->a_target; + const char *target = ap->a_target; struct fuse_dispatcher fdi; diff --git a/sys/fs/nandfs/nandfs_vnops.c b/sys/fs/nandfs/nandfs_vnops.c index b7dbdcaa6f3b..80e98c368cd7 100644 --- a/sys/fs/nandfs/nandfs_vnops.c +++ b/sys/fs/nandfs/nandfs_vnops.c @@ -1939,8 +1939,8 @@ nandfs_symlink(struct vop_symlink_args *ap) len = strlen(ap->a_target); - error = vn_rdwr(UIO_WRITE, *vpp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, *vpp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(*vpp); diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index b9f5789ce016..9dad6591f234 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -474,7 +474,7 @@ int nfsrpc_rename(vnode_t, vnode_t, char *, int, vnode_t, vnode_t, char *, int, int nfsrpc_link(vnode_t, vnode_t, char *, int, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, int *, int *, void *); -int nfsrpc_symlink(vnode_t, char *, int, char *, struct vattr *, +int nfsrpc_symlink(vnode_t, char *, int, const char *, struct vattr *, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *); int nfsrpc_mkdir(vnode_t, char *, int, struct vattr *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index efd26b5b88fc..0bc34e302ea2 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2627,7 +2627,7 @@ nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, * nfs symbolic link create rpc */ APPLESTATIC int -nfsrpc_symlink(vnode_t dvp, char *name, int namelen, char *target, +nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *dstuff) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 1df8842d9734..2cedc3a32efc 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -411,7 +411,7 @@ void tmpfs_ref_node(struct tmpfs_node *node); void tmpfs_ref_node_locked(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, - char *, dev_t, struct tmpfs_node **); + const char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool); void tmpfs_free_tmp(struct tmpfs_mount *); @@ -424,7 +424,7 @@ int tmpfs_alloc_vp(struct mount *, struct tmpfs_node *, int, struct vnode **); void tmpfs_free_vp(struct vnode *); int tmpfs_alloc_file(struct vnode *, struct vnode **, struct vattr *, - struct componentname *, char *); + struct componentname *, const char *); void tmpfs_check_mtime(struct vnode *); void tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *); diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 80711da58774..4f30f947e223 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -182,7 +182,7 @@ tmpfs_ref_node_locked(struct tmpfs_node *node) int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *parent, - char *target, dev_t rdev, struct tmpfs_node **node) + const char *target, dev_t rdev, struct tmpfs_node **node) { struct tmpfs_node *nnode; vm_object_t obj; @@ -717,7 +717,7 @@ tmpfs_free_vp(struct vnode *vp) */ int tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap, - struct componentname *cnp, char *target) + struct componentname *cnp, const char *target) { int error; struct tmpfs_dirent *de; diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index dbacfd7858ce..41f5a19efe2a 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1176,7 +1176,7 @@ tmpfs_symlink(struct vop_symlink_args *v) struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; struct vattr *vap = v->a_vap; - char *target = v->a_target; + const char *target = v->a_target; #ifdef notyet /* XXX FreeBSD BUG: kern_symlink is not setting VLNK */ MPASS(vap->va_type == VLNK); diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 90cef879c4ed..5b21026b517b 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -325,7 +325,7 @@ vop_symlink { OUT struct vnode **vpp; IN struct componentname *cnp; IN struct vattr *vap; - IN char *target; + IN const char *target; }; diff --git a/sys/sys/param.h b/sys/sys/param.h index 769a3146e21d..f7a26d5e0d44 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300002 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300003 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 9e8896866660..f0e3f2d23df5 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2095,7 +2095,7 @@ ufs_symlink(ap) struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - char *a_target; + const char *a_target; } */ *ap; { struct vnode *vp, **vpp = ap->a_vpp; @@ -2116,8 +2116,8 @@ ufs_symlink(ap) ip->i_flag |= IN_CHANGE | IN_UPDATE; error = UFS_UPDATE(vp, 0); } else - error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, vp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp);