From: Alexey Fisher <bug-track@fisher-privat.net>
To: <linux-kernel@vger.kernel.org>,
joe@perches.com, hirofumi@mail.parknet.co.jp
Cc: Alexey Fisher <bug-track@fisher-privat.net>
Subject: [PATCH 2/4] Add fat_msg() function for preformated FAT messages
Date: Wed, 10 Nov 2010 11:23:10 +0100 [thread overview]
Message-ID: <1289384592-4881-2-git-send-email-bug-track@fisher-privat.net> (raw)
In-Reply-To: <1289331805.28590.17.camel@Joe-Laptop>
Add fat_msg() to replace not cosequent used printk() in fs/fat/*
New message format should be as fallow:
FAT-fs (sda1): some thing happened.
Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
---
fs/fat/fat.h | 1 +
fs/fat/misc.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 4f99235..803eade 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -331,6 +331,7 @@ __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
__fat_fs_error(sb, 1, fmt , ## args)
#define fat_fs_error_ratelimit(sb, fmt, args...) \
__fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args)
+void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...);
extern int fat_clusters_flush(struct super_block *sb);
extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster);
extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,
diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index 958c5f9..3aac24b 100644
--- a/fs/fat/misc.c
+++ b/fs/fat/misc.c
@@ -47,6 +47,25 @@ void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
}
EXPORT_SYMBOL_GPL(__fat_fs_error);
+/**
+ * fat_msg() - print preformated FAT specific messages. Every thing what is
+ * not fat_fs_error() should be fat_msg().
+ */
+void __attribute__ ((format (printf, 3, 4)))
+fat_msg(struct super_block *sb, const char *level, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ va_start(args, fmt);
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf);
+
+ va_end(args);
+}
+
/* Flushes the number of free clusters on FAT32 */
/* XXX: Need to write one per FSINFO block. Currently only writes 1 */
int fat_clusters_flush(struct super_block *sb)
--
1.7.1
next prev parent reply other threads:[~2010-11-10 10:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 16:55 [PATCH 0/2] FAT unified kernel messages Alexey Fisher
2010-11-09 16:55 ` [PATCH 1/2] Introduce fat_msg() for " Alexey Fisher
2010-11-09 17:25 ` Joe Perches
2010-11-09 17:56 ` Wolfram Sang
2010-11-09 18:58 ` [PATCH 1/2] Idd fat_msg() to unified kernel messages for FAT fs Alexey Fisher
2010-11-09 19:43 ` Joe Perches
2010-11-10 10:23 ` [PATCH 1/4] Convert fat_fs_error to use %pV Alexey Fisher
2010-11-10 10:32 ` Andreas Schwab
2010-11-10 10:23 ` Alexey Fisher [this message]
2010-11-10 10:23 ` [PATCH 3/4] Replace all printk with fat_msg() Alexey Fisher
2010-11-10 10:23 ` [PATCH 4/4] Report each FAT mount and mount options Alexey Fisher
2010-11-10 11:33 ` [PATCH 1/2] Idd fat_msg() to unified kernel messages for FAT fs OGAWA Hirofumi
2010-11-09 16:55 ` [PATCH 2/2] Unify rest of FAT messages Alexey Fisher
2010-11-09 19:04 ` [PATCH 2/2 v2] " Alexey Fisher
2010-11-10 11:40 ` OGAWA Hirofumi
2010-11-10 12:41 ` Alexey Fisher
2010-11-10 13:53 ` OGAWA Hirofumi
2010-11-10 15:07 ` Alexey Fisher
2010-11-10 16:40 ` OGAWA Hirofumi
2010-11-10 16:58 ` Alexey Fisher
2010-11-10 20:53 ` OGAWA Hirofumi
2011-02-24 8:04 ` Alexey Fisher
2011-03-02 14:17 ` OGAWA Hirofumi
2010-11-09 17:03 ` [PATCH 0/2] FAT unified kernel messages Randy Dunlap
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=1289384592-4881-2-git-send-email-bug-track@fisher-privat.net \
--to=bug-track@fisher-privat.net \
--cc=hirofumi@mail.parknet.co.jp \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®