git: 7fa08d415283 - main - kern_racct.c: Don't compile if RACCT undefined

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Wed, 22 Nov 2023 19:18:02 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=7fa08d415283c9a0c1e2b57edfbb13d722c25735

commit 7fa08d415283c9a0c1e2b57edfbb13d722c25735
Author:     Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-11-21 17:33:08 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-11-22 19:17:17 +0000

    kern_racct.c: Don't compile if RACCT undefined
    
    Just skip compiling this file if RACCT isn't defined.  This allows to
    skip including headers that no code uses at all, and also to remove the
    whole file's #ifdef/#endif bracketing.
    
    Reviewed by:    markj
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
---
 sys/conf/files        | 2 +-
 sys/kern/kern_racct.c | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/sys/conf/files b/sys/conf/files
index c5cd70415931..7ffcbe6e0dda 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -3795,7 +3795,7 @@ kern/kern_priv.c		standard
 kern/kern_proc.c		standard
 kern/kern_procctl.c		standard
 kern/kern_prot.c		standard
-kern/kern_racct.c		standard
+kern/kern_racct.c		optional racct
 kern/kern_rangelock.c		standard
 kern/kern_rctl.c		standard
 kern/kern_resource.c		standard
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index 37b77243fe0e..43c3da0c2320 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -59,8 +59,6 @@
 #include <sys/rctl.h>
 #endif
 
-#ifdef RACCT
-
 FEATURE(racct, "Resource Accounting");
 
 /*
@@ -1364,5 +1362,3 @@ racct_init(void)
 	prison0.pr_prison_racct = prison_racct_find("0");
 }
 SYSINIT(racct, SI_SUB_RACCT, SI_ORDER_FIRST, racct_init, NULL);
-
-#endif /* !RACCT */