]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[XFS] avoid memory allocations in xfs_fs_vcmn_err
authorChristoph Hellwig <hch@infradead.org>
Wed, 17 Dec 2008 17:27:36 +0000 (12:27 -0500)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Mon, 22 Dec 2008 07:02:01 +0000 (18:02 +1100)
commitefc557570dc99b46e46a7be51c3c7402b485e829
treefaba8c63e6bcf798ab76f7da1fcb035ece445700
parent9f6c92b9cc2fd41d6c7b493be5637cc5b5659880
[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 <a.beregalov@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/support/debug.c
fs/xfs/support/debug.h
fs/xfs/xfs_error.c
fs/xfs/xfs_error.h