From efc557570dc99b46e46a7be51c3c7402b485e829 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 17 Dec 2008 12:27:36 -0500 Subject: [XFS] avoid memory allocations in xfs_fs_vcmn_err xfs_fs_vcmn_err can be called under a spinlock, but does a sleeping memory allocation to create buffer for it's internal sprintf. Fortunately it's the only caller of icmn_err, so we can merge the two and have one single static buffer and spinlock protecting it. While we're at it make sure we proper __attribute__ format annotations so that the compiler can detect mismatched format strings. Reported-by: Alexander Beregalov Signed-off-by: Christoph Hellwig Reviewed-by: Eric Sandeen Signed-off-by: Lachlan McIlroy --- fs/xfs/support/debug.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'fs/xfs/support/debug.h') diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h index 75845f9..6f4fd37 100644 --- a/fs/xfs/support/debug.h +++ b/fs/xfs/support/debug.h @@ -27,8 +27,6 @@ #define CE_ALERT 1 /* alert */ #define CE_PANIC 0 /* panic */ -extern void icmn_err(int, char *, va_list) - __attribute__ ((format (printf, 2, 0))); extern void cmn_err(int, char *, ...) __attribute__ ((format (printf, 2, 3))); extern void assfail(char *expr, char *f, int l); -- cgit v1.1