The branch main has been updated by mjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6aa246e605b9528b23aaedf4b051b4672fb28829

commit 6aa246e605b9528b23aaedf4b051b4672fb28829
Author:     Mateusz Guzik <[email protected]>
AuthorDate: 2022-02-12 20:26:34 +0000
Commit:     Mateusz Guzik <[email protected]>
CommitDate: 2022-02-13 13:07:08 +0000

    vfs: convert vnsz2log to a macro
---
 sys/kern/vfs_subr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 94748a4a4858..56efe0367c03 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -460,7 +460,11 @@ SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode,
     "Try to reclaim a vnode by its file descriptor");
 
 /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */
-static int vnsz2log;
+#define vnsz2log 8
+#ifndef DEBUG_LOCKS
+_Static_assert((sizeof(struct vnode) >= 256) && (sizeof(struct vnode) < 512),
+    "vnsz2log needs to be updated");
+#endif
 
 /*
  * Support for the bufobj clean & dirty pctrie.
@@ -657,7 +661,6 @@ vntblinit(void *dummy __unused)
        uma_ctor ctor;
        uma_dtor dtor;
        int cpu, physvnodes, virtvnodes;
-       u_int i;
 
        /*
         * Desiredvnodes is a function of the physical memory size and the
@@ -731,9 +734,6 @@ vntblinit(void *dummy __unused)
        syncer_maxdelay = syncer_mask + 1;
        mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF);
        cv_init(&sync_wakeup, "syncer");
-       for (i = 1; i <= sizeof(struct vnode); i <<= 1)
-               vnsz2log++;
-       vnsz2log--;
 
        CPU_FOREACH(cpu) {
                vd = DPCPU_ID_PTR((cpu), vd);

Reply via email to