summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_error.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-12-17 12:27:36 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-12-22 18:02:01 +1100
commitefc557570dc99b46e46a7be51c3c7402b485e829 (patch)
treefaba8c63e6bcf798ab76f7da1fcb035ece445700 /fs/xfs/xfs_error.c
parent9f6c92b9cc2fd41d6c7b493be5637cc5b5659880 (diff)
downloadop-kernel-dev-efc557570dc99b46e46a7be51c3c7402b485e829.zip
op-kernel-dev-efc557570dc99b46e46a7be51c3c7402b485e829.tar.gz
[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>
Diffstat (limited to 'fs/xfs/xfs_error.c')
-rw-r--r--fs/xfs/xfs_error.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index f227ecd..92d5cd5 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -153,21 +153,6 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud)
}
#endif /* DEBUG */
-static void
-xfs_fs_vcmn_err(int level, xfs_mount_t *mp, char *fmt, va_list ap)
-{
- if (mp != NULL) {
- char *newfmt;
- int len = 16 + mp->m_fsname_len + strlen(fmt);
-
- newfmt = kmem_alloc(len, KM_SLEEP);
- sprintf(newfmt, "Filesystem \"%s\": %s", mp->m_fsname, fmt);
- icmn_err(level, newfmt, ap);
- kmem_free(newfmt);
- } else {
- icmn_err(level, fmt, ap);
- }
-}
void
xfs_fs_cmn_err(int level, xfs_mount_t *mp, char *fmt, ...)
OpenPOWER on IntegriCloud