From: Rodrigo Freire <rfreire@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: sfrench@samba.org, linux-cifs@vger.kernel.org, piastryyy@gmail.com
Subject: [PATCH v3 1/2] CIFS: Adds information-level logging function
Date: Sun, 7 Oct 2018 12:21:25 -0300 [thread overview]
Message-ID: <3e9246011e68c3ebeea111c8bb743d1a189ce6ac.1538873915.git.rfreire@redhat.com> (raw)
In-Reply-To: <cover.1538873915.git.rfreire@redhat.com>
Currently, CIFS lacks a internal logging function that prints out data
when CIFS_DEBUG=n. When CIFS_DEBUG=y, the only message level for CIFS
events are KERN_ERR or KERN_DEBUG.
This patch creates cifs_info(), which is useful for printing
non-critical event messges, at either CIFS_DEBUG state.
Signed-off-by: Rodrigo Freire <rfreire@redhat.com>
---
fs/cifs/cifs_debug.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index f4f3f08..72db298 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -47,6 +47,17 @@
*/
#ifdef CONFIG_CIFS_DEBUG
+/* Information level messages, minor events */
+#define cifs_info_func(ratefunc, fmt, ...) \
+do { \
+ pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); \
+} while (0)
+
+#define cifs_info(fmt, ...) \
+do { \
+ cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); \
+} while (0)
+
/* information message: e.g., configuration, major event */
#define cifs_dbg_func(ratefunc, type, fmt, ...) \
do { \
@@ -81,6 +92,11 @@
if (0) \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
+
+#define cifs_info(fmt, ...) \
+do { \
+ pr_info("CIFS: "fmt, ##__VA_ARGS__); \
+} while (0)
#endif
#endif /* _H_CIFS_DEBUG */
--
1.8.3.1
next prev parent reply other threads:[~2018-10-07 15:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-07 15:21 [PATCH v3 0/2] CIFS: Info-level log support, print message when attempting mount Rodrigo Freire
2018-10-07 15:21 ` Rodrigo Freire [this message]
2018-10-07 15:21 ` [PATCH v3 2/2] CIFS: Print message when attempting a mount Rodrigo Freire
2018-10-07 18:58 ` [PATCH v3 0/2] CIFS: Info-level log support, print message when attempting mount Steve French
2018-10-07 20:27 ` Rodrigo Freire
2018-10-07 21:06 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e9246011e68c3ebeea111c8bb743d1a189ce6ac.1538873915.git.rfreire@redhat.com \
--to=rfreire@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=piastryyy@gmail.com \
--cc=sfrench@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).