Date: Thu, 12 Aug 2021 08:56:04 GMT From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 0d77f6c0c350 - main - linux(4): Add LINUX_RATELIMIT_MSG macro for future use. Message-ID: <202108120856.17C8u49T064071@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=0d77f6c0c350ae41acc0653a236a76d981773021 commit 0d77f6c0c350ae41acc0653a236a76d981773021 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2021-08-12 08:55:55 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2021-08-12 08:55:55 +0000 linux(4): Add LINUX_RATELIMIT_MSG macro for future use. Differential Revision: https://reviews.freebsd.org/D31488 MFC after: 2 weeks --- 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 26ec8a3d4847..994efa88100f 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -165,6 +165,18 @@ void linux_free_get_char_devices(char *string); } \ } 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; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108120856.17C8u49T064071>