extern struct inode *nilfs_alloc_inode(struct super_block *);
 extern void nilfs_destroy_inode(struct inode *);
 
+extern __printf(3, 4)
+void __nilfs_msg(struct super_block *sb, const char *level,
+                const char *fmt, ...);
 extern __printf(3, 4)
 void __nilfs_error(struct super_block *sb, const char *function,
                   const char *fmt, ...);
 
 #ifdef CONFIG_PRINTK
 
+#define nilfs_msg(sb, level, fmt, ...)                                 \
+       __nilfs_msg(sb, level, fmt, ##__VA_ARGS__)
 #define nilfs_error(sb, fmt, ...)                                      \
        __nilfs_error(sb, __func__, fmt, ##__VA_ARGS__)
 
 #else
 
+#define nilfs_msg(sb, level, fmt, ...)                                 \
+       no_printk(fmt, ##__VA_ARGS__)
 #define nilfs_error(sb, fmt, ...)                                      \
        do {                                                            \
                no_printk(fmt, ##__VA_ARGS__);                          \
 
 static int nilfs_setup_super(struct super_block *sb, int is_mount);
 static int nilfs_remount(struct super_block *sb, int *flags, char *data);
 
+void __nilfs_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;
+       if (sb)
+               printk("%sNILFS (%s): %pV\n", level, sb->s_id, &vaf);
+       else
+               printk("%sNILFS: %pV\n", level, &vaf);
+       va_end(args);
+}
+
 static void nilfs_set_error(struct super_block *sb)
 {
        struct the_nilfs *nilfs = sb->s_fs_info;