From 2782c00c0485bb0ec92d7cc95b673116295fce2d Mon Sep 17 00:00:00 2001 From: Ryan Libby Date: Sun, 23 Feb 2020 03:32:11 +0000 Subject: [PATCH] vfs: quiet -Wwrite-strings Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23797 --- sys/kern/vfs_subr.c | 2 +- sys/kern/vfs_vnops.c | 5 +++-- sys/kern/vnode_if.src | 2 +- sys/sys/vnode.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a5e3079de6c..258ccb2d1ed 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4040,7 +4040,7 @@ vcount(struct vnode *vp) /* * Print out a description of a vnode. */ -static char *typename[] = +static const char * const typename[] = {"VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD", "VMARKER"}; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index d0c438d1622..6d3b6dd3ee2 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1566,7 +1566,8 @@ vn_poll(struct file *fp, int events, struct ucred *active_cred, * permits vn_lock to return doomed vnodes. */ static int __noinline -_vn_lock_fallback(struct vnode *vp, int flags, char *file, int line, int error) +_vn_lock_fallback(struct vnode *vp, int flags, const char *file, int line, + int error) { KASSERT((flags & LK_RETRY) == 0 || error == 0, @@ -1602,7 +1603,7 @@ _vn_lock_fallback(struct vnode *vp, int flags, char *file, int line, int error) } int -_vn_lock(struct vnode *vp, int flags, char *file, int line) +_vn_lock(struct vnode *vp, int flags, const char *file, int line) { int error; diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index bc2a8db1761..bfa81016946 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -380,7 +380,7 @@ vop_reclaim { vop_lock1 { IN struct vnode *vp; IN int flags; - IN char *file; + IN const char *file; IN int line; }; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 19c4930263d..cb49e9c97f2 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -689,7 +689,7 @@ int vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, struct thread *fsize_td); int vn_need_pageq_flush(struct vnode *vp); int vn_isdisk(struct vnode *vp, int *errp); -int _vn_lock(struct vnode *vp, int flags, char *file, int line); +int _vn_lock(struct vnode *vp, int flags, const char *file, int line); #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode,