From 512fa9a4e0bc14978fb6a01fd8d0e2cbbe0cc985 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sun, 19 Jan 2020 05:36:45 +0000 Subject: [PATCH] vfs: plug a conditional assigment of lo_name in getnewvnode It only matters for witness. No functional changes. --- sys/kern/vfs_subr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 08b7649a2aa..9597cd99dc0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1669,11 +1669,15 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, * that we can compare pointers rather than doing a strcmp(). */ lo = &vp->v_vnlock->lock_object; +#ifdef WITNESS if (lo->lo_name != tag) { +#endif lo->lo_name = tag; +#ifdef WITNESS WITNESS_DESTROY(lo); WITNESS_INIT(lo, tag); } +#endif /* * By default, don't allow shared locks unless filesystems opt-in. */