Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Feb 2024 10:42:24 GMT
From:      Olivier Certner <olce@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fe5468bdf404 - stable/13 - kern_racct.c: Don't compile if RACCT undefined
Message-ID:  <202402271042.41RAgOAM079739@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by olce:

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

commit fe5468bdf404160b05ad892e944161edbd00240c
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-11-21 17:33:08 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-02-27 10:41:54 +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
    
    (cherry picked from commit 7fa08d415283c9a0c1e2b57edfbb13d722c25735)
    
    Approved by:        emaste (mentor)
---
 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 5feae02ddd82..20495b57b7c0 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -3888,7 +3888,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 435036a63777..41f77f2bcd71 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");
 
 /*
@@ -1357,5 +1355,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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202402271042.41RAgOAM079739>