Skip to content

Commit 54b141f

Browse files
authored
FreeBSD: Remove references to DEBUG_VFS_LOCKS
This option is removed upstream in favour of plain INVARIANTS. VNASSERT is always defined so I see no reason to use it conditionally. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #18136
1 parent 8605bdf commit 54b141f

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

module/Makefile.bsd

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ CFLAGS+= -DZFS_DEBUG -g
6262
CFLAGS += -DNDEBUG
6363
.endif
6464

65-
.if defined(WITH_VFS_DEBUG) && ${WITH_VFS_DEBUG} == "true"
66-
# kernel must also be built with this option for this to work
67-
CFLAGS+= -DDEBUG_VFS_LOCKS
68-
.endif
69-
7065
.if defined(WITH_GCOV) && ${WITH_GCOV} == "true"
7166
CFLAGS+= -fprofile-arcs -ftest-coverage
7267
.endif

module/os/freebsd/zfs/zfs_vnops_os.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@
102102

103103
VFS_SMR_DECLARE;
104104

105-
#ifdef DEBUG_VFS_LOCKS
106-
#define VNCHECKREF(vp) \
107-
VNASSERT((vp)->v_holdcnt > 0 && (vp)->v_usecount > 0, vp, \
108-
("%s: wrong ref counts", __func__));
109-
#else
110-
#define VNCHECKREF(vp)
111-
#endif
112-
113105
#if __FreeBSD_version >= 1400045
114106
typedef uint64_t cookie_t;
115107
#else
@@ -1060,9 +1052,6 @@ zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode,
10601052
zfs_acl_ids_t acl_ids;
10611053
boolean_t fuid_dirtied;
10621054
uint64_t txtype;
1063-
#ifdef DEBUG_VFS_LOCKS
1064-
vnode_t *dvp = ZTOV(dzp);
1065-
#endif
10661055

10671056
if (is_nametoolong(zfsvfs, name))
10681057
return (SET_ERROR(ENAMETOOLONG));
@@ -1192,7 +1181,8 @@ zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode,
11921181
getnewvnode_drop_reserve();
11931182

11941183
out:
1195-
VNCHECKREF(dvp);
1184+
VNASSERT(ZTOV(dzp)->v_holdcnt > 0 && ZTOV(dzp)->v_usecount > 0,
1185+
ZTOV(dzp), ("%s: wrong ref counts", __func__));
11961186
if (error == 0) {
11971187
*zpp = zp;
11981188
}

0 commit comments

Comments
 (0)