git: 130e81199136 - stable/13 - linux(4): Add LINUX_RATELIMIT_MSG macro for future use.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Jun 2022 19:38:06 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=130e81199136ae65cf186e5a551fc276a2d24944 commit 130e81199136ae65cf186e5a551fc276a2d24944 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2021-08-12 08:55:55 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-06-17 19:33:32 +0000 linux(4): Add LINUX_RATELIMIT_MSG macro for future use. Differential Revision: https://reviews.freebsd.org/D31488 MFC after: 2 weeks (cherry picked from commit 0d77f6c0c350ae41acc0653a236a76d981773021) --- sys/compat/linux/linux_util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 7a8ec80cb1bf..d01058867f06 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -174,6 +174,18 @@ bool linux_use_real_ifname(const struct ifnet *ifp); } \ } while (0) +#define LINUX_RATELIMIT_MSG(_message) \ + do { \ + static int seen = 0; \ + \ + if (seen == 0) { \ + linux_msg(curthread, _message); \ + \ + if (linux_debug < 3) \ + seen = 1; \ + } \ + } while (0) + #define LINUX_RATELIMIT_MSG_OPT1(_message, _opt1) \ do { \ static int seen = 0; \