diff --git a/sys/dev/virtio/9pfs/virtfs_vnops.c b/sys/dev/virtio/9pfs/virtfs_vnops.c index 29d00d9af07..63c4a3d3496 100644 --- a/sys/dev/virtio/9pfs/virtfs_vnops.c +++ b/sys/dev/virtio/9pfs/virtfs_vnops.c @@ -285,7 +285,9 @@ virtfs_lookup(struct vop_lookup_args *ap) error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, curthread); if (!error) { +#if __FreeBSD_version < 1400054 cnp->cn_flags |= SAVENAME; +#endif return (EJUSTRETURN); } } @@ -304,8 +306,10 @@ virtfs_lookup(struct vop_lookup_args *ap) /* Check if the entry in cache is stale or not */ if ((virtfs_node_cmp(vp, &newfid->qid) == 0) && ((error = VOP_GETATTR(vp, &vattr, cnp->cn_cred)) == 0)) { +#if __FreeBSD_version < 1400054 if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; +#endif goto out; } /* @@ -439,8 +443,10 @@ virtfs_lookup(struct vop_lookup_args *ap) cnp->cn_nameptr[cnp->cn_namelen] = tmpchr; +#if __FreeBSD_version < 1400054 if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; +#endif /* Store the result the cache if MAKEENTRY is specified in flags */ if ((cnp->cn_flags & MAKEENTRY) != 0) @@ -1611,7 +1617,7 @@ virtfs_symlink(struct vop_symlink_args *ap) struct vnode **vpp; struct vattr *vap; struct componentname *cnp; - char *symtgt; + const char *symtgt; struct virtfs_node *dnp; struct virtfs_session *vses; struct mount *mp; @@ -2150,4 +2156,4 @@ struct vop_vector virtfs_vnops = { }; #if __FreeBSD_version >= 1300069 VFS_VOP_VECTOR_REGISTER(virtfs_vnops); -#endif \ No newline at end of file +#endif diff --git a/sys/dev/virtio/9pnet/client.c b/sys/dev/virtio/9pnet/client.c index 018fcc11b13..bb023720ef5 100644 --- a/sys/dev/virtio/9pnet/client.c +++ b/sys/dev/virtio/9pnet/client.c @@ -247,12 +247,13 @@ p9_client_check_return(struct p9_client *c, struct p9_req_t *req) * Note this is still not completely an error, as lookups for files * not present can hit this and return. Hence it is made a debug print. */ - if (error != 0) + if (error != 0) { if (req->rc->id == P9PROTO_RERROR) { p9_debug(TRANS, "<<< RERROR (%d) %s\n", error, ename); } else if (req->rc->id == P9PROTO_RLERROR) { p9_debug(TRANS, "<<< RLERROR (%d)\n", error); } + } if (req->rc->id == P9PROTO_RERROR) { free(ename, M_TEMP); @@ -1134,7 +1135,7 @@ p9_client_renameat(struct p9_fid *oldfid, char *oldname, struct p9_fid *newfid, /* Request to create symbolic link */ int -p9_create_symlink(struct p9_fid *fid, char *name, char *symtgt, gid_t gid) +p9_create_symlink(struct p9_fid *fid, char *name, const char *symtgt, gid_t gid) { int error; struct p9_req_t *req; diff --git a/sys/dev/virtio/9pnet/trans_virtio.c b/sys/dev/virtio/9pnet/trans_virtio.c index 8c8220204b8..3985588c8f5 100644 --- a/sys/dev/virtio/9pnet/trans_virtio.c +++ b/sys/dev/virtio/9pnet/trans_virtio.c @@ -477,7 +477,6 @@ static driver_t vt9p_drv = { vt9p_mthds, sizeof(struct vt9p_softc) }; -static devclass_t vt9p_class; static int vt9p_modevent(module_t mod, int type, void *unused) @@ -502,7 +501,6 @@ vt9p_modevent(module_t mod, int type, void *unused) return (error); } -DRIVER_MODULE(vt9p, virtio_pci, vt9p_drv, vt9p_class, - vt9p_modevent, 0); +DRIVER_MODULE(vt9p, virtio_pci, vt9p_drv, vt9p_modevent, 0); MODULE_VERSION(vt9p, 1); MODULE_DEPEND(vt9p, virtio, 1, 1, 1); diff --git a/sys/dev/virtio/virtio_fs_client.h b/sys/dev/virtio/virtio_fs_client.h index 277be67559e..9bf81044cec 100644 --- a/sys/dev/virtio/virtio_fs_client.h +++ b/sys/dev/virtio/virtio_fs_client.h @@ -149,7 +149,7 @@ void p9_client_cb(struct p9_client *c, struct p9_req_t *req); int p9stat_read(struct p9_client *clnt, char *data, size_t len, struct p9_wstat *st); void p9_client_disconnect(struct p9_client *clnt); void p9_client_begin_disconnect(struct p9_client *clnt); -int p9_create_symlink(struct p9_fid *fid, char *name, char *symtgt, gid_t gid); +int p9_create_symlink(struct p9_fid *fid, char *name, const char *symtgt, gid_t gid); int p9_create_hardlink(struct p9_fid *dfid, struct p9_fid *oldfid, char *name); int p9_readlink(struct p9_fid *fid, char **target); int p9_client_renameat(struct p9_fid *oldfid, char *oldname, struct p9_fid *newfid, char *newname); diff --git a/sys/modules/virtio/Makefile b/sys/modules/virtio/Makefile index 4a823d63c33..7697ef5e761 100644 --- a/sys/modules/virtio/Makefile +++ b/sys/modules/virtio/Makefile @@ -23,6 +23,6 @@ # SUCH DAMAGE. # -SUBDIR= virtio pci network block balloon scsi random console +SUBDIR= virtio pci network block balloon scsi random console 9pfs 9pnet .include <bsd.subdir.mk>